feat(debug): add filters to octree visualization

Default visualization was unreadable because every node from depth 0 to
maxDepth was rendered with rainbow-coloured edges. Add three filters
exposed in the Debug folder:

- Octree Leaves Only (default true): skip internal nodes
- Octree Min Depth (default 4): hide the largest enclosing boxes
- Octree Opacity (default 0.35): tone down line density

Also skip nodes without triangles, drop the per-depth HSL palette in
favour of a uniform cyan, and bump default Octree Max Depth to 8.
This commit is contained in:
Tom Boullay
2026-06-01 16:50:08 +02:00
parent 5faf4b4197
commit da7d66e1fd
3 changed files with 76 additions and 33 deletions
+13 -1
View File
@@ -7,6 +7,12 @@ interface DebugVisualsStore {
setShowOctree: (value: boolean) => void;
octreeMaxDepth: number;
setOctreeMaxDepth: (value: number) => void;
octreeMinDepth: number;
setOctreeMinDepth: (value: number) => void;
octreeLeavesOnly: boolean;
setOctreeLeavesOnly: (value: boolean) => void;
octreeOpacity: number;
setOctreeOpacity: (value: number) => void;
}
export const useDebugVisualsStore = create<DebugVisualsStore>((set) => ({
@@ -14,6 +20,12 @@ export const useDebugVisualsStore = create<DebugVisualsStore>((set) => ({
setShowPlayerModel: (showPlayerModel) => set({ showPlayerModel }),
showOctree: false,
setShowOctree: (showOctree) => set({ showOctree }),
octreeMaxDepth: 6,
octreeMaxDepth: 8,
setOctreeMaxDepth: (octreeMaxDepth) => set({ octreeMaxDepth }),
octreeMinDepth: 4,
setOctreeMinDepth: (octreeMinDepth) => set({ octreeMinDepth }),
octreeLeavesOnly: true,
setOctreeLeavesOnly: (octreeLeavesOnly) => set({ octreeLeavesOnly }),
octreeOpacity: 0.35,
setOctreeOpacity: (octreeOpacity) => set({ octreeOpacity }),
}));