Dynamic shadows artifacts

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Amt0571
Posts: 128
Joined: Mon Mar 06, 2006 6:29 pm

Dynamic shadows artifacts

Post 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!
magisterrivus
Posts: 33
Joined: Sat Aug 05, 2006 9:46 pm

Post 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.
under construction
Amt0571
Posts: 128
Joined: Mon Mar 06, 2006 6:29 pm

Post 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
Amt0571
Posts: 128
Joined: Mon Mar 06, 2006 6:29 pm

Post 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!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Maybe the normals are incorrect such that some vertices are drawn inside out?
Amt0571
Posts: 128
Joined: Mon Mar 06, 2006 6:29 pm

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