Add volume management system for spatial acceleration of scene traversal and culling#63
Draft
Add volume management system for spatial acceleration of scene traversal and culling#63
Conversation
…tion - Add AABB helper methods (GetCenter, GetExtent, IsValid, Contains) - Add Sphere intersection functions (Sphere-Plane, Sphere-AABB, Sphere-Frustum) - Create BoundingVolume abstraction unifying AABB and Sphere bounds - Create VolumeManager using OctTree for spatial partitioning - Integrate VolumeManager into RenderScene for primitive tracking - Update MeshRenderer to sync volume bounds on transform changes - Add comprehensive unit tests Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
…d frustum culling - Use unordered_map for entries to ensure stable pointers - Store pointers in octree to avoid stale index issues - Add ForeachWithNodeTest to OctTree for custom node-level culling - FrustumCull now skips entire octree subtrees outside the frustum Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Design volume management for scene traversal and culling
Add volume management system for spatial acceleration of scene traversal and culling
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces octree-backed spatial volume management to replace linear primitive iteration during frustum culling and spatial queries.
Core geometry additions
Shapes.h/.cpp): Sphere-Plane, Sphere-AABB, Sphere-FrustumAABB.h):GetCenter(),GetExtent(),IsValid(),Contains()BoundingVolume.h): Type-erased wrapper over AABB/Sphere with frustum/AABB intersection dispatchOctTree extension
ForeachWithNodeTest— generic traversal with a caller-supplied node-level predicate, enabling early subtree rejection (e.g. frustum vs node AABB)VolumeManager (
VolumeManager.h)unordered_map<VolumeID, VolumeEntry>for O(1) lookup with pointer stabilityOctree<VolumeEntry*>for spatial partitioning — pointers into the map, so octreeIndexChangedcallbacks update the canonical entry directlyFrustumCull: octree-accelerated traversal that skips entire subtrees outside the frustum, then refines per-elementQueryByAABB: delegates to existing octree bound testAddVolume/RemoveVolume/UpdateVolume(remove + re-insert)Render pipeline integration
RenderSceneowns aVolumeManager;AddPrimitive/RemovePrimitiveauto-register volumesRenderPrimitivecarries avolumeIdfor trackingMeshRenderer::UpdateTransformsyncs world bounds into the volume managerTests
test/core/VolumeTest.cppcovers AABB helpers, all new intersection functions, BoundingVolume dispatch, and VolumeManager operations (add/remove/update/frustum cull/AABB query/user data).💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.