summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
blob: 7e9818e54a7f3e141cc67e530991a7a6948eba41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/** 
 * @file avatarSkinV.glsl
 *
 * $LicenseInfo:firstyear=2007&license=viewerlgpl$
 * $/LicenseInfo$
 */

attribute vec4 weight;  //1

uniform vec4 matrixPalette[45];

mat4 getSkinnedTransform()
{
	mat4 ret;
	int i = int(floor(weight.x));
	float x = fract(weight.x);
		
	ret[0] = mix(matrixPalette[i+0], matrixPalette[i+1], x);
	ret[1] = mix(matrixPalette[i+15],matrixPalette[i+16], x);
	ret[2] = mix(matrixPalette[i+30],matrixPalette[i+31], x);
	ret[3] = vec4(0,0,0,1);

	return ret;
}