Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualpcmaster

Posted 20 August 2012 - 02:22 AM

Or you can use f32to16 to pack two halfs into an uint. Like this:
float2 toBeQuantised(333.333, 666.666);
uint half1 = f32to16(toBeQuantised.x);
uint half2 = f32to16(toBeQuantised.y);
uint twoHalfs = half1 | (half2 << 16);

But this doesn't make that much sense or use, in addition to what Kauna said :-)

#2pcmaster

Posted 20 August 2012 - 02:21 AM

Or you can use f32to16 to pack two halfs into a uint. Like this:
float2 toBeQuantised(333.333, 666.666);
uint half1 = f32to16(toBeQuantised.x);
uint half2 = f32to16(toBeQuantised.y);
uint twoHalfs = half1 | (half2 << 16);

But this doesn't make that much sense or use, in addition to what Kauna said :-)

#1pcmaster

Posted 20 August 2012 - 02:21 AM

Or you can use f32to16 to pack two halfs into a uint. Like this:
[source lang="cpp"]float2 toBeQuantised(333.333, 666.666);uint half1 = f32to16(toBeQuantised.x);uint half2 = f32to16(toBeQuantised.y);uint twoHalfs = half1 | (half2 << 16);[/source]
But this doesn't make that much sense or use, in addition to what Kauna said :-)

PARTNERS