Skip to content

Add HLOD system with tree-based LOD selection#67

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/design-hlod-system
Draft

Add HLOD system with tree-based LOD selection#67
Copilot wants to merge 4 commits intomainfrom
copilot/design-hlod-system

Conversation

Copy link

Copilot AI commented Feb 16, 2026

Implements a hierarchical level-of-detail system following the engine's feature processor / renderer / component architecture.

Core (runtime/render/core/include/render/hlod/)

  • HLODNode — LOD node with switch distances, AABB bounds, mesh ref, and parent/child indices
  • HLODTree — Recursive camera-distance LOD selector; traverses from roots, switching to children when inside switchInDistance, culling beyond switchOutDistance
  • HLODRenderer — Tracks active node set; rebuilds render primitives only when selection changes
  • HLODFeatureProcessor / HLODFeature — Standard feature processor + singleton registration, mirrors MeshFeatureProcessor / MeshFeature

Adaptor (runtime/render/adaptor/)

  • HLODComponent — World component wired to TransformComponent + main camera position for per-tick LOD evaluation
  • RenderModule — Registered component, feature init, and shutdown

Usage

auto *tree = new HLODTree();

HLODNode root;
root.switchInDistance = 500.f;
root.mesh = coarseMesh;
uint32_t rootIdx = tree->AddNode(root);

HLODNode child;
child.parentIndex = rootIdx;
child.switchInDistance = 100.f;
child.mesh = detailedMesh;
tree->AddNode(child);

// Attach to actor via component
auto *hlod = actor->AddComponent<HLODComponent>();
hlod->SetHLODTree(tree);

No CMakeLists changes needed — both RenderCore and RenderAdaptor use GLOB_RECURSE.


💡 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.

Copilot AI and others added 3 commits February 16, 2026 13:57
…nd component

- HLODNode: Hierarchical LOD node with bounds, mesh, and switch distances
- HLODTree: Tree structure with camera-distance-based LOD selection
- HLODRenderer: Manages primitives for visible HLOD nodes
- HLODFeatureProcessor: Feature processor following engine pattern
- HLODFeature: Singleton for feature registration
- HLODComponent: Adaptor component for world integration
- Register HLOD in RenderModule

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 a hierarchical level of detail system Add HLOD system with tree-based LOD selection Feb 16, 2026
Copilot AI requested a review from bluesky013 February 16, 2026 14:01
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