[GH-ISSUE #7255] Particles: cull against the view frustum like vanilla (Frustum.pointInFrustum) #3189

Open
opened 2026-11-03 04:06:32 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @OsamahDev1 on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7255

Originally assigned to: @OsamahDev1 on GitHub.

🤖 Filed by OsamahDev1's AI agent (Claude Code, Opus 5.5), not by OsamahDev1 personally.

What's missing: ParticleEngine::render (crates/horizon-client-render/src/particles.rs) builds camera-facing quads for every live particle, including ones behind the camera or off to the side. Nothing on the particle path tests the view frustum.

Vanilla: ParticleEngine.extract culls against the camera frustum pulled back 3 blocks (Frustum.offset), and QuadParticleGroup tests each particle with Frustum.pointInFrustum. The port map lists both as missing (tools/port_map/client2-003.tsv). ROADMAP's "A batch of targeted optimisations" names "a particle frustum test first (also a parity gap)".

Plan: reuse gfx::Frustum (the client's view_frustum), add vanilla's point test with its 3-block offset, and skip off-screen particles before their sprite, light and quad work. Rendering only: spawning, ticking and random draws don't change. I'll confirm the exact rule against the 26.3 bytecode and put before and after frame times in the PR.

Related: #6684 / #7054 add an opt-in Particle Culling setting (Off by default, with occlusion). This issue is vanilla's own frustum test, which runs whatever the settings.

Originally created by @OsamahDev1 on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7255 Originally assigned to: @OsamahDev1 on GitHub. > 🤖 Filed by OsamahDev1's AI agent (Claude Code, Opus 5.5), not by OsamahDev1 personally. **What's missing:** `ParticleEngine::render` (`crates/horizon-client-render/src/particles.rs`) builds camera-facing quads for every live particle, including ones behind the camera or off to the side. Nothing on the particle path tests the view frustum. **Vanilla:** `ParticleEngine.extract` culls against the camera frustum pulled back 3 blocks (`Frustum.offset`), and `QuadParticleGroup` tests each particle with `Frustum.pointInFrustum`. The port map lists both as `missing` (`tools/port_map/client2-003.tsv`). ROADMAP's "A batch of targeted optimisations" names "a particle frustum test first (also a parity gap)". **Plan:** reuse `gfx::Frustum` (the client's `view_frustum`), add vanilla's point test with its 3-block offset, and skip off-screen particles before their sprite, light and quad work. Rendering only: spawning, ticking and random draws don't change. I'll confirm the exact rule against the 26.3 bytecode and put before and after frame times in the PR. **Related:** #6684 / #7054 add an opt-in Particle Culling setting (Off by default, with occlusion). This issue is vanilla's own frustum test, which runs whatever the settings.
Author
Owner

@OsamahDev1 commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6578731660 --> @OsamahDev1 commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3189
No description provided.