Created
November 8, 2020 20:57
-
-
Save riklomas/181e49a3eb171b64c82d8b3aa161b55f to your computer and use it in GitHub Desktop.
hsv2rgb.glsl
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
vec3 hsv2rgb(float h, float s, float v) { | |
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); | |
vec3 p = abs(fract(h + K.xyz) * 6.0 - K.www); | |
return v * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), s); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment