f8216b6e77
Layers texture-averaged colors on top of palette.rs's hand-picked table as a fallback (color_for_textured), not a hard replacement — biome-tinted/animated blocks (grass top, leaves, water, lava) deliberately keep the hand-picked color since averaging their raw jar textures would be wrong, not just imprecise. Vanilla: worker/src/textures.rs downloads Mojang's official client jar directly from launchermeta/piston-meta/piston-data (same endpoints the real launcher uses, gated behind ACCEPT_MINECRAFT_EULA=true, off by default, mirrors BlueMap's accept-download) and averages every block texture, cached to disk so it's not re-downloaded every restart. Modded: ingests block_registry/block_textures messages from the mod (new Postgres tables + MinIO storage in api/src/textures.ts) — sent once per connection over the existing WS gateway. texturepacks/<name>/ (Dynmap-style flat PNGs) lets an operator override the vanilla defaults worker-wide via TEXTURE_PACK. A per-server texturePack admin column/API exists for the same purpose, but render-time per-server resolution (of both the admin selection and the ingested modded textures) is explicitly deferred — the worker still applies one process-wide palette; true per-server resolution needs the render pipeline to thread a server-scoped palette through the batch/GPU-dispatch path, judged too big a change for this phase. Documented in README. Docker was unavailable in this dev environment for the usual integration-test verification; bunx tsc --noEmit was used as a fallback static check instead (clean except 2 pre-existing unrelated errors in markers.test.ts).
51 lines
3.0 KiB
Bash
51 lines
3.0 KiB
Bash
DATABASE_URL=postgres://mcmapper:mcmapper@postgres:5432/mcmapper
|
|
REDIS_URL=redis://redis:6379
|
|
|
|
# See api/.env.example for what this points at and why — same shared MinIO instance/bucket,
|
|
# same rule: MINIO_SECRET_KEY is real, set it in an untracked `.env` next to this file, never here.
|
|
MINIO_ENDPOINT=192.168.0.3
|
|
MINIO_PORT=28205
|
|
MINIO_USE_SSL=false
|
|
MINIO_ACCESS_KEY=mcmapper
|
|
MINIO_SECRET_KEY=changeme-set-in-untracked-env
|
|
|
|
# cpu | gpu | hybrid (Phase 8) — see render/mod.rs's RenderBackend doc comment. `gpu` offloads
|
|
# tile shading and per-voxel face-visibility extraction to a wgpu compute shader; `hybrid` offloads
|
|
# only tile shading and keeps meshing on CPU. Unrecognized values, and `gpu`/`hybrid` on a machine
|
|
# with no compatible GPU adapter, fall back to `cpu` with a logged warning rather than crashing.
|
|
RENDER_BACKEND=cpu
|
|
|
|
# Thread count for the rayon pool that renders a batch of dirty chunks in parallel (see
|
|
# config.rs/main.rs — a single 16x16 tile is too small for rayon to help within itself, so the
|
|
# parallelism target is many chunks in flight at once). `auto` (default) uses
|
|
# std::thread::available_parallelism(); set a positive integer to override (0/garbage also falls
|
|
# back to auto).
|
|
RENDER_THREADS=auto
|
|
|
|
# server | consumer — tunes how many dirty-chunk entries are pulled off the Redis stream per
|
|
# xread cycle before being rendered in parallel. `server` (default) batches more aggressively —
|
|
# many small batches so every core on a many-core Xeon-style box stays fed; `consumer` uses
|
|
# fewer, larger batches, less scheduling overhead per chunk on fewer/faster cores. Unrecognized
|
|
# values fall back to `server`, matching this project's own primary deployment target.
|
|
RENDER_PROFILE=server
|
|
|
|
# Phase 11: set to exactly "true" to opt in to the worker downloading Mojang's official client
|
|
# jar (from launchermeta/piston-meta/piston-data — the same endpoints the real launcher uses, so
|
|
# this never redistributes anything, only fetches directly from Mojang) and averaging its block
|
|
# textures into real colors, replacing palette.rs's hand-picked table. Mirrors BlueMap's
|
|
# `accept-download` flag — off by default, since it's a real (if small, one-time, cached)
|
|
# network fetch an operator should consent to.
|
|
ACCEPT_MINECRAFT_EULA=false
|
|
# Which Minecraft version's client jar to pull textures from — 1.12.2 (this project's primary
|
|
# target) by default. Textures are looked up by file stem (e.g. "stone", "oak_planks"), which is
|
|
# stable across the 1.7.10/1.12.2 era this project prioritizes.
|
|
MC_TEXTURE_VERSION=1.12.2
|
|
# Where the downloaded-and-averaged vanilla palette is cached (as JSON) so it isn't rebuilt on
|
|
# every restart.
|
|
TEXTURE_CACHE_DIR=./cache
|
|
# Optional: name of a `texturepacks/<name>/` directory (flat *.png files, file stem = texture
|
|
# name) whose colors are layered on top of the downloaded vanilla defaults — the Dynmap-style
|
|
# operator-override mechanism. Currently applies worker-wide (this env var), not yet resolved
|
|
# per-server from the admin panel's `texturePack` field — see README's Phase 11 note.
|
|
#TEXTURE_PACK=
|