fix(graphics): tune presets, single-line ui, vegetation LOD by nearest instance
🔍 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

- 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.
This commit is contained in:
Tom Boullay
2026-06-02 14:33:16 +02:00
parent 627c8d4eb9
commit 4f1b3b4ff3
3 changed files with 15 additions and 10 deletions
+4 -4
View File
@@ -39,12 +39,12 @@ export const GRAPHICS_PRESETS = {
}, },
high: { high: {
label: "High", label: "High",
chunkLoadRadius: 35, chunkLoadRadius: 30,
chunkUnloadRadius: 45, chunkUnloadRadius: 40,
chunkStreamingEnabled: true, chunkStreamingEnabled: true,
fogEnabled: false, fogEnabled: false,
forceLodModels: false, forceLodModels: false,
lodHighDetailDistance: 10, lodHighDetailDistance: 20,
}, },
ultra: { ultra: {
label: "Ultra", label: "Ultra",
@@ -53,7 +53,7 @@ export const GRAPHICS_PRESETS = {
chunkStreamingEnabled: true, chunkStreamingEnabled: true,
fogEnabled: false, fogEnabled: false,
forceLodModels: false, forceLodModels: false,
lodHighDetailDistance: 20, lodHighDetailDistance: 30,
}, },
max: { max: {
label: "Max", label: "Max",
+1 -1
View File
@@ -1544,7 +1544,7 @@ canvas {
} }
.game-settings-menu__choice-group--presets { .game-settings-menu__choice-group--presets {
grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-columns: repeat(5, minmax(0, 1fr));
} }
.game-settings-menu__choice-group button, .game-settings-menu__choice-group button,
+10 -5
View File
@@ -109,12 +109,17 @@ function useVegetationChunkModelPaths(
const next = new Map<string, string>(); const next = new Map<string, string>();
for (const chunk of chunks) { for (const chunk of chunks) {
const distance = Math.hypot( let nearestDistance = Number.POSITIVE_INFINITY;
chunk.centerX - cameraX, for (const instance of chunk.instances) {
chunk.centerZ - cameraZ, const distance = Math.hypot(
); instance.position[0] - cameraX,
instance.position[2] - cameraZ,
);
if (distance < nearestDistance) nearestDistance = distance;
}
const modelPath = selectMapModelPathByDistance({ const modelPath = selectMapModelPathByDistance({
distance, distance: nearestDistance,
modelName: VEGETATION_TYPES[chunk.type].mapName, modelName: VEGETATION_TYPES[chunk.type].mapName,
modelPath: chunk.modelPath, modelPath: chunk.modelPath,
preset, preset,