about Lighting and shadow casting

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.
Jacky_J
Posts: 55
Joined: Fri Apr 27, 2007 5:01 am

Post by Jacky_J »

Steel Style wrote:I think it's work now, please try and submit the result here thanks.

http://steelstyle.free.fr/IrrImg/ShadowVolumes01.patch
Hmm, i tried your patch but i'm getting funky results:

Image

Image

In that first pic, the shadows on the right are below the world somewhere.
Steel Style
Posts: 168
Joined: Sun Feb 04, 2007 3:30 pm
Location: France

Post by Steel Style »

Thank you verry much can you send me a little source + media zip file with your file.

Also this is the same for D3D and OpenGL ?
Zpass or Zfail Method ? or maybe both ?
Jacky_J
Posts: 55
Joined: Fri Apr 27, 2007 5:01 am

Post by Jacky_J »

You can check out the sourcecode here:
http://code.google.com/p/irrlamb/source/checkout

That was opengl with just the default call to addShadowVolumeSceneNode()

zpass works better, until your camera is in the shadow volume. Then everything is reversed (shadows become non shadows, vice versa)
Steel Style
Posts: 168
Joined: Sun Feb 04, 2007 3:30 pm
Location: France

Post by Steel Style »

For the Z pass the behaviour inside the shadow is a normal limitation of Zpass.

For the Zfail I don't know how I missed this, maybe I did too much Zpass instead of Zfail test. But I looked at the code again I don't really have clue but that can be a error due to far plane clipping.

:/
m3ltd0wn
Posts: 107
Joined: Wed Dec 12, 2007 8:32 am
Location: Romania

reply

Post by m3ltd0wn »

using addShadowVolumeSceneNode();
on animated mesh scene nodes and I have 2 cameras in my scene, irrlicht version 1.6:

Image
Image

is it fixed in the latest svn version?
Jacky_J
Posts: 55
Joined: Fri Apr 27, 2007 5:01 am

Post by Jacky_J »

Nope, hasn't been fixed in the latest svn. I imagine once we get all the bugs sorted out, they'll add it in. I'm just surprised all this time shadow volumes were never implemented correctly in irrlicht.
m3ltd0wn
Posts: 107
Joined: Wed Dec 12, 2007 8:32 am
Location: Romania

reply

Post by m3ltd0wn »

hope they will be repaired in the future, right now i'm not using shadows in my project because it is in the early stages of developement, but in the future i will need dynamic shadows :D

i'll keep an eye on this thread :)
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

you mean camera casts shadow? that sounds funny to me.
m3ltd0wn
Posts: 107
Joined: Wed Dec 12, 2007 8:32 am
Location: Romania

reply

Post by m3ltd0wn »

i have 2 cameras, one is a fps style camera the other one is a custom camera movable by WASD keys, the default active camera is the custom camera, and by pressing F2 key, the active camera is switched to the fps camera :) then if i press WASD the custom camera moves around and the effect is seen in the second picture :D
in the first picture the custom camera is active.

i don't know if those circled shadows are from the cameras or not :) my node hierarchy is: whole_car_node(parent)->vw_node
whole_car_node(parent)->unslidable_node
wheels_node(parent)->front wheels and rear wheels
and vw_node is parent for the 3dmodels (IAnimatedSceneNodes) for different parts of the chassis of the car :)

vw_node,whole_car_node,unslidable_node and wheels_node are Empty SceneNodes ...

the scale of the model is vector3df(20,20,20), and the center of the model is right there where the strange little shadow is :)
the position of the whole_car_node is vector3df(0,0,0) and the position of the vw_node is vector3df(0,3,0)

don't know if this helps but the effects are strange indeed :D
Jacky_J
Posts: 55
Joined: Fri Apr 27, 2007 5:01 am

Post by Jacky_J »

Any updates to this? Maybe we can get some of the Ogre people to help us out. :D
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, we have a properly working shadow code up to one point. The projection is not correctly working and thus the shadow is moving wrongly. But it might be fixed in 1.8
Post Reply