Created
September 23, 2016 14:07
-
-
Save PopupAsylum/59d480bcb4e749ee2ef154c8551d0c19 to your computer and use it in GitHub Desktop.
Returns 1 if 0<=x<1, 0 otherwise
This file contains 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
//returns 1 if 0<=x<1, 0 otherwise | |
float IsBetween0And1(float x) { | |
return 1 - saturate(floor(abs((x-0.5)*2))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment