diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2012-06-06 23:21:07 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2012-06-06 23:21:07 -0400 |
commit | 89ea7ccfc7fd4c33eab4ad9123141fa40231a00d (patch) | |
tree | af2083dc9563abc8fa7a97100fc7766044d406e8 /indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | |
parent | 3d1cb7ef111cbd5724262077702e0dc2a3d6998d (diff) | |
parent | a519e34f02b4b2663fe082ba9ad12f1b423669cb (diff) |
Automated merge with file:///Users/nat/linden/viewer-maint-1144
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 19de0c0b39..dd87ddb330 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -23,41 +23,33 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + uniform sampler2DRect depthMap; vec4 diffuseLookup(vec2 texcoord); -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; uniform vec2 screen_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 mat4 inv_proj; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; -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 /= pos.w; - pos.w = 1.0; - return pos; -} +uniform mat4 inv_proj; void main() { @@ -66,9 +58,9 @@ void main() vec4 pos = vec4(vary_position, 1.0); - vec4 diff= diffuseLookup(gl_TexCoord[0].xy); + vec4 diff= diffuseLookup(vary_texcoord0.xy); - vec4 col = vec4(vary_ambient + vary_directional.rgb, gl_Color.a); + vec4 col = vec4(vary_ambient + vary_directional.rgb, vertex_color.a); vec4 color = diff * col; color.rgb = atmosLighting(color.rgb); @@ -77,9 +69,6 @@ void main() color.rgb += diff.rgb * vary_pointlight_col.rgb; - gl_FragColor = color; - //gl_FragColor = vec4(1,0,1,1); - //gl_FragColor = vec4(1,0,1,1)*shadow; - + frag_color = color; } |