Jump to content
  • Advertisement
Sign in to follow this  
Gazoo101

16 Bit Non-Clamped Texture

This topic is 2529 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

Ok Dudes,

I've searched for an hour and still I cannot figure out what I am doing wrong. I want to make a simple 16 bit float 3D texture that is not clamped and I'm trying to accomplish this via this call:


glTexImage3D(GL_TEXTURE_3D, 0, GL_LUMINANCE16F_ARB,
dims[0],
dims[1],
dims[2], 0,
GL_LUMINANCE, GL_SHORT, volumeData);


The code runs fine, and yet my values are still clamped to 0-1. I must be missing something, or perhaps one of the types are incorrect, but I'm at a loss. Is there perhaps some call to an enable function that must preceed the usage of non-clamped textures?

As far as I can tell it should work with 3D textures just fine...

Gazoo

Share this post


Link to post
Share on other sites
Advertisement
Let it be known! I've spent a few hours and come to the following conclusion. Someone please correct me if I am wrong:

OpenGL clamps values IF they're provided in the GL_SHORT format (and perhaps other non-float formats). It does not matter if you want them represented at 16 bit float or 32 bit float internally. They WILL be clamped between 0 and 1.


In other words, to upload actual NON-clamped data, stick to this upload code:


glTexImage3D(GL_TEXTURE_3D, 0, GL_LUMINANCE16F_ARB, tWidth, tHeight, tDepth, 0, GL_LUMINANCE, GL_FLOAT, ptexels);


Note that the values MUST be provided in float...

Gazoo out...

Share this post


Link to post
Share on other sites
If you want to actually have SHORT, then such integer formats are supported in GL 3. Have a look at the spec. All SM 4 GPUs support integer samplers.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!