Skip to content

rendering: first-person viewmodel layer — separate FOV, no geometry clipping #175

Description

@shadow-kernel

Context

A first-person horror game shows arms + flashlight/weapon in view. Rendered naively in the main pass, the viewmodel clips through walls the moment the player faces one, and the world FOV (often 90°+) distorts it. Every FPS engine renders the viewmodel as a separate layer; Vortex has no such concept — the render sequence is fixed (3D scene → motion vectors → upscale → UI).

Goal

A viewmodel render layer: entities flagged 'first-person' render after the world with depth cleared or remapped to a near range, using their own FOV (e.g. 54°), still receiving the scene lighting (flashlight self-illumination case) and still producing motion vectors so DLSS SR/FG doesn't ghost the weapon.

Acceptance Criteria

  • ViewmodelLayer flag on entities; flagged meshes render in a second scene pass with own projection (configurable FOV)
  • Weapon/arms never clip world geometry (depth range remap or depth clear — decision documented)
  • Lighting matches the scene (point/spot lights + the scripted flashlight affect the viewmodel)
  • Motion vectors cover the viewmodel pass (verified: no DLSS FG ghosting when swaying the weapon)
  • Render-scale + DLSS + post-FX chain order preserved (viewmodel included before post)
  • Shadows: viewmodel receives spot-shadow darkening but does not need to cast (v1)
  • Works with skinned (arms) and rigid (weapon) meshes, incl. socket-attached entities

Technical Notes

Simplest robust order: render world → clear depth → render viewmodel with own proj → continue with mvec/post. Motion-vector pass needs the same dual-projection handling (motionvector.hlsl reprojection with viewmodel matrices). Mind the render-scale offscreen RT: viewmodel renders into the same scaled RT.

Dependencies

  • rendering: spot light shadow mapping (the flashlight) — for receive-shadows interaction (soft)
  • animation: bone socket system (weapon attached to arms rig)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1-highHohe Priorität – als Nächstes einplanenarea:renderingRenderer, Lichter, Schatten, Post-FX, Shaderhorror-blockerEssenziell BEVOR die Horror-Game-Entwicklung startetsize:L~1 Wochetype:featureNeues Engine-/Editor-Feature

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions