summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorAdam Moss <c@yotes.com>2012-04-21 18:33:07 +0100
committerAdam Moss <c@yotes.com>2012-04-21 18:33:07 +0100
commit442c5cf339ddffb10db9f819704bf77ad941bc28 (patch)
tree0ee758e66bcc5ebdec7fa1739ec8b981f1e92240 /indra/newview/app_settings
parent03442801bd8018318efb4a4e763dc8969fd11ed7 (diff)
STORM-1819: Ternary/graded shadow support
a bunch of trivial clean-ups and commentary.
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl11
6 files changed, 4 insertions, 26 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
index 07d5b08191..6269a051f1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl
@@ -29,18 +29,13 @@ out vec4 frag_color;
#define frag_color gl_FragColor
#endif
-uniform mat4 modelview_projection_matrix;
-
uniform float minimum_alpha;
uniform sampler2D diffuseMap;
-//flat VARYING int foo;
VARYING float pos_zd2;
VARYING float pos_w;
VARYING float target_pos_x;
-//VARYING vec4 pre_pos;
-//VARYING vec4 post_pos;
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
index 6397a5c461..c1f2d90712 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
@@ -34,9 +34,6 @@ ATTRIBUTE vec2 texcoord0;
VARYING float pos_zd2;
VARYING float pos_w;
VARYING float target_pos_x;
-//flat VARYING int foo;
-//VARYING vec4 pre_pos;
-//VARYING vec4 post_pos;
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
@@ -47,11 +44,9 @@ void main()
//transform vertex
vec4 pre_pos = vec4(position.xyz, 1.0);
vec4 pos = modelview_projection_matrix * pre_pos;
- //post_pos = pos;
target_pos_x = 0.5 * (shadow_target_width - 1.0) * pos.x;
pos_w = pos.w;
pos_zd2 = pos.z * 0.5;
- //foo = int(posxw.x);
gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index 70a5912258..a8a3d3efc1 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -68,8 +68,7 @@ float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc)
stc.xyz /= stc.w;
stc.z += shadow_bias;
- //stc.x = floor(stc.x + fract(stc.y) * 1.5);
- stc.x = floor(stc.x + fract(stc.y*12345));
+ stc.x = floor(stc.x + fract(stc.y*12345)); // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here
float cs = shadow2DRect(shadowMap, stc.xyz).x;
float shadow = cs;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
index 5fc4fd72ef..d8856a5f1e 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl
@@ -81,8 +81,7 @@ float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc)
stc.xyz /= stc.w;
stc.z += shadow_bias;
- //stc.x = floor(stc.x + fract(stc.y) * 1.5);
- stc.x = floor(stc.x + fract(stc.y*12345));
+ stc.x = floor(stc.x + fract(stc.y*12345)); // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here
float cs = shadow2DRect(shadowMap, stc.xyz).x;
float shadow = cs;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
index 785d50b853..f863f07e1a 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl
@@ -80,8 +80,7 @@ float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc)
stc.xyz /= stc.w;
stc.z += shadow_bias;
- //stc.x = floor(stc.x + fract(stc.y) * 1.5);
- stc.x = floor(stc.x + fract(stc.y*12345));
+ stc.x = floor(stc.x + fract(stc.y*12345)); // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here
float cs = shadow2DRect(shadowMap, stc.xyz).x;
float shadow = cs;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
index b0034addb5..be11790881 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl
@@ -88,20 +88,11 @@ float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl, vec2 pos_scr
stc.xyz /= stc.w;
stc.z += shadow_bias*scl;
- ////stc.x = floor(stc.x + fract(stc.y*12345));
- //stc.x = floor(stc.x + fract(stc.y));
- stc.x = floor(stc.x + fract(pos_screen.y*0.666666666));
-
- //stc.x = floor(stc.x);
- //stc.y = floor(stc.y);
-
- //stc.x += 0.5;
+ stc.x = floor(stc.x + fract(pos_screen.y*0.666666666)); // add some jitter to X sample pos according to Y to disguise the snapping going on here
float cs = shadow2DRect(shadowMap, stc.xyz).x;
float shadow = cs;
- //return shadow;
-
shadow += mex(shadow2DRect(shadowMap, stc.xyz+vec3(2.0, 1.5, 0.0)).x,cs);
shadow += mex(shadow2DRect(shadowMap, stc.xyz+vec3(1.0, -1.5, 0.0)).x,cs);
shadow += mex(shadow2DRect(shadowMap, stc.xyz+vec3(-2.0, 1.5, 0.0)).x,cs);