skeletal animation + light = fubar, help?

Started by
22 comments, last by drdlord 19 years, 8 months ago
I'm trying to get Direct3D skinning, (skeletal animation, the ablity to move arms etc in a mesh) working. I have it working on tiny.x got her to walk in a nice circle... Then I tried to add lighting... Simply turning on lighting seems to strech her head and arms strangly as if the bone transformation matricies were wrong. I can create and remove this error simply by changing true vs false on m_pd3dDevice->SetRenderState(D3DRS_LIGHTING, TRUE); The lighting itself seems to work, parts of the mesh get darker, (although it's not very smooth, are the normals in tiny.x not right?) Any ideas on what might be causing this? tiny looks perfect when lighting is off. Thank you in advance for helping me figure out this strange error
Advertisement
Can you post a screenshot? I'm curious about what this looks like. It may help someone figure it out.
Sounds like a problem with normals. Are you using the shader or the World(N) transforms to do the vertex blending?
Ok, I've made a screenshot of it with and without light.

http://servers.lanified.wappo.net/skinning_light.jpg
http://servers.lanified.wappo.net/skinning.jpg

I'm using world transforms, I wondered if it was normals so I tried both adding D3DXComputeNormals(this->MeshData.pMesh, NULL);
and m_pd3dDevice->SetRenderState( D3DRS_NORMALIZENORMALS, TRUE ); nether seemed to help.

Any ideas? I've posted my visual studio .net 2003 project including sources here if someone wants to look at it:

http://servers.lanified.wappo.net/skinning.zip

[Edited by - Coder on August 5, 2004 4:51:03 PM]
Wow, this it much stranger than I envisioned. I don't think that normals can cause that strange of an effect. Looks more like some of the verts got mis-transformed. You say that this only happens when you turn lighting on? Have you tried using the shader (provided with the blending sample) instead? I am not sure I can help you with this, but perhaps someone else has some ideas. Have you tried it on different graphics cards?
Unfortunatly I only have 1 computer with a graphics card worth mentioning, (radeon 9700 pro) so I can't test it on other cards.

I did include the executable in the zip file I posted though so if you have the time please try it and tell me the results, (exe is under debug, move it to the same dir as tiny.x and run; should work, light is enabled in that compile)

as for shaders I havn't learned them yet... but I'll give it a try. Eventualy I want to be able to move bones myself rather than relying on animations in the .x file do shaders allow this?

This is really bugging me I've gone over my code at least a dozen times and I can't see the bug it's pretty close to the indexed shaderless mode of the sample in d3d9.0b under meshes\skinnedmesh and that one works...

Thanks for the ideas hope someone can tell me where I messed up
I downloaded the project and everything looks fine on my machine so it doesn't look like anything is wrong with your code.
I would try updating your video drivers.
-dizzyGame Institute InternPlease rate me. :)
Thank you yzzid, can I ask what video card you ran it on? is this a ati vs nvida thing or somthing...
just updated video drivers, no change :(
I think your subject needs to be formed with left hand assignment. .....

skeletal animation + light = fubar
fubar = skeletal animation + light
--What are you nutz?I have nothing to say to your unevolved little brain. The more I say gives you more weapons to ask stupid questions.

This topic is closed to new replies.

Advertisement