* Unshaded material now supports HW skinning

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10553 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..RD 12 years ago
parent c21b60fbe7
commit d9e3af1795
  1. 6
      engine/src/core-data/Common/MatDefs/Misc/Unshaded.j3md
  2. 8
      engine/src/core-data/Common/MatDefs/Misc/Unshaded.vert

@ -11,6 +11,10 @@ MaterialDef Unshaded {
Texture2D GlowMap
// The glow color of the object
Color GlowColor
// For hardware skinning
Int NumberOfBones
Matrix4Array BoneMatrices
}
Technique {
@ -27,6 +31,7 @@ MaterialDef Unshaded {
HAS_LIGHTMAP : LightMap
HAS_VERTEXCOLOR : VertexColor
HAS_COLOR : Color
NUM_BONES : NumberOfBones
}
}
@ -62,6 +67,7 @@ MaterialDef Unshaded {
NEED_TEXCOORD1
HAS_GLOWMAP : GlowMap
HAS_GLOWCOLOR : GlowColor
NUM_BONES : NumberOfBones
}
}
}

@ -1,3 +1,5 @@
#import "Common/ShaderLib/Skinning.glsllib"
uniform mat4 g_WorldViewProjectionMatrix;
attribute vec3 inPosition;
@ -27,5 +29,9 @@ void main(){
vertColor = inColor;
#endif
gl_Position = g_WorldViewProjectionMatrix * vec4(inPosition, 1.0);
vec4 modelSpacePos = vec4(inPosition, 1.0);
#ifdef NUM_BONES
Skinning_Compute(modelSpacePos);
#endif
gl_Position = g_WorldViewProjectionMatrix * modelSpacePos;
}
Loading…
Cancel
Save