1 registered members (AndrewAMD),
1,018
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Improved PSSM shadows (exponential shadowmapping)
#430852
10/03/13 13:19
10/03/13 13:19
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
OP
Expert
|
OP
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
Hi, I added a new feature to my earlier PSSM demo, namely exponential shadowmapping, that can be used instead of PCF smoothing, and now it is enough to use 1 or 2 splits for even large areas thanks to its higher precision. It is not desirable to use more splits, because in that case blurring the depth maps makes things slower. Together with stencil blur, nice shadows can be produced. It has a debug mode to check split areas having different colours. Shadows now fade out with distance fog (beside border fade-out). To be honest, I'm not totally satisfied with its implementation, I made a better one without using the stencil buffer, but it works fine too. I had problems with the depth maps, and the exponential scale factor has to have a much higher value comparing my original implementation (and what is suggested in an NVidia artice) to get proper results. There are some new terrain and object shaders included, you can choose what to use, Shader Model 3 or 2. You can select per pixel light support in the shaders (on by default). The Shade-C 0.91 water package now consists of only 3 files, so you can include it in your game easily. Now it supports SM3.0 object shaders too (underwater artifacts eliminated). Also features per pixel light support. There is an option to cover the terrain with grass, which can be animated or non-animated. Eats up some FPS. An exe is included for Free/Extra users to enable them to check these possibilities of Gamestudio. Download link (updated at 22-11-2013): http://www.mediafire.com/download/s4qsgzvm77qfi7g/improved%20PSSM%20shadows.zipA few screenshots: See other details in the readme file. It's free, please use it Regards, Ivan
Last edited by sivan; 11/22/13 12:48.
|
|
|
Re: Improved PSSM shadows (exponential shadowmapping)
[Re: 3run]
#430858
10/03/13 15:53
10/03/13 15:53
|
Joined: Oct 2004
Posts: 900 Lgh
rojart
User
|
User
Joined: Oct 2004
Posts: 900
Lgh
|
Thank you sivan, very nice shadows. By the way, d3d_anisotropy function doesn't really work, check here my workaround.
|
|
|
Re: Improved PSSM shadows (exponential shadowmapping)
[Re: sivan]
#430881
10/04/13 11:06
10/04/13 11:06
|
Joined: Aug 2002
Posts: 3,258 Mainz
oliver2s
Expert
|
Expert
Joined: Aug 2002
Posts: 3,258
Mainz
|
I found 2 funny (probably) engine bugs: - if stencil_blur in main.c is commented out, and #define USE_SM30 is used (enabling shader model 3 object shaders), then the shadows become sharp and have fog colour. but it also results in fog coloured artifacts in case of shader model 2, near water surfaces (probably because the water shader always uses shader model 3). the same happens if I replace FOG with TEXCOORD7 in shaders. but if you press T to create the test character, in some camera angles shadows become perfect... - another issue can happen if only the terrain is visible, then without stencil_blur applied, sometimes the 1st terrain texture is rendered on the screen...
thus stencil_blur must be at least 0.1. always. I have again a little list of engine bugs to present to Jcl... Maybe they are all related to that PSSM bug which was fixed in beta A8.45? Are you a beta tester?
|
|
|
|