Aetheria/Assets/Shaders/PackFloat.cginc
Reinier Vens b08423b936 NEW CLOUDS NEW CLOUDS NEW CLOUDS WHOOO
Added new clouds shader with improved raymarching loop
Currently only being used in main menu (rest is coming right up!)
Removed WWise (it's nice, but all it's doing is throwing exceptions rn since we ain't about to get a license)
2022-07-10 02:53:09 +01:00

15 lines
No EOL
376 B
HLSL

float pack(float a, float b)
{
uint aScaled = f32tof16(a);
uint bScaled = f32tof16(b);
uint abPacked = (aScaled << 16) | (bScaled & 0xFFFF);
return asfloat(abPacked);
}
void unpack(float x, out float a, out float b)
{
float inputFloat = x;
uint uintInput = asuint(inputFloat);
a = f16tof32(uintInput >> 16);
b = f16tof32(uintInput & 0xFFFF);
}