diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 13676ceead..4c26621a88 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -38,11 +38,10 @@ ATTRIBUTE vec3 position; void passTextureIndex(); #endif ATTRIBUTE vec3 normal; +#if INDEX_MODE != NON_INDEXED_NO_COLOR ATTRIBUTE vec4 diffuse_color; +#endif ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec3 binormal; -ATTRIBUTE vec2 texcoord1; -ATTRIBUTE vec2 texcoord2; #if HAS_SKIN mat4 getObjectSkinnedTransform(); @@ -71,15 +70,10 @@ VARYING vec4 vertex_color; #endif VARYING vec2 vary_texcoord0; -VARYING vec2 vary_texcoord1; -VARYING vec2 vary_texcoord2; VARYING vec3 vary_norm; -VARYING mat3 vary_rotation; uniform float near_clip; -uniform float shadow_offset; -uniform float shadow_bias; uniform vec4 light_position[8]; uniform vec3 light_direction[8]; @@ -159,8 +153,7 @@ void main() pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); #endif - vary_texcoord1 = (texture_matrix0 * vec4(texcoord1,0,1)).xy; - vary_texcoord2 = (texture_matrix0 * vec4(texcoord2,0,1)).xy; + #if INDEX_MODE == INDEXED passTextureIndex(); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; @@ -169,33 +162,27 @@ void main() #endif vary_norm = norm; - float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); - vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; - - vec3 n = norm; - vec3 b = normalize(normal_matrix * binormal); - vec3 t = cross(b, n); - - vary_rotation[0] = vec3(t.x, b.x, n.x); - vary_rotation[1] = vec3(t.y, b.y, n.y); - vary_rotation[2] = vec3(t.z, b.z, n.z); + vary_position = pos.xyz; calcAtmospherics(pos.xyz); - vec3 dff = pow(diffuse_color.rgb, vec3(2.2)); + +#if INDEX_MODE == NON_INDEXED_NO_COLOR + vec4 diffuse_color = vec4(1,1,1,1); +#endif //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); - vary_pointlight_col = dff; + vary_pointlight_col = diffuse_color.rgb; col.rgb = vec3(0,0,0); // Add windlight lights col.rgb = atmosAmbient(vec3(0.)); + vary_ambient = col.rgb*diffuse_color.rgb; vary_directional.rgb = atmosAffectDirectionalLight(1); - vary_ambient = col.rgb*dff; - col.rgb = col.rgb*dff; + col.rgb = col.rgb*diffuse_color.rgb; #if INDEX_MODE != NON_INDEXED_NO_COLOR vertex_color = col; #endif |