Merge static objects into one tree: rays leaving surfaces up to 1.75× faster
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- three.js, typescript, web-dev
- Domain
- computer-graphics, performance
Research direction
Start by reading the scene tree construction and the walk-equivalence test; the issue does not name their file paths. Build a merged tree for static, non-instanced geometry while retaining instancing for moving or repeated objects, and determine whether the change belongs here or in @pmndrs/bvh. Done means the walk-equivalence test passes and performance is re-timed on an RTX 3060 and in DDGI and radiance cache ray passes.
Written by the indexing model from the issue text.
Description
Rays that leave a surface trace much slower than rays that start in the air. The cause is the top level of the scene's trees: the boxes around separate objects overlap, so a ray leaving a surface enters many objects it never hits.
Merging the static objects into one tree fixes most of it. Measured on the Apple M5 Pro at main (#52, bench/results/surface-rays-m5.csv; pages trace-bench-surface-sponza and trace-bench-surface-bistro-interior):
| Scene | Closest hit, merged vs instanced | Any hit | Steps per ray, instanced → merged |
|---|---|---|---|
| Sponza | 1.75× (runs 1.71–1.85) | 1.36× | 113.8 → 70.3 |
| Bistro interior | 1.19× (runs 1.15–1.26) | 1.14× | 114.3 → 101.4 |
The Mac's archived track (archive/mac-radiance-cache, its RC5.4) measured 1.86× and 1.24× with the same step counts.
To do:
- Build one merged tree for static, non-instanced geometry and keep instancing for objects that move or repeat. Decide where this belongs: here or in
@pmndrs/bvh. - Keep the walk-equivalence test passing.
- Re-time on the RTX 3060, then on DDGI's and the radiance cache's real ray passes, not only the bench.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 16h 11m
- Merged PRs (30d)
- 15
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pmndrs/gi
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
chore
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
TU.3: Safari on the M5 ProPossibly taken @DennisSmolek claimed this today. Openneeds-mac tuning
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Maintainers usually reply within 1 day
Similar issues
-
bug zoo
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
software-mansion/runntime#151 ·
Maintainers usually reply within 4 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
sidebandstudio/clawtrate#728 ·
Maintainers usually reply within 1 day
-
enhancement github_actions help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tranquilo-art/tranquilo-app#254 ·
Maintainers usually reply within 1 day
-
docs good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
DojoCodingLabs/hermit#73 ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Tfoucher5/fuzzy-toolkit#44 ·
Maintainers usually reply within 1 day