opengl es - WebGL copy texture framebuffer to texture framebuffer? -
I am trying to copy a textured framebuffer to another in WebGL, and so far it is just a black screen gives. I'm able to render in texture framebuffers without problems.
Here is the code that I thought would work (it currently works on iOS):
// bind source Fbo current fbo glGetIntegerv (GL_FRAMEBUFFER_BINDING, Amp; current_fbo); GlobindFramebuffer (GLFFAMFFER, src_framebuffer); // Setup Source fbo attachment glFramebufferTextxture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, src_handle, 0); // glReadBuffer (GL_COLOR_ATTACHMENT0); & Lt; - Commented because it is not available in WebGL / bind destination fbo glActiveTexture (GL_TEXTURE0 + i); GlobIndacts (dist_tags, dist_indle); // Copy glocopyTexImage2D from source to source (dest_target, 0, dest_format, 0, 0, dest_width, dest_height, 0); // set back original fbo / / glReadBuffer (GL_NONE); Globind FrameBuffer (GL_FamBuffer, current_fbo); WebGL does not support glReadbuffer, so I can not specify it, though it supports many render targets with the WEBGL_draw_buffers extension, so we can not set any problems to attachments (Why the texture frame buffer work flawlessly).
I know that since I can not specify the read buffer, maybe this technique can not work? Any ideas or work around?
CopyTexImage2D works just fine. Here are 2 compliance tests.
Have you checked the JavaScript console for errors? You are only copying level 0 which means that you need to set your filtering correctly or you need to create emips. Javascript console will contain error messages about potentially incompatible texture < / Div>
Comments
Post a Comment