Rendering to a texture (How ?)
Posted 21 August 2001 - 04:22 PM
Members - Reputation: 851
Posted 21 August 2001 - 04:36 PM
Maybe that''ll give you what you need.
Members - Reputation: 124
Posted 22 August 2001 - 12:35 AM
int teximgnum = 0;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, 512, 512, 0);
RenderTextureScene(); // render scene to be displayed on a texture
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 512, 512);
RenderView(); // render real scene
Posted 23 August 2001 - 09:12 AM
Ofcourse it is slow, even with the same data formats. The frambuffer data has to be transfered over the AGP bus down to host memory and back to the 3D card as a texture. Even if this is done as a simple block transfer (no processing, same data format) it still needs the data to be transfered over the AGP bus twice per texture each frame.
> btw theres an arb_render_to_texture extension on the horizon
This would be the ultimate solution. Do you have any more detailed info on this one ?