Created
May 26, 2020 17:34
-
-
Save igorsegallafa/af06d15e20f93ddd60b0b2a1680e73cf to your computer and use it in GitHub Desktop.
Mesh Skinning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS_INPUT VS( VS_INPUT input ) | |
{ | |
PS_INPUT output; | |
float4 position = mul(input.pos, GetSkinMatrix(input.blendIndice)); | |
float4 worldPosition = mul( position, World ); | |
float4 normalPosition = mul(input.normal, GetSkinMatrix(input.blendIndice)); | |
float4 normalWorldPosition = mul(normalPosition, World); | |
float4 viewPosition = mul( worldPosition, View ); | |
output.pos = mul( viewPosition, Projection ); | |
output.normal = normalWorldPosition; | |
output.color = input.color; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment