Jump to content
  • Advertisement
Sign in to follow this  
damsku

Packing 32bits float into 16bits integers

This topic is 3828 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 would like to pack a value from a 32bits floating point target into a 2x16bits integer target in HLSL. But I am not quite sure how to do it :) And of course, I also want to unpack the value from a 2x16bits to 32bits fp.. Anyone knows resources about this? Thanks. damien

Share this post


Link to post
Share on other sites
Advertisement
What's the range of the 32-bit floats, and what do the numbers represent? This will help when giving any advice...

Share this post


Link to post
Share on other sites
The shader model required would also help. For example, PS4.0 does have bit-math, for which a simple | may be enough to unpack correctly.

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!