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 gammaCorrect(vec3 color, float gamma){ | |
return pow(color, vec3(1.0/gamma)); | |
} | |
vec3 levelRange(vec3 color, float minInput, float maxInput){ | |
return min(max(color - vec3(minInput), vec3(0.0)) / (vec3(maxInput) - vec3(minInput)), vec3(1.0)); | |
} | |
vec3 finalLevels(vec3 color, float minInput, float gamma, float maxInput){ | |
return gammaCorrect(levelRange(color, minInput, maxInput), gamma); |