Home Technical Talk

hlsl and skeletal animation

polycounter
Offline / Send Message
rollin polycounter
When I want to get a correct result from a tangentspace normalmap on a skinned mesh. Do I have to put in my hlsl shader code somthing like that?
finalPosition   += mul(input.pos, mWorldMatrixArray[indexArray[iBone]]) * blendWeightsArray[iBone];
         finalNormal      += mul(input.normal, (float3x3)mWorldMatrixArray[indexArray[iBone]]) * blendWeightsArray[iBone];
         finalTangent   += mul(input.tangent, (float3x3)mWorldMatrixArray[indexArray[iBone]]) * blendWeightsArray[iBone];

Like calculating my correct normals and tangents from my base-pose + bone transformation? Or is this just for special cases?

I'm bit confused bc in max you don't have to worry about it as far as I know. At least I haven't see something like that in my node-based shader work from shaderFX.

I'm using the hlsl shader with ogre btw and my tangents and normals are baked into the vertex data of the mesh.
Sign In or Register to comment.