summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/windlight
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/windlight')
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl11
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl19
2 files changed, 16 insertions, 14 deletions
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
index 20b1e3513e..1463d507bc 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
@@ -33,7 +33,7 @@ vec3 srgb_to_linear(vec3 col);
vec3 linear_to_srgb(vec3 col);
vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten)
-{
+{
if (no_atmo == 1)
{
return light;
@@ -45,14 +45,7 @@ vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten)
vec3 atmosFragLightingLinear(vec3 light, vec3 additive, vec3 atten)
{
- if (no_atmo == 1)
- {
- return light;
- }
-
- light *= atten.r;
- light += additive;
- return light*2.0;
+ return atmosFragLighting(light, additive, atten);
}
vec3 atmosLighting(vec3 light)
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl
index 739f00a8b0..0093e8a31e 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsFuncs.glsl
@@ -50,6 +50,8 @@ uniform float sun_moon_glow_factor;
float getAmbientClamp() { return 1.0f; }
+vec3 srgb_to_linear(vec3 col);
+
// return colors in sRGB space
void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive,
out vec3 atten, bool use_ao)
@@ -148,6 +150,14 @@ vec3 srgb_to_linear(vec3 col);
void calcAtmosphericVarsLinear(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive,
out vec3 atten, bool use_ao)
{
+#if 1
+ calcAtmosphericVars(inPositionEye, light_dir, 1.0, sunlit, amblit, additive, atten, false);
+ sunlit = srgb_to_linear(sunlit);
+ additive = srgb_to_linear(additive);
+ amblit = ambient_linear;
+#else
+
+ //EXPERIMENTAL -- attempt to factor out srgb_to_linear conversions above
vec3 rel_pos = inPositionEye;
//(TERRAIN) limit altitude
@@ -217,12 +227,11 @@ void calcAtmosphericVarsLinear(vec3 inPositionEye, vec3 light_dir, float ambFact
additive = (blue_horizon.rgb * blue_weight.rgb) * (cs + tmpAmbient.rgb) + (haze_horizon * haze_weight.rgb) * (cs * haze_glow + tmpAmbient.rgb);
// brightness of surface both sunlight and ambient
- sunlit = sunlight.rgb;
+ sunlit = min(sunlight.rgb, vec3(1));
amblit = tmpAmbient.rgb;
additive *= vec3(1.0 - combined_haze);
- //sunlit = srgb_to_linear(sunlit);
- amblit = ambient_linear;
- additive = srgb_to_linear(additive*1.5);
-
+ //sunlit = sunlight_linear;
+ amblit = ambient_linear*0.8;
+#endif
}