Skip to content

Commit

Permalink
Remove clamp function in contrast fragment shader.
Browse files Browse the repository at this point in the history
* OpenGL automatically clamps the output colors to the [0, 1] interval.

PiperOrigin-RevId: 465071999
  • Loading branch information
leonwind authored and marcbaechinger committed Oct 19, 2022
1 parent 40a28d5 commit 30fab8c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ void main() {
vec4 inputColor = texture2D(uTexSampler, vTexSamplingCoord);

gl_FragColor = vec4(
clamp(uContrastFactor * (inputColor.r - 0.5) + 0.5, 0.0, 1.0),
clamp(uContrastFactor * (inputColor.g - 0.5) + 0.5, 0.0, 1.0),
clamp(uContrastFactor * (inputColor.b - 0.5) + 0.5, 0.0, 1.0),
uContrastFactor * (inputColor.r - 0.5) + 0.5,
uContrastFactor * (inputColor.g - 0.5) + 0.5,
uContrastFactor * (inputColor.b - 0.5) + 0.5,
inputColor.a);
}

0 comments on commit 30fab8c

Please sign in to comment.