From 3e66e311174cdc745573560038506eb61559de0a Mon Sep 17 00:00:00 2001 From: Tom Boullay Date: Tue, 2 Jun 2026 13:51:33 +0200 Subject: [PATCH] feat(graphics): add max preset (no chunk streaming, LOD@50m) Restore ultra to its original behaviour (50m chunk streaming, HD within 20m, no fog) and introduce a new max preset that disables chunk streaming entirely (loads all chunks unconditionally) and pushes the HD/LOD swap distance to 50m. Add chunkStreamingEnabled flag to GraphicsPresetConfig so the streaming gate honours the preset. The settings card label shows 'All' when streaming is off. --- src/components/ui/GameSettingsMenu.tsx | 6 +++-- src/data/world/graphicsConfig.ts | 22 ++++++++++++++++++- .../map-instancing/MapInstancingSystem.tsx | 1 + src/world/vegetation/VegetationSystem.tsx | 1 + 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/components/ui/GameSettingsMenu.tsx b/src/components/ui/GameSettingsMenu.tsx index abd52ce..f30c6f0 100644 --- a/src/components/ui/GameSettingsMenu.tsx +++ b/src/components/ui/GameSettingsMenu.tsx @@ -105,6 +105,9 @@ function GraphicsPresetButton({ const lodLabel = config.forceLodModels ? "LOD forcé" : `HD ${config.lodHighDetailDistance}m`; + const chunkLabel = config.chunkStreamingEnabled + ? formatChunkDistance(config.chunkLoadRadius) + : "All"; return ( ); diff --git a/src/data/world/graphicsConfig.ts b/src/data/world/graphicsConfig.ts index be5b1e9..441a2ef 100644 --- a/src/data/world/graphicsConfig.ts +++ b/src/data/world/graphicsConfig.ts @@ -1,9 +1,16 @@ -export const GRAPHICS_PRESET_KEYS = ["low", "medium", "high", "ultra"] as const; +export const GRAPHICS_PRESET_KEYS = [ + "low", + "medium", + "high", + "ultra", + "max", +] as const; export type GraphicsPreset = (typeof GRAPHICS_PRESET_KEYS)[number]; export interface GraphicsPresetConfig { chunkLoadRadius: number; + chunkStreamingEnabled: boolean; chunkUnloadRadius: number; fogEnabled: boolean; forceLodModels: boolean; @@ -16,6 +23,7 @@ export const GRAPHICS_PRESETS = { label: "Basse", chunkLoadRadius: 10, chunkUnloadRadius: 18, + chunkStreamingEnabled: true, fogEnabled: true, forceLodModels: true, lodHighDetailDistance: 0, @@ -24,6 +32,7 @@ export const GRAPHICS_PRESETS = { label: "Moyenne", chunkLoadRadius: 20, chunkUnloadRadius: 30, + chunkStreamingEnabled: true, fogEnabled: true, forceLodModels: true, lodHighDetailDistance: 0, @@ -32,6 +41,7 @@ export const GRAPHICS_PRESETS = { label: "High", chunkLoadRadius: 35, chunkUnloadRadius: 45, + chunkStreamingEnabled: true, fogEnabled: false, forceLodModels: false, lodHighDetailDistance: 10, @@ -40,10 +50,20 @@ export const GRAPHICS_PRESETS = { label: "Ultra", chunkLoadRadius: 50, chunkUnloadRadius: 65, + chunkStreamingEnabled: true, fogEnabled: false, forceLodModels: false, lodHighDetailDistance: 20, }, + max: { + label: "Max", + chunkLoadRadius: 50, + chunkUnloadRadius: 65, + chunkStreamingEnabled: false, + fogEnabled: false, + forceLodModels: false, + lodHighDetailDistance: 50, + }, } as const satisfies Record; export const GRAPHICS_DEFAULTS = { diff --git a/src/world/map-instancing/MapInstancingSystem.tsx b/src/world/map-instancing/MapInstancingSystem.tsx index c5be5e9..1cb4c10 100644 --- a/src/world/map-instancing/MapInstancingSystem.tsx +++ b/src/world/map-instancing/MapInstancingSystem.tsx @@ -149,6 +149,7 @@ export function MapInstancingSystem({ const streamingEnabled = streaming && CHUNK_CONFIG.enabled && + graphicsPresetConfig.chunkStreamingEnabled && sceneMode === "game" && cameraMode === "player"; diff --git a/src/world/vegetation/VegetationSystem.tsx b/src/world/vegetation/VegetationSystem.tsx index ef07b55..c74a931 100644 --- a/src/world/vegetation/VegetationSystem.tsx +++ b/src/world/vegetation/VegetationSystem.tsx @@ -83,6 +83,7 @@ export function VegetationSystem({ const streamingEnabled = streaming && CHUNK_CONFIG.enabled && + graphicsPreset.chunkStreamingEnabled && sceneMode === "game" && cameraMode === "player";