summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl17
1 files changed, 4 insertions, 13 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
index 35d752be02..003dd05e6f 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
@@ -82,11 +82,7 @@ vec3 srgb_to_linear(vec3 c);
vec3 linear_to_srgb(vec3 c);
void calcAtmosphericVarsLinear(vec3 inPositionEye, vec3 norm, vec3 light_dir, out vec3 sunlit, out vec3 amblit, out vec3 atten, out vec3 additive);
-vec3 atmosFragLightingLinear(vec3 color, vec3 additive, vec3 atten);
-
-#ifdef WATER_FOG
-vec4 applyWaterFogViewLinear(vec3 pos, vec4 color, vec3 sunlit);
-#endif
+vec4 applySkyAndWaterFog(vec3 pos, vec3 additive, vec3 atten, vec4 color);
void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float nh, out float nl, out float nv, out float vh, out float lightDist);
float calcLegacyDistanceAttenuation(float distance, float falloff);
@@ -228,13 +224,6 @@ void main()
color = pbrBaseLight(diffuseColor, specularColor, metallic, v, norm.xyz, perceptualRoughness, light_dir, sunlit_linear, scol, radiance, irradiance, colorEmissive, ao, additive, atten);
- 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 light = vec3(0);
// Punctual lights
@@ -250,7 +239,8 @@ void main()
color.rgb += light.rgb;
-
+ color.rgb = applySkyAndWaterFog(pos.xyz, additive, atten, vec4(color, 1.0)).rgb;
+
float a = basecolor.a*vertex_color.a;
frag_color = max(vec4(color.rgb,a), vec4(0));
@@ -305,6 +295,7 @@ void main()
float a = basecolor.a*vertex_color.a;
color += colorEmissive;
+
color = linear_to_srgb(color);
frag_color = max(vec4(color.rgb,a), vec4(0));
}