diff --git a/engine/src/core-data/Common/MatDefs/Misc/Unshaded.j3md b/engine/src/core-data/Common/MatDefs/Misc/Unshaded.j3md index 0637087e9..744bb6e4d 100644 --- a/engine/src/core-data/Common/MatDefs/Misc/Unshaded.j3md +++ b/engine/src/core-data/Common/MatDefs/Misc/Unshaded.j3md @@ -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 } } } \ No newline at end of file diff --git a/engine/src/core-data/Common/MatDefs/Misc/Unshaded.vert b/engine/src/core-data/Common/MatDefs/Misc/Unshaded.vert index bfc347d63..1d47bb395 100644 --- a/engine/src/core-data/Common/MatDefs/Misc/Unshaded.vert +++ b/engine/src/core-data/Common/MatDefs/Misc/Unshaded.vert @@ -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; } \ No newline at end of file