Skip to content

shadows: trace the directional light's shadows - #44

Merged
freezy merged 2 commits into
masterfrom
feat/rt-shadows
Nov 20, 2026
Merged

freezy merged 2 commits into
masterfrom
feat/rt-shadows

Conversation

@freezy

@freezy freezy commented Nov 20, 2026

Copy link
Copy Markdown
Member

Traces the directional light's shadows when VpeGraphicsSettings.RayTracedShadows is on. Needs freezy/VisualPinball.Engine#638.

  • Only directional lights trace. Spots keep their shadow maps, because every traced light costs about as much again.
  • One ray per pixel, HDRP's denoiser at 8 px, coloured shadows through transparents, softness from the light's angular diameter. On an RTX 4090 at native 4K this adds about 3.2 ms per frame, or about 0.7 ms behind DLSS Performance.
  • The camera's ray tracing frame setting is only on while a ray-traced setting wants it. With it on, HDRP builds the acceleration structure and drops lights that aren't included for ray tracing, so every light is included then and no lamp goes dark.
  • IsEffectSupported answers for any quality level's asset (TierEffectSupport). Traced shadows need a GPU that traces, ray tracing on the asset, and screen-space shadows on the asset.
  • The effective-settings line in the log counts the traced lights.

…for it.

One ray per pixel, denoised at 8 px, coloured through transparents. The camera only
traces while a ray-traced setting is on, and every light is included for ray tracing
then, so no lamp goes dark.
@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest changes appear safe to merge and fix the camera-setting ownership issue.

Summary

Adds ray-traced shadows for directional lights while spots keep shadow maps.

  • Directional lights trace shadows when the graphics setting allows it.
  • Callers can check which effects each quality tier supports.

Reviews (2) · Last reviewed commit: "shadows: hold the camera's ray tracing t..." · Reviewed by Greptile

Comment thread Runtime/HdrpGraphicsApplier.cs Resolved
…ngs.

Autofocus giving the camera its own settings back dropped the ray tracing choice
with them. The holds are released when tracing ends, the camera changes, the tier
can't trace, or a new play session starts without a domain reload.
@freezy
freezy merged commit 002b436 into master Nov 20, 2026
5 checks passed
@freezy
freezy deleted the feat/rt-shadows branch November 20, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant