dynamic shadows from level geometry?
dynamic shadows from level geometry?
Hi, I am planning to try out the Irrlicht engine. I had a question about the shadows. I've seen in screenshots that models can cast dynamic shadows but I have not seen the level geometry react to the lights in the same way casting their own dynamic shadow. Is this not possible or have I just not seen it?
Anyways, I was just curious.
Anyways, I was just curious.
It is possible in a limited way. The shadow technique used by Irrlicht works fine for smaller objects, but has its issues with more complex, big, meshes like level geom usually is.
One problem occurs, when you place the camera inside a shadow, the shadow will look wrong then. Another problem is with big, closed level meshes. Closed meshes with the light inside will probably look all wrong. Splitting the level mesh up can help. Too detailed meshes, with too many overlapping extruded edges will firstly cost lots of CPU performance to calculate the extruded geometry, will cost much fillrate when rendered and might break stencil buffer resolution, which makes it look all wrong.
You can try it for your level, but chance is, it will look bad in some circumstances and it might be slow.
One problem occurs, when you place the camera inside a shadow, the shadow will look wrong then. Another problem is with big, closed level meshes. Closed meshes with the light inside will probably look all wrong. Splitting the level mesh up can help. Too detailed meshes, with too many overlapping extruded edges will firstly cost lots of CPU performance to calculate the extruded geometry, will cost much fillrate when rendered and might break stencil buffer resolution, which makes it look all wrong.
You can try it for your level, but chance is, it will look bad in some circumstances and it might be slow.
-
- Posts: 97
- Joined: Sat Oct 14, 2006 10:51 am
- Location: Australia,melbourne
same problem
Hi,
Although I have no experience in computer graphics, I've been trying to find a solution to the exact same problem.
First idea : cast rays against all vertices in the area and test for intersection.
This might work if the map is only made of a few cubes (bomberman style).
My second guess was to grab the depth buffer once the frame is rendered. Then, knowing what the height of the character is, apply some morphological filtering to the depth buffer and then use it as a mask. Since it's so expensive to move the depth buffer from GPU to memory, i thought it might be possible to use shaders(which I can't try because of my stupid laptop's radeon 7500). New problem here, since it seems the zbuffer is stored in a compressed mode.
If you come accross any idea, please let me know.
Although I have no experience in computer graphics, I've been trying to find a solution to the exact same problem.
First idea : cast rays against all vertices in the area and test for intersection.
This might work if the map is only made of a few cubes (bomberman style).
My second guess was to grab the depth buffer once the frame is rendered. Then, knowing what the height of the character is, apply some morphological filtering to the depth buffer and then use it as a mask. Since it's so expensive to move the depth buffer from GPU to memory, i thought it might be possible to use shaders(which I can't try because of my stupid laptop's radeon 7500). New problem here, since it seems the zbuffer is stored in a compressed mode.
If you come accross any idea, please let me know.
-
- Posts: 13
- Joined: Wed Feb 14, 2007 3:32 pm
- Location: HH | Germany
- Contact:
Hey, this might be a bit late, but this is very possible using shadow maps : http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=22225