
16-bit per color channel in opengl?
Hello,
What is required for having 64-bit textures (16-bit/channel RGBA) used in OpenGL? Any advice would be very welcome, as I didn''t find anything on these boards or elsewhere either. I''m able to read a 64-bit png with libpng, but when I use glu''s function as follows:
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA16, 256, 256, GL_RGBA16, GL_UNSIGNED_BYTE, buffer);
... I really don''t get anything but grey displayed instead of the texture on the screen. Should those GL_RGBA16:s be included at this point the way I have them, anyway?
How can I check if my 3D hardware supports such textures, and do I have to set some settings to set the 3D hardware (if capable) to a such mode that it processes (at least some of the) textures in higher precision?
I''m not even sure about my png loading code. I just assumed that if I have a GLubyte* buffer, I can copy from the decompressed png row by row also in the case of 64-bit png, just that a row is double the length as there is double the data. Should the reading into the ''buffer'' be done somehow else? Anyway it shouldn''t be all grey even if the reading would somehow be garbled.
I''m using Linux with GLX.
I hope I''m not alone trying to use 64-bit textures in OpenGL

On delphi3d.net you can find a lot about what your card supports, check it out.
EDIT: .net instead of .com
[edited by - Tree Penguin on February 3, 2004 5:48:41 PM]
EDIT: .net instead of .com
[edited by - Tree Penguin on February 3, 2004 5:48:41 PM]
I have no experience with 64-bit textures, but try:
I wouldn''t be surprised if your OpenGL implementation just uses 32-bit internally though (it''s not required to match what you request).
You''ll probably need to make your buffer a GLushort buffer too.
Enigma
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA16, 256, 256, GL_RGBA, GL_UNSIGNED_SHORT, buffer);
I wouldn''t be surprised if your OpenGL implementation just uses 32-bit internally though (it''s not required to match what you request).
You''ll probably need to make your buffer a GLushort buffer too.
Enigma
quote:
Original post by Enigma
I have no experience with 64-bit textures, but try:gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA16, 256, 256, GL_RGBA, GL_UNSIGNED_SHORT, buffer);
.
.
You''ll probably need to make your buffer a GLushort buffer too.
Thanks! I had tried that before, but only now I read (man gluBuild2DMipmaps) that the latter GL_RGBA indeed has to be without the "16". My png loading code was also buggy in case of 64-bit pngs, but changing to GLushort everywhere made me realize what was wrong in that: getting a reddish picture about 1/4 of the whole picture..
I actually managed to load the 64-bit texture now! Happy!
quote:
I wouldn''t be surprised if your OpenGL implementation just uses 32-bit internally though (it''s not required to match what you request).
It seems to look similar with internal format set either to GL_RGBA or GL_RGBA16. I don''t know what''s actually going on, whether it is really using now the 16-bit/color channel in the graphics pipeline when GL_RGBA16 is set - I''ve ATI Radeon 8500 which AFAIK doesn''t support any floating point pixel formats but 64-bit integer might be possible.
Now I should try to do a more proper 64-bit texture (instead of just converting an ordinary photo to 64-bit) and somehow find out if indeed there is more information used there than 32-bit/pixel - dunno how to do that, though. Maybe some lighting that''d reveal details that wouldn''t be available in 32-bit/pixel image? I hope the "original" OpenGL lighting methods are enough, as I''ve just done one course and then some with OpenGL and don''t know anything about how e.g. lighting is done on OpenGL 1.4+ -things (like Doom 3...).
Thanks for helping!
February 04, 2004 11:15 AM
R3xx (9500+) is the only chip that support 64bit integer textures.
The R2xx does support a higher internal precision (12bit fixed), but unfortantly it doesn''t support any higher external precisions.
The R2xx does support a higher internal precision (12bit fixed), but unfortantly it doesn''t support any higher external precisions.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement