Created
October 31, 2017 06:55
-
-
Save keijiro/f4458a5dcfde5282aec646614f85936c to your computer and use it in GitHub Desktop.
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
half3 Hue2RGB(half h) | |
{ | |
h = frac(saturate(h)) * 6 - 2; | |
half3 rgb = saturate(half3(abs(h - 1) - 1, 2 - abs(h), 2 - abs(h - 2))); | |
#ifndef UNITY_COLORSPACE_GAMMA | |
rgb = GammaToLinearSpace(rgb); | |
#endif | |
return rgb; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment