Ratatoskr/scripts/preview-config.js
Nibu 5642acf2f9 scene: terrain style, a baked Phacelle height map on a displaced grid lit by the baked sky
style 'terrain' (WebGL2, tier-gated, dynamic import): height map baked once on the
GPU into RGBA8 (promoted from the terrain-tier-spike), a displaced grid, the baked
gradient as sky, baked sun/ambient/haze. Sky from option, ?sky=, or the stars'
night notion. Cadence guard, pauses, context loss and compile failure follow the
ridge scene. preview-config.js takes an optional style argument.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 18:36:18 +00:00

13 lines
737 B
JavaScript

// Preview builds: set the background scene tier in dist/config.json (default 'low'); config.json
// in the repo stays 'off'. Usage: node scripts/preview-config.js [tier] [style]
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
const tier = process.argv[2] ?? 'low';
const style = process.argv[3];
const file = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'dist', 'config.json');
const config = JSON.parse(fs.readFileSync(file, 'utf8'));
config.backgroundScene = { ...config.backgroundScene, tier, ...(style ? { style } : {}) };
fs.writeFileSync(file, `${JSON.stringify(config, null, 2)}\n`);
console.log(`${file}: backgroundScene.tier = ${tier}${style ? `, style = ${style}` : ''}`);