Page 1 of 1

Dynamic shadows artifacts

Posted: Sun Aug 20, 2006 12:08 pm
by Amt0571
I've been trying to enable dynamic shadows on a model, and when I add the ShadowVolumeSceneNode, I get the following result:

Image

The code I'm using to load the level and enable the lightning is the following:

scene::IAnimatedMesh* mesh;
mesh = smgr->getMesh("./data/scene.ms3d");
scene::IAnimatedMeshSceneNode*q3node = 0;
q3node = smgr->addAnimatedMeshSceneNode(mesh);

q3node->setMaterialType(video::EMT_SOLID);
q3node->setMaterialFlag(video::EMF_LIGHTING, true);

scene::ILightSceneNode* light1 =
smgr->addLightSceneNode(0, core::vector3df(0,0,0),
video::SColorf(1.0f, 1.0f, 1.0f, 0.0f), 500.0f);

I'm using ms3d (MilkShape) for the mesh and I'm unable to see what I've done wrong. Any suggestion?

Thanks in advance!

Posted: Sun Aug 20, 2006 4:11 pm
by magisterrivus
Wohoooo,
finally i am not alone.

take a look at this thread:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=14952

i also posted it into the bugs forum but none seems to have this problem or none knows a fix.

Posted: Tue Aug 22, 2006 9:43 am
by Amt0571
I had already seen your post after using the search, but as I understand (my english is not very good), you only have this problem when you try to use dynamic shadows and parallax mapping at the same time.

I'm not using parallax mapping, and well, on your screenshot it seems there are some shadows rendered correctly.

In my scene, it's difficult to tell, but the lines that appear are the outlines of other parts of the mesh.

Any help?


Thanks

Posted: Tue Aug 22, 2006 10:38 am
by Amt0571
After messing with the zfailmethod and other parameters, I've managed to get shadows to work in some instances:

First of all, I moved the light to another position, set the zfailmethod to false, and the infinity to 50000.0f.

As you can see, my scene is a building with some terrain. Using the parametrers I said before, when I'm outside the building, the shadows appear correctly, but as soon as I get inside the building, everything gets messed up... I'm unable to tell what I'm doing wrong... any help?


Thanks in advance!

Posted: Tue Aug 22, 2006 1:28 pm
by hybrid
Maybe the normals are incorrect such that some vertices are drawn inside out?

Posted: Tue Aug 22, 2006 4:00 pm
by Amt0571
I've checked it many times. The normals are correct, tomorrow I'll post a screenshot of the problem that will better explain the problem.

Here are the screenshots, sorry for the delay, I could not post them earlier:

This is when I'm far from any wall:

Image


This happens when I get close to or inside the building:

Image


Thanks!