Hardware Skinning and lighting (4 weights)

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
Maestro81
Gnoblar
Posts: 23
Joined: Wed Jul 02, 2008 7:30 pm
x 3

Hardware Skinning and lighting (4 weights)

Post by Maestro81 »

I recently tried to get hardware skinning working on my character.

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
   }
}
Now it seems to work, but it appears that my lighting is lost. So, with software skinning it looks as follows:

Image

Whereas hardware skinning looks as follows:

Image

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
Post Reply