fbo

Shader Materials and GL Framebuffers in THREE.js

荒凉一梦 提交于 2019-12-24 05:49:50
问题 I'm trying to use an FBO in a material in THREE.js. I have a GPU-based fluid simulation which outputs its final visualisation to a framebuffer object, which I would like to use to texture a mesh. Here's my simple fragment shader: varying vec2 vUv; uniform sampler2D tDiffuse; void main() { gl_FragColor = texture2D( tDiffuse, vUv ); } I am then trying to use a simple THREE.ShaderMaterial: var material = new THREE.ShaderMaterial( { uniforms: { tDiffuse: { type: "t", value: outputFBO } }, //other

Using Frame Buffer Objects (FBO) in Borland C++ Builder 6

旧时模样 提交于 2019-12-24 03:03:27
问题 I have an "access violation" on the Frame Buffer Object (FBO)'s command glGenFramebuffersEXT : void TGLForm::DrawScene() { wglMakeCurrent(ghDC, ghRC); glEnable(GL_TEXTURE_2D); GLuint framebuffer, texturefbo; GLenum status; glGenFramebuffersEXT(1, &framebuffer); // access violation here Founding a help thread concerning the FBOs, I checked that the glext.h initialization were okay and repeated amidst the preprocessor lines this way : #include "glext.h" #include "wglext.h" extern

glGenFramebuffers or glGenFramebuffersEXT?

≡放荡痞女 提交于 2019-12-23 07:41:07
问题 I'm confused. To use the Framebuffer Object extension (FBO) in OpenGL 1.x on Windows, which of these do I use?: wglGetProcAddress("glGenFramebuffers"); // or wglGetProcAddress("glGenFramebuffersEXT"); As far as I can tell from reports from users with different hardware, some drivers support all combinations of neither, one of the two, or both. Which is the right one to use? Do some drivers really support one but not the other? Is it correct to try to fall back from one to the other if not

FBO Blitting is not working

半世苍凉 提交于 2019-12-21 12:57:20
问题 I'm trying to render a multisampled scene to texture, here is the code I'm using. I'm getting a black screen. I check the fbo completeness at the end of init, and they report that both fbo's are complete. void init_rendered_FBO() { glGenFramebuffers(1,&fbo); glBindFramebuffer(GL_FRAMEBUFFER, fbo); glGenTextures(1,&fbo_tex); glBindTexture(GL_TEXTURE_2D, fbo_tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO

Performance variation of encoder using MediaCodec encode from surface

偶尔善良 提交于 2019-12-21 05:57:23
问题 I render a texture to both display and a codec input surface (from where an encoder uses it). There is a large performance variation when the texture is rendered to the display surface, and when it is rendered to the input surface of the encoder, but only on some devices, like S3 Galaxy (~10 times slower to render to encoder surface). On other devices, the speed is similar (S4, Nexus4, etc). A similar scenario can be demonstrated with Grafika and Record GL app activity. (FBO blit x2) The fps

OpenGL ES to video in iOS (rendering to a texture with iOS 5 texture cache)

情到浓时终转凉″ 提交于 2019-12-21 02:42:20
问题 You know the sample code of Apple with the CameraRipple effect? Well I'm trying to record the camera output in a file after openGL has done all the cool effect of water. I've done it with glReadPixels, where I read all the pixels in a void * buffer , create CVPixelBufferRef and append it to the AVAssetWriterInputPixelBufferAdaptor, but it's too slow, coz readPixels takes tons of time. I found out that using FBO and texture cash you can do the same, but faster. Here is my code in drawInRect

loading a file texture in FIRST frame of a feedback loop with swapped buffers in three.js

社会主义新天地 提交于 2019-12-13 00:30:28
问题 I'm working on a website in three.js using several feedback shader loops (texture pingpong). When someone visits the site, the loop should continue from a certain point (depending on when he/she visits). To achieve this I intend to load a picture (eg a jpeg) from the server in the first frame, render this to my pingpong buffers and continue with my normal feedback loop from frame 2 onwards. Here's a stripped down version of my problem, as a feedback function i simply add a small value to the

FBO: render to texture, wrong texture mapping when drawing rendered texture

大兔子大兔子 提交于 2019-12-12 21:38:37
问题 I'm using OpengGL on a Mac OS X application to draw texture on a NSOpenGLView . The app is a movie player. It decodes movie frames into CVOpenGLTextureRef (which are OpenGL texture) and I draw them directly to the view using GL_QUAD . Everything works correctly. Below is the relevant part of the code. // "image" is the CVOpenGLTextureRef containing the movie frame as texture GLenum textureTarget = CVOpenGLTextureGetTarget(image); GLuint textureName = CVOpenGLTextureGetName(image); glEnable

Frame Buffer Object (FBO) and Render & Depth Buffers Relation

断了今生、忘了曾经 提交于 2019-12-12 16:24:35
问题 I saw many examples on the web (for example) which do the following Create and Bind FBO Create and Bind BUFFERS (texture, render, depth, stencil) Then, UnBind BUFFERS To work with FBO- Bind FBO, do the work then UnBind FBO However, also Bind texture BUFFER for read, write etc. with texture BUFFER BUT NEVER EVER SEEN re-Bind of other BUFFERS (render, depth, stencil), Why? Example of BUFFERS creation and bind/unbind (Below code is just for example only to show what I explained and works

OpenGL - FBO and alpha blending

拥有回忆 提交于 2019-12-12 01:53:26
问题 I was finding for answer, but I can't get answer for my problem. I have FBO and I can't get alpha blending and multisample to work. FBO draws scene to texture and then it's drown to default framebuffer with two textured triangles. Drawing directly to default framebuffer is fine. Here is difference between default framebuffer (top) and my FBO (bottom). I use FBO with 2x color attachments and 1x depth attachments. (Only GL_COLOR_ATTACHMENT0 is used, second is for other function) Depth test: