Skip to content

Main-thread CPU reductions for scenes with many instanced decor objects - #168

Closed
CCP-Stefano wants to merge 6 commits into
carbonengine:mainfrom
CCP-Stefano:cpu-pass
Closed

CCP-Stefano wants to merge 6 commits into
carbonengine:mainfrom
CCP-Stefano:cpu-pass

Conversation

@CCP-Stefano

Copy link
Copy Markdown

Experimental CPU reductions found while profiling space scenes with thousands of instanced decor pieces. Each commit stands alone and sits behind a trinity.settings switch:

  • AddHull reuses the instanced mesh for repeated hulls in a modular object.
  • eveStaticInstanceCaching (default on): cache static instance spheres and ray-tracing transforms while nothing moves.
  • eveInstancedGroupScreenSizeCull (default on): skip instanced sphere groups whose largest instance is below the screen size cut.
  • eveInstancedGroupCullMargin (default 0.95, previously 0.5).
  • eveReflectionShadowRefreshVisits (default 1 = unchanged): refresh reflection shadows every N visits of a cube face.
  • No per-object Tracy zone in EveSpaceObject2::UpdateVisibility (it allocated per call while Tracy runs).

Draft: opened for CI coverage, not for merge yet. Known open item: under investigation for a possible leak of EveChildInstancedMeshes when modular objects leave the scene.

🤖 Generated with Claude Code

CCP-Stefano and others added 6 commits November 27, 2026 19:21
Switch: trinity.settings eveStaticInstanceCaching (default on). Also records each sphere group's largest instance radius for the group cull.
…en size cut in a view

Switch: trinity.settings eveInstancedGroupScreenSizeCull (default on). Needs the caching commit (largest instance radius).
Switch: trinity.settings eveInstancedGroupCullMargin (default 0.95; 0.5 is the previous value).
…s of that face

Switch: trinity.settings eveReflectionShadowRefreshVisits (default 1 = render every visit, as before).
…p-allocates per call while Tracy runs and inflated the loop ~10x

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ccpgames-carbon

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@CCP-Stefano

Copy link
Copy Markdown
Author

Closing: experimental work, opened by mistake for CI only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants