summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2011-12-13 11:15:18 -0800
committerTodd Stinson <stinson@lindenlab.com>2011-12-13 11:15:18 -0800
commit9d1db4f19ae7ca044e47d0fe4e605e14882351c5 (patch)
tree2d499d53b60b2486f1e6666f8b9fe2063f984d22 /indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
parent817c97c2f836948f210599a6f67e36a411b22c21 (diff)
parentdbc91a7fac9513bdd879c5c2dc82208e08eaad2d (diff)
Pull and merge from https://bitbucket.org/lindenlab/viewer-development.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl40
1 files changed, 14 insertions, 26 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index 839606cdcb..1179b212ae 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -22,11 +22,16 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
-
#extension GL_ARB_texture_rectangle : enable
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
+
uniform sampler2DRectShadow shadowMap0;
uniform sampler2DRectShadow shadowMap1;
uniform sampler2DRectShadow shadowMap2;
@@ -41,29 +46,16 @@ uniform vec2 shadow_res;
vec3 atmosLighting(vec3 light);
vec3 scaleSoftClip(vec3 light);
-varying vec3 vary_ambient;
-varying vec3 vary_directional;
-varying vec3 vary_fragcoord;
-varying vec3 vary_position;
-varying vec3 vary_pointlight_col;
+VARYING vec3 vary_ambient;
+VARYING vec3 vary_directional;
+VARYING vec3 vary_fragcoord;
+VARYING vec3 vary_position;
+VARYING vec3 vary_pointlight_col;
uniform float shadow_bias;
uniform mat4 inv_proj;
-vec4 getPosition(vec2 pos_screen)
-{
- float depth = texture2DRect(depthMap, pos_screen.xy).a;
- vec2 sc = pos_screen.xy*2.0;
- sc /= screen_res;
- sc -= vec2(1.0,1.0);
- vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
- vec4 pos = inv_proj * ndc;
- pos.xyz /= pos.w;
- pos.w = 1.0;
- return pos;
-}
-
float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl)
{
stc.xyz /= stc.w;
@@ -122,9 +114,9 @@ void main()
}
}
- vec4 diff = diffuseLookup(gl_TexCoord[0].xy);
+ vec4 diff = diffuseLookup(vary_texcoord0.xy);
- vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, gl_Color.a);
+ vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, vertex_color.a);
vec4 color = diff * col;
color.rgb = atmosLighting(color.rgb);
@@ -133,10 +125,6 @@ void main()
color.rgb += diff.rgb * vary_pointlight_col.rgb;
- //gl_FragColor = gl_Color;
gl_FragColor = color;
- //gl_FragColor.r = 0.0;
- //gl_FragColor = vec4(1,shadow,1,1);
-
}