summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl22
1 files changed, 15 insertions, 7 deletions
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
index ee9c990b12..e314555ef9 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
@@ -27,17 +27,25 @@ vec3 getAdditiveColor();
vec3 getAtmosAttenuation();
vec3 scaleSoftClipFrag(vec3 light);
-uniform int no_atmo;
+vec3 srgb_to_linear(vec3 col);
+vec3 linear_to_srgb(vec3 col);
+
+uniform int sun_up_factor;
vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten)
-{
- if (no_atmo == 1)
- {
- return light;
- }
+{
light *= atten.r;
+ additive = srgb_to_linear(additive*2.0);
+ // magic 1.25 here is to match the default RenderSkyHDRScale -- this parameter needs to be plumbed into sky settings or something
+ // so it's available to all shaders that call atmosFragLighting instead of just softenLightF.glsl
+ additive *= sun_up_factor*1.25 + 1.0;
light += additive;
- return light * 2.0;
+ return light;
+}
+
+vec3 atmosFragLightingLinear(vec3 light, vec3 additive, vec3 atten)
+{
+ return atmosFragLighting(light, additive, atten);
}
vec3 atmosLighting(vec3 light)