2013-12-18 20:28:06 +01:00
|
|
|
#include "GBufferHeader.hlsli"
|
|
|
|
|
|
|
|
VertexOut main( VertexIn input )
|
|
|
|
{
|
|
|
|
VertexOut output;
|
2014-02-04 17:59:04 +01:00
|
|
|
|
2014-02-05 16:00:28 +01:00
|
|
|
float3 offsetX = input.pos - BindPoseData[input.boneIndex.x][3].xyz;
|
|
|
|
float3 offsetY = input.pos - BindPoseData[input.boneIndex.y][3].xyz;
|
|
|
|
float3 offsetZ = input.pos - BindPoseData[input.boneIndex.z][3].xyz;
|
|
|
|
float3 offsetW = input.pos - BindPoseData[input.boneIndex.w][3].xyz;
|
|
|
|
|
|
|
|
Matrix boneTrans = AnimatedData[input.boneIndex.x]*input.boneWeight.x +
|
|
|
|
AnimatedData[input.boneIndex.y]*input.boneWeight.y +
|
|
|
|
AnimatedData[input.boneIndex.z]*input.boneWeight.z +
|
2014-02-07 08:34:01 +01:00
|
|
|
AnimatedData[input.boneIndex.w]*input.boneWeight.w;
|
2014-02-05 16:00:28 +01:00
|
|
|
|
2014-02-07 08:34:01 +01:00
|
|
|
input.pos = mul(boneTrans,float4(input.pos,1)).xyz * Animated + input.pos * int(1-Animated);
|
2014-02-05 16:00:28 +01:00
|
|
|
|
2014-02-07 08:34:01 +01:00
|
|
|
input.normal = mul(boneTrans,float4(input.normal,1)).xyz * Animated + input.normal * int(1-Animated);
|
2014-01-31 16:29:50 +01:00
|
|
|
|
2014-01-08 07:01:59 +01:00
|
|
|
output.pos = mul(WVP, float4(input.pos,1));
|
2014-01-16 09:30:01 +01:00
|
|
|
output.normal = mul(WV, float4(input.normal,0)).xyz;
|
2013-12-18 20:28:06 +01:00
|
|
|
output.UV = input.UV;
|
|
|
|
return output;
|
|
|
|
}
|