Jump to content
  • Advertisement
Sign in to follow this  
BloodOrange1981

odd texture co ordinates...any one care to explain?

This topic is 1963 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 saw something puzzling today. Someone using 16 bit unsigned ints as texture co ordinates, with a 0x3c00 as`1.0f` and of course 0x0000 as `0.0f`.

These are then fed into the GPU as if they were 16 bit floats! 

 

However I`m completely puzzled as to how and why this would even work. Any ideas?

Edited by BloodOrange1981

Share this post


Link to post
Share on other sites
Advertisement

Seems like half-floats (16bit floats). 0x3c00 is the hex presentation of 1.0 as 16-bit float. Take a look here.

Edited by Ashaman73

Share this post


Link to post
Share on other sites
I may be wrong but I think it may have to do with him using his own vertex shader which can accept whatever format you set it up to use.

Share this post


Link to post
Share on other sites

Seems like half-floats (16bit floats). 0x3c00 is the hex presentation of 1.0 as 16-bit float. Take a look here.

 

Thank you very much for the link! That's another mystery solved, and another new thing learned today.

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!