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>
13 lines
737 B
JavaScript
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}` : ''}`);
|