summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2019-03-20 16:10:10 +0000
committerRider Linden <rider@lindenlab.com>2019-03-20 16:10:10 +0000
commitfa6e4137e39f9adac8696af688d0f6f28f6cb29d (patch)
treebb8d7caa122850d4ef4c18a9846a55504960d010 /indra/newview/app_settings
parentb1999722be317f2b293ad3e4a68310a82a467fc0 (diff)
parent2d514e4b10025dc37c20db7db821e621dcdcaaf1 (diff)
Merged in graham_linden/viewer-eep-fixes (pull request #305)
SL-10764, SL-10768. SL-10763
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r--indra/newview/app_settings/settings.xml22
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl11
-rw-r--r--indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl2
9 files changed, 52 insertions, 23 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 088bc3dfac..c0dcafdd51 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8558,6 +8558,28 @@
</array>
</map>
+ <key>RenderAlphaBatchFullbrights</key>
+ <map>
+ <key>Comment</key>
+ <string>Render fullbright alpha content more efficiently, but with possible visual differences from prev viewers.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>RenderAlphaBatchEmissives</key>
+ <map>
+ <key>Comment</key>
+ <string>Render emissive alpha content more efficiently, but with possible visual differences from prev viewers.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>RenderAnisotropic</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index 08ddaeceb3..d5ef010017 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -45,17 +45,6 @@ VARYING vec2 vary_texcoord0;
vec4 applyWaterFogView(vec3 pos, vec4 color);
#endif
-vec3 fullbrightAtmosTransportDeferred(vec3 light)
-{
- return light;
-}
-
-vec3 fullbrightScaleSoftClipDeferred(vec3 light)
-{
- //soft clip effect:
- return light;
-}
-
#ifdef HAS_ALPHA_MASK
uniform float minimum_alpha;
#endif
@@ -78,8 +67,6 @@ void main()
#endif
color.rgb *= vertex_color.rgb;
- color.rgb = fullbrightAtmosTransportDeferred(color.rgb);
- color.rgb = fullbrightScaleSoftClipDeferred(color.rgb);
#ifdef WATER_FOG
vec3 pos = vary_position;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index 2569e49743..57916eb3e5 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -72,10 +72,13 @@ uniform vec2 screen_res;
uniform mat4 inv_proj;
vec3 getNorm(vec2 pos_screen);
+vec3 srgb_to_linear(vec3 cs);
+vec3 linear_to_srgb(vec3 cl);
vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = srgb_to_linear(ret.rgb);
vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
@@ -95,6 +98,7 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = srgb_to_linear(ret.rgb);
vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
@@ -112,6 +116,7 @@ vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret.rgb = srgb_to_linear(ret.rgb);
vec2 dist = tc-vec2(0.5);
diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl
index a9288b3df6..dd14192ad6 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/lightFuncV.glsl
@@ -52,7 +52,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
da *= spot*spot; // GL_SPOT_EXPONENT=2
//angular attenuation
- da *= calcDirectionalLight(n, lv);
+ da *= calcDirectionalLight(n, -lv);
return da;
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index 275bc829a7..4e3ecbcbf5 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -71,11 +71,19 @@ uniform vec2 screen_res;
uniform mat4 inv_proj;
+vec3 srgb_to_linear(vec3 cs);
+
vec3 getNorm(vec2 pos_screen);
+vec4 correctWithGamma(vec4 col)
+{
+ return vec4(srgb_to_linear(col.rgb), col.a);
+}
+
vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret = correctWithGamma(ret);
vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
@@ -95,6 +103,7 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret = correctWithGamma(ret);
vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
@@ -211,16 +220,13 @@ void main()
dlit = color.rgb * plcol.rgb * plcol.a;
col = dlit*lit*diff_tex*shadow;
- amb_da += (da*0.5) * proj_ambiance;
- amb_da += (da*da*0.5 + 0.5) * proj_ambiance;
- //amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance;
- //amb_da = min(amb_da,shadow);
+ amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance;
}
//float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0);
vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod);
- amb_da += (da*da*0.5+0.5)*proj_ambiance;
+ amb_da += (da*da*0.5+0.5)*(1.0-shadow)*proj_ambiance;
amb_da *= dist_atten * noise;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 9b69d8d855..abea8aecca 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -71,11 +71,18 @@ uniform vec2 screen_res;
uniform mat4 inv_proj;
+vec3 srgb_to_linear(vec3 cs);
vec3 getNorm(vec2 pos_screen);
+vec4 correctWithGamma(vec4 col)
+{
+ return vec4(srgb_to_linear(col.rgb), col.a);
+}
+
vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret = correctWithGamma(ret);
vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
@@ -95,6 +102,7 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret = correctWithGamma(ret);
vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
@@ -112,6 +120,7 @@ vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret = correctWithGamma(ret);
vec2 dist = tc-vec2(0.5);
@@ -216,7 +225,7 @@ void main()
//float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0);
vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod);
- amb_da += (da*da*0.5+0.5)*proj_ambiance;
+ amb_da += (da*da*0.5+0.5)*(1.0-shadow)*proj_ambiance;
amb_da *= dist_atten * noise;
diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl
index 3acf9fe883..8ca7db1814 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl
@@ -34,7 +34,7 @@ vec3 atmosGetDiffuseSunlightColor();
vec3 scaleDownLight(vec3 light);
uniform vec4 light_position[8];
-uniform vec3 light_attenuation[8];
+uniform vec4 light_attenuation[8];
uniform vec3 light_diffuse[8];
vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol)
diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl
index e043ac873e..ce5855646c 100644
--- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl
+++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsSpecularV.glsl
@@ -32,7 +32,7 @@ vec3 atmosGetDiffuseSunlightColor();
vec3 scaleDownLight(vec3 light);
uniform vec4 light_position[8];
-uniform vec3 light_attenuation[8];
+uniform vec4 light_attenuation[8];
uniform vec3 light_diffuse[8];
vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol)
diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
index 9842d9ba93..5302b05043 100644
--- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
@@ -32,7 +32,7 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
uniform vec4 light_position[8];
uniform vec3 light_direction[8];
-uniform vec3 light_attenuation[8];
+uniform vec4 light_attenuation[8];
uniform vec3 light_diffuse[8];
vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)