Improving the "debug view" by basing it on rain time, so it's unaffected by the base brightness and contrast

This commit is contained in:
Rezmason
2022-09-10 12:12:43 -07:00
parent f9ac81817f
commit 058b8189a9
4 changed files with 10 additions and 17 deletions

View File

@@ -93,13 +93,12 @@ void main() {
float alpha = clamp(sigDist/fwidth(sigDist) + 0.5, 0., 1.);
if (showDebugView) {
brightness *= 2.;
gl_FragColor = vec4(
vec3(
shine.b,
vec2(
brightness,
clamp(0., 1., pow(brightness * 0.9, 6.0))
1.0 - (shine.g * 3.0),
1.0 - (shine.g * 10.0)
) * (1.0 - shine.b)
) * alpha,
1.

View File

@@ -63,11 +63,7 @@ float getRainTime(float simTime, vec2 glyphPos) {
}
float getBrightness(float rainTime) {
float value = 1. - fract(rainTime);
if (loops) {
value = 1. - fract(rainTime);
}
return value * baseContrast + baseBrightness;
return (1. - fract(rainTime)) * baseContrast + baseBrightness;
}
// Additional effects
@@ -151,7 +147,7 @@ vec4 computeResult(float simTime, bool isFirstFrame, vec2 glyphPos, vec2 screenP
brightness = mix(previousBrightness, brightness, brightnessDecay);
}
vec4 result = vec4(brightness, 0., cursor, effect);
vec4 result = vec4(brightness, fract(rainTime), cursor, effect);
return result;
}