The State Art of Shadow Mapping

Bachelor Project at EPFL, LGG lab

Bachelor project by Joachim Huet

With tutor Stefan Lienhard

 

Presentation :

The aim of this project is to see what type of shadow mapping we should use in what situation, to compare the various ways to create shadows in quality of rendering and in efficiency.  To do so we will compute the various proposals and try to find scenes appropriate to each of them and see that the others method don't work find on some scenes. For example cascaded shadows maps are used for big scenes of the outside and won't be of use to render a simple chair in a room.

This wiki will be used to have a support for the ongoing project. To note every step and so we can follow the project's progress.

The official starting date is the September, 14th. We will try to put a chapter per week about what happened in the week.

 

Week 1 :

This week I created the interface and base for the project, added some objects and make the add of objects easier. Once the structure was up, I compiled one shadow mapping solution to have more than just the objects.

Week 2 (More):

On the second week I continued to read some documentation on bias shadow mapping (deeper search). I computed the bias shadow mapping. 
I also put the project on github ( https://github.com/jololhuet/shadowmapping ) and started this wiki to help following my progress.

Week 3-4 (More):

Computed the spot light so we can work with perspective shadows too. It tooks some time and the shadows aren't really good for now because of distance from light. Will still need to work on it. Also looked at the OpenGL 4.0 Shading Language Cookbook about random sampling for pcf. Normal Offset computed (http://www.dissidentlogic.com/old/images/NormalOffsetShadows/GDC_Poster_NormalOffset.png) and glPolygonOffset too. Bias with caring about slopes and those two techniques give a similar result, should add an object above the wall to maybe see a difference between the various techniques.

Week 5 (More):

Adjust TweakBar so that we can control pretty much everything on it :

* Bias type : -Slope Bias, -Normal Offset Bias, -Polygon Offset Bias (Slope Bias is by default when none is clicked)

* Buffer Size : This was pretty tricky because we could just init it again every time we displayed it but it took too much memory as the display function is called a lot. So we init it only once when the buffer_size changes so it is a lot faster.) (initially 1024x1024)

* Radius for PCF and shadow darkness for bias shadow mapping. 

* Aspect, Fovy, Near, Far for the perspective view can be changed, the first parameters are not optimal as we can see peter panning with the perspective projection at some light inclinaison point.

Depth shadow map should be seen from the light's point of view. 

Rotated PCF created, inspired by :  http://www.sunandblackcat.com/tipFullView.php?l=eng&topicid=35

PCSS (Radius optimal) : 

http://developer.download.nvidia.com/shaderlibrary/docs/shadow_PCSS.pdf

http://http.download.nvidia.com/developer/presentations/2005/SIGGRAPH/Percentage_Closer_Soft_Shadows.pdf

This method is used when we have area lights so that the penumbra is set correctly depending on the distance from the light. We didn't implement it cause we have just a point light or directional and so it would be complicated to change the code just for this case. But it's one improvement really usefull that is provided in case you want a more realistic shadow map with area light.

VSM (More):

After PCF, I implemented the variance shadow maps. 
With the perspective light view it's not really nice working yet but otherwise with some blur the shadow looks great.

 

PSM high quality :

https://www-sop.inria.fr/reves/Basilic/2002/SD02/PerspectiveShadowMaps.pdf

http://www.comp.nus.edu.sg/~tants/tsm/psm.html

 

http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/Isidoro-ShadowMapping.pdf


http://www.digitalrune.com/Support/Blog/tabid/719/EntryId/218/Shadow-Acne.aspx