Last active
August 29, 2015 14:11
-
-
Save pyalot/ea8fefbad620f2435729 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vec2 pack16(float value){ | |
float f = clamp(value, 0.0, 1.0)*255.0; | |
float digitLow = fract(f); | |
float digitHigh = floor(f)/255.0; | |
return vec2(digitHigh, digitLow); | |
} | |
float unpack16(vec2 value){ | |
return value.x+value.y/255.0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment