Jump to content
  • Advertisement
Sign in to follow this  
drdlord

skeletal animation + light = fubar, help?

This topic is 5092 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Can you post a screenshot? I'm curious about what this looks like. It may help someone figure it out.

Share this post


Link to post
Share on other sites
Sounds like a problem with normals. Are you using the shader or the World(N) transforms to do the vertex blending?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Thank you yzzid, can I ask what video card you ran it on? is this a ati vs nvida thing or somthing...

Share this post


Link to post
Share on other sites
I think your subject needs to be formed with left hand assignment. .....

skeletal animation + light = fubar
fubar = skeletal animation + light

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!