summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-05-25 15:51:15 -0500
committerDave Parks <davep@lindenlab.com>2011-05-25 15:51:15 -0500
commit9eea451a82379a61fa4a6cc2a55274e06cecbd58 (patch)
tree51f44405fa18b7a2354c22c0c4125f49e8b21d69 /indra/newview/app_settings/shaders/class2
parent0d5a661e57239c3e5d46a55cf4e2d808f31121fe (diff)
SH-469 Don't use depth buffers and multisample buffers where not absolutely needed -- make sample counts consistent between shaders and render targets.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl26
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl24
3 files changed, 30 insertions, 29 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
index c6f0ea2a5d..d0f9101774 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl
@@ -14,7 +14,7 @@ uniform sampler2DMS diffuseRect;
uniform sampler2DMS specularRect;
uniform sampler2DMS depthMap;
uniform sampler2DMS normalMap;
-uniform sampler2DMS lightMap;
+uniform sampler2DRect lightMap;
uniform sampler2D noiseMap;
uniform sampler2D lightFunc;
uniform sampler2D projectionMap;
@@ -112,6 +112,17 @@ void main()
ivec2 itc = ivec2(frag.xy);
+ float shadow = 1.0;
+
+ if (proj_shadow_idx >= 0)
+ {
+ vec4 shd = texture2DRect(lightMap, frag);
+ float sh[2];
+ sh[0] = shd.b;
+ sh[1] = shd.a;
+ shadow = min(sh[proj_shadow_idx]+shadow_fade, 1.0);
+ }
+
for (int i = 0; i < samples; i++)
{
vec3 pos = getPosition(itc, i).xyz;
@@ -120,17 +131,6 @@ void main()
dist2 /= vary_light.w;
if (dist2 <= 1.0)
{
- float shadow = 1.0;
-
- if (proj_shadow_idx >= 0)
- {
- vec4 shd = texelFetch(lightMap, itc, i);
- float sh[2];
- sh[0] = shd.b;
- sh[1] = shd.a;
- shadow = min(sh[proj_shadow_idx]+shadow_fade, 1.0);
- }
-
vec3 norm = texelFetch(normalMap, itc, i).xyz;
norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
@@ -239,6 +239,6 @@ void main()
discard;
}
- gl_FragColor.rgb = fcol/wght;
+ gl_FragColor.rgb = fcol/samples;
gl_FragColor.a = 0.0;
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
index 71482d0c7b..cb09fe9895 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl
@@ -13,7 +13,7 @@
uniform sampler2DMS diffuseRect;
uniform sampler2DMS specularRect;
uniform sampler2DMS normalMap;
-uniform sampler2DMS lightMap;
+uniform sampler2DRect lightMap;
uniform sampler2DMS depthMap;
uniform sampler2D noiseMap;
uniform samplerCube environmentMap;
@@ -257,7 +257,8 @@ void main()
vec3 fcol = vec3(0,0,0);
- float amb = 0;
+ vec2 scol_ambocc = texture2DRect(lightMap, tc).rg;
+ float ambocc = scol_ambocc.g;
for (int i = 0; i < samples; ++i)
{
@@ -271,9 +272,9 @@ void main()
vec4 diffuse = texelFetch(diffuseRect, itc, i);
vec4 spec = texelFetch(specularRect, itc, i);
- vec2 scol_ambocc = texelFetch(lightMap, itc, i).rg;
+ float amb = 0;
+
float scol = max(scol_ambocc.r, diffuse.a);
- float ambocc = scol_ambocc.g;
amb += ambocc;
calcAtmospherics(pos.xyz, ambocc);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
index 099a45718a..8d6ffd79c5 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl
@@ -14,7 +14,7 @@ uniform sampler2DMS diffuseRect;
uniform sampler2DMS specularRect;
uniform sampler2DMS depthMap;
uniform sampler2DMS normalMap;
-uniform sampler2DMS lightMap;
+uniform sampler2DRect lightMap;
uniform sampler2D noiseMap;
uniform sampler2D lightFunc;
uniform sampler2D projectionMap;
@@ -113,6 +113,17 @@ void main()
vec3 fcol = vec3(0,0,0);
int wght = 0;
+ float shadow = 1.0;
+
+ if (proj_shadow_idx >= 0)
+ {
+ vec4 shd = texture2DRect(lightMap, frag.xy);
+ float sh[2];
+ sh[0] = shd.b;
+ sh[1] = shd.a;
+ shadow = min(sh[proj_shadow_idx]+shadow_fade, 1.0);
+ }
+
for (int i = 0; i < samples; i++)
{
vec3 pos = getPosition(itc, i).xyz;
@@ -121,17 +132,6 @@ void main()
dist2 /= vary_light.w;
if (dist2 <= 1.0)
{
- float shadow = 1.0;
-
- if (proj_shadow_idx >= 0)
- {
- vec4 shd = texelFetch(lightMap, itc, i);
- float sh[2];
- sh[0] = shd.b;
- sh[1] = shd.a;
- shadow = min(sh[proj_shadow_idx]+shadow_fade, 1.0);
- }
-
vec3 norm = texelFetch(normalMap, itc, i).xyz;
norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm