This project is read-only.

Animated model shadow

Mar 22, 2013 at 10:01 AM
Edited Mar 22, 2013 at 10:01 AM

I'm trying to add animated model to my soultion. It works, the model is animated and i can add to markers, but i can't solve the problem of the shadow. When i don't add shadow settings to the animated model's geometrynode it's working, but when i add it throws exception.

Has anybody solved the animated model's shadow problem?
May 4, 2013 at 9:34 PM
Hi, i have a similar problem, but have u use this lines:

u must have this line scene.ShadowMap = new MultiLightShadowMap(); before CreateObject(); also make sure u have MultiLightShadowMap.fx and SimpleShadowShader.fx in your content directory.

in CreateGround()...
        groundNode.Model.ShadowAttribute = ShadowAttribute.ReceiveOnly;
        groundNode.Model.Shader = new SimpleShadowShader(scene.ShadowMap);
in CreateObject()...
        aNode.Model.ShadowAttribute = ShadowAttribute.ReceiveCast;
        aNode.Model.Shader = new SimpleShadowShader(scene.ShadowMap);

Btw, can you please explain me how did u get your animated model into the scene? did u use MAYA or 3dsmax? what exporter did u use? your model is .FBX or .X ? please help me with this. Is your model using bones?

Hope this can help u and hope u can help me :)

May 22, 2013 at 2:20 PM
Edited May 22, 2013 at 2:21 PM
Dear Buskerone!

Sorry for the late reply, I had a lot of works in these weeks.

I used to add these lines that you write, but it doesn't work yet. I think the GoblinXNA can't render shadows with animated models, so we have to wite an own fx file to manage animated model shadows, but i don't know how to do that. I asked a lot of times in this forum how to add animated model shadow, but no one replied. :((

I didn't made animated models in 3DS Max, so I don't know how to do that. When I add animated model to my project I made some separated elements of the model and I animated these elements by code, like wind turbine etc. The wind turbine was 2 elements, and I rotate the turbine by code.
If you want to animate models in the modelling programs (3DS Max or Maya), you have to add bones to your model.
Read this article how to do that in Maya:

I searched but I didn't find article about how to make animated models in 3DS Max to GoblinXNA, if you find some, please share with me. :)

Bye and sorry again. ;)