Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (dr_panther, TedMar, AndrewAMD), 986 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Improved PSSM shadows (exponential shadowmapping) #430852
10/03/13 13:19
10/03/13 13:19
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline OP
Expert
sivan  Offline 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.zip

A few screenshots:







See other details in the readme file.

It's free, please use it laugh

Regards,

Ivan

Last edited by sivan; 11/22/13 12:48.

Free world editor for 3D Gamestudio: MapBuilder Editor
Re: Improved PSSM shadows (exponential shadowmapping) [Re: sivan] #430856
10/03/13 14:18
10/03/13 14:18
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Thank you man! It's awesome, as always! laugh
I'll be waiting for new shade-c shadows as well laugh


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Improved PSSM shadows (exponential shadowmapping) [Re: 3run] #430857
10/03/13 15:19
10/03/13 15:19
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Nice, does it work with transparencies?

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 Offline
User
rojart  Offline
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.


Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: Improved PSSM shadows (exponential shadowmapping) [Re: rojart] #430861
10/03/13 18:32
10/03/13 18:32
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline OP
Expert
sivan  Offline OP
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
transparency works in the same bad way as before, it is an engine related issue to be fixed nobody knows when. later I will make another exponential shadowmapping demo based on what I've already implemented in next MapBuilder by modifying Shade-C variance shadowmapping, that features correct self shadows on alpha textures (but only a one split system).

thanks Rojart, I will test it.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: Improved PSSM shadows (exponential shadowmapping) [Re: sivan] #430878
10/04/13 10:10
10/04/13 10:10
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline OP
Expert
sivan  Offline OP
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
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...


Free world editor for 3D Gamestudio: MapBuilder Editor
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 Offline
Expert
oliver2s  Offline
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Originally Posted By: sivan
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?

Re: Improved PSSM shadows (exponential shadowmapping) [Re: oliver2s] #430882
10/04/13 11:25
10/04/13 11:25
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Hi sivan, I've the beta and works by me.

What exactly you meant by "then the shadows become sharp and have fog colour", some screenshots?


Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: Improved PSSM shadows (exponential shadowmapping) [Re: rojart] #430884
10/04/13 11:33
10/04/13 11:33
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline OP
Expert
sivan  Offline OP
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
ahh great, Jcl once told me when I mentioned the 2nd problem that it is probably solved in the beta. but I have no access to the betas... maybe when I finally recieve my pro licence I can have.

the 1st problem looks like this:



Free world editor for 3D Gamestudio: MapBuilder Editor
Re: Improved PSSM shadows (exponential shadowmapping) [Re: sivan] #430890
10/04/13 12:40
10/04/13 12:40
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Yes this works with beta, you don't need pro to beta access, afaik just pm jcl.



Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1