-
Can I extract the hex value from a sampler2D?
I am wanting to push quite a bit of floating point data through to the shader to handle lighting/shadowing. Initially I thought of using uniform structures and arrays but I suspect I will exceed quota allowable for uniforms so have opted for textures as a place to push through these floating point arrays. Rather than using floating point format images (unless someone knows how to construct these on the fly using SDL2) I was thinking of converting the floats to hex and shoving the hex into the rgba. Is it possible to read hex values directly from textures? Or does someone have the conversion rgba to hex to float? Cheers.
-
Senior Member
OpenGL Guru
There is no such thing as a "hex value". There are integers and there are floating-point numbers.
There are integral image formats. These are only available on GL 3.0+ capable hardware. Uploading the data must be done with a special pixel format.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules