Skip to content

feat: implement LOD hysteresis to prevent model popping#1310

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/plan-fsr-lod-upgrade-W2BwJ
Feb 3, 2026
Merged

feat: implement LOD hysteresis to prevent model popping#1310
braedonsaunders merged 1 commit into
mainfrom
claude/plan-fsr-lod-upgrade-W2BwJ

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

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

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
@braedonsaunders braedonsaunders merged commit 393ae7e into main Feb 3, 2026
3 of 4 checks passed
@braedonsaunders braedonsaunders deleted the claude/plan-fsr-lod-upgrade-W2BwJ branch February 3, 2026 16:32
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