Jump to content
  • Advertisement
Sign in to follow this  
Lode

OpenGL OpenGL floating point textures

This topic is 3417 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm using an OpenGL texture as buffer to contain the painting in a painting program (this program is geared towards myself for editing textures for my own game projects). I'm doing this as a 8-bit per channel texture now, but for some image operations it's better of the drawing is represented by something with higher precision than 8-bit per channel. I'm considering two options: 1) Keep using 8-bit per channel texture for OpenGL, and use a floating point buffer to contain the image, and constantly convert it to the OpenGL texture to draw it. But, I think this would be really slow, is that true or not? 2) Use a floating point OpenGL texture (32 bit floating point per channel). I have some questions for this option though... -Are such floating point textures supported on all video cards? Or will there be compatibility problems? -Does such a texture also support alpha channel? -Are the values in range 0.0-1.0, and what happens to smaller and larger values? -What's the performance of floating point textures? (and how does it compare to option 1) above?) -If I'd use approach 1), what's the fastest way to convert a float or double buffer of RGBA values to a 8-bit per channel OpenGL texture? Is there an OpenGL call that can do it directly? Thanks! [Edited by - Lode on March 13, 2009 6:00:43 AM]

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Lode
-Are such floating point textures supported on all video cards? Or will there be compatibility problems?
In general, anything OpenGL 2.0+ will support floating point textures, but even recent intel integrated cards seem to have issues.
Quote:
-If I'd use approach 1), what's the fastest way to convert a float or double buffer of RGBA values to a 8-bit per channel OpenGL texture? Is there an OpenGL call that can do it directly?
glTexImage2D(GL_TEXTURE_2D, 0, G_RGBA, width, height, 0 GL_RGBA, GL_FLOAT, data), or similar.

Share this post


Link to post
Share on other sites
-Are such floating point textures supported on all video cards? Or will there be compatibility problems?

Possibly... would have to check for texture float extension support on GL1.5 or GL2.0 is supposed to ARB for floating point textures.

-Does such a texture also support alpha channel?
Yes, 16/32bit to boot RGBA


-Are the values in range 0.0-1.0, and what happens to smaller and larger values?

This extension introduces texel values that can be
outside [0, 1]. No clamping occurs to these values during
texture filtering. For the fixed-function pipeline, the
filtered texel is now clamped before it is used for texture
environment blending. The ARB_color_buffer_float extension
can be used to control this clamping. For the programmable
pipelines, no clamping occurs.



-What's the performance of floating point textures? (and how does it compare to option 1) above?)
From what I have done with them I didn't see any difference, but YMMV and I would guess size and amount of floating point textures will probably play a role in this also.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!