Skip to content

feat: torch, Light spell and spell projectile shadows; highlighted NPCs keep their shadow - #556

Merged
BoroBongo merged 1 commit into
feature/pcvr-shadows-lightingfrom
feature/pcvr-hero-spell-shadows
Nov 23, 2026
Merged

BoroBongo merged 1 commit into
feature/pcvr-shadows-lightingfrom
feature/pcvr-hero-spell-shadows

Conversation

@BoroBongo

Copy link
Copy Markdown
Contributor

What

Follow-up to #555 (kept separate, so #555 stays reviewable): moving lights cast shadows too.

  • The hero's torch and the Light spell. ClaimHeroLight(owner, unityLight) gets the hero light's Unity light, which casts a cube shadow. Near plane is 0.2 m, so the torch's own stick doesn't hide the flame. The hero light slot is marked (w < 0) and the shaders light it through URP with the shadow, like the lamps in feat: PC shadows - sun/moon, lamps, torch and spells, the hero's own shadow, SSAO, darker nights (GD3D11-like) #555.
  • Spell projectiles (VRSpellThrow) register their light as a dynamic shadow light. A flying fireball now lights the walls it passes (before, it lit only NPCs and objects) and throws shadows. Up to 4 dynamic shadow lights at once; destroyed ones drop out.
  • Spell effect lights (VisualFxLight: summoning, fire rain) come before the lamps among the pooled shadow lights.
  • Cap raised from 8 to 12 shadow lights (GothicShadowLightsFeature + GothicShadows.hlsl): 6 lamps + hero light + projectiles.
  • Bug fix (playtest): a highlighted NPC (hovered by the hand) lost its shadow. Lit/SingleMesh-Dynamic and Lit/AlphaToCoverage-Dynamic, the highlight/fade swap shaders, now have a ShadowCaster pass.
  • Shadows option: switches all of these too.

Why

Playtest feedback on #555: "lamps, spells and everything else should cast shadows", and "a highlighted NPC stops casting its shadow".

How to test manually

PCVR (quality High). Night, e.g. G2 Khorinis around 2:00:

  • Light a torch and hold it: benches, barrels and NPCs cast shadows that move with the torch, and the torch lights the ground around you. The stick doesn't throw a big shadow over everything.
  • Cast Light: the same, from the light above your head.
  • Cast a fireball / ice / lightning projectile along a wall at night: the wall lights up as it passes, with moving shadows.
  • Summoning (red light) or fire rain: their light casts shadows.
  • Hover an NPC or item with your hand (highlight): its shadow stays.
  • Shadows option off: no shadows from any of them, and they still light as before.

Checked in the Editor: a hero light placed at hand height on the night market lights the ground, benches and NPCs, with bench shadows. Projectiles are untested (no way to cast in the Editor test).

Save/load

No new state.

Known gaps / follow-ups

  • NPC torches and burning NPCs (NpcBurnEffect) don't cast shadows.
  • GPU cost of moving shadow lights (cube re-render every frame) is unmeasured.

…adows; highlighted NPCs and objects keep theirs

- ClaimHeroLight takes the hero light's Unity light (torch, Light spell): it casts a cube shadow (near plane 0.2 m, so the torch's stick doesn't hide its flame), its slot is marked (w < 0) and the shaders light it through URP like the lamps.
- Spell projectiles (VRSpellThrow) register their light as a dynamic shadow light: a flying fireball now lights the walls it passes (before only NPCs and objects) and throws shadows. Up to 4 dynamic shadow lights; destroyed ones drop out.
- Spell effect lights (VisualFxLight: summoning, fire rain) come before the lamps among the pooled shadow lights.
- 12 shadow lights at most (feature and shader).
- Lit/SingleMesh-Dynamic and Lit/AlphaToCoverage-Dynamic (highlight on hover, fading) got a ShadowCaster pass - a highlighted NPC lost its shadow.
- The Shadows option switches them too.
@BoroBongo
BoroBongo merged commit 6693cdb into feature/pcvr-shadows-lighting Nov 23, 2026
1 check passed
@BoroBongo
BoroBongo deleted the feature/pcvr-hero-spell-shadows branch November 23, 2026 02:14
@BoroBongo

Copy link
Copy Markdown
Contributor Author

Folded into #555 on purpose (one PR for the PC shadows): its commits are now part of feature/pcvr-shadows-lighting, which is why GitHub shows this one as merged. Review and test it there.

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