From 1415743545db573c227600332ff498bad4121d8e Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:53:58 +1100 Subject: [PATCH] Update world.frag --- assets/opensb/rendering/effects/world.frag | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/opensb/rendering/effects/world.frag b/assets/opensb/rendering/effects/world.frag index a123096..7da662d 100644 --- a/assets/opensb/rendering/effects/world.frag +++ b/assets/opensb/rendering/effects/world.frag @@ -55,8 +55,11 @@ vec4 bicubicSample(sampler2D texture, vec2 texcoord, vec2 texscale) { vec3 sampleLight(vec2 coord, vec2 scale) { //soften super bright lights a little + const float threshold = 1.0; vec3 rgb = bicubicSample(lightMap, coord, scale).rgb; - return mix(rgb, (rgb / (vec3(1.) + rgb)) * 1.666666, 0.666666); + vec3 lower = min(rgb, threshold); + vec3 upper = max(rgb, threshold) - threshold; + return lower + (upper / (vec3(1.) + upper)); } void main() {