quakeforge/libs/video/renderer/glsl/quakemdl.vert
Bill Currie add5440ad1 Upload the normals with the vertex data.
Not all hardware can access a texture sampler from the vertex shader, and I
don't want multiple paths this early in the game. Now, vertex normals are
uploaded as shorts. Should be 14 bytes per vertex (was 10, could have been
8 if I had put the normal index with the vertex rather than st).
2012-01-04 09:42:00 +09:00

21 lines
356 B
GLSL

uniform mat4 mvp_mat;
uniform mat3 norm_mat;
uniform vec2 skin_size;
attribute vec4 vcolor;
attribute vec2 vst;
attribute vec3 vnormal;
attribute vec3 vertex;
varying vec3 normal;
varying vec2 st;
varying vec4 color;
void
main (void)
{
gl_Position = mvp_mat * vec4 (vertex, 1.0);
st = vst / skin_size;
normal = norm_mat * vnormal;
color = vcolor;
}