Files
La-Fabrik/src/data/world/graphicsConfig.ts
T
Tom Boullay 4f1b3b4ff3
🔍 Lint / 🪄 Check lint (push) Has been cancelled
🔍 Lint / 🎨 Check format (push) Has been cancelled
🔍 Lint / 🔎 Typecheck (push) Has been cancelled
📊 Quality / 🔒 Security Audit (push) Has been cancelled
📊 Quality / 📋 Dependency Freshness (push) Has been cancelled
📊 Quality / 📦 Bundle Size (push) Has been cancelled
🔍 Lint / 🏗 Build (push) Has been cancelled
fix(graphics): tune presets, single-line ui, vegetation LOD by nearest instance
- Bump high to 30m chunk / HD<20m and ultra to HD<30m so HD models
  persist further before swapping.
- Render the 5 graphics preset cards on a single row.
- Vegetation LOD selection now uses the distance to the nearest instance
  in each chunk instead of the chunk centre, matching MapInstancingSystem
  and avoiding premature LOD swaps when the camera enters a chunk.
2026-06-02 14:33:16 +02:00

79 lines
1.7 KiB
TypeScript

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;
label: string;
lodHighDetailDistance: number;
}
export const GRAPHICS_PRESETS = {
low: {
label: "Basse",
chunkLoadRadius: 10,
chunkUnloadRadius: 18,
chunkStreamingEnabled: true,
fogEnabled: true,
forceLodModels: true,
lodHighDetailDistance: 0,
},
medium: {
label: "Moyenne",
chunkLoadRadius: 20,
chunkUnloadRadius: 30,
chunkStreamingEnabled: true,
fogEnabled: true,
forceLodModels: true,
lodHighDetailDistance: 0,
},
high: {
label: "High",
chunkLoadRadius: 30,
chunkUnloadRadius: 40,
chunkStreamingEnabled: true,
fogEnabled: false,
forceLodModels: false,
lodHighDetailDistance: 20,
},
ultra: {
label: "Ultra",
chunkLoadRadius: 50,
chunkUnloadRadius: 65,
chunkStreamingEnabled: true,
fogEnabled: false,
forceLodModels: false,
lodHighDetailDistance: 30,
},
max: {
label: "Max",
chunkLoadRadius: 50,
chunkUnloadRadius: 65,
chunkStreamingEnabled: false,
fogEnabled: false,
forceLodModels: false,
lodHighDetailDistance: 50,
},
} as const satisfies Record<GraphicsPreset, GraphicsPresetConfig>;
export const GRAPHICS_DEFAULTS = {
preset: "high" as GraphicsPreset,
dynamicGrass: true,
dynamicTrees: true,
dynamicClouds: true,
shadowsEnabled: true,
grassDensity: 1.0,
};
export type GraphicsState = typeof GRAPHICS_DEFAULTS;