#define LIGHTING_DATA 1 #include "$ENGINE$\VertexCommon.bslinc" mixin VertexInput { mixin VertexCommon; #ifndef NO_ANIMATION variations { SKINNED = { false, true }; MORPH = { false, true }; }; #endif code { float4 getVertexWorldPosition(VertexInput input, VertexIntermediate intermediate) { #if MORPH float4 position = float4(input.position + input.deltaPosition, 1.0f); #else float4 position = float4(input.position, 1.0f); #endif #if SKINNED position = float4(mul(intermediate.blendMatrix, position), 1.0f); #endif return mul(gMatWorld, position); } float4 getVertexWorldPosition(VertexInput_PO input) { #if MORPH float4 position = float4(input.position + input.deltaPosition, 1.0f); #else float4 position = float4(input.position, 1.0f); #endif #if SKINNED float3x4 blendMatrix = getBlendMatrix(input.blendWeights, input.blendIndices); position = float4(mul(blendMatrix, position), 1.0f); #endif return mul(gMatWorld, position); } // Note: This can be made optional if velocity buffer isn't required float4 getPrevVertexWorldPosition(VertexInput input, VertexIntermediate intermediate) { #if MORPH float4 position = float4(input.position + input.deltaPosition, 1.0f); #else float4 position = float4(input.position, 1.0f); #endif #if SKINNED #if PREV_CLIP_POS position = float4(mul(intermediate.prevBlendMatrix, position), 1.0f); #endif #endif return mul(gMatPrevWorld, position); } }; };