Replacing "logarithmic brightness" with a simple brightness-and-contrast setup. Adjusting a bunch of configs.

This commit is contained in:
Rezmason
2022-09-04 23:48:34 -07:00
parent 17b0e11cb7
commit 58e3aac143
4 changed files with 34 additions and 23 deletions

View File

@@ -23,6 +23,7 @@ uniform float animationSpeed, fallSpeed, cycleSpeed;
uniform bool hasSun, hasThunder, loops;
uniform bool showComputationTexture;
uniform float brightnessOverride, brightnessThreshold, brightnessDecay;
uniform float baseContrast, baseBrightness;
uniform float raindropLength, glyphHeightToWidth;
uniform int cycleStyle, rippleType;
uniform float rippleScale, rippleSpeed, rippleThickness;
@@ -63,7 +64,7 @@ float getBrightness(float rainTime) {
if (loops) {
value = 1. - fract(rainTime);
}
return log(value * 1.25) * 3.;
return value * baseContrast + baseBrightness;
}
float getCycleSpeed(float rainTime, float brightness) {

View File

@@ -15,6 +15,8 @@ struct Config {
brightnessThreshold : f32,
brightnessOverride : f32,
brightnessDecay : f32,
baseBrightness : f32,
baseContrast : f32,
cursorEffectThreshold : f32,
cycleSpeed : f32,
cycleFrameSkip : i32,
@@ -140,7 +142,7 @@ fn getBrightness(rainTime : f32) -> f32 {
if (bool(config.loops)) {
value = 1.0 - fract(rainTime);
}
return log(value * 1.25) * 3.0;
return value * config.baseContrast + config.baseBrightness;
}
fn getCycleSpeed(rainTime : f32, brightness : f32) -> f32 {