LWJGL Forum

Programming => OpenGL => Topic started by: Kai on January 31, 2009, 13:14:20

Title: Off-screen rendering into compressed textures
Post by: Kai on January 31, 2009, 13:14:20
Hi,

I am heavily using off-screen rendering with FBOs and shaders to procedurally generate textures.
The problem now is that these textures would consume too much VRAM.
I know that there is a possibility to create compressed textures when already having either the compressed data or the uncompressed data in a buffer to be handled to the GL driver, but I have neither.
Of course, it would be possible to read-back the generated uncompressed texture data and use the above approach to compress it in a new texture, but I wondered if there would be another solution to directly create a compressed texture while rendering to the FBO.

Does anyone know if it is possible and how?
Title: Re: Off-screen rendering into compressed textures
Post by: spasi on February 01, 2009, 17:27:29
You can try Real-Time YCoCg-DXT Compression (http://developer.nvidia.com/object/real-time-ycocg-dxt-compression.html) or something similar.
Title: Re: Off-screen rendering into compressed textures
Post by: Kai on February 02, 2009, 14:59:31
Thanks spasi!

It looks as if there is no other solution to this but to reimplement the compression algorithms in a shader.

I also scanned the FBO specification for this and it states that none of the compressed texture formats are "color-renderable".
So it seems to be definitely not possible to do such a thing with FBOs.
Title: Re: Off-screen rendering into compressed textures
Post by: broumbroum on February 04, 2009, 17:14:33
I do off-screen rendering throughout a Java2D Sprite pipeline which is then forwarding to a GL Texture buffer. This is slow if rendering each frame offscreen, but faster if rendering once on the loading time. E.g. I can load alphbet. characters in Java2D and then load into a GL Texture buffer for printing at any time.
Title: Re: Off-screen rendering into compressed textures
Post by: Kai on February 04, 2009, 17:45:23
QuoteI do off-screen rendering throughout a Java2D Sprite pipeline which is then forwarding to a GL Texture buffer. This is slow if rendering each frame offscreen, but...

I fail to see how this is related to do off-screen rendering into a compressed texture.

The fact that off-screen rendering is possible with Framebuffer objects and uncompressed textures, is something I'm well aware of but I wanted to save memory by rendering directly into compressed textures, which, according to the FBO extension specification, is not possible.