pango
06-02-2010, 11:23 PM
In general,we write a RTT code using FBO like below:
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,GL_CO LOR_ATTACHMENT0_EXT,GL_TEXTURE_2D,texDstId,0);
glBindTexture(GL_TEXTURE_2D,texSrcId);
...// Rendering Code
but if I write the code like below:
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,GL_CO LOR_ATTACHMENT0_EXT,GL_TEXTURE_2D,TexID,0);
glBindTexture(GL_TEXTURE_2D,TexID);
...// Rendering Code
the texture "TexID" is attatched to a FBO,and bind a texture name simultaneously,it is src & dst in a operation,so is it valid?whether it would cut down the performance of my program?
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,GL_CO LOR_ATTACHMENT0_EXT,GL_TEXTURE_2D,texDstId,0);
glBindTexture(GL_TEXTURE_2D,texSrcId);
...// Rendering Code
but if I write the code like below:
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,GL_CO LOR_ATTACHMENT0_EXT,GL_TEXTURE_2D,TexID,0);
glBindTexture(GL_TEXTURE_2D,TexID);
...// Rendering Code
the texture "TexID" is attatched to a FBO,and bind a texture name simultaneously,it is src & dst in a operation,so is it valid?whether it would cut down the performance of my program?