Skip to content

Follow-up: Port facing_ok culling to world-space #128

@deevus

Description

@deevus

This was generated by AI during triage.

Parent

#116 — PRD: Deepen game_render interface for GPU-ready world-space rendering

Status

This is now a non-blocking follow-up cleanup/deepening task, not a blocker for completing #116.

The original issue assumed that facing_ok was the last consumer of the DrawTrack3 screen-space projection pass. That is no longer accurate: DrawTrack3 still uses projected TrackScreenXYZ / GroundScreenXYZ data for clipping and render-depth bookkeeping, and func3.c still has repo-wide consumers of TrackScreenXYZ.

What to build

Port the five DrawTrack3 ground backface-culling call sites from legacy projected/view-space facing_ok(...) inputs to a world/camera-space helper such as facing_ok_world(...).

The helper should compute the same front/back-facing decision from world-space vertices, using the current camera position to make the determinant equivalent to the legacy camera-relative projected coordinates.

Acceptance criteria

  • DrawTrack3 ground culling uses world-space vertices or tVec3 / GameRenderVertex inputs for the five current facing_ok decisions.
  • Legacy facing_ok(...) is either replaced by facing_ok_world(...) in DrawTrack3 or clearly scoped as legacy-only.
  • Culling results are visually unchanged: no new pop-in/pop-out at grazing angles.
  • The change is covered by tests/scene_render_seam_check.py or equivalent static seam checks that prevent reintroducing projected TrackScreenXYZ/GroundScreenXYZ inputs to DrawTrack3 facing decisions.
  • zig build and zig build test-snapshots pass.

Explicitly out of scope

Follow-up candidate

After #116 is complete, a later cleanup can replace DrawTrack3’s projected-depth and clip-count bookkeeping with explicit camera-space/world-space helpers, then remove the remaining DrawTrack3 projection pass if no longer needed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions