2 #define OSG_HAS_DIFFUSE_MAP 1
4 #ifdef OSG_HAS_NORMAL_MAP
5 void calcSkin(inout vec4 pos, inout vec3 norm,
7 in vec4 matIdx, in vec4 weight );
9 void calcSkin(inout vec4 pos, inout vec3 norm,
10 in vec4 matIdx, in vec4 weight );
14 varying vec3 vertNorm;
16 #ifdef OSG_HAS_NORMAL_MAP
17 varying vec3 vertTangent;
25 #ifdef OSG_HAS_DIFFUSE_MAP
26 gl_TexCoord[0] = gl_MultiTexCoord0;
29 #ifdef OSG_HAS_NORMAL_MAP
30 vertTangent = gl_MultiTexCoord1.xyz;
33 vec4 jointIdx = gl_MultiTexCoord2;
34 vec4 jointWeight = gl_MultiTexCoord3;
36 #ifdef OSG_HAS_NORMAL_MAP
37 calcSkin(vertPos, vertNorm, vertTangent, jointIdx, jointWeight);
39 calcSkin(vertPos, vertNorm, jointIdx, jointWeight);
42 vertPos = gl_ModelViewMatrix * vertPos;
43 vertNorm = gl_NormalMatrix * vertNorm;
45 #ifdef OSG_HAS_NORMAL_MAP
46 vertTangent = gl_NormalMatrix * vertTangent;
49 gl_Position = gl_ProjectionMatrix * vertPos;