2012-01-01 14:58:12 +00:00
|
|
|
uniform sampler2D normals;
|
|
|
|
uniform mat4 mvp_mat;
|
2012-01-02 02:18:34 +00:00
|
|
|
uniform mat3 norm_mat;
|
2012-01-02 04:41:12 +00:00
|
|
|
uniform vec2 skin_size;
|
2012-01-01 14:58:12 +00:00
|
|
|
|
|
|
|
attribute vec4 vcolor;
|
|
|
|
attribute vec3 stn;
|
|
|
|
attribute vec3 vertex;
|
|
|
|
|
|
|
|
varying vec3 normal;
|
|
|
|
varying vec2 st;
|
|
|
|
varying vec4 color;
|
|
|
|
|
|
|
|
void
|
|
|
|
main (void)
|
|
|
|
{
|
|
|
|
float nind;
|
|
|
|
vec3 norma, normb;
|
|
|
|
gl_Position = mvp_mat * vec4 (vertex, 1.0);
|
2012-01-02 04:41:12 +00:00
|
|
|
st = stn.st / skin_size;
|
|
|
|
nind = stn.p / 162.0;
|
2012-01-02 04:15:51 +00:00
|
|
|
norma = texture2D (normals, vec2 (0.0, nind)).xyz;
|
|
|
|
normb = texture2D (normals, vec2 (1.0, nind)).xyz;
|
|
|
|
normal = norm_mat * (2.0 * norma + normb / 128.0 - vec3 (1.0, 1.0, 1.0));
|
2012-01-01 14:58:12 +00:00
|
|
|
color = vcolor;
|
|
|
|
}
|