Page 1 of 4

Shadow Map Demo - New RTS shadow demo!

Posted: Mon Jun 11, 2007 1:04 pm
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

Posted: Mon Jun 11, 2007 1:16 pm
by FlyingIsFun1217
Wonderful progress!
I love seeing additions like this make irrlicht a strong yet easy engine to use!

Great job :)
FlyingIsFun1217

Posted: Mon Jun 11, 2007 1:56 pm
by BlindSide
I would like people to post their FPS using each method here, for testing purposes.

Thank you.

Posted: Mon Jun 11, 2007 2:19 pm
by rooly
45-65 with intel 845g 800x600 + 512x512
35-40 with stencil shadow. min 28 max 45

Posted: Mon Jun 11, 2007 2:29 pm
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?

Posted: Mon Jun 11, 2007 2:50 pm
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..

Posted: Mon Jun 11, 2007 3:01 pm
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

Posted: Mon Jun 11, 2007 4:22 pm
by BlindSide
Its ok this is fixed in new demo. Please test using this demo and post new comparison framerate!

Posted: Mon Jun 11, 2007 10:50 pm
by monkeycracks
OpenGL didn't work for me, but the comparison between stencil and yours in D3D9 are great. Works much better than stencil.

Posted: Mon Jun 11, 2007 11:13 pm
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

Posted: Tue Jun 12, 2007 12:54 am
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?

Posted: Tue Jun 12, 2007 1:51 am
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

Posted: Tue Jun 12, 2007 2:36 am
by GameDude
Nice work, looks amazing.

Posted: Tue Jun 12, 2007 3:02 am
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!

Posted: Tue Jun 12, 2007 3:19 am
by Dances
I wanted to see but I'm 404ing.