Jump to content
  • Advertisement
Sign in to follow this  
nullsquared

Shaders: packing 4-byte RGBA value into single 4-byte (32-bit) floating point value

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

Hello [smile] I have yet another shader packing question. Say I have a 4-component texture, each component using 32-bits (128-bit texture, FLOAT32_RGBA). Now, thinking about it, memory-wise, I should be able to pack 4 32-bit textures into this "fat" texture. However, what I don't understand, is how I would pack and later unpack 4 values into a single value. To make it worse, we're simply dealing with shader floats here - the only difference being, is that the input floats come from a 32-bit texture, and the output floats go into a 128-bit texture. Anyone have any ideas? I'm using CG/HLSL, though I can understand GLSL code if you have an example that uses GLSL. Please note that my maths education is still rather small (US high-school math is useless), so the better the explanation, but more appreciated [wink] Thanks you very much in advance!

Share this post


Link to post
Share on other sites
Advertisement
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!