diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl | 5 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 6dfc1b952c..bd4875f3ff 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -9,13 +9,14 @@ #extension GL_ARB_texture_rectangle : enable -uniform sampler2D diffuseMap; uniform sampler2DRectShadow shadowMap0; uniform sampler2DRectShadow shadowMap1; uniform sampler2DRectShadow shadowMap2; uniform sampler2DRectShadow shadowMap3; uniform sampler2DRect depthMap; +vec4 diffuseLookup(vec2 texcoord); + uniform mat4 shadow_matrix[6]; uniform vec4 shadow_clip; uniform vec2 screen_res; @@ -105,7 +106,7 @@ void main() } } - vec4 diff= texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 diff = diffuseLookup(gl_TexCoord[0].xy); vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, gl_Color.a); vec4 color = diff * col; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl index f6160815eb..c6c0b0f32a 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -22,6 +22,7 @@ varying vec3 vary_directional; varying vec3 vary_fragcoord; varying vec3 vary_position; varying vec3 vary_pointlight_col; +varying float vary_texture_index; uniform float near_clip; uniform float shadow_offset; @@ -60,11 +61,13 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa void main() { //transform vertex - gl_Position = ftransform(); + vec4 vert = vec4(gl_Vertex.xyz, 1.0); + vary_texture_index = gl_Vertex.w; + gl_Position = gl_ModelViewProjectionMatrix * vert; gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - vec4 pos = (gl_ModelViewMatrix * gl_Vertex); + vec4 pos = (gl_ModelViewMatrix * vert); vec3 norm = normalize(gl_NormalMatrix * gl_Normal); float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz)); @@ -99,7 +102,7 @@ void main() gl_FogFragCoord = pos.z; - pos = gl_ModelViewProjectionMatrix * gl_Vertex; + pos = gl_ModelViewProjectionMatrix * vert; vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); } |