Created
February 24, 2020 17:00
-
-
Save yearofthewhopper/12f45f90382afd1b12dcabb329a1f7b8 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
void main() { | |
vec4 textureColor = texture2D(sTexture, vTextureCoord); | |
vec3 fragRGB = textureColor.rgb; | |
vec3 fragHSV = rgb2hsv(fragRGB); | |
float h = vHSV.x / 360.0; | |
fragHSV.x *= h; | |
fragHSV.yz *= vHSV.yz; | |
fragHSV.x = mod(fragHSV.x, 1.0); | |
fragHSV.y = mod(fragHSV.y, 1.0); | |
fragHSV.z = mod(fragHSV.z, 1.0); | |
fragRGB = hsv2rgb(fragHSV); | |
gl_FragColor = vec4(hsv2rgb(fragHSV), textureColor.w); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment