Added glint brightness and contrast, makes a big difference

This commit is contained in:
Rezmason
2022-09-17 10:09:52 -07:00
parent 9c2d6d7ed8
commit eddbd12c36
6 changed files with 66 additions and 46 deletions

View File

@@ -56,7 +56,7 @@ float getRainBrightness(float simTime, vec2 glyphPos) {
if (!loops) {
rainTime = wobble(rainTime);
}
return fract(rainTime);
return 1.0 - fract(rainTime);
}
// Main function
@@ -64,7 +64,7 @@ float getRainBrightness(float simTime, vec2 glyphPos) {
vec4 computeResult(float simTime, bool isFirstFrame, vec2 glyphPos, vec2 screenPos, vec4 previous) {
float brightness = getRainBrightness(simTime, glyphPos);
float brightnessBelow = getRainBrightness(simTime, glyphPos + vec2(0., -1.));
float cursor = brightness < brightnessBelow ? 1.0 : 0.0;
float cursor = brightness > brightnessBelow ? 1.0 : 0.0;
// Blend the glyph's brightness with its previous brightness, so it winks on and off organically
if (!isFirstFrame) {