Advertisement

Rendering Directly to Texture Memory

Started by November 10, 2000 12:12 PM
2 comments, last by stecher 24 years ago
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.
Protozone
Advertisement
Most major vendors are looking at implementing the pbuffer_ARB extension:

http://oss.sgi.com/projects/oglsample/registry/ARB/wgl_pbuffer.txt

HTH,
Paul Grovespauls opengl page
Rendering to a pbuffer looks pretty straight forward, but how would you use a pbuffer as a texture without copying from the pbuffer to texture memory? I''d really like to avoid any copying.

This topic is closed to new replies.

Advertisement