summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl44
5 files changed, 5 insertions, 54 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
index cf9ce646d1..fe796a054d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
@@ -52,9 +52,6 @@ VARYING vec2 vary_texcoord2;
VARYING vec2 vary_texcoord3;
VARYING float altitude_blend_factor;
-/// Soft clips the light with a gamma correction
-vec3 scaleSoftClip(vec3 light);
-
vec4 cloudNoise(vec2 uv)
{
vec4 a = texture2D(cloud_noise_texture, uv);
@@ -119,7 +116,6 @@ void main()
color = (cloudColorSun*(1.-alpha2) + cloudColorAmbient);
color.rgb= max(vec3(0), color.rgb);
color.rgb *= 2.0;
- color.rgb = scaleSoftClip(color.rgb);
/// Gamma correct for WL (soft clip effect).
frag_data[0] = vec4(color.rgb, alpha1);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl
index 0b4a59c866..4bf16b50bf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl
@@ -74,7 +74,6 @@ const float ONE_OVER_PI = 0.3183098861;
vec3 srgb_to_linear(vec3 cs);
vec3 atmosFragLightingLinear(vec3 light, vec3 additive, vec3 atten);
-vec3 scaleSoftClipFragLinear(vec3 light);
float calcLegacyDistanceAttenuation(float distance, float falloff)
{
@@ -568,7 +567,7 @@ vec3 pbrBaseLight(vec3 diffuseColor, vec3 specularColor, float metallic, vec3 v,
specContrib *= sunlit * 2.75 * scol;
specContrib += ibl_spec;
- color += colorEmissive; //divide by two to correct for magical multiply by two in atmosFragLighting
+ color += colorEmissive;
return color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
index f0522850de..fb97cd95b4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl
@@ -27,14 +27,9 @@
/*[EXTRA_CODE_HERE]*/
-#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
-#else
-#define frag_color gl_FragColor
-#endif
vec3 fullbrightAtmosTransport(vec3 light);
-vec3 fullbrightScaleSoftClip(vec3 light);
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
@@ -46,8 +41,6 @@ void main()
vec4 color = diffuseLookup(vary_texcoord0.xy)*vertex_color;
color.rgb = fullbrightAtmosTransport(color.rgb);
- color.rgb = fullbrightScaleSoftClip(color.rgb);
-
frag_color = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index c406c669f2..3a15fd1111 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -89,7 +89,6 @@ void main()
#ifndef IS_HUD
color.rgb = fullbrightAtmosTransport(color.rgb);
- color.rgb = fullbrightScaleSoftClip(color.rgb);
color.rgb = srgb_to_linear(color.rgb);
#endif
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
index e3a201c724..745999fc2f 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
@@ -76,42 +76,9 @@ vec4 applyWaterFogView(vec3 pos, vec4 color)
vec4 applyWaterFogViewLinearNoClip(vec3 pos, vec4 color, vec3 sunlit)
{
- vec3 view = normalize(pos);
- //normalize view vector
- float es = -(dot(view, waterPlane.xyz));
-
-
- //find intersection point with water plane and eye vector
-
- //get eye depth
- float e0 = max(-waterPlane.w, 0.0);
-
- vec3 int_v = waterPlane.w > 0.0 ? view * waterPlane.w / es : vec3(0.0, 0.0, 0.0);
-
- //get object depth
- float depth = length(pos - int_v);
-
- //get "thickness" of water
- float l = max(depth, 0.1);
-
- float kd = waterFogDensity*1.3;
- float ks = waterFogKS;
- vec4 kc = waterFogColor;
- kc.rgb = srgb_to_linear(kc.rgb); // TODO -- pass in waterFogColor linear
- kc.rgb *= sunlit;
-
- float F = 0.98;
-
- float t1 = -kd * pow(F, ks * e0);
- float t2 = kd + ks * es;
- float t3 = pow(F, t2 * l) - 1.0;
-
- float L = min(t1 / t2 * t3, 1.0);
-
- float D = pow(0.98, l * kd);
-
- color.rgb = color.rgb * D + kc.rgb * L;
-
+ color.rgb = linear_to_srgb(color.rgb);
+ color = applyWaterFogView(pos, color);
+ color.rgb = srgb_to_linear(color.rgb);
return color;
}
@@ -122,10 +89,7 @@ vec4 applyWaterFogViewLinear(vec3 pos, vec4 color, vec3 sunlit)
return color;
}
- color.rgb = linear_to_srgb(color.rgb);
- color = applyWaterFogView(pos, color);
- color.rgb = srgb_to_linear(color.rgb);
- return color;
+ return applyWaterFogViewLinearNoClip(pos, color, sunlit);
}
vec4 applyWaterFogViewLinear(vec3 pos, vec4 color)