From a836a927722e6750d698c2bcd145e91eb7f0c995 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Sun, 14 Jun 2026 04:37:39 +0100 Subject: [PATCH 1/5] Graphics/perf pass: presets, perf overlay, water, clouds, shadows, debug tooling - Graphics settings: Low/Medium/High presets + individual toggles (render scale, shadows, water, foliage, clouds, FXAA), persisted to localStorage, low-end autodetect, reactive apply without reload - Perf overlay (F3): FPS, frame ms, draw/tris, loaded/meshed/visible/culled chunks, shadow casters, water meshes, lighting/fog/water values - Render scale (hardware scaling) + optional FXAA (pure FXAA, no image-processing washout), adaptive chunk gen/mesh/light budgets from frame time - Frozen world matrices on static chunk meshes; foliage render-distance cull - Cloud quality tiers (off/simple/fancy) with day/night dimming - Shadow quality tiers (off/low/med/high) via runtime reconfigure - Water: StandardMaterial blue tint with emissive floor + specular glint, scene fog + lights; vertex colours stripped so lakes render continuously (no chunk seams); debug opacity/off toggles - Fog tuned per preset; face shading deepened for terrain depth - Debug tooling: wireframe (N), chunk borders (B), water/shadow/fog/post toggles, safe-mode terrain isolation, material dump, water audit, lifecycle logging - WebGL context-loss handling, render-distance cap, clean disposal --- index.html | 70 ++++- src/engine/Clouds.ts | 46 +++- src/engine/Input.ts | 1 + src/engine/Sky.ts | 16 ++ src/game/ChunkMesher.ts | 2 +- src/game/Game.ts | 302 ++++++++++++++++++++- src/game/World.ts | 308 ++++++++++++++++++++-- src/game/graphics/GraphicsController.ts | 207 +++++++++++++++ src/game/graphics/GraphicsSettings.ts | 168 ++++++++++++ src/game/lighting/LightingConfig.ts | 6 +- src/game/lighting/LightingSystem.ts | 18 +- src/game/lighting/ShadowManager.ts | 27 ++ src/game/lighting/VoxelTerrainMaterial.ts | 16 +- src/game/lighting/WaterMaterial.ts | 104 ++++++++ src/main.ts | 27 ++ src/state/Settings.ts | 28 +- src/types.ts | 22 +- src/ui/ChunkBorderOverlay.ts | 112 ++++++++ src/ui/Menus.ts | 81 +++++- src/ui/PerfOverlay.ts | 189 +++++++++++++ src/ui/ui.css | 111 ++++++++ 21 files changed, 1796 insertions(+), 65 deletions(-) create mode 100644 src/game/graphics/GraphicsController.ts create mode 100644 src/game/graphics/GraphicsSettings.ts create mode 100644 src/game/lighting/WaterMaterial.ts create mode 100644 src/ui/ChunkBorderOverlay.ts create mode 100644 src/ui/PerfOverlay.ts diff --git a/index.html b/index.html index ac3deb0..02f6812 100644 --- a/index.html +++ b/index.html @@ -53,6 +53,7 @@

Controls

  • EOpen inventory / switch mode
  • FCycle selected block
  • PCapture screenshot
  • +
  • F3Toggle perf overlay (FPS / draw / chunks)
  • EscPause
  • @@ -66,7 +67,7 @@

    Settings

    - +
    @@ -90,12 +91,74 @@

    Settings

    + +
    Graphics
    + +
    + +
    + + + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    - +
    - +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    @@ -126,6 +189,7 @@

    Paused