Rendering Directly to Texture Memory
Direct3d has the ability to render directly to texture memory, but OpenGL does not.
The only way I have been able to accoplish this in OpenGL is to render to the frame buffer, then copy the image from the frame buffer into texture memory. Unfortunately the copy simply kills performance.
Does anyone know if there is a better way to render into texture memory in OpenGL? Or if any vendors, such as nvidia, are planning on creating an extension to support this?
From the OpenGL Technical FAQ:
"21.120 How can I render into a texture map?
With OpenGL 1.1, you can use the glCopyTexImage2D() or glCopyTexSubImage2D() functions to assist with this task. glCopyTexImage2D() takes the contents of the framebuffer and sets it as the current texture map, while glCopyTexSubImage2D() only replaces part of the current texture with the contents of the framebuffer. There''s a GLUT 3.7 example called multispheremap.c that does this."
Looks like the way you''re doing it is probably the best way for now... unfortunately.
"21.120 How can I render into a texture map?
With OpenGL 1.1, you can use the glCopyTexImage2D() or glCopyTexSubImage2D() functions to assist with this task. glCopyTexImage2D() takes the contents of the framebuffer and sets it as the current texture map, while glCopyTexSubImage2D() only replaces part of the current texture with the contents of the framebuffer. There''s a GLUT 3.7 example called multispheremap.c that does this."
Looks like the way you''re doing it is probably the best way for now... unfortunately.
Protozone
Most major vendors are looking at implementing the pbuffer_ARB extension:
http://oss.sgi.com/projects/oglsample/registry/ARB/wgl_pbuffer.txt
HTH,
http://oss.sgi.com/projects/oglsample/registry/ARB/wgl_pbuffer.txt
HTH,
Paul Grovespauls opengl page
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement