feat: implement LOD hysteresis to prevent model popping#1310
Merged
Conversation
Add LOD hysteresis system to prevent flickering when entities are near LOD distance boundaries. Uses a 10% margin (configurable via lodHysteresis setting) to create a "dead zone" around thresholds. Changes: - AssetManager: Add getBestLODWithHysteresis() function - UnitRenderer: Track per-entity LOD, use hysteresis in selection - BuildingRenderer: Same implementation for buildings - UnifiedCullingCompute: Add hysteresis to CPU fallback path - CullingService: Clean up LOD tracking on entity unregister - uiStore: Add lodHysteresis graphics setting (default 0.1) - rendering.md: Document the LOD hysteresis system With 10% hysteresis: - LOD0→LOD1 switches at 55 units (50 * 1.10) - LOD1→LOD0 switches at 45 units (50 * 0.90) - LOD1→LOD2 switches at 132 units (120 * 1.10) - LOD2→LOD1 switches at 108 units (120 * 0.90) https://claude.ai/code/session_01KbKNtVm9MU6RxTPZJGsZdg
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.
Add LOD hysteresis system to prevent flickering when entities are near LOD distance boundaries. Uses a 10% margin (configurable via lodHysteresis setting) to create a "dead zone" around thresholds.
Changes:
With 10% hysteresis:
https://claude.ai/code/session_01KbKNtVm9MU6RxTPZJGsZdg