Information about Shadowmapping

Posted By: Slin

Information about Shadowmapping - 02/25/08 21:49

I think that we should try to collect all usefull papers/information/codes on shadowmapping there is on the internet.
We should make a difference between approaches on softshadows and ways to get rid of aliasing.

I start with techniques for less aliasing -> higher Shadowresolution near to the player, less "flickering", ...:




And these are about softshadows:


I am sure that there are quite some good ressources missing, so please add all you know of
And then when it seems that we have most of them together IŽd like to discuss them a little bit to exchange some experiences and hopefully end with some nice implementations (or at least one great )
Posted By: frazzle

Re: Information about Shadowmapping - 02/26/08 19:35

Great idea to collect useful write-ups about SM
Here's an article I found about aliasing caused by conditionals in HLSL:

http://ati.amd.com/developer/SIGGRAPH04/ShadingCourse2004_HLSL_Slides.pdf

Not the entire article is based on this, the interesting part starts from page 26
I'll try to input some SM code I've got asap

Cheers

Frazzle
Posted By: Mare

Re: Information about Shadowmapping - 02/27/08 13:03

Great posts guys!!! Im sorry but I dont have anything clever to post, but I have a simple question, that is maybe going to trouble us when we finaly deside to write a shadowmapping shader: How can we make model to cast shadow on some other model using shadowmapping, maybe I am stupid but I know how shadow mapping works(It stores the depth buffer, and compares to depth of a procesed pixel in the light space coordinates......), now how can we store the whole depth buffer for the entire scene, not just for the procesed model? If we cant that would give us only selfshadowing, not casting shadows on other entityes because every model will compare the depth of its processed pixel to the depth stored only by its self geometry, and wont know if some other model is blocking the light in front of it...



And now I have a solution for making ultra-real sof shadows, maybe it isnt so fast as the variace shadowmapping but its how it works in the nature.Basicly it has four steps(I dont know realy how to implemnt them in the shader, but I know that there's someone of you who knows):

1) generate basic aliased shadowmap;
2) blur the shadowmap(I know that will produce strange artifacts, like black_glowing);
3) do a bloom filter on a blured shadowmap(corrects the black_glowing...)
4) apply the shadow map!!!


ps. This is a great post, we should keep it going until we find a solution!
Posted By: Slin

Re: Information about Shadowmapping - 02/27/08 15:06

http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/811731/an/0/page/0#Post811731
As you see, it is very easy to do shadowmapping with Gamestudio the only problem is how to optimize it
What you explain is like this ("Screenspace Blurring": http://www.gamedev.net/reference/articles/article2193.asp) but with bloom which wonŽt change anything because you would blur the shadows, remove parts of the blur and blur it again...
Show me an example or such if you know that I am wrong

I found two more interesting techniques:

Posted By: BoH_Havoc

Re: Information about Shadowmapping - 02/28/08 13:43

Cascaded shadow maps:
http://developer.download.nvidia.com/SDK...shadow_maps.pdf

Real-Time Soft Shadows with Shadow Accumulation (no code):
http://www.iit.bme.hu/~szirmay/softshadow.pdf
Posted By: Slin

Re: Information about Shadowmapping - 02/28/08 16:20

Nice, I wasnŽt able to find much information about CSM

Here is a screenshot showing my results with this technique http://www.softgames.de/developia/viewarticle.php?cid=27884:

Posted By: croman

Re: Information about Shadowmapping - 02/28/08 16:25

@Slin, check vsmsun project topic, i asked an important question...

sorry for a offtopic post
Posted By: xXxGuitar511

Re: Information about Shadowmapping - 02/28/08 16:41

I'd like to try my luck with cascaded shadow maps, but first I need to find the time...

Is there anyone here thats a math expert? lol
Posted By: frazzle

Re: Information about Shadowmapping - 02/29/08 22:38

I guess you don't really need to be math expert to solve the aliasing effect IMHO
The most commen reason why you get aliasing for the shadow mapping algorithm are the following:

- The resolution of the shadow map.
- A limited numerical precision used when performing the comparaison between depth value from shadow map and the depth value for the fragment's distance to the light.

The first element can be easily solved when using a 1024X1024 shadow map which can store depth values in a 32-bit floating point.
This was already known and is also already used to partly overcome the aliasing effect.
The second element is more complex off course but I've done some look-ups and it seems that the following aspects are the most salutary:

1) Distribution of depth values in the light's viewing frustum.
2) Adjusting the viewing frustrum of the light source so that only the visible areas of the scene are covered by the viewing frustrum of the light.
3) PCF, adjacent bilinear filtering and maybe even a jitter value.

Number 3 is easy to enhance and already used but numbers 1 and 2 are far more complex in theory but can be achieved with a rather small amount of code at the practical side AFAIK

Btw, another interesting article about AA when using shadow maps :

http://files.filefront.com/Serverlisting+01rar/;9729203;/fileinfo.html

Cheers

Frazzle
Posted By: Joey

Re: Information about Shadowmapping - 03/01/08 15:14

pcf gives you best results. screen space blur is not as well-suited since it suffers from edge bleeding. multiplicate the pcf texel offset with the distance shadow-caster - shadow-receiver and you'll even get penumbra wedges...
Posted By: ello

Re: Information about Shadowmapping - 03/03/08 10:53

anyone mentiones "Fractional-Disk Soft Shadows" ? those look quite convincing
© 2024 lite-C Forums