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.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl40
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbrglowV.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl48
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl48
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/textureUtilV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl41
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/gaussianF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/reflectionmipF.glsl20
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl3
13 files changed, 66 insertions, 177 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 6ab966ae01..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)
{
@@ -396,7 +395,7 @@ vec3 pbrIbl(vec3 diffuseColor,
specContrib = specular * ao;
- return (diffuse + specular*0.5) * ao; //reduce by half to place in appropriate color space for atmospherics
+ return (diffuse + specular) * ao;
}
vec3 pbrIbl(vec3 diffuseColor,
@@ -562,16 +561,13 @@ vec3 pbrBaseLight(vec3 diffuseColor, vec3 specularColor, float metallic, vec3 v,
float NdotV = clamp(abs(dot(norm, v)), 0.001, 1.0);
vec3 ibl_spec;
- color += pbrIbl(diffuseColor, specularColor, radiance, irradiance, ao, NdotV, 0.2, ibl_spec);
+ color += pbrIbl(diffuseColor, specularColor, radiance, irradiance, ao, NdotV, perceptualRoughness, ibl_spec);
color += pbrPunctual(diffuseColor, specularColor, perceptualRoughness, metallic, norm, v, normalize(light_dir), specContrib) * sunlit * 2.75 * scol;
specContrib *= sunlit * 2.75 * scol;
specContrib += ibl_spec;
- color += colorEmissive*0.5;
-
- color = atmosFragLightingLinear(color, additive, atten);
- color = scaleSoftClipFragLinear(color);
+ 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 afe504743d..3a15fd1111 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -88,8 +88,10 @@ void main()
#endif
#ifndef IS_HUD
+ color.rgb = fullbrightAtmosTransport(color.rgb);
color.rgb = srgb_to_linear(color.rgb);
#endif
+
frag_color.rgb = color.rgb;
frag_color.a = color.a;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl
index a9e114dddc..e9515a9187 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl
@@ -44,18 +44,10 @@ uniform mat4 modelview_matrix;
out vec3 vary_position;
-uniform vec2 texture_base_color_scale;
-uniform float texture_base_color_rotation;
-uniform vec2 texture_base_color_offset;
-uniform vec2 texture_normal_scale;
-uniform float texture_normal_rotation;
-uniform vec2 texture_normal_offset;
-uniform vec2 texture_metallic_roughness_scale;
-uniform float texture_metallic_roughness_rotation;
-uniform vec2 texture_metallic_roughness_offset;
-uniform vec2 texture_emissive_scale;
-uniform float texture_emissive_rotation;
-uniform vec2 texture_emissive_offset;
+uniform vec4[2] texture_base_color_transform;
+uniform vec4[2] texture_normal_transform;
+uniform vec4[2] texture_metallic_roughness_transform;
+uniform vec4[2] texture_emissive_transform;
out vec3 vary_fragcoord;
@@ -78,7 +70,7 @@ out vec3 vary_tangent;
flat out float vary_sign;
out vec3 vary_normal;
-vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf_rotation, vec2 khr_gltf_offset, mat4 sl_animation_transform);
+vec2 texture_transform(vec2 vertex_texcoord, vec4[2] khr_gltf_transform, mat4 sl_animation_transform);
void main()
@@ -97,10 +89,10 @@ void main()
vary_fragcoord.xyz = vert.xyz + vec3(0,0,near_clip);
- base_color_texcoord = texture_transform(texcoord0, texture_base_color_scale, texture_base_color_rotation, texture_base_color_offset, texture_matrix0);
- normal_texcoord = texture_transform(texcoord0, texture_normal_scale, texture_normal_rotation, texture_normal_offset, texture_matrix0);
- metallic_roughness_texcoord = texture_transform(texcoord0, texture_metallic_roughness_scale, texture_metallic_roughness_rotation, texture_metallic_roughness_offset, texture_matrix0);
- emissive_texcoord = texture_transform(texcoord0, texture_emissive_scale, texture_emissive_rotation, texture_emissive_offset, texture_matrix0);
+ base_color_texcoord = texture_transform(texcoord0, texture_base_color_transform, texture_matrix0);
+ normal_texcoord = texture_transform(texcoord0, texture_normal_transform, texture_matrix0);
+ metallic_roughness_texcoord = texture_transform(texcoord0, texture_metallic_roughness_transform, texture_matrix0);
+ emissive_texcoord = texture_transform(texcoord0, texture_emissive_transform, texture_matrix0);
#ifdef HAS_SKIN
vec3 n = (mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz;
@@ -133,12 +125,8 @@ uniform mat4 modelview_matrix;
out vec3 vary_position;
-uniform vec2 texture_base_color_scale;
-uniform float texture_base_color_rotation;
-uniform vec2 texture_base_color_offset;
-uniform vec2 texture_emissive_scale;
-uniform float texture_emissive_rotation;
-uniform vec2 texture_emissive_offset;
+uniform vec4[2] texture_base_color_transform;
+uniform vec4[2] texture_emissive_transform;
in vec3 position;
in vec4 diffuse_color;
@@ -149,7 +137,7 @@ out vec2 emissive_texcoord;
out vec4 vertex_color;
-vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf_rotation, vec2 khr_gltf_offset, mat4 sl_animation_transform);
+vec2 texture_transform(vec2 vertex_texcoord, vec4[2] khr_gltf_transform, mat4 sl_animation_transform);
void main()
@@ -159,8 +147,8 @@ void main()
gl_Position = vert;
vary_position = vert.xyz;
- base_color_texcoord = texture_transform(texcoord0, texture_base_color_scale, texture_base_color_rotation, texture_base_color_offset, texture_matrix0);
- emissive_texcoord = texture_transform(texcoord0, texture_emissive_scale, texture_emissive_rotation, texture_emissive_offset, texture_matrix0);
+ base_color_texcoord = texture_transform(texcoord0, texture_base_color_transform, texture_matrix0);
+ emissive_texcoord = texture_transform(texcoord0, texture_emissive_transform, texture_matrix0);
vertex_color = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrglowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrglowV.glsl
index b73d08cf0d..82a50a115c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrglowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrglowV.glsl
@@ -34,12 +34,8 @@ uniform mat4 modelview_projection_matrix;
uniform mat4 texture_matrix0;
-uniform vec2 texture_base_color_scale;
-uniform float texture_base_color_rotation;
-uniform vec2 texture_base_color_offset;
-uniform vec2 texture_emissive_scale;
-uniform float texture_emissive_rotation;
-uniform vec2 texture_emissive_offset;
+uniform vec4[2] texture_base_color_transform;
+uniform vec4[2] texture_emissive_transform;
in vec3 position;
in vec4 emissive;
@@ -51,7 +47,7 @@ out vec2 emissive_texcoord;
out vec4 vertex_emissive;
-vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf_rotation, vec2 khr_gltf_offset, mat4 sl_animation_transform);
+vec2 texture_transform(vec2 vertex_texcoord, vec4[2] khr_gltf_transform, mat4 sl_animation_transform);
void main()
{
@@ -68,8 +64,8 @@ void main()
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
#endif
- base_color_texcoord = texture_transform(texcoord0, texture_base_color_scale, texture_base_color_rotation, texture_base_color_offset, texture_matrix0);
- emissive_texcoord = texture_transform(texcoord0, texture_emissive_scale, texture_emissive_rotation, texture_emissive_offset, texture_matrix0);
+ base_color_texcoord = texture_transform(texcoord0, texture_base_color_transform, texture_matrix0);
+ emissive_texcoord = texture_transform(texcoord0, texture_emissive_transform, texture_matrix0);
vertex_emissive = emissive;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
index 6f50aefdab..e2c23ac8f0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
@@ -38,18 +38,10 @@ uniform mat4 modelview_projection_matrix;
#endif
uniform mat4 texture_matrix0;
-uniform vec2 texture_base_color_scale;
-uniform float texture_base_color_rotation;
-uniform vec2 texture_base_color_offset;
-uniform vec2 texture_normal_scale;
-uniform float texture_normal_rotation;
-uniform vec2 texture_normal_offset;
-uniform vec2 texture_metallic_roughness_scale;
-uniform float texture_metallic_roughness_rotation;
-uniform vec2 texture_metallic_roughness_offset;
-uniform vec2 texture_emissive_scale;
-uniform float texture_emissive_rotation;
-uniform vec2 texture_emissive_offset;
+uniform vec4[2] texture_base_color_transform;
+uniform vec4[2] texture_normal_transform;
+uniform vec4[2] texture_metallic_roughness_transform;
+uniform vec4[2] texture_emissive_transform;
in vec3 position;
in vec4 diffuse_color;
@@ -68,7 +60,7 @@ out vec3 vary_tangent;
flat out float vary_sign;
out vec3 vary_normal;
-vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf_rotation, vec2 khr_gltf_offset, mat4 sl_animation_transform);
+vec2 texture_transform(vec2 vertex_texcoord, vec4[2] khr_gltf_transform, mat4 sl_animation_transform);
void main()
{
@@ -86,10 +78,10 @@ void main()
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
#endif
- base_color_texcoord = texture_transform(texcoord0, texture_base_color_scale, texture_base_color_rotation, texture_base_color_offset, texture_matrix0);
- normal_texcoord = texture_transform(texcoord0, texture_normal_scale, texture_normal_rotation, texture_normal_offset, texture_matrix0);
- metallic_roughness_texcoord = texture_transform(texcoord0, texture_metallic_roughness_scale, texture_metallic_roughness_rotation, texture_metallic_roughness_offset, texture_matrix0);
- emissive_texcoord = texture_transform(texcoord0, texture_emissive_scale, texture_emissive_rotation, texture_emissive_offset, texture_matrix0);
+ base_color_texcoord = texture_transform(texcoord0, texture_base_color_transform, texture_matrix0);
+ normal_texcoord = texture_transform(texcoord0, texture_normal_transform, texture_matrix0);
+ metallic_roughness_texcoord = texture_transform(texcoord0, texture_metallic_roughness_transform, texture_matrix0);
+ emissive_texcoord = texture_transform(texcoord0, texture_emissive_transform, texture_matrix0);
#ifdef HAS_SKIN
vec3 n = (mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz;
@@ -114,18 +106,10 @@ uniform mat4 modelview_projection_matrix;
uniform mat4 texture_matrix0;
-uniform vec2 texture_base_color_scale;
-uniform float texture_base_color_rotation;
-uniform vec2 texture_base_color_offset;
-uniform vec2 texture_normal_scale;
-uniform float texture_normal_rotation;
-uniform vec2 texture_normal_offset;
-uniform vec2 texture_metallic_roughness_scale;
-uniform float texture_metallic_roughness_rotation;
-uniform vec2 texture_metallic_roughness_offset;
-uniform vec2 texture_emissive_scale;
-uniform float texture_emissive_rotation;
-uniform vec2 texture_emissive_offset;
+uniform vec4[2] texture_base_color_transform;
+uniform vec4[2] texture_normal_transform;
+uniform vec4[2] texture_metallic_roughness_transform;
+uniform vec4[2] texture_emissive_transform;
in vec3 position;
in vec4 diffuse_color;
@@ -136,15 +120,15 @@ out vec2 emissive_texcoord;
out vec4 vertex_color;
-vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf_rotation, vec2 khr_gltf_offset, mat4 sl_animation_transform);
+vec2 texture_transform(vec2 vertex_texcoord, vec4[2] khr_gltf_transform, mat4 sl_animation_transform);
void main()
{
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- base_color_texcoord = texture_transform(texcoord0, texture_base_color_scale, texture_base_color_rotation, texture_base_color_offset, texture_matrix0);
- emissive_texcoord = texture_transform(texcoord0, texture_emissive_scale, texture_emissive_rotation, texture_emissive_offset, texture_matrix0);
+ base_color_texcoord = texture_transform(texcoord0, texture_base_color_transform, texture_matrix0);
+ emissive_texcoord = texture_transform(texcoord0, texture_emissive_transform, texture_matrix0);
vertex_color = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
index f0e940eb5f..383fcaa9a7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
@@ -44,9 +44,6 @@ vec3 linear_to_srgb(vec3 cl);
//===============================================================
// tone mapping taken from Khronos sample implementation
//===============================================================
-const float GAMMA = 2.2;
-const float INV_GAMMA = 1.0 / GAMMA;
-
// sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT
const mat3 ACESInputMat = mat3
@@ -65,29 +62,6 @@ const mat3 ACESOutputMat = mat3
-0.07367, -0.00605, 1.07602
);
-
-// linear to sRGB approximation
-// see http://chilliant.blogspot.com/2012/08/srgb-approximations-for-hlsl.html
-vec3 linearTosRGB(vec3 color)
-{
- return pow(color, vec3(INV_GAMMA));
-}
-
-
-// sRGB to linear approximation
-// see http://chilliant.blogspot.com/2012/08/srgb-approximations-for-hlsl.html
-vec3 sRGBToLinear(vec3 srgbIn)
-{
- return vec3(pow(srgbIn.xyz, vec3(GAMMA)));
-}
-
-
-vec4 sRGBToLinear(vec4 srgbIn)
-{
- return vec4(sRGBToLinear(srgbIn.xyz), srgbIn.w);
-}
-
-
// ACES tone map (faster approximation)
// see: https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/
vec3 toneMapACES_Narkowicz(vec3 color)
@@ -128,6 +102,7 @@ vec3 toneMapACES_Hill(vec3 color)
}
uniform float exposure;
+uniform float gamma;
vec3 toneMap(vec3 color)
{
@@ -145,11 +120,12 @@ vec3 toneMap(vec3 color)
// boost exposure as discussed in https://github.com/mrdoob/three.js/pull/19621
// this factor is based on the exposure correction of Krzysztof Narkowicz in his
// implemetation of ACES tone mapping
- color /= 0.6;
+ color *= 1.0/0.6;
+ //color /= 0.6;
color = toneMapACES_Hill(color);
#endif
- return linearTosRGB(color);
+ return linear_to_srgb(color);
}
//===============================================================
@@ -192,16 +168,26 @@ float noise(vec2 x) {
//=============================
+
+vec3 legacyGamma(vec3 color)
+{
+ color = 1. - clamp(color, vec3(0.), vec3(1.));
+ color = 1. - pow(color, vec3(gamma)); // s/b inverted already CPU-side
+
+ return color;
+}
+
void main()
{
//this is the one of the rare spots where diffuseRect contains linear color values (not sRGB)
vec4 diff = texture2D(diffuseRect, vary_fragcoord);
diff.rgb = toneMap(diff.rgb);
- vec2 tc = vary_fragcoord.xy*screen_res;
-
+ diff.rgb = legacyGamma(diff.rgb);
+
+ vec2 tc = vary_fragcoord.xy*screen_res*4.0;
vec3 seed = (diff.rgb+vec3(1.0))*vec3(tc.xy, tc.x+tc.y);
vec3 nz = vec3(noise(seed.rg), noise(seed.gb), noise(seed.rb));
- diff.rgb += nz*0.008;
+ diff.rgb += nz*0.003;
//diff.rgb = nz;
frag_color = diff;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/textureUtilV.glsl b/indra/newview/app_settings/shaders/class1/deferred/textureUtilV.glsl
index 39cc07d2d1..71f7ec52c4 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/textureUtilV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/textureUtilV.glsl
@@ -58,7 +58,7 @@ vec2 khr_texture_transform(vec2 texcoord, vec2 scale, float rotation, vec2 offse
// animations, available through LSL script functions such as
// LlSetTextureAnim. It assumes a right-handed UV coordinate system.
// texcoord - The final texcoord to use for image sampling
-vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf_rotation, vec2 khr_gltf_offset, mat4 sl_animation_transform)
+vec2 texture_transform(vec2 vertex_texcoord, vec4[2] khr_gltf_transform, mat4 sl_animation_transform)
{
vec2 texcoord = vertex_texcoord;
@@ -67,7 +67,7 @@ vec2 texture_transform(vec2 vertex_texcoord, vec2 khr_gltf_scale, float khr_gltf
// Convert to left-handed coordinate system. The offset of 1 is necessary
// for rotations to be applied correctly.
texcoord.y = 1.0 - texcoord.y;
- texcoord = khr_texture_transform(texcoord, khr_gltf_scale, khr_gltf_rotation, khr_gltf_offset);
+ texcoord = khr_texture_transform(texcoord, khr_gltf_transform[0].xy, khr_gltf_transform[0].z, khr_gltf_transform[1].xy);
// Convert back to right-handed coordinate system
texcoord.y = 1.0 - texcoord.y;
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
index 16651dcdbc..745999fc2f 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl
@@ -33,6 +33,7 @@ uniform float waterFogKS;
vec3 getPositionEye();
vec3 srgb_to_linear(vec3 col);
+vec3 linear_to_srgb(vec3 col);
vec4 applyWaterFogView(vec3 pos, vec4 color)
{
@@ -68,48 +69,16 @@ vec4 applyWaterFogView(vec3 pos, vec4 color)
float D = pow(0.98, l*kd);
color.rgb = color.rgb * D + kc.rgb * L;
+ color.a = kc.a + color.a;
return 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;
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/gaussianF.glsl b/indra/newview/app_settings/shaders/class1/interface/gaussianF.glsl
index 8e341503f5..188fac5460 100644
--- a/indra/newview/app_settings/shaders/class1/interface/gaussianF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/gaussianF.glsl
@@ -41,7 +41,7 @@ void main()
{
vec3 col = vec3(0,0,0);
- float w[] = { 0.0002, 0.0060, 0.0606, 0.2417, 0.3829, 0.2417, 0.0606, 0.0060, 0.0002 };
+ float w[9] = float[9]( 0.0002, 0.0060, 0.0606, 0.2417, 0.3829, 0.2417, 0.0606, 0.0060, 0.0002 );
for (int i = 0; i < 9; ++i)
{
diff --git a/indra/newview/app_settings/shaders/class1/interface/reflectionmipF.glsl b/indra/newview/app_settings/shaders/class1/interface/reflectionmipF.glsl
index 9f7706fe36..45267e4403 100644
--- a/indra/newview/app_settings/shaders/class1/interface/reflectionmipF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/reflectionmipF.glsl
@@ -26,29 +26,11 @@
out vec4 frag_color;
uniform sampler2D diffuseRect;
-uniform sampler2D depthMap;
-
-uniform float resScale;
-uniform float znear;
-uniform float zfar;
in vec2 vary_texcoord0;
-// get linear depth value given a depth buffer sample d and znear and zfar values
-float linearDepth(float d, float znear, float zfar);
-
void main()
{
- float depth = texture(depthMap, vary_texcoord0.xy).r;
- float dist = linearDepth(depth, znear, zfar);
-
- // convert linear depth to distance
- vec3 v;
- v.xy = vary_texcoord0.xy / 512.0 * 2.0 - 1.0;
- v.z = 1.0;
- v = normalize(v);
- dist /= v.z;
-
vec3 col = texture(diffuseRect, vary_texcoord0.xy).rgb;
- frag_color = vec4(col, dist/256.0);
+ frag_color = vec4(col, 0.0);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
index edc0a9628b..7af7f20f85 100644
--- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl
@@ -26,15 +26,12 @@
uniform mat4 modelview_projection_matrix;
in vec3 position;
-in vec4 diffuse_color;
-out vec4 vertex_color;
out vec2 vary_texcoord0;
void main()
{
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
vary_texcoord0 = position.xy*0.5+0.5;
- vertex_color = diffuse_color;
}