summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/windlight
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2024-03-28 16:07:09 -0500
committerGitHub <noreply@github.com>2024-03-28 16:07:09 -0500
commit43e605b8339105151fa7e97b27359d87479a3461 (patch)
treeb1d3d6853fe8e3c774c9aa2a78e74790429461b6 /indra/newview/app_settings/shaders/class1/windlight
parent617436b7cb9a574c08e49974046c330da1b706e0 (diff)
#731 Fix for divide by zero when haze density set to zero (#1085)
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/windlight')
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl2
1 files changed, 1 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
index 8769cc0239..40b7f9cf0e 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
@@ -66,7 +66,7 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou
// I had thought blue_density and haze_density should have equal weighting,
// but attenuation due to haze_density tends to seem too strong
- vec3 combined_haze = blue_density + vec3(haze_density);
+ vec3 combined_haze = max(blue_density + vec3(haze_density), vec3(1e-6));
vec3 blue_weight = blue_density / combined_haze;
vec3 haze_weight = vec3(haze_density) / combined_haze;