5
$\begingroup$

I am building my own graphic engine.

My depth texture is significantly smaller than that of the screen.

The low resolution depth map results in rigid shadow like this...

enter image description here

I am sure this is a common issue.

I would like to learn "go to" technique to resolve this issue.

$\endgroup$
  • 3
    $\begingroup$ The simplest option is to get higher resolution of your shadow map in areas you care about. $\endgroup$ – ratchet freak Mar 22 '17 at 9:04
  • 3
    $\begingroup$ Percentage Closer Filtering $\endgroup$ – Quinchilion Mar 22 '17 at 12:58
  • $\begingroup$ PCF isn't really that good. In fact, PCF is the naive brute force solution for shadow map filtering. It definitely does not deserve to be called "the go to" solution. Even the simplest exponential shadow maps can be linearly filtered without destroying performance. $\endgroup$ – MickLH Mar 24 '17 at 1:47
  • $\begingroup$ A realistic solution for a game engine is something more like using cascade shadow map partitioning in conjunction with a linearly filterable depth representation that you can pre-filter to the desired degree of smoothness. $\endgroup$ – MickLH Mar 24 '17 at 1:51
3
$\begingroup$

Percentage Closer Filtering with some amount of blur (ie. a minimum filter size in texture space) is the most basic method I know of. For example, see GPU Gems. My experience is that it is also quite robust.

$\endgroup$
3
$\begingroup$

Ah, shadows. They still are bothering after so many people spent years trying to improve them.
Whether your engine is deferred or forward, the shadow pass should be quite the same, and suffer the same issues.
You are correct, this is a famous problem. Some methods can improve these artifacts in some cases, see the methods mentioned already, or for example "light-perspective-cascades", "variance shadow maps", "shadow atlas" (compute optimal resolution for shadows of each light given available memory, and arrange them accordingly in a big buffer), "moment shadow mapping".
Some other workarounds are "baking" the shadow maps if light and object do not move. I am missing a lot, but don't recall seeing a solution that works well when resolution / number of filtering passes / samples is restricted...

$\endgroup$
2
$\begingroup$

One technique is adaptive shadow maps where you use a low resolution map for shadows that are rendered far away from the camera, a mid-resolution map for stuff that's in the mid range, and a high resolution map for stuff that's close.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.