fixed light flickering when rotating an object.
This commit is contained in:
@@ -9,7 +9,9 @@ uniform float threshold = 1.0;
|
||||
void main() {
|
||||
vec3 c = texture(sceneTex, TexCoord).rgb;
|
||||
float luma = dot(c, vec3(0.2125, 0.7154, 0.0721));
|
||||
float bright = max(luma - threshold, 0.0);
|
||||
vec3 masked = c * step(0.0, bright);
|
||||
float knee = 0.25;
|
||||
float w = clamp((luma - threshold) / max(knee, 1e-4), 0.0, 1.0);
|
||||
w = w * w * (3.0 - 2.0 * w);
|
||||
vec3 masked = c * w;
|
||||
FragColor = vec4(masked, 1.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user