I first tried Ogre/HardwareSkinningTwoWeights from the examples, but as the character has more than 2 weights assigned to the vertices, the mesh was distorted. HardwareSkinningFourWeights from the examples was "not supported", I guess that's because the HardwareSkinningFourWeights example was aimed at the CG platform. I changed it to HSLS as follows:
Code: Select all
vertex_program Ogre/HardwareSkinningFourWeightsHLSL hlsl
{
source Example_Basic.hlsl
entry_point hardwareSkinningFourWeights_vp
target vs_1_1
includes_skeletal_animation true
column_major_matrices false
}
vertex_program Ogre/HardwareSkinningFourWeights unified
{
delegate Ogre/HardwareSkinningFourWeightsHLSL
default_params
{
param_named_auto worldMatrix3x4Array world_matrix_array_3x4
param_named_auto viewProjectionMatrix viewproj_matrix
param_named_auto lightPos[0] light_position 0
param_named_auto lightPos[1] light_position 1
param_named_auto lightDiffuseColour[0] light_diffuse_colour 0
param_named_auto lightDiffuseColour[1] light_diffuse_colour 1
param_named_auto ambient ambient_light_colour
}
}
Whereas hardware skinning looks as follows:
Am I missing something in order to get my software-skinning lighting back? I am a beginner in vertex programs, so any help would really be appreciated.
Ben