summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl24
1 files changed, 13 insertions, 11 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index 681186d6b2..025ff48109 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -22,10 +22,12 @@
* $/LicenseInfo$
*/
-
-
#extension GL_ARB_texture_rectangle : enable
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
//class 2 -- shadows and SSAO
uniform sampler2DRect depthMap;
@@ -46,8 +48,8 @@ uniform float ssao_max_radius;
uniform float ssao_factor;
uniform float ssao_factor_inv;
-varying vec2 vary_fragcoord;
-varying vec4 vary_light;
+VARYING vec2 vary_fragcoord;
+uniform vec3 sun_dir;
uniform mat4 inv_proj;
uniform vec2 screen_res;
@@ -148,15 +150,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl)
stc.xyz /= stc.w;
stc.z += spot_shadow_bias*scl;
- float cs = shadow2D(shadowMap, stc.xyz).x;
+ float cs = shadow2D(shadowMap, stc.xyz);
float shadow = cs;
vec2 off = 1.5/proj_shadow_res;
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs);
- shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs);
+ shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs);
return shadow/5.0;
@@ -184,10 +186,10 @@ void main()
}*/
float shadow = 1.0;
- float dp_directional_light = max(0.0, dot(norm, vary_light.xyz));
+ float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz));
vec3 shadow_pos = pos.xyz + displace*norm;
- vec3 offset = vary_light.xyz * (1.0-dp_directional_light);
+ vec3 offset = sun_dir.xyz * (1.0-dp_directional_light);
vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0);