diff options
author | Dave Parks <davep@lindenlab.com> | 2011-09-29 19:32:56 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-09-29 19:32:56 -0500 |
commit | 7238714634e72dacc4b09c1c4ee98b16fb0c91fe (patch) | |
tree | 89500aeb877bcf5b3d00f0c96ec0f0321834de1e /indra/newview/app_settings/shaders/class1/objects/simpleV.glsl | |
parent | 973fefc8d9014f6389b4c3f9633ce398fdf5399e (diff) |
SH-2507 Potential fix for basic shaders causing objects to disappear with some drivers (prune shader tree of unused shaders while we're at it)
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/objects/simpleV.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/objects/simpleV.glsl | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl index df9111f941..37a20383e2 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl @@ -29,28 +29,36 @@ uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; +void passTextureIndex(); +ATTRIBUTE vec2 texcoord0; ATTRIBUTE vec3 normal; ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; + +vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); +void calcAtmospherics(vec3 inPositionEye); + VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -void calcAtmospherics(vec3 inPositionEye); - void main() { //transform vertex - vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0)); - gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - + vec4 vert = vec4(position.xyz,1.0); + passTextureIndex(); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; + + + vec3 norm = normalize(normal_matrix * normal); calcAtmospherics(pos.xyz); vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); vertex_color = color; + + } |