EEVEE-Next: Improve shadow bias #121088

Merged
Clément Foucault merged 13 commits from fclem/blender:eevee-next-shadow-bias-improved into main 2024-04-27 14:31:02 +02:00

13 Commits

Author SHA1 Message Date
Clément Foucault 06ca6af849 Fix make format 2024-04-27 14:05:17 +02:00
Clément Foucault 2f546a223a Merge branch 'main' into eevee-next-shadow-bias-improved 2024-04-27 11:11:09 +02:00
Clément Foucault 613436ecf9 Merge branch 'main' into eevee-next-shadow-bias-improved 2024-04-27 11:09:55 +02:00
Clément Foucault 4778d53bc8 Remove shadow normal offset
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
2024-04-26 23:39:52 +02:00
Clément Foucault 2b03ad5a2d Merge branch 'main' into eevee-next-shadow-bias-improved
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
2024-04-26 21:16:12 +02:00
Clément Foucault 3acf4ac453 Scale slope bias depending on filter size 2024-04-26 21:02:15 +02:00
Clément Foucault d0fedfbe63 Remove debug draw 2024-04-26 19:48:01 +02:00
Clément Foucault 91782cec6b Refactor PCF 2024-04-26 18:52:38 +02:00
Clément Foucault bc05753324 WIP 2024-04-26 17:34:48 +02:00
Clément Foucault ce3705c90b Punctual shadow texel radius 2024-04-26 17:02:36 +02:00
Clément Foucault ff6ebb4579 WIP 2024-04-26 15:46:36 +02:00
Clément Foucault 312c039e5f Merge branch 'main' into eevee-next-shadow-bias-improved 2024-04-26 13:13:43 +02:00
Clément Foucault b58e9459fe EEVEE-Next: Improve shadow bias
Compute shadow bias in the normal direction to avoid
both shadow leaking at certain angles or shadow
acnee.

This bias is computed automatically based on the minimum
bias amount required to remove all errors.

We do the bias in world space instead of shadow space
for speed and simplicity. This requires us to bias using
the upper bound of biases for the same location in space
(using biggest texel world radius instead of UVZ bias).
This isn't much of an issue since the bias is still less
than 2 texel. The bias is still modulated by facing
ratio to the light so surfaces facing the light have no
biases.

We always bias toward the normal direction instead of the
light direction. This is alike Cycles geometric offset for
the shadow terminator fix. This is better since it does'nt
modify the shading at all.

This changes the PCF filtering to only filter after the
the "safe" zone where we cannot have any shadow acnee.
This introduces bias in this regard since we move the
shadow map center away from the surface.

This removes the geometric offset inside the shadow surface
shader as we already account for that at sampling time.
2024-04-25 19:07:33 +02:00