[PR #7054] Add particle culling #7300

Open
opened 2026-11-03 06:37:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7054
Author: @elythepreciouscat
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: perf/async-occlusion-culling


📝 Commits (5)

  • 7fc42e8 Add standalone particle culling worker
  • 5d5dd03 Add ordinary-scene particle culling measurements
  • 32c30eb Merge remote-tracking branch 'origin/main' into review/particle-only
  • 740b215 Fix particle culling Clippy findings
  • ae1a4ec Merge origin/main into particle culling branch

📊 Changes

21 files changed (+1363 additions, -50 deletions)

View changed files

➕ benchmarks/particle-culling/2026-11-02/README.md (+27 -0)
➕ benchmarks/particle-culling/2026-11-02/main-off.png (+0 -0)
➕ benchmarks/particle-culling/2026-11-02/particle-async.png (+0 -0)
➕ benchmarks/particle-culling/2026-11-02/particle-off.png (+0 -0)
➕ benchmarks/particle-culling/2026-11-02/particle-sync.png (+0 -0)
📝 crates/horizon-client-render/src/gfx.rs (+12 -0)
📝 crates/horizon-client-render/src/graphics.rs (+55 -1)
📝 crates/horizon-client-render/src/graphics_ui.rs (+93 -6)
📝 crates/horizon-client-render/src/particles.rs (+301 -23)
📝 crates/horizon-client/assets/horizon/lang/de_de.json (+5 -1)
📝 crates/horizon-client/assets/horizon/lang/en_us.json (+5 -1)
📝 crates/horizon-client/assets/horizon/lang/es_es.json (+5 -1)
📝 crates/horizon-client/assets/horizon/lang/fr_fr.json (+5 -1)
📝 crates/horizon-client/assets/horizon/lang/pl_pl.json (+5 -1)
📝 crates/horizon-client/assets/horizon/lang/ru_ru.json (+5 -1)
📝 crates/horizon-client/assets/horizon/lang/tr_tr.json (+5 -1)
📝 crates/horizon-client/assets/horizon/lang/uk_ua.json (+5 -1)
📝 crates/horizon-client/assets/horizon/lang/zh_cn.json (+5 -1)
📝 crates/horizon-client/src/game.rs (+42 -9)
➕ crates/horizon-client/src/game/particle_culling.rs (+784 -0)

...and 1 more files

📄 Description

🤖 Opened by elythepreciouscat's AI agent (OpenAI Codex, GPT-6), not by elythepreciouscat personally.

What and why

Fixes #6684.

Adds Particle Culling to Advanced Graphics with Off, Synchronous, and Asynchronous modes. Off remains the default. The culler rejects particles outside the view, below a pixel, or conservatively proven hidden behind opaque terrain. It changes render submission only; particle spawning, ticking, random draws, lifetimes, collision, sounds, and effects stay unchanged.

The asynchronous particle queries use their own worker and bounded queue. This PR contains only particle culling: particle-light lookup caching is split into #7391, and the entity-occlusion rewrite is split into #7399.

When Particle Culling is Off, the render path delegates directly to render; disabled_culled_render_matches_the_regular_particle_path checks that both paths produce the same vertices.

Review measurements

Two opposite-order passes on an ordinary scene with 24 mobs, about 9,400–10,100 rain particles, and campfire smoke. Host: Intel Core i7-3770S, Intel HD Graphics 4000, Vulkan/Mesa, 675×727, render distance 4, VSync off, 260 FPS cap. Each sample measured for 8 seconds after 2 seconds warmup. CPU is average CPU time per frame; p99 is frame time.

Condition FPS CPU ms/frame Frame p99 ms
Main, all culling Off 88.39 1.930 23.85
This branch, all culling Off 88.55 1.828 24.88
Main, Entity Culling Synchronous 89.12 1.887 23.07
This branch, Entity Culling Synchronous and Particle Culling Off 89.06 1.897 25.18
Particle Culling Synchronous 88.87 1.774 24.94
Particle Culling Asynchronous* 89.00 1.754 24.90

The default and existing Entity Sync comparisons are within run-to-run variation. No FPS gain is claimed for this ordinary scene. The asynchronous sample predates the final dedicated-worker change, so it is historical context, not a measurement of the final async implementation.

Full setup and measurements

Main, culling Off

Particle branch, culling Off

Particle Culling, Synchronous

Particle Culling, Asynchronous

Kind

  • parity
  • bug
  • perf
  • feature
  • extra
  • tooling
  • docs

Self-check

Checks were not rerun for this split, as requested. The PR branch includes the latest origin/main.

🤖 Generated with OpenAI Codex


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/7054 **Author:** [@elythepreciouscat](https://github.com/elythepreciouscat) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `perf/async-occlusion-culling` --- ### 📝 Commits (5) - [`7fc42e8`](https://github.com/horizon-rust/horizon/commit/7fc42e8269177e1fada6dafc55788d939ba29e33) Add standalone particle culling worker - [`5d5dd03`](https://github.com/horizon-rust/horizon/commit/5d5dd03eb8d881c3bbe9031da94f26789dabc3ba) Add ordinary-scene particle culling measurements - [`32c30eb`](https://github.com/horizon-rust/horizon/commit/32c30eb98fa23edda41bcb985e7d52c9b4c1cad0) Merge remote-tracking branch 'origin/main' into review/particle-only - [`740b215`](https://github.com/horizon-rust/horizon/commit/740b215a998e754d5fdc9111aa492672066540f9) Fix particle culling Clippy findings - [`ae1a4ec`](https://github.com/horizon-rust/horizon/commit/ae1a4ec23c8372e12cc0e9d81457125b0a18c1f9) Merge origin/main into particle culling branch ### 📊 Changes **21 files changed** (+1363 additions, -50 deletions) <details> <summary>View changed files</summary> ➕ `benchmarks/particle-culling/2026-11-02/README.md` (+27 -0) ➕ `benchmarks/particle-culling/2026-11-02/main-off.png` (+0 -0) ➕ `benchmarks/particle-culling/2026-11-02/particle-async.png` (+0 -0) ➕ `benchmarks/particle-culling/2026-11-02/particle-off.png` (+0 -0) ➕ `benchmarks/particle-culling/2026-11-02/particle-sync.png` (+0 -0) 📝 `crates/horizon-client-render/src/gfx.rs` (+12 -0) 📝 `crates/horizon-client-render/src/graphics.rs` (+55 -1) 📝 `crates/horizon-client-render/src/graphics_ui.rs` (+93 -6) 📝 `crates/horizon-client-render/src/particles.rs` (+301 -23) 📝 `crates/horizon-client/assets/horizon/lang/de_de.json` (+5 -1) 📝 `crates/horizon-client/assets/horizon/lang/en_us.json` (+5 -1) 📝 `crates/horizon-client/assets/horizon/lang/es_es.json` (+5 -1) 📝 `crates/horizon-client/assets/horizon/lang/fr_fr.json` (+5 -1) 📝 `crates/horizon-client/assets/horizon/lang/pl_pl.json` (+5 -1) 📝 `crates/horizon-client/assets/horizon/lang/ru_ru.json` (+5 -1) 📝 `crates/horizon-client/assets/horizon/lang/tr_tr.json` (+5 -1) 📝 `crates/horizon-client/assets/horizon/lang/uk_ua.json` (+5 -1) 📝 `crates/horizon-client/assets/horizon/lang/zh_cn.json` (+5 -1) 📝 `crates/horizon-client/src/game.rs` (+42 -9) ➕ `crates/horizon-client/src/game/particle_culling.rs` (+784 -0) _...and 1 more files_ </details> ### 📄 Description > 🤖 Opened by elythepreciouscat's AI agent (OpenAI Codex, GPT-6), not by elythepreciouscat personally. ## What and why Fixes #6684. Adds **Particle Culling** to Advanced Graphics with Off, Synchronous, and Asynchronous modes. Off remains the default. The culler rejects particles outside the view, below a pixel, or conservatively proven hidden behind opaque terrain. It changes render submission only; particle spawning, ticking, random draws, lifetimes, collision, sounds, and effects stay unchanged. The asynchronous particle queries use their own worker and bounded queue. This PR contains only particle culling: particle-light lookup caching is split into #7391, and the entity-occlusion rewrite is split into #7399. When Particle Culling is Off, the render path delegates directly to `render`; `disabled_culled_render_matches_the_regular_particle_path` checks that both paths produce the same vertices. ## Review measurements Two opposite-order passes on an ordinary scene with 24 mobs, about 9,400–10,100 rain particles, and campfire smoke. Host: Intel Core i7-3770S, Intel HD Graphics 4000, Vulkan/Mesa, 675×727, render distance 4, VSync off, 260 FPS cap. Each sample measured for 8 seconds after 2 seconds warmup. CPU is average CPU time per frame; p99 is frame time. | Condition | FPS | CPU ms/frame | Frame p99 ms | | --- | ---: | ---: | ---: | | Main, all culling Off | 88.39 | 1.930 | 23.85 | | This branch, all culling Off | 88.55 | 1.828 | 24.88 | | Main, Entity Culling Synchronous | 89.12 | 1.887 | 23.07 | | This branch, Entity Culling Synchronous and Particle Culling Off | 89.06 | 1.897 | 25.18 | | Particle Culling Synchronous | 88.87 | 1.774 | 24.94 | | Particle Culling Asynchronous* | 89.00 | 1.754 | 24.90 | The default and existing Entity Sync comparisons are within run-to-run variation. No FPS gain is claimed for this ordinary scene. The asynchronous sample predates the final dedicated-worker change, so it is historical context, not a measurement of the final async implementation. [Full setup and measurements](https://github.com/elythepreciouscat/horizon/blob/perf/async-occlusion-culling/benchmarks/particle-culling/2026-11-02/README.md) ![Main, culling Off](https://raw.githubusercontent.com/elythepreciouscat/horizon/perf/async-occlusion-culling/benchmarks/particle-culling/2026-11-02/main-off.png) ![Particle branch, culling Off](https://raw.githubusercontent.com/elythepreciouscat/horizon/perf/async-occlusion-culling/benchmarks/particle-culling/2026-11-02/particle-off.png) ![Particle Culling, Synchronous](https://raw.githubusercontent.com/elythepreciouscat/horizon/perf/async-occlusion-culling/benchmarks/particle-culling/2026-11-02/particle-sync.png) ![Particle Culling, Asynchronous](https://raw.githubusercontent.com/elythepreciouscat/horizon/perf/async-occlusion-culling/benchmarks/particle-culling/2026-11-02/particle-async.png) ## Kind - [ ] parity - [ ] bug - [ ] perf - [x] feature - [ ] extra - [ ] tooling - [ ] docs ## Self-check Checks were not rerun for this split, as requested. The PR branch includes the latest `origin/main`. 🤖 Generated with [OpenAI Codex](https://openai.com/codex) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7300
No description provided.