Skip to content
Snippets Groups Projects
Commit a6fa1557 authored by David Parks's avatar David Parks
Browse files

Make avatars use same shadow offset magic as prims.

parent 3a2c3a45
No related branches found
No related tags found
No related merge requests found
...@@ -9,10 +9,13 @@ ...@@ -9,10 +9,13 @@
uniform sampler2D diffuseMap; uniform sampler2D diffuseMap;
varying vec4 post_pos;
void main() void main()
{ {
//gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a); //gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a);
gl_FragColor = vec4(1,1,1,1); gl_FragColor = vec4(1,1,1,1);
gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
} }
...@@ -11,6 +11,8 @@ mat4 getSkinnedTransform(); ...@@ -11,6 +11,8 @@ mat4 getSkinnedTransform();
attribute vec4 weight; attribute vec4 weight;
varying vec4 post_pos;
void main() void main()
{ {
gl_TexCoord[0] = gl_MultiTexCoord0; gl_TexCoord[0] = gl_MultiTexCoord0;
...@@ -30,8 +32,9 @@ void main() ...@@ -30,8 +32,9 @@ void main()
norm = normalize(norm); norm = normalize(norm);
pos = gl_ProjectionMatrix * pos; pos = gl_ProjectionMatrix * pos;
pos.z = max(pos.z, -pos.w+0.01); post_pos = pos;
gl_Position = pos;
gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
gl_FrontColor = gl_Color; gl_FrontColor = gl_Color;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment