summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class3/deferred/materialF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/materialF.glsl15
1 files changed, 8 insertions, 7 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
index 77e3b92385..5fb5647d35 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
@@ -38,7 +38,7 @@ uniform float emissive_brightness; // fullbright flag, 1.0 == fullbright, 0.0 o
uniform int sun_up_factor;
#ifdef WATER_FOG
-vec4 applyWaterFogView(vec3 pos, vec4 color);
+vec4 applyWaterFogViewLinear(vec3 pos, vec4 color, vec3 sunlit);
#endif
vec3 atmosFragLightingLinear(vec3 l, vec3 additive, vec3 atten);
@@ -49,6 +49,7 @@ void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float
vec3 srgb_to_linear(vec3 cs);
vec3 linear_to_srgb(vec3 cs);
vec3 legacy_adjust(vec3 c);
+vec3 legacy_adjust_fullbright(vec3 c);
#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
@@ -396,7 +397,7 @@ void main()
}
#endif
- color = mix(color.rgb, diffcol.rgb, emissive);
+ color = mix(color.rgb, legacy_adjust_fullbright(diffcol.rgb), emissive);
if (env > 0.0)
{ // add environmentmap
@@ -410,6 +411,11 @@ void main()
color.rgb = atmosFragLightingLinear(color.rgb, additive, atten);
+#ifdef WATER_FOG
+ vec4 temp = applyWaterFogViewLinear(pos, vec4(color, 0.0), sunlit_linear);
+ color = temp.rgb;
+#endif
+
vec3 npos = normalize(-pos.xyz);
vec3 light = vec3(0, 0, 0);
@@ -430,11 +436,6 @@ void main()
glare = min(glare, 1.0);
float al = max(diffcol.a, glare) * vertex_color.a;
-#ifdef WATER_FOG
- vec4 temp = applyWaterFogView(pos, vec4(color, 0.0));
- color = temp.rgb;
-#endif
-
frag_color = max(vec4(color, al), vec4(0));
#else // mode is not DIFFUSE_ALPHA_MODE_BLEND, encode to gbuffer