Saturday, July 30, 2016

(Beginner) Pcss Shadows Questions

(Beginner) Pcss Shadows Questions

Hi, 

 

I am playing around with PCSS shadows in my small 3D engine (for learning purpose) but there is two things I don't understand. Probably beginner problems...

 

 

- Reading from my shadow map requiere an UV coordinate, and I add poisson disk offset to them to read surrounding pixel and try to find blockers (nVidia PCSS method). But what I don't get is how it work when the UV + Offset are greater than 1 ? It go out of the texture then ?

 

Exemple : UV = 0.54,0.74 + Offset = 0.84,0.44. I would expect poisson disk to be really small value like 0.00xx.. to read nearly surrounding pixel and not random pixel on the whole map. I probably don't get how reading texture work...

 

 

- My other problem is that the depth map I generate from the point of view of my light has a too small range so I don't find a lot of blockers (so shadow are still hard). When visualizing my shadow map in the VS debugger, all my value are between 0.998 - 1.0 (sometime event between 1 - 1 :s). Even with my clip space as tight as possible. In a particular case my near plane is 0.1f and my far plane is 20.0f, I would expect depth values a bit more expended like 0.97 - 1.0. What could influence the depth repartition when rendering my shadow map (a 32bit floating point texture). Due to that tight depth range, my PCSS offset value after having calculated blockers is really small, so I don't really get soft shadows. When debugging the sample code from nVidia, I notice that the main difference is that their depth value are more expended and so the offset value is something like 8-9 while mine is something like 0.025..

 

Thank a lot if someone can light me up ;)


No comments:

Post a Comment