RT shadows: shadow terminator artifacts on smooth-shaded low-poly mesh (triangles fill stepwise) -- Hanika offset for all RT shadow rays #664
Labels
No labels
amd
avatars
bug
builder
cannot-reproduce
crash
epic
feature
from-viewer
gl-removal
known-limitation
monitoring
parity
perf
platform
priority
critical
priority
high
priority
low
priority
medium
provenance
rendering
rt
status
in-progress
status
testing
status
up-next
triage
ui
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sky_line/Slipstream#664
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ray-traced shadows on smooth-shaded low-poly mesh (avatar legs, rigged bodies, sculpties) step along the triangles. Near the terminator, where the surface turns away from the light, whole triangles fill with shadow one at a time, from one side to the other. Dotted lines also appear along triangle edges from the soft-shadow samples. Seen in-world on a pony avatar's legs lit by an RT projector.
Cause: the shadow terminator problem
RenderVKSunTerminatorSoften(Chiang, Li & Burley 2019) andRenderVKRTShadowTerminatorFloor, which lifts soft-disc rays near the terminator. Projector RT shadows, and probably RT point/probe rays, appear to have neither.Fix: Hanika, "Hacking the Shadow Terminator" (Ray Tracing Gems II, ch. 4)
Before tracing, move the shadow-ray origin from the flat triangle onto the smooth surface implied by the vertex normals (projection onto the tangent planes at the three vertices, blended barycentrically). It's cheap, needs no tuning, and is independent of light type. Apply it to sun / moon, projector and any other RT shadow rays (RT shadow mask, the lit pass's ray-query path, god rays if relevant), for both rigged (post-skin positions and normals) and static geometry. Keep the existing sun tweaks only where they still add something, and keep an A/B setting.
Related: #648 (AO facet lines from the per-facet geometric normal). It's the same smooth-vs-faceted mismatch, but in a different pass.
Agent dispatched (Opus).
Fixed in 1.3.0 Beta 3: the shadow terminator lift now comes from the exact rasterized triangle (pre-pass), with no triangle-by-triangle filling, crease leaks or seam lines in testing. The grazing fade is off by default.