Shadows bug - additional shadow lines (rev 4288)

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Bonaducci
Posts: 11
Joined: Fri Aug 03, 2012 1:22 am
Location: Wrocław, Poland

Shadows bug - additional shadow lines (rev 4288)

Post by Bonaducci »

I've created topic in Beginners help, because I wasn't sure if this is bug or my fault, but now I'm pretty sure.
http://irrlicht.sourceforge.net/forum/v ... 50#p271250
Probably this is the proper subforum for this thread, so please delete older one.

I'm trying to use IAnimatedMesh to get shadows. As you now, this is not working so fast, but that is not my point (I hope, that this will be improved eventually).
I have some bug and don't know if it's my fault, or bug in engine.

This is SS
Image
Image
As you can see, there ale shadow lines from spheres.

How I add spheres:

Code: Select all

SAnimatedMesh * AMesh = new SAnimatedMesh();
    AMesh->addMesh(irrScene->getGeometryCreator()->createSphereMesh(TRadius, 32, 32));
 
    IAnimatedMeshSceneNode* Node = irrScene -> addAnimatedMeshSceneNode(AMesh);
 
    Node->setMaterialFlag(video::EMF_BACK_FACE_CULLING, true);
    Node->setMaterialFlag(EMF_LIGHTING, true);
    Node->setMaterialFlag(EMF_NORMALIZE_NORMALS, true);
    Node->setMaterialTexture(0, irrDriver->getTexture("rust0.jpg"));
    Node->addShadowVolumeSceneNode();
and light:

Code: Select all

    ILightSceneNode *light = irrScene->addLightSceneNode(0, vector3df(0,100,0), SColorf(1.0f, 0.6f, 0.7f, 1.0f), 500.0f);
    if (light)
    {
        light->getLightData().Attenuation.set(0.f, 1.f/500.f, 0.f);
        ISceneNodeAnimator* anim = irrScene->createFlyCircleAnimator(vector3df(0,150,0),250.0f);
        if (anim)
        {
            light->addAnimator(anim);
            anim->drop();
        }
    }
I'm using nightly irrlicht build from SVN, but don't remmember which revision. I'll update it to the newest and try again. I'll also check it with boxes.

//Edit 1:
Boxes work fine.
I've already downloaded 1.7.3 and nightly rev 4288. I'll check them if there was and still is this problem.

//Edit 2:
For Irrlicht 1.7.3 it's working in proper way, but... It is so laggy. For 50k triangles it's barely working...
For Irrlicht rev 4288 it has this bug. But it's quite fast. About 70fps (I have ~95fps lock).

//Edit 3:
Last screen with all shadows turned on.
Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Shadows bug - additional shadow lines (rev 4288)

Post by hybrid »

Yes, the shadows in 1.7.x and previous versions also have other projection problems. We are working on the shadows currently, so with the 1.8 release it should work correctly then.
Bonaducci
Posts: 11
Joined: Fri Aug 03, 2012 1:22 am
Location: Wrocław, Poland

Re: Shadows bug - additional shadow lines (rev 4288)

Post by Bonaducci »

I've checked two options for calculating normals.

Normals for triangles:
Image
Very sharp, but a lot of things are still missing to get realistic view. Most of all is shadow leveling. Shadows are the same covered by some objects or not, backs are black even when there is bright front of another object. This is quite hard to do, but it would improve visual appearance of engine a lot.

Averange normals (standard method):
Image
This is half measure, because it looks way better, but is less realistic. The same problems as in triangle normals, but now shadowed parts are kind of gradient of neighbor triangles. It would be a big problem with big triangles, because it would loose a lot of precision.

I hope, that it will be improved too :)
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Shadows bug - additional shadow lines (rev 4288)

Post by hendu »

Very sharp, but a lot of things are still missing to get realistic view. Most of all is shadow leveling. Shadows are the same covered by some objects or not, backs are black even when there is bright front of another object. This is quite hard to do, but it would improve visual appearance of engine a lot.
That's called global illumination / n-bounce lighting, is very expensive, and can't be done with shadow volumes (the current technique used).

If you want soft shadows / GI / any other nice effect, feel free to code it ;)
Post Reply