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.
This commit is contained in:
Tom Boullay
2026-06-02 13:51:33 +02:00
parent 2c194cdd2e
commit 3e66e31117
4 changed files with 27 additions and 3 deletions
+4 -2
View File
@@ -105,6 +105,9 @@ function GraphicsPresetButton({
const lodLabel = config.forceLodModels const lodLabel = config.forceLodModels
? "LOD forcé" ? "LOD forcé"
: `HD ${config.lodHighDetailDistance}m`; : `HD ${config.lodHighDetailDistance}m`;
const chunkLabel = config.chunkStreamingEnabled
? formatChunkDistance(config.chunkLoadRadius)
: "All";
return ( return (
<button <button
@@ -115,8 +118,7 @@ function GraphicsPresetButton({
> >
<span>{config.label}</span> <span>{config.label}</span>
<small> <small>
{formatChunkDistance(config.chunkLoadRadius)} · {lodLabel} ·{" "} {chunkLabel} · {lodLabel} · {config.fogEnabled ? "Fog" : "Clear"}
{config.fogEnabled ? "Fog" : "Clear"}
</small> </small>
</button> </button>
); );
+21 -1
View File
@@ -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 type GraphicsPreset = (typeof GRAPHICS_PRESET_KEYS)[number];
export interface GraphicsPresetConfig { export interface GraphicsPresetConfig {
chunkLoadRadius: number; chunkLoadRadius: number;
chunkStreamingEnabled: boolean;
chunkUnloadRadius: number; chunkUnloadRadius: number;
fogEnabled: boolean; fogEnabled: boolean;
forceLodModels: boolean; forceLodModels: boolean;
@@ -16,6 +23,7 @@ export const GRAPHICS_PRESETS = {
label: "Basse", label: "Basse",
chunkLoadRadius: 10, chunkLoadRadius: 10,
chunkUnloadRadius: 18, chunkUnloadRadius: 18,
chunkStreamingEnabled: true,
fogEnabled: true, fogEnabled: true,
forceLodModels: true, forceLodModels: true,
lodHighDetailDistance: 0, lodHighDetailDistance: 0,
@@ -24,6 +32,7 @@ export const GRAPHICS_PRESETS = {
label: "Moyenne", label: "Moyenne",
chunkLoadRadius: 20, chunkLoadRadius: 20,
chunkUnloadRadius: 30, chunkUnloadRadius: 30,
chunkStreamingEnabled: true,
fogEnabled: true, fogEnabled: true,
forceLodModels: true, forceLodModels: true,
lodHighDetailDistance: 0, lodHighDetailDistance: 0,
@@ -32,6 +41,7 @@ export const GRAPHICS_PRESETS = {
label: "High", label: "High",
chunkLoadRadius: 35, chunkLoadRadius: 35,
chunkUnloadRadius: 45, chunkUnloadRadius: 45,
chunkStreamingEnabled: true,
fogEnabled: false, fogEnabled: false,
forceLodModels: false, forceLodModels: false,
lodHighDetailDistance: 10, lodHighDetailDistance: 10,
@@ -40,10 +50,20 @@ export const GRAPHICS_PRESETS = {
label: "Ultra", label: "Ultra",
chunkLoadRadius: 50, chunkLoadRadius: 50,
chunkUnloadRadius: 65, chunkUnloadRadius: 65,
chunkStreamingEnabled: true,
fogEnabled: false, fogEnabled: false,
forceLodModels: false, forceLodModels: false,
lodHighDetailDistance: 20, lodHighDetailDistance: 20,
}, },
max: {
label: "Max",
chunkLoadRadius: 50,
chunkUnloadRadius: 65,
chunkStreamingEnabled: false,
fogEnabled: false,
forceLodModels: false,
lodHighDetailDistance: 50,
},
} as const satisfies Record<GraphicsPreset, GraphicsPresetConfig>; } as const satisfies Record<GraphicsPreset, GraphicsPresetConfig>;
export const GRAPHICS_DEFAULTS = { export const GRAPHICS_DEFAULTS = {
@@ -149,6 +149,7 @@ export function MapInstancingSystem({
const streamingEnabled = const streamingEnabled =
streaming && streaming &&
CHUNK_CONFIG.enabled && CHUNK_CONFIG.enabled &&
graphicsPresetConfig.chunkStreamingEnabled &&
sceneMode === "game" && sceneMode === "game" &&
cameraMode === "player"; cameraMode === "player";
@@ -83,6 +83,7 @@ export function VegetationSystem({
const streamingEnabled = const streamingEnabled =
streaming && streaming &&
CHUNK_CONFIG.enabled && CHUNK_CONFIG.enabled &&
graphicsPreset.chunkStreamingEnabled &&
sceneMode === "game" && sceneMode === "game" &&
cameraMode === "player"; cameraMode === "player";