Shadow Map Demo - New RTS shadow demo!

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Shadow Map Demo - New RTS shadow demo!

Post by BlindSide »

Hey I have made a new demo it is the RTS shadow demo.

Controls are:
A S D W - Move camera.
R - Show/hide shadow map image.
T/G - Zoom in/out.

Please Note: This demo only runs at 1280x1024 fullscreen, so make sure you have a monitor that supports this.

Here is a screenshot:
Image

Download it here:
http://irrlichtirc.g0dsoft.com/BlindSide/rtsdemo.zip

Update: Yes ppl I am still working on this, to keep you occupied here is a new demo, featuring really long shadows that fade (and 4 sample filtering). Long term plans for shadow mapping is to implement PSM, for large outdoor areas to be shadowed quickly and with high quality, and/or also to utilize all 32 bits of the colour texture for depth as my simple implementation only utilizes 8 bits. (Will have to think of some clever way to do this huh..). Cheers :D

NEW FADING SHADOWS DEMO (PS 2.0 Only!):

Image

This demo is set at 1024x600 with 1024x512 shadow maps.

Download here: Shadow Map Demo (Sorry about sendspace, will find a better place for these things soon..)








OLD DEMO:

I have made a demo for my shadow maps

*PLEASE NOTE: NEW DEMO HAS BEEN UPDATED AGAIN WITH OPTIMISATIONS AND MORE SOFT SHADOWS (CHOOSE FILTERING IN DIRECTX)*

Download from here (Thanks Spintz ;) ):
http://irrnet.spintz.com/ShadowMap.zip

Here is a screenshot:
Image



In the demo there are 4 modes:

A: 800x600 with 512x512 shadow map.
B: 1024x600 with 1024x512 shadow map.
C: 1024x1024 with 1024x1024 shadow map.
D: 800x600 with stencil buffer shadows (For comparison).

If you notice, the speeds with the shadow maps are much more stable, if you go near the shadow or spin the camera around sydney. With stencil shadows it is slow then fast then slow, especially if you bring the camera very close sometimes the fps drops to 8. Also there are artifacts when you come near the shadow and things like in stencil, with the shadow maps you can glide your camera right on the shadow with no problem (As they are part of the texture).

Please note that to get rid of some of the z-buffer depth artifacts I had to clip a bit of the value for the terrain shadow map, and so there is a small gap in the shadow near sydney feet. (But the shadow has not moved like with stencil shadows, there is only a small gap cut out). I will get around to fixing this sometime, for now you can tweak with the shader settings and maybe fix it yourselves.

Cheers :D
Last edited by BlindSide on Mon Jul 09, 2007 4:34 am, edited 11 times in total.
FlyingIsFun1217
Posts: 219
Joined: Fri Apr 13, 2007 8:29 pm
Location: Illinois
Contact:

Post by FlyingIsFun1217 »

Wonderful progress!
I love seeing additions like this make irrlicht a strong yet easy engine to use!

Great job :)
FlyingIsFun1217
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

I would like people to post their FPS using each method here, for testing purposes.

Thank you.
rooly
Posts: 224
Joined: Tue Oct 25, 2005 4:32 pm
Location: Louisiana, USA, backwater country
Contact:

Post by rooly »

45-65 with intel 845g 800x600 + 512x512
35-40 with stencil shadow. min 28 max 45
When banks compete, you win.
When ISPs compete, you win.
When electronics retailers compete, you win.
When governments compete...you get drafted.
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

my card = geforce fx5200

A: 800x600 with 512x512 shadow map. 23 - 27
B: 1024x600 with 1024x512 shadow map. 17 - 22
C: 1024x1024 with 1024x1024 shadow map. don't know, i can't see the header of the window, but some problems occurred on the shadow when it rotates.
D: 800x600 with stencil buffer shadows (For comparison). 22 - 49

there's shadow on the terrain as well?
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Virion wrote:my card = geforce fx5200

A: 800x600 with 512x512 shadow map. 23 - 27
B: 1024x600 with 1024x512 shadow map. 17 - 22
C: 1024x1024 with 1024x1024 shadow map. don't know, i can't see the header of the window, but some problems occurred on the shadow when it rotates.
D: 800x600 with stencil buffer shadows (For comparison). 22 - 49

there's shadow on the terrain as well?
Yes as you have a fx5200 which is not much better than my 9200, the pixel shader will have problems keeping up at higher resolutions, and so the texture "lags" behind as the shadow rotates.

About the terrain, I am not sure if this is a shadow or just the depth buffer getting less accurate as it gets further away from the light (and steeper). This dissappears when i place the light higher, maybe I should update that demo..
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

maybe it is shadow? because when your light is lowered down, parts of the terrain blocked the light and causing shadow...

maybe you can make it like: the terrain only receive shadow, but do not cast any shadow itself
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Its ok this is fixed in new demo. Please test using this demo and post new comparison framerate!
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

OpenGL didn't work for me, but the comparison between stencil and yours in D3D9 are great. Works much better than stencil.
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

GeForce 6200 AGP 8x 256MB
DX
A 23-28 no issues
B 18-25 no issues
C 16-33 (WTF? 33?) no issues
D 12-18 no issues

OGL
A 33-34, huge graphics issue, screen included
B 29-32, same issue
C 25-31, same issue
D 15-31, no issues

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

Post by BlindSide »

Haha I have actually not tested at all using OGL, I just chucked it through ATI's HLSL2GLSL converter. Maybe someone with GLSL knowledge can convert them?
olivehehe_03
Posts: 157
Joined: Tue Mar 20, 2007 8:30 am

Post by olivehehe_03 »

I got Intel Core Duo @ 1.86Ghz, 1Gb RAM and 128Mb Geforce Go 7300

Direct X
a) 60 - 65
b) 45 - 65
c) visual problems, see screenshot, around 60
Image
d) 20 - 35

OpenGL
a, b and c) visual problems, see screenshot
Image
d) more visual problems, see screen again, < 5
Image
Tell me what you cherish most. Give me the pleasure of taking it away.
GameDude
Posts: 498
Joined: Thu May 24, 2007 12:24 am

Post by GameDude »

Nice work, looks amazing.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Thanks for testing olivehehe_03!

D is just normal stencil shadows so maybe I forgot to set something up for this, Shadow Mapping was just converted to GLSL using crappy ATI tool and it seems it did a bad job, so someone with GLSL experience can help here.

I have just added soft shadows! Try it out!
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

I wanted to see but I'm 404ing.
Post Reply