dynamic shadows from level geometry?

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
greenbean
Posts: 4
Joined: Sun Jan 07, 2007 1:05 am

dynamic shadows from level geometry?

Post by greenbean »

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.
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

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.
greenbean
Posts: 4
Joined: Sun Jan 07, 2007 1:05 am

Post by greenbean »

well i was thinking of doing a top view and just simple block walls casting shadows. I want to do something similar to how they did in the game Nox. where anything your player can't see is black.

Here is a pic incase you never played it.
Image
a_haouchar
Posts: 97
Joined: Sat Oct 14, 2006 10:51 am
Location: Australia,melbourne

Post by a_haouchar »

nowonder my project is slow! i need to fix my lara up.

so its possible to get every object to cast a shadow:)
greenbean
Posts: 4
Joined: Sun Jan 07, 2007 1:05 am

Post by greenbean »

uh huh
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

That game looks 2D, is it even using shadow or just blacking out the part player cant see?

Maybe you can use heavy black fog for your effect?
greenbean
Posts: 4
Joined: Sun Jan 07, 2007 1:05 am

Post by greenbean »

it is 2d, i just want to simulate something similar to that in 3d orthographic. I wasn't sure the best way to do it. i was just thinking maybe the player could act like a dynamic light so anything not in line of sight would be black.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Hmmm that sounds doable with a shader. You can test maybe if there is an obsticle between every vertex in the geometry and the player and black them out if neccesary. But im not sure if shaders are able to detect if something is in the way.
chewif
Posts: 2
Joined: Sun Jan 01, 2006 10:43 pm

same problem

Post by chewif »

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.
atomhamster
Posts: 13
Joined: Wed Feb 14, 2007 3:32 pm
Location: HH | Germany
Contact:

Post by atomhamster »

nothing new from me, but im also looking to achieve such an effect.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Hey, this might be a bit late, but this is very possible using shadow maps : http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=22225
Post Reply