create-threenative 0.2.10 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-docs/references/assertion-reference.md +109 -3
- package/agent-docs/references/auto-exposure.md +28 -45
- package/agent-docs/references/build-profiles.md +1 -1
- package/agent-docs/references/capability-reference.md +527 -44
- package/agent-docs/references/debug-surface.md +64 -0
- package/agent-docs/references/finding-assets.md +11 -12
- package/agent-docs/references/performance-basics.md +19 -0
- package/agent-docs/references/trace-a-slow-frame.md +21 -0
- package/agent-docs/references/visual-baseline.md +23 -4
- package/agent-files/.agents/skills/ponytail/SKILL.md +1 -1
- package/agent-files/.agents/skills/prd-creator/SKILL.md +17 -6
- package/agent-files/.agents/skills/threenative-capabilities/SKILL.md +87 -23
- package/agent-files/.agents/skills/threenative-performance/SKILL.md +12 -11
- package/agent-files/.claude/hooks/ponytail-context.mjs +1 -1
- package/agent-files/scripts/reference.mjs +9 -4
- package/capabilities.json +739 -50
- package/dist/index.d.ts +40 -6
- package/dist/index.js +227 -34
- package/dist/quality.d.ts +12 -0
- package/dist/quality.js +166747 -0
- package/dist/threenative.js +60 -44
- package/dist/web-engine-gltf-loader.js +2 -0
- package/dist/web-engine-mesh-bvh-webgpu.js +1 -1
- package/dist/web-engine-mesh-bvh.js +7 -0
- package/dist/web-engine-post-effects.js +645 -19
- package/dist/web-engine-runtime.js +3528 -343
- package/package.json +19 -9
- package/template-assets/assets/bay-PROVENANCE.md +21 -0
- package/template-assets/assets/bay-ground.webp +0 -0
- package/template-assets/assets/bay-metal.webp +0 -0
- package/template-assets/assets/bay-pavement-normal.webp +0 -0
- package/template-assets/assets/bay-pavement.webp +0 -0
- package/template-assets/assets/bay-plaster-normal.webp +0 -0
- package/template-assets/assets/bay-plaster.webp +0 -0
- package/template-assets/assets/bay-wood-normal.webp +0 -0
- package/template-assets/assets/bay-wood.webp +0 -0
- package/template-assets/assets/tex-PROVENANCE.md +25 -0
- package/template-assets/assets/tex-bark-normal.webp +0 -0
- package/template-assets/assets/tex-bark.webp +0 -0
- package/template-assets/assets/tex-birch-bark.webp +0 -0
- package/template-assets/assets/tex-grass.webp +0 -0
- package/template-assets/assets/tex-planks-normal.webp +0 -0
- package/template-assets/assets/tex-planks.webp +0 -0
- package/template-assets/assets/tex-rock-normal.webp +0 -0
- package/template-assets/assets/tex-rock.webp +0 -0
- package/template-assets/assets/tex-roof-tiles-normal.webp +0 -0
- package/template-assets/assets/tex-roof-tiles.webp +0 -0
- package/template-assets/assets/tex-sand-normal.webp +0 -0
- package/template-assets/assets/tex-sand.webp +0 -0
- package/template-assets/assets/tex-stone-wall-normal.webp +0 -0
- package/template-assets/assets/tex-stone-wall.webp +0 -0
- package/template-assets/kitExposure.ts +20 -0
- package/template-assets/patches/three@0.185.1.patch +481 -272
- package/template-assets/quality/biome.json +7 -0
- package/template-assets/quality/eslint.config.js +3 -0
- package/template-assets/realistic-ocean/README.md +113 -0
- package/template-assets/realistic-ocean/install.mjs +56 -0
- package/template-assets/realistic-ocean/src/realisticOcean.ts +151 -0
- package/template-assets/realistic-ocean/src/realisticOceanLifetime.ts +29 -0
- package/template-assets/realistic-ocean/src/render/REALISTIC-OCEAN-LICENSE.txt +25 -0
- package/template-assets/realistic-ocean/src/render/realisticSea.ts +642 -0
- package/template-assets/realistic-ocean/src/render/realisticSeaMaps.ts +311 -0
- package/template-assets/realistic-ocean/src/render/realisticSpectrum.ts +289 -0
- package/templates/AGENTS.md +21 -0
- package/templates/CLAUDE.md +23 -0
- package/templates/action-rpg/.codex/config.toml +6 -2
- package/templates/action-rpg/.cursor/mcp.json +8 -2
- package/templates/action-rpg/.gemini/settings.json +8 -2
- package/templates/action-rpg/.mcp.json +8 -2
- package/templates/action-rpg/.vscode/mcp.json +9 -2
- package/templates/action-rpg/.zed/settings.json +9 -2
- package/templates/action-rpg/AGENTS.md +11 -11
- package/templates/action-rpg/CLAUDE.md +11 -11
- package/templates/action-rpg/opencode.json +10 -2
- package/templates/action-rpg/package.json +15 -10
- package/templates/action-rpg/playtests/combat.playtest.json +6 -0
- package/templates/action-rpg/playtests/inventory.playtest.json +22 -0
- package/templates/action-rpg/playtests/performance.playtest.json +1 -1
- package/templates/action-rpg/playtests/roll.playtest.json +112 -0
- package/templates/action-rpg/playtests/swing.playtest.json +55 -0
- package/templates/action-rpg/playtests/win.playtest.json +4 -4
- package/templates/action-rpg/src/entities/Fighter.ts +44 -4
- package/templates/action-rpg/src/entities/Player.ts +64 -12
- package/templates/action-rpg/src/render/atmosphere.ts +444 -0
- package/templates/action-rpg/src/render/backlightMaterial.ts +49 -18
- package/templates/action-rpg/src/render/clouds.ts +605 -0
- package/templates/action-rpg/src/render/dungeon.ts +8 -6
- package/templates/action-rpg/src/render/exposure.ts +11 -109
- package/templates/action-rpg/src/render/gpuSky.ts +752 -0
- package/templates/action-rpg/src/render/lighting.ts +27 -4
- package/templates/action-rpg/src/render/materialLighting.ts +2 -11
- package/templates/action-rpg/src/render/palette.ts +1 -0
- package/templates/action-rpg/src/render/postprocessing.ts +4 -4
- package/templates/action-rpg/src/render/props.ts +10 -8
- package/templates/action-rpg/src/render/quality.ts +56 -108
- package/templates/action-rpg/src/render/sky.ts +74 -1
- package/templates/action-rpg/src/scenes/Play.ts +16 -12
- package/templates/action-rpg/src/ui/CharacterPanel.tsx +7 -2
- package/templates/action-rpg/src/ui/Hud.tsx +5 -7
- package/templates/action-rpg/src/ui/InventoryPanel.tsx +14 -14
- package/templates/action-rpg/threenative.config.ts +3 -0
- package/templates/adventure/.codex/config.toml +23 -0
- package/templates/adventure/.cursor/mcp.json +38 -0
- package/templates/adventure/.gemini/settings.json +38 -0
- package/templates/adventure/.mcp.json +38 -0
- package/templates/adventure/.vscode/mcp.json +43 -0
- package/templates/adventure/.zed/settings.json +43 -0
- package/templates/adventure/AGENTS.md +60 -0
- package/templates/adventure/CLAUDE.md +62 -0
- package/templates/adventure/index.html +14 -0
- package/templates/adventure/kit.json +8 -0
- package/templates/adventure/native-playtests/survives.playtest.json +52 -0
- package/templates/adventure/opencode.json +49 -0
- package/templates/adventure/package.json +65 -0
- package/templates/adventure/playtests/boss.playtest.json +406 -0
- package/templates/adventure/playtests/combat.playtest.json +342 -0
- package/templates/adventure/playtests/controls.playtest.json +142 -0
- package/templates/adventure/playtests/explore.playtest.json +45 -0
- package/templates/adventure/playtests/flicker.playtest.json +206 -0
- package/templates/adventure/playtests/hearts.playtest.json +171 -0
- package/templates/adventure/playtests/lockon.playtest.json +256 -0
- package/templates/adventure/playtests/look.playtest.json +72 -0
- package/templates/adventure/playtests/move-hollow.playtest.json +106 -0
- package/templates/adventure/playtests/move.playtest.json +84 -0
- package/templates/adventure/playtests/performance.playtest.json +55 -0
- package/templates/adventure/playtests/puzzle.playtest.json +250 -0
- package/templates/adventure/playtests/stride.playtest.json +67 -0
- package/templates/adventure/playtests/survives.playtest.json +171 -0
- package/templates/adventure/playtests/thornback.playtest.json +267 -0
- package/templates/adventure/public/favicon.svg +4 -0
- package/templates/adventure/src/entities/Block.ts +114 -0
- package/templates/adventure/src/entities/Chest.ts +69 -0
- package/templates/adventure/src/entities/Door.ts +81 -0
- package/templates/adventure/src/entities/Dummy.ts +69 -0
- package/templates/adventure/src/entities/Flicker.ts +239 -0
- package/templates/adventure/src/entities/Hero.ts +561 -0
- package/templates/adventure/src/entities/LockOn.ts +180 -0
- package/templates/adventure/src/entities/Mossling.ts +249 -0
- package/templates/adventure/src/entities/Switch.ts +49 -0
- package/templates/adventure/src/entities/Thornback.ts +238 -0
- package/templates/adventure/src/entities/Warden.ts +196 -0
- package/templates/adventure/src/game.ts +65 -0
- package/templates/adventure/src/interact.ts +63 -0
- package/templates/adventure/src/level/Hollow.ts +240 -0
- package/templates/adventure/src/level/Vale.ts +383 -0
- package/templates/adventure/src/main.ts +18 -0
- package/templates/adventure/src/render/camera.ts +416 -0
- package/templates/adventure/src/render/creatures.ts +405 -0
- package/templates/adventure/src/render/effects.ts +333 -0
- package/templates/adventure/src/render/foliage.ts +1072 -0
- package/templates/adventure/src/render/hero.ts +1447 -0
- package/templates/adventure/src/render/kitExposure.ts +20 -0
- package/templates/adventure/src/render/lighting.ts +74 -0
- package/templates/adventure/src/render/loading.ts +332 -0
- package/templates/adventure/src/render/materials.ts +179 -0
- package/templates/adventure/src/render/palette.ts +137 -0
- package/templates/adventure/src/render/postprocessing.ts +70 -0
- package/templates/adventure/src/render/props.ts +383 -0
- package/templates/adventure/src/render/quality.ts +46 -0
- package/templates/adventure/src/render/sky.ts +271 -0
- package/templates/adventure/src/render/surface.ts +259 -0
- package/templates/adventure/src/render/touch-controls.ts +137 -0
- package/templates/adventure/src/scenes/Play.ts +959 -0
- package/templates/adventure/src/state.ts +113 -0
- package/templates/adventure/src/style.css +98 -0
- package/templates/adventure/src/ui/App.tsx +22 -0
- package/templates/adventure/src/ui/GameUi.tsx +20 -0
- package/templates/adventure/src/ui/Hud.tsx +70 -0
- package/templates/adventure/src/ui/Menu.tsx +15 -0
- package/templates/adventure/src/ui/main.tsx +14 -0
- package/templates/adventure/tailwind.config.ts +2 -0
- package/templates/adventure/threenative.config.ts +62 -0
- package/templates/adventure/tsconfig.json +17 -0
- package/templates/adventure/vite.config.ts +49 -0
- package/templates/collectathon/.codex/config.toml +23 -0
- package/templates/collectathon/.cursor/mcp.json +38 -0
- package/templates/collectathon/.gemini/settings.json +38 -0
- package/templates/collectathon/.mcp.json +38 -0
- package/templates/collectathon/.vscode/mcp.json +43 -0
- package/templates/collectathon/.zed/settings.json +43 -0
- package/templates/collectathon/AGENTS.md +58 -0
- package/templates/collectathon/CLAUDE.md +60 -0
- package/templates/collectathon/index.html +14 -0
- package/templates/collectathon/kit.json +8 -0
- package/templates/collectathon/native-playtests/survives.playtest.json +52 -0
- package/templates/collectathon/opencode.json +49 -0
- package/templates/collectathon/package.json +65 -0
- package/templates/collectathon/playtests/acrobatics.playtest.json +238 -0
- package/templates/collectathon/playtests/camera.playtest.json +80 -0
- package/templates/collectathon/playtests/clipped-probe.playtest.json +101 -0
- package/templates/collectathon/playtests/collect.playtest.json +196 -0
- package/templates/collectathon/playtests/combat.playtest.json +246 -0
- package/templates/collectathon/playtests/double-tap-air.playtest.json +198 -0
- package/templates/collectathon/playtests/double-tap.playtest.json +136 -0
- package/templates/collectathon/playtests/effects.playtest.json +124 -0
- package/templates/collectathon/playtests/enemies.playtest.json +295 -0
- package/templates/collectathon/playtests/explore.playtest.json +45 -0
- package/templates/collectathon/playtests/hop-reach.playtest.json +117 -0
- package/templates/collectathon/playtests/jump-chain.playtest.json +274 -0
- package/templates/collectathon/playtests/ledge-angle.playtest.json +107 -0
- package/templates/collectathon/playtests/ledge-too-high.playtest.json +115 -0
- package/templates/collectathon/playtests/ledge.playtest.json +100 -0
- package/templates/collectathon/playtests/look.playtest.json +64 -0
- package/templates/collectathon/playtests/performance.playtest.json +55 -0
- package/templates/collectathon/playtests/stride.playtest.json +111 -0
- package/templates/collectathon/playtests/survives.playtest.json +123 -0
- package/templates/collectathon/playtests/telegraphs.playtest.json +132 -0
- package/templates/collectathon/playtests/thornback.playtest.json +157 -0
- package/templates/collectathon/playtests/wall-kick.playtest.json +206 -0
- package/templates/collectathon/playtests/win.playtest.json +166 -0
- package/templates/collectathon/public/favicon.svg +4 -0
- package/templates/collectathon/src/entities/Hero.ts +915 -0
- package/templates/collectathon/src/entities/Pickup.ts +63 -0
- package/templates/collectathon/src/entities/Walker.ts +248 -0
- package/templates/collectathon/src/game.ts +51 -0
- package/templates/collectathon/src/level/Course.ts +590 -0
- package/templates/collectathon/src/level/terrain.ts +144 -0
- package/templates/collectathon/src/main.ts +14 -0
- package/templates/collectathon/src/playtest-events.ts +15 -0
- package/templates/collectathon/src/render/camera.ts +163 -0
- package/templates/collectathon/src/render/castle.ts +408 -0
- package/templates/collectathon/src/render/effects.ts +284 -0
- package/templates/collectathon/src/render/foliage.ts +744 -0
- package/templates/collectathon/src/render/ground.ts +139 -0
- package/templates/collectathon/src/render/hero.ts +452 -0
- package/templates/collectathon/src/render/kitExposure.ts +20 -0
- package/templates/collectathon/src/render/lighting.ts +65 -0
- package/templates/collectathon/src/render/loading.ts +332 -0
- package/templates/collectathon/src/render/materials.ts +196 -0
- package/templates/collectathon/src/render/palette.ts +82 -0
- package/templates/collectathon/src/render/postprocessing.ts +79 -0
- package/templates/collectathon/src/render/props.ts +218 -0
- package/templates/collectathon/src/render/quality.ts +54 -0
- package/templates/collectathon/src/render/sky.ts +262 -0
- package/templates/collectathon/src/render/surface.ts +269 -0
- package/templates/collectathon/src/render/touch-controls.ts +179 -0
- package/templates/collectathon/src/render/touch-layout.ts +48 -0
- package/templates/collectathon/src/render/water.ts +191 -0
- package/templates/collectathon/src/scenes/Play.ts +481 -0
- package/templates/collectathon/src/state.ts +38 -0
- package/templates/collectathon/src/style.css +106 -0
- package/templates/collectathon/src/ui/App.tsx +22 -0
- package/templates/collectathon/src/ui/GameUi.tsx +20 -0
- package/templates/collectathon/src/ui/Hud.tsx +77 -0
- package/templates/collectathon/src/ui/Menu.tsx +13 -0
- package/templates/collectathon/src/ui/main.tsx +14 -0
- package/templates/collectathon/tailwind.config.ts +2 -0
- package/templates/collectathon/threenative.config.ts +62 -0
- package/templates/collectathon/tsconfig.json +17 -0
- package/templates/collectathon/vite.config.ts +49 -0
- package/templates/kart/.codex/config.toml +23 -0
- package/templates/kart/.cursor/mcp.json +38 -0
- package/templates/kart/.gemini/settings.json +38 -0
- package/templates/kart/.mcp.json +38 -0
- package/templates/kart/.vscode/mcp.json +43 -0
- package/templates/kart/.zed/settings.json +43 -0
- package/templates/kart/AGENTS.md +58 -0
- package/templates/kart/CLAUDE.md +60 -0
- package/templates/kart/index.html +14 -0
- package/templates/kart/kit.json +8 -0
- package/templates/kart/native-playtests/survives.playtest.json +65 -0
- package/templates/kart/opencode.json +49 -0
- package/templates/kart/package.json +64 -0
- package/templates/kart/playtests/drift.playtest.json +226 -0
- package/templates/kart/playtests/explore.playtest.json +45 -0
- package/templates/kart/playtests/hit-stays-above-road.playtest.json +92 -0
- package/templates/kart/playtests/item-key.playtest.json +108 -0
- package/templates/kart/playtests/items.playtest.json +143 -0
- package/templates/kart/playtests/lap-times.playtest.json +138 -0
- package/templates/kart/playtests/laps.playtest.json +149 -0
- package/templates/kart/playtests/performance.playtest.json +57 -0
- package/templates/kart/playtests/race.playtest.json +294 -0
- package/templates/kart/playtests/restart.playtest.json +87 -0
- package/templates/kart/playtests/rocket-start.playtest.json +56 -0
- package/templates/kart/playtests/smooth-drive.playtest.json +101 -0
- package/templates/kart/playtests/surfaces.playtest.json +113 -0
- package/templates/kart/playtests/survives.playtest.json +116 -0
- package/templates/kart/playtests/wall.playtest.json +118 -0
- package/templates/kart/public/favicon.svg +4 -0
- package/templates/kart/src/entities/Driver.ts +123 -0
- package/templates/kart/src/entities/Items.ts +194 -0
- package/templates/kart/src/entities/Kart.ts +517 -0
- package/templates/kart/src/game.ts +45 -0
- package/templates/kart/src/main.ts +14 -0
- package/templates/kart/src/playtest-events.ts +15 -0
- package/templates/kart/src/render/camera.ts +83 -0
- package/templates/kart/src/render/course.ts +579 -0
- package/templates/kart/src/render/effects.ts +266 -0
- package/templates/kart/src/render/items.ts +163 -0
- package/templates/kart/src/render/kart.ts +256 -0
- package/templates/kart/src/render/kitExposure.ts +20 -0
- package/templates/kart/src/render/lighting.ts +58 -0
- package/templates/kart/src/render/loading.ts +332 -0
- package/templates/kart/src/render/materials.ts +119 -0
- package/templates/kart/src/render/palette.ts +74 -0
- package/templates/kart/src/render/postprocessing.ts +79 -0
- package/templates/kart/src/render/quality.ts +54 -0
- package/templates/kart/src/render/skids.ts +86 -0
- package/templates/kart/src/render/sky.ts +105 -0
- package/templates/kart/src/render/touch-controls.ts +168 -0
- package/templates/kart/src/render/touch-layout.ts +48 -0
- package/templates/kart/src/scenes/Race.ts +850 -0
- package/templates/kart/src/state.ts +53 -0
- package/templates/kart/src/style.css +106 -0
- package/templates/kart/src/track/Course.ts +276 -0
- package/templates/kart/src/track/Race.ts +133 -0
- package/templates/kart/src/ui/App.tsx +21 -0
- package/templates/kart/src/ui/GameUi.tsx +20 -0
- package/templates/kart/src/ui/Hud.tsx +172 -0
- package/templates/kart/src/ui/Menu.tsx +13 -0
- package/templates/kart/src/ui/main.tsx +14 -0
- package/templates/kart/tailwind.config.ts +2 -0
- package/templates/kart/threenative.config.ts +62 -0
- package/templates/kart/tsconfig.json +17 -0
- package/templates/kart/vite.config.ts +49 -0
- package/templates/minimal/.codex/config.toml +6 -2
- package/templates/minimal/.cursor/mcp.json +8 -2
- package/templates/minimal/.gemini/settings.json +8 -2
- package/templates/minimal/.mcp.json +8 -2
- package/templates/minimal/.vscode/mcp.json +9 -2
- package/templates/minimal/.zed/settings.json +9 -2
- package/templates/minimal/AGENTS.md +11 -13
- package/templates/minimal/CLAUDE.md +11 -13
- package/templates/minimal/opencode.json +10 -2
- package/templates/minimal/package.json +14 -9
- package/templates/minimal/playtests/camera-wall.playtest.json +36 -0
- package/templates/minimal/playtests/jump.playtest.json +45 -0
- package/templates/minimal/playtests/play.playtest.json +1 -1
- package/templates/minimal/src/game.ts +2 -0
- package/templates/minimal/src/render/atmosphere.ts +444 -0
- package/templates/minimal/src/render/backlightMaterial.ts +49 -18
- package/templates/minimal/src/render/camera.ts +35 -4
- package/templates/minimal/src/render/clouds.ts +605 -0
- package/templates/minimal/src/render/exposure.ts +7 -111
- package/templates/minimal/src/render/gpuSky.ts +752 -0
- package/templates/minimal/src/render/lighting.ts +26 -4
- package/templates/minimal/src/render/materialLighting.ts +2 -10
- package/templates/minimal/src/render/postprocessing.ts +4 -4
- package/templates/minimal/src/render/quality.ts +10 -116
- package/templates/minimal/src/render/sky.ts +73 -1
- package/templates/minimal/src/scenes/Play.ts +18 -7
- package/templates/platformer/.codex/config.toml +6 -2
- package/templates/platformer/.cursor/mcp.json +8 -2
- package/templates/platformer/.gemini/settings.json +8 -2
- package/templates/platformer/.mcp.json +8 -2
- package/templates/platformer/.vscode/mcp.json +9 -2
- package/templates/platformer/.zed/settings.json +9 -2
- package/templates/platformer/AGENTS.md +13 -9
- package/templates/platformer/CLAUDE.md +13 -9
- package/templates/platformer/opencode.json +10 -2
- package/templates/platformer/package.json +15 -10
- package/templates/platformer/playtests/dash-jump.playtest.json +34 -0
- package/templates/platformer/playtests/finish.playtest.json +58 -0
- package/templates/platformer/playtests/idle.playtest.json +44 -0
- package/templates/platformer/playtests/performance.playtest.json +1 -1
- package/templates/platformer/src/entities/Fox.ts +19 -6
- package/templates/platformer/src/game.ts +1 -0
- package/templates/platformer/src/level/Stage.ts +4 -1
- package/templates/platformer/src/render/backlightMaterial.ts +49 -18
- package/templates/platformer/src/render/camera.ts +30 -1
- package/templates/platformer/src/render/exposure.ts +6 -111
- package/templates/platformer/src/render/fox.ts +5 -2
- package/templates/platformer/src/render/kitExposure.ts +20 -0
- package/templates/platformer/src/render/materialLighting.ts +2 -11
- package/templates/platformer/src/render/postprocessing.ts +4 -4
- package/templates/platformer/src/render/props.ts +1 -2
- package/templates/platformer/src/render/quality.ts +10 -118
- package/templates/platformer/src/scenes/Play.ts +31 -15
- package/templates/platformer/src/ui/Menu.tsx +1 -1
- package/templates/puzzle/.codex/config.toml +6 -2
- package/templates/puzzle/.cursor/mcp.json +8 -2
- package/templates/puzzle/.gemini/settings.json +8 -2
- package/templates/puzzle/.mcp.json +8 -2
- package/templates/puzzle/.vscode/mcp.json +9 -2
- package/templates/puzzle/.zed/settings.json +9 -2
- package/templates/puzzle/AGENTS.md +14 -17
- package/templates/puzzle/CLAUDE.md +14 -17
- package/templates/puzzle/opencode.json +10 -2
- package/templates/puzzle/package.json +15 -10
- package/templates/puzzle/playtests/performance.playtest.json +1 -1
- package/templates/puzzle/playtests/replay-keeps-progress.playtest.json +78 -0
- package/templates/puzzle/src/render/backlightMaterial.ts +49 -18
- package/templates/puzzle/src/render/exposure.ts +11 -109
- package/templates/puzzle/src/render/lighting.ts +3 -3
- package/templates/puzzle/src/render/materialLighting.ts +2 -11
- package/templates/puzzle/src/render/palette.ts +1 -1
- package/templates/puzzle/src/render/postprocessing.ts +4 -4
- package/templates/puzzle/src/render/quality.ts +44 -153
- package/templates/puzzle/src/render/vault.ts +18 -6
- package/templates/puzzle/src/scenes/Play.ts +6 -1
- package/templates/puzzle/src/ui/Hud.tsx +8 -43
- package/templates/racing/.codex/config.toml +6 -2
- package/templates/racing/.cursor/mcp.json +8 -2
- package/templates/racing/.gemini/settings.json +8 -2
- package/templates/racing/.mcp.json +8 -2
- package/templates/racing/.vscode/mcp.json +9 -2
- package/templates/racing/.zed/settings.json +9 -2
- package/templates/racing/AGENTS.md +10 -12
- package/templates/racing/CLAUDE.md +10 -12
- package/templates/racing/opencode.json +10 -2
- package/templates/racing/package.json +15 -10
- package/templates/racing/playtests/brake.playtest.json +54 -0
- package/templates/racing/playtests/outcome.playtest.json +19 -0
- package/templates/racing/playtests/performance.playtest.json +1 -1
- package/templates/racing/playtests/stopped-car-is-not-rescued.playtest.json +59 -0
- package/templates/racing/src/entities/RacingCar.ts +12 -3
- package/templates/racing/src/entities/Rival.ts +11 -2
- package/templates/racing/src/render/atmosphere.ts +444 -0
- package/templates/racing/src/render/backlightMaterial.ts +49 -18
- package/templates/racing/src/render/clouds.ts +605 -0
- package/templates/racing/src/render/exposure.ts +6 -111
- package/templates/racing/src/render/gpuSky.ts +752 -0
- package/templates/racing/src/render/kitExposure.ts +20 -0
- package/templates/racing/src/render/lighting.ts +26 -4
- package/templates/racing/src/render/materialLighting.ts +2 -11
- package/templates/racing/src/render/materials.ts +2 -1
- package/templates/racing/src/render/postprocessing.ts +4 -4
- package/templates/racing/src/render/quality.ts +27 -115
- package/templates/racing/src/render/sky.ts +72 -1
- package/templates/racing/src/scenes/Race.ts +9 -7
- package/templates/racing/src/track/TrackSector.ts +5 -2
- package/templates/racing/src/ui/Hud.tsx +12 -7
- package/templates/rain/.codex/config.toml +6 -2
- package/templates/rain/.cursor/mcp.json +8 -2
- package/templates/rain/.gemini/settings.json +8 -2
- package/templates/rain/.mcp.json +8 -2
- package/templates/rain/.vscode/mcp.json +9 -2
- package/templates/rain/.zed/settings.json +9 -2
- package/templates/rain/AGENTS.md +12 -12
- package/templates/rain/CLAUDE.md +12 -12
- package/templates/rain/opencode.json +10 -2
- package/templates/rain/package.json +14 -9
- package/templates/rain/playtests/performance.playtest.json +1 -1
- package/templates/rain/src/game.ts +1 -1
- package/templates/rain/src/render/bloom-shader.ts +1 -1
- package/templates/rain/src/render/clouds-shader.ts +2 -2
- package/templates/rain/src/render/clouds.ts +2 -1
- package/templates/rain/src/render/exposure.ts +11 -109
- package/templates/rain/src/render/post-shader.ts +7 -11
- package/templates/rain/src/render/postprocessing.ts +8 -24
- package/templates/rain/src/render/quality.ts +44 -98
- package/templates/rain/src/render/world-shader.ts +281 -97
- package/templates/rain/src/render/world.ts +82 -2
- package/templates/rain/src/style.css +1 -1
- package/templates/rain/src/ui/GameUi.tsx +6 -2
- package/templates/rain/src/ui/Hud.tsx +1 -1
- package/templates/rain/tools/generate-shaders.mjs +2 -2
- package/templates/rain/tools/tempest-post.frag +4 -6
- package/templates/rain/tools/tempest-world.frag +80 -12
- package/templates/rts/.codex/config.toml +6 -2
- package/templates/rts/.cursor/mcp.json +8 -2
- package/templates/rts/.gemini/settings.json +8 -2
- package/templates/rts/.mcp.json +8 -2
- package/templates/rts/.vscode/mcp.json +9 -2
- package/templates/rts/.zed/settings.json +9 -2
- package/templates/rts/AGENTS.md +15 -16
- package/templates/rts/CLAUDE.md +15 -16
- package/templates/rts/opencode.json +10 -2
- package/templates/rts/package.json +14 -9
- package/templates/rts/playtests/performance.playtest.json +1 -1
- package/templates/rts/playtests/rts-attack.playtest.json +5 -0
- package/templates/rts/playtests/rts-build.playtest.json +20 -1
- package/templates/rts/playtests/rts-orders.playtest.json +1 -1
- package/templates/rts/playtests/rts-pause.playtest.json +112 -0
- package/templates/rts/playtests/rts-train.playtest.json +1 -1
- package/templates/rts/playtests/rts-zoom.playtest.json +81 -0
- package/templates/rts/src/game.ts +29 -7
- package/templates/rts/src/render/army.ts +181 -49
- package/templates/rts/src/render/backlightMaterial.ts +49 -18
- package/templates/rts/src/render/environment.ts +276 -0
- package/templates/rts/src/render/exposure.ts +3 -65
- package/templates/rts/src/render/ground.ts +478 -0
- package/templates/rts/src/render/lighting.ts +62 -11
- package/templates/rts/src/render/materialLighting.ts +2 -11
- package/templates/rts/src/render/materials.ts +47 -118
- package/templates/rts/src/render/palette.ts +30 -13
- package/templates/rts/src/render/picking.ts +18 -0
- package/templates/rts/src/render/postprocessing.ts +4 -4
- package/templates/rts/src/render/quality.ts +64 -85
- package/templates/rts/src/render/resources.ts +21 -22
- package/templates/rts/src/render/sky.ts +9 -12
- package/templates/rts/src/render/terrain.ts +36 -11
- package/templates/rts/src/scenes/Play.ts +373 -38
- package/templates/rts/src/sim/ai.ts +0 -11
- package/templates/rts/src/state.ts +46 -0
- package/templates/rts/src/style.css +1543 -0
- package/templates/rts/src/ui/Commands.tsx +204 -107
- package/templates/rts/src/ui/GameUi.tsx +12 -5
- package/templates/rts/src/ui/Hud.tsx +611 -116
- package/templates/rts/src/ui/Minimap.tsx +103 -37
- package/templates/rts/src/ui/icons.tsx +116 -0
- package/templates/rts/src/ui/labels.ts +73 -0
- package/templates/rts/src/ui/minimapPoint.ts +30 -0
- package/templates/rts/threenative.config.ts +1 -1
- package/templates/runner/.codex/config.toml +6 -2
- package/templates/runner/.cursor/mcp.json +8 -2
- package/templates/runner/.gemini/settings.json +8 -2
- package/templates/runner/.mcp.json +8 -2
- package/templates/runner/.vscode/mcp.json +9 -2
- package/templates/runner/.zed/settings.json +9 -2
- package/templates/runner/AGENTS.md +12 -12
- package/templates/runner/CLAUDE.md +12 -12
- package/templates/runner/opencode.json +10 -2
- package/templates/runner/package.json +15 -10
- package/templates/runner/playtests/near-miss.playtest.json +48 -0
- package/templates/runner/playtests/performance.playtest.json +2 -2
- package/templates/runner/playtests/stride.playtest.json +27 -0
- package/templates/runner/playtests/survives.playtest.json +2 -2
- package/templates/runner/src/conventions.ts +3 -1
- package/templates/runner/src/entities/Runner.ts +11 -5
- package/templates/runner/src/render/atmosphere.ts +444 -0
- package/templates/runner/src/render/backlightMaterial.ts +49 -18
- package/templates/runner/src/render/clouds.ts +605 -0
- package/templates/runner/src/render/exposure.ts +6 -111
- package/templates/runner/src/render/gpuSky.ts +752 -0
- package/templates/runner/src/render/kitExposure.ts +20 -0
- package/templates/runner/src/render/lighting.ts +26 -4
- package/templates/runner/src/render/materialLighting.ts +2 -11
- package/templates/runner/src/render/postprocessing.ts +4 -4
- package/templates/runner/src/render/quality.ts +26 -114
- package/templates/runner/src/render/sky.ts +73 -1
- package/templates/runner/src/scenes/Run.ts +19 -15
- package/templates/runner/src/track.ts +12 -3
- package/templates/sailing/.codex/config.toml +6 -2
- package/templates/sailing/.cursor/mcp.json +8 -2
- package/templates/sailing/.gemini/settings.json +8 -2
- package/templates/sailing/.mcp.json +8 -2
- package/templates/sailing/.vscode/mcp.json +9 -2
- package/templates/sailing/.zed/settings.json +9 -2
- package/templates/sailing/AGENTS.md +10 -11
- package/templates/sailing/CLAUDE.md +10 -11
- package/templates/sailing/opencode.json +10 -2
- package/templates/sailing/package.json +15 -10
- package/templates/sailing/playtests/fail.playtest.json +46 -5
- package/templates/sailing/playtests/float-after-the-run-ends.playtest.json +7 -0
- package/templates/sailing/playtests/performance.playtest.json +1 -1
- package/templates/sailing/src/game.ts +1 -0
- package/templates/sailing/src/render/backlightMaterial.ts +49 -18
- package/templates/sailing/src/render/exposure.ts +6 -111
- package/templates/sailing/src/render/kitExposure.ts +20 -0
- package/templates/sailing/src/render/materialLighting.ts +2 -11
- package/templates/sailing/src/render/ocean.ts +0 -1
- package/templates/sailing/src/render/postprocessing.ts +4 -4
- package/templates/sailing/src/render/quality.ts +31 -138
- package/templates/sailing/src/scenes/Sailing.ts +12 -4
- package/templates/sailing/src/ui/Hud.tsx +6 -2
- package/templates/sailing/src/ui/Menu.tsx +1 -1
- package/templates/shooter/.codex/config.toml +6 -2
- package/templates/shooter/.cursor/mcp.json +8 -2
- package/templates/shooter/.gemini/settings.json +8 -2
- package/templates/shooter/.mcp.json +8 -2
- package/templates/shooter/.vscode/mcp.json +9 -2
- package/templates/shooter/.zed/settings.json +9 -2
- package/templates/shooter/AGENTS.md +13 -12
- package/templates/shooter/CLAUDE.md +13 -12
- package/templates/shooter/index.html +1 -1
- package/templates/shooter/main.html +13 -0
- package/templates/shooter/opencode.json +10 -2
- package/templates/shooter/package.json +15 -10
- package/templates/shooter/playtests/breakable-shatters.playtest.json +6 -0
- package/templates/shooter/playtests/enemy-body-is-a-body.playtest.json +6 -0
- package/templates/shooter/playtests/hands-authored-rate.playtest.json +54 -0
- package/templates/shooter/playtests/movement-eases.playtest.json +53 -0
- package/templates/shooter/playtests/performance.playtest.json +3 -3
- package/templates/shooter/playtests/stairs-smooth-the-eye.playtest.json +56 -0
- package/templates/shooter/playtests/weapon-sharp-while-turning.playtest.json +206 -0
- package/templates/shooter/src/entities/Breakables.ts +34 -10
- package/templates/shooter/src/entities/Enemy.ts +176 -54
- package/templates/shooter/src/entities/FpsPlayer.ts +55 -16
- package/templates/shooter/src/entities/Rifle.ts +83 -9
- package/templates/shooter/src/entities/movement.ts +96 -0
- package/templates/shooter/src/render/atmosphere.ts +444 -0
- package/templates/shooter/src/render/backlightMaterial.ts +49 -18
- package/templates/shooter/src/render/camera.ts +3 -1
- package/templates/shooter/src/render/clouds.ts +605 -0
- package/templates/shooter/src/render/exposure.ts +10 -109
- package/templates/shooter/src/render/facade.ts +26 -68
- package/templates/shooter/src/render/gpuSky.ts +752 -0
- package/templates/shooter/src/render/lighting.ts +27 -4
- package/templates/shooter/src/render/materialAssignments.ts +9 -1
- package/templates/shooter/src/render/materialLighting.ts +2 -11
- package/templates/shooter/src/render/occlusion.ts +13 -4
- package/templates/shooter/src/render/palette.ts +1 -0
- package/templates/shooter/src/render/postprocessing.ts +4 -4
- package/templates/shooter/src/render/quality.ts +50 -108
- package/templates/shooter/src/render/scale.ts +0 -11
- package/templates/shooter/src/render/sky.ts +103 -2
- package/templates/shooter/src/render/surface.ts +140 -0
- package/templates/shooter/src/render/town.ts +3 -6
- package/templates/shooter/src/render/townMaterials.ts +95 -42
- package/templates/shooter/src/render/vehicles.ts +2 -0
- package/templates/shooter/src/scenes/Play.ts +83 -23
- package/templates/shooter/src/ui/Hud.tsx +268 -193
- package/templates/shooter/src/worker-page.ts +29 -0
- package/templates/shooter/src/worker.ts +5 -0
- package/templates/shooter/threenative.config.ts +3 -0
- package/templates/shooter/vite.config.ts +2 -0
- package/templates/snow/.codex/config.toml +6 -2
- package/templates/snow/.cursor/mcp.json +8 -2
- package/templates/snow/.gemini/settings.json +8 -2
- package/templates/snow/.mcp.json +8 -2
- package/templates/snow/.vscode/mcp.json +9 -2
- package/templates/snow/.zed/settings.json +9 -2
- package/templates/snow/AGENTS.md +12 -10
- package/templates/snow/CLAUDE.md +12 -10
- package/templates/snow/opencode.json +10 -2
- package/templates/snow/package.json +15 -10
- package/templates/snow/playtests/performance.playtest.json +1 -1
- package/templates/snow/src/render/backlightMaterial.ts +49 -18
- package/templates/snow/src/render/exposure.ts +17 -106
- package/templates/snow/src/render/materialLighting.ts +2 -11
- package/templates/snow/src/render/postprocessing.ts +11 -5
- package/templates/snow/src/render/quality.ts +46 -126
- package/templates/snow/src/render/snowSurface.ts +32 -15
- package/templates/snow/src/scenes/Snow.ts +2 -1
- package/templates/starter/.codex/config.toml +6 -2
- package/templates/starter/.cursor/mcp.json +8 -2
- package/templates/starter/.gemini/settings.json +8 -2
- package/templates/starter/.mcp.json +8 -2
- package/templates/starter/.vscode/mcp.json +9 -2
- package/templates/starter/.zed/settings.json +9 -2
- package/templates/starter/AGENTS.md +18 -14
- package/templates/starter/CLAUDE.md +18 -14
- package/templates/starter/index.html +1 -1
- package/templates/starter/main.html +12 -0
- package/templates/starter/native-playtests/react-hud.playtest.json +1 -0
- package/templates/starter/native-playtests/render-chain.playtest.json +34 -21
- package/templates/starter/opencode.json +10 -2
- package/templates/starter/package.json +15 -10
- package/templates/starter/playtests/play.playtest.json +22 -2
- package/templates/starter/playtests/production-readiness.playtest.json +14 -0
- package/templates/starter/src/entities/Crate.ts +19 -1
- package/templates/starter/src/render/arena.ts +2 -2
- package/templates/starter/src/render/atmosphere.ts +444 -0
- package/templates/starter/src/render/backlightMaterial.ts +49 -18
- package/templates/starter/src/render/camera.ts +28 -0
- package/templates/starter/src/render/clouds.ts +605 -0
- package/templates/starter/src/render/contactShadow.ts +50 -0
- package/templates/starter/src/render/exposure.ts +9 -111
- package/templates/starter/src/render/gpuSky.ts +752 -0
- package/templates/starter/src/render/grade.ts +1 -1
- package/templates/starter/src/render/lighting.ts +34 -6
- package/templates/starter/src/render/materialLighting.ts +2 -11
- package/templates/starter/src/render/postprocessing.ts +27 -14
- package/templates/starter/src/render/quality.ts +18 -147
- package/templates/starter/src/render/sky.ts +90 -40
- package/templates/starter/src/render/temporalAA.ts +1 -1
- package/templates/starter/src/render/temporalAAStage.ts +1 -1
- package/templates/starter/src/render/temporalCurrentFootprint.ts +0 -1
- package/templates/starter/src/render/temporalDetailStage.ts +106 -0
- package/templates/starter/src/render/temporalRejectionCounter.ts +2 -2
- package/templates/starter/src/render/volumetricFogCamera.ts +32 -0
- package/templates/starter/src/render/volumetricFogOptions.ts +7 -0
- package/templates/starter/src/render/volumetricFogTransport.ts +27 -19
- package/templates/starter/src/render/volumetricFogVolume.ts +31 -7
- package/templates/starter/src/scenes/Play.ts +11 -8
- package/templates/starter/src/ui/Hud.tsx +1 -1
- package/templates/starter/src/worker-page.ts +29 -0
- package/templates/starter/src/worker.ts +5 -0
- package/templates/starter/vite.config.ts +2 -0
- package/templates/tower-defense/.codex/config.toml +6 -2
- package/templates/tower-defense/.cursor/mcp.json +8 -2
- package/templates/tower-defense/.gemini/settings.json +8 -2
- package/templates/tower-defense/.mcp.json +8 -2
- package/templates/tower-defense/.vscode/mcp.json +9 -2
- package/templates/tower-defense/.zed/settings.json +9 -2
- package/templates/tower-defense/AGENTS.md +10 -12
- package/templates/tower-defense/CLAUDE.md +10 -12
- package/templates/tower-defense/opencode.json +10 -2
- package/templates/tower-defense/package.json +15 -10
- package/templates/tower-defense/playtests/chill-tint.playtest.json +387 -0
- package/templates/tower-defense/playtests/performance.playtest.json +1 -1
- package/templates/tower-defense/src/enemies/Enemy.ts +9 -0
- package/templates/tower-defense/src/render/backlightMaterial.ts +49 -18
- package/templates/tower-defense/src/render/exposure.ts +11 -109
- package/templates/tower-defense/src/render/lighting.ts +4 -2
- package/templates/tower-defense/src/render/materialLighting.ts +2 -11
- package/templates/tower-defense/src/render/postprocessing.ts +4 -4
- package/templates/tower-defense/src/render/quality.ts +10 -116
- package/templates/tower-defense/src/render/sky.ts +2 -2
- package/templates/tower-defense/src/scenes/Battle.ts +4 -0
- package/template-assets/autoExposure.ts +0 -225
- package/template-assets/exposureGraph.ts +0 -178
- package/template-assets/exposureReadback.ts +0 -79
- package/template-assets/worldEnvironment.ts +0 -1212
- package/templates/action-rpg/src/render/autoExposure.ts +0 -225
- package/templates/action-rpg/src/render/exposureGraph.ts +0 -178
- package/templates/action-rpg/src/render/exposureReadback.ts +0 -79
- package/templates/action-rpg/src/render/worldEnvironment.ts +0 -1212
- package/templates/minimal/src/render/autoExposure.ts +0 -225
- package/templates/minimal/src/render/exposureGraph.ts +0 -178
- package/templates/minimal/src/render/exposureReadback.ts +0 -79
- package/templates/minimal/src/render/worldEnvironment.ts +0 -1212
- package/templates/platformer/src/render/autoExposure.ts +0 -225
- package/templates/platformer/src/render/exposureGraph.ts +0 -178
- package/templates/platformer/src/render/exposureReadback.ts +0 -79
- package/templates/platformer/src/render/worldEnvironment.ts +0 -1212
- package/templates/puzzle/src/render/autoExposure.ts +0 -225
- package/templates/puzzle/src/render/exposureGraph.ts +0 -178
- package/templates/puzzle/src/render/exposureReadback.ts +0 -79
- package/templates/puzzle/src/render/worldEnvironment.ts +0 -1212
- package/templates/racing/src/render/autoExposure.ts +0 -225
- package/templates/racing/src/render/exposureGraph.ts +0 -178
- package/templates/racing/src/render/exposureReadback.ts +0 -79
- package/templates/racing/src/render/worldEnvironment.ts +0 -1212
- package/templates/rain/src/render/autoExposure.ts +0 -225
- package/templates/rain/src/render/exposureGraph.ts +0 -178
- package/templates/rain/src/render/exposureReadback.ts +0 -79
- package/templates/rain/src/render/worldEnvironment.ts +0 -1212
- package/templates/rts/src/render/autoExposure.ts +0 -225
- package/templates/rts/src/render/exposureGraph.ts +0 -178
- package/templates/rts/src/render/exposureReadback.ts +0 -79
- package/templates/rts/src/render/worldEnvironment.ts +0 -1212
- package/templates/runner/src/render/autoExposure.ts +0 -225
- package/templates/runner/src/render/exposureGraph.ts +0 -178
- package/templates/runner/src/render/exposureReadback.ts +0 -79
- package/templates/runner/src/render/worldEnvironment.ts +0 -1212
- package/templates/sailing/src/render/autoExposure.ts +0 -225
- package/templates/sailing/src/render/exposureGraph.ts +0 -178
- package/templates/sailing/src/render/exposureReadback.ts +0 -79
- package/templates/sailing/src/render/worldEnvironment.ts +0 -1212
- package/templates/shooter/src/render/autoExposure.ts +0 -225
- package/templates/shooter/src/render/exposureGraph.ts +0 -178
- package/templates/shooter/src/render/exposureReadback.ts +0 -79
- package/templates/shooter/src/render/worldEnvironment.ts +0 -1212
- package/templates/snow/src/render/autoExposure.ts +0 -225
- package/templates/snow/src/render/exposureGraph.ts +0 -178
- package/templates/snow/src/render/exposureReadback.ts +0 -79
- package/templates/snow/src/render/worldEnvironment.ts +0 -1212
- package/templates/starter/src/render/autoExposure.ts +0 -225
- package/templates/starter/src/render/exposureGraph.ts +0 -178
- package/templates/starter/src/render/exposureReadback.ts +0 -79
- package/templates/starter/src/render/worldEnvironment.ts +0 -1212
- package/templates/tower-defense/src/render/autoExposure.ts +0 -225
- package/templates/tower-defense/src/render/exposureGraph.ts +0 -178
- package/templates/tower-defense/src/render/exposureReadback.ts +0 -79
- package/templates/tower-defense/src/render/worldEnvironment.ts +0 -1212
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Generated for you. This is ordinary Three.js — edit or delete it freely.
|
|
2
|
+
// ThreeNative does not read this file.
|
|
3
|
+
//
|
|
4
|
+
// `palette` is the six roles the render layer shares: the two sky bands, the haze the distance
|
|
5
|
+
// fades into, the meadow and the stone the world is made of, and one saturated `accent` for
|
|
6
|
+
// everything Wren can use — chests, the key, the lock-on reticle, the heart vessel.
|
|
7
|
+
//
|
|
8
|
+
// `C` is this game's colour table for the procedural models, named per part, so recolouring
|
|
9
|
+
// Wren's cloak never touches a rock.
|
|
10
|
+
|
|
11
|
+
export const palette = {
|
|
12
|
+
/** The bright mist above the canopy, and the loading screen's progress track. */
|
|
13
|
+
skyHigh: 0xd2e2da,
|
|
14
|
+
/** The haze just above the trees, and the loading screen's background. */
|
|
15
|
+
skyLow: 0xa9c4b8,
|
|
16
|
+
/** Distance fades into this: a cool teal-green forest mist. */
|
|
17
|
+
horizon: 0x8fae9f,
|
|
18
|
+
grass: 0x4c6a2a,
|
|
19
|
+
stone: 0x7d7a6c,
|
|
20
|
+
/** The one saturated role: what the player can take or use. */
|
|
21
|
+
accent: 0xf2b33d,
|
|
22
|
+
} as const;
|
|
23
|
+
|
|
24
|
+
export const C = {
|
|
25
|
+
grassDark: 0x4e7a2a,
|
|
26
|
+
grassTip: 0x7f9e44,
|
|
27
|
+
dirt: 0x8b6a48,
|
|
28
|
+
path: 0xb39a72,
|
|
29
|
+
stoneDark: 0x5d5a52,
|
|
30
|
+
moss: 0x5c7f33,
|
|
31
|
+
mossLight: 0x4e6e2c,
|
|
32
|
+
flagstone: 0x6b675e,
|
|
33
|
+
flagstoneDark: 0x5c5850,
|
|
34
|
+
flagstoneLight: 0x7a766b,
|
|
35
|
+
grout: 0x2a2724,
|
|
36
|
+
bark: 0x5a4130,
|
|
37
|
+
leaf: 0x3f7a35,
|
|
38
|
+
leafLight: 0x6aa046,
|
|
39
|
+
wood: 0x9b6a3c,
|
|
40
|
+
woodDark: 0x6b4426,
|
|
41
|
+
iron: 0x4a4d52,
|
|
42
|
+
pine: 0x2f5a32,
|
|
43
|
+
pineLight: 0x46743c,
|
|
44
|
+
deadwood: 0x8a8274,
|
|
45
|
+
woodRing: 0xc49a6a,
|
|
46
|
+
bush: 0x3a6b2e,
|
|
47
|
+
fern: 0x4f8a3a,
|
|
48
|
+
grassTall: 0x7ea548,
|
|
49
|
+
litter: 0x8a6236,
|
|
50
|
+
ivy: 0x2f5a2a,
|
|
51
|
+
flowerGold: 0xf0c23a,
|
|
52
|
+
flowerWhite: 0xf2efe6,
|
|
53
|
+
flowerViolet: 0x9a6ad0,
|
|
54
|
+
mushroomStem: 0xe9dcc4,
|
|
55
|
+
mushroomCap: 0xc0392b,
|
|
56
|
+
/** A firefly's glow: an emissive colour, never a light. */
|
|
57
|
+
firefly: 0xd9ff7a,
|
|
58
|
+
brass: 0xc79a3a,
|
|
59
|
+
|
|
60
|
+
// The forest floor, the old trees and the hut
|
|
61
|
+
soil: 0x33271c,
|
|
62
|
+
soilWet: 0x2a2a20,
|
|
63
|
+
forestMoss: 0x3e5820,
|
|
64
|
+
mossBright: 0x4f6c26,
|
|
65
|
+
cliff: 0x4e5446,
|
|
66
|
+
rock: 0x6c6b5f,
|
|
67
|
+
flagstone2: 0x6a665b,
|
|
68
|
+
barkDeep: 0x2e231b,
|
|
69
|
+
leafDeep: 0x2f5a22,
|
|
70
|
+
leafSun: 0x6e9a32,
|
|
71
|
+
broadleaf: 0x2f6a2a,
|
|
72
|
+
flowerPink: 0xe07ab8,
|
|
73
|
+
thatch: 0xb08a4a,
|
|
74
|
+
thatchDark: 0x7a5a2e,
|
|
75
|
+
hutDoor: 0x4a3020,
|
|
76
|
+
lanternGlow: 0xffb055,
|
|
77
|
+
pitcher: 0xff8a2a,
|
|
78
|
+
water: 0x1c3534,
|
|
79
|
+
/** The companion orb: a soft white-blue light of its own. */
|
|
80
|
+
orb: 0xcfe6ff,
|
|
81
|
+
|
|
82
|
+
// Wren
|
|
83
|
+
tunic: 0xa0502c,
|
|
84
|
+
tunicTrim: 0xd29b3e,
|
|
85
|
+
/** The tunic's hem band: a muted ochre, cloth rather than gold. */
|
|
86
|
+
hem: 0xa8793a,
|
|
87
|
+
undershirt: 0xe9dcc0,
|
|
88
|
+
cap: 0x30448a,
|
|
89
|
+
capDark: 0x1e2b5a,
|
|
90
|
+
/** The hood's lining, rolled over the edge of the opening. */
|
|
91
|
+
capLining: 0x5a72b4,
|
|
92
|
+
trousers: 0x7a7458,
|
|
93
|
+
bootCuff: 0x8f6a45,
|
|
94
|
+
skin: 0xe8b98f,
|
|
95
|
+
/** The skin's own faint warmth, added in shade. */
|
|
96
|
+
skinGlow: 0x4a2416,
|
|
97
|
+
mouth: 0x9a5444,
|
|
98
|
+
hair: 0x5b3320,
|
|
99
|
+
hairLight: 0x7a4428,
|
|
100
|
+
sclera: 0xe6ded0,
|
|
101
|
+
iris: 0x2e2014,
|
|
102
|
+
lid: 0x24160e,
|
|
103
|
+
blush: 0xe3a083,
|
|
104
|
+
gloves: 0x9a6238,
|
|
105
|
+
belt: 0x47301e,
|
|
106
|
+
sole: 0x2a1d14,
|
|
107
|
+
leather: 0x6b4a2e,
|
|
108
|
+
blade: 0xd8dde3,
|
|
109
|
+
ember: 0xff7a2a,
|
|
110
|
+
shield: 0x8a5a32,
|
|
111
|
+
lamp: 0xffd27a,
|
|
112
|
+
/** The slash arc and the shield's block flash: additive, so they read under any exposure. */
|
|
113
|
+
slash: 0xffb35a,
|
|
114
|
+
flash: 0xfff1c2,
|
|
115
|
+
|
|
116
|
+
// Mosslings, the Warden, the dummies
|
|
117
|
+
mossBody: 0x6d9a3a,
|
|
118
|
+
mossBelly: 0xb9c97a,
|
|
119
|
+
eye: 0x1c1a14,
|
|
120
|
+
eyeGlow: 0xffe08a,
|
|
121
|
+
wardenStone: 0x575550,
|
|
122
|
+
flickerFur: 0x4a3a5c,
|
|
123
|
+
flickerBelly: 0x8a7a92,
|
|
124
|
+
flickerWing: 0x2e2238,
|
|
125
|
+
/** The red the Flicker's and the Thornback's eyes burn before they strike. */
|
|
126
|
+
flickerTell: 0xff3b2a,
|
|
127
|
+
thornShell: 0x4a3626,
|
|
128
|
+
thornBelly: 0x7a8a4a,
|
|
129
|
+
thorn: 0xd9cfae,
|
|
130
|
+
/** The Thornback's rump sac: the one place a cut lands. */
|
|
131
|
+
thornWeak: 0xb6ff6a,
|
|
132
|
+
wardenRune: 0x6fd6ff,
|
|
133
|
+
straw: 0xd4b257,
|
|
134
|
+
|
|
135
|
+
heart: 0xe5484d,
|
|
136
|
+
reticle: 0xffcf4a,
|
|
137
|
+
} as const;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Generated for you. This file wires two things together and decides nothing itself.
|
|
2
|
+
//
|
|
3
|
+
// `quality.ts`, in this folder, owns which overrides each tier adds to the engine's look.
|
|
4
|
+
// `WorldEnvironment` from the engine core builds the chain and prints `TN_RENDER_CHAIN` and
|
|
5
|
+
// `TN_WORLD_ENVIRONMENT`, naming every stage as applied or refused **with a reason**, so a stage
|
|
6
|
+
// that silently no-op'd is never mistaken for one you turned off.
|
|
7
|
+
//
|
|
8
|
+
// To force one tier for one run — a desktop that is dropping frames, a capture you want to
|
|
9
|
+
// compare — pass it: `setupPost(renderer, scene, camera, { tier: "low" })`. Overriding does not
|
|
10
|
+
// silence the report: `TN_QUALITY_TIER` names the tier that ran either way.
|
|
11
|
+
import { type OutputRenderer, WorldEnvironment } from "@threenative/core";
|
|
12
|
+
import type { Camera, DirectionalLight, Scene } from "three";
|
|
13
|
+
import { type QualityTier, qualityPreset, resolveQualityTier } from "./quality.js";
|
|
14
|
+
|
|
15
|
+
import { temporalDetailRequested, temporalDetailStages } from "./temporalDetailStage.js";
|
|
16
|
+
|
|
17
|
+
type ProfileGlobals = typeof globalThis & {
|
|
18
|
+
__THREENATIVE_PROFILE__?: { hostedSoftware?: unknown };
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export function setupPost(
|
|
22
|
+
renderer: OutputRenderer,
|
|
23
|
+
scene: Scene,
|
|
24
|
+
camera: Camera,
|
|
25
|
+
environment: {
|
|
26
|
+
godraysLight?: DirectionalLight;
|
|
27
|
+
mobile?: boolean;
|
|
28
|
+
/** The renderer named a software adapter; this game's answer is its `low` tier. */
|
|
29
|
+
software?: boolean;
|
|
30
|
+
/** The renderer's GPU family (`ctx.renderer.gpuClass?.class`); it picks the start tier. */
|
|
31
|
+
gpuClass?: string;
|
|
32
|
+
/** Forces a tier, ignoring `mobile`. An unknown name throws rather than falling back. */
|
|
33
|
+
tier?: QualityTier;
|
|
34
|
+
} = {},
|
|
35
|
+
): { readonly tier: QualityTier; dispose(): void } {
|
|
36
|
+
// The native production collector explicitly marks a software-only hosted smoke run; that run
|
|
37
|
+
// takes the `low` look so its screenshot settles on a CPU adapter. An ordinary desktop is `high`.
|
|
38
|
+
const hostedSoftware =
|
|
39
|
+
(globalThis as ProfileGlobals).__THREENATIVE_PROFILE__?.hostedSoftware === true;
|
|
40
|
+
const tier = resolveQualityTier({
|
|
41
|
+
mobile: environment.mobile,
|
|
42
|
+
gpuClass: environment.gpuClass,
|
|
43
|
+
software: environment.software,
|
|
44
|
+
tier: environment.tier ?? (hostedSoftware ? "low" : undefined),
|
|
45
|
+
});
|
|
46
|
+
const source =
|
|
47
|
+
environment.tier !== undefined ? "override" : hostedSoftware ? "hosted-software" : "platform";
|
|
48
|
+
console.info(
|
|
49
|
+
`TN_QUALITY_TIER ${tier} mobile=${environment.mobile === true} software=${
|
|
50
|
+
environment.software === true
|
|
51
|
+
} source=${source}`,
|
|
52
|
+
);
|
|
53
|
+
const settings = qualityPreset(tier);
|
|
54
|
+
const detail = temporalDetailRequested(renderer, settings) ? temporalDetailStages() : [];
|
|
55
|
+
const world = new WorldEnvironment({
|
|
56
|
+
...settings,
|
|
57
|
+
authoredStageNames: [...(settings.authoredStageNames ?? []), ...detail.map(({ name }) => name)],
|
|
58
|
+
authoredStages: () => detail,
|
|
59
|
+
});
|
|
60
|
+
const applied = world.apply(renderer, scene, camera, { godraysLight: environment.godraysLight });
|
|
61
|
+
let disposed = false;
|
|
62
|
+
return {
|
|
63
|
+
tier,
|
|
64
|
+
dispose(): void {
|
|
65
|
+
if (disposed) return;
|
|
66
|
+
disposed = true;
|
|
67
|
+
applied.dispose?.();
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
// Generated for you. This is ordinary Three.js — edit or delete it freely.
|
|
2
|
+
//
|
|
3
|
+
// Every prop in the vale and the Hollow, from primitives: chests, doors, the grate, the push
|
|
4
|
+
// block, the floor switch, the signposts, the lantern-keeper's hut, the pitcher-plant lantern,
|
|
5
|
+
// torches, the heart vessel and Wren's companion orb (the vale's planting is `foliage.ts`). Each
|
|
6
|
+
// builder returns a group with its origin on the floor; the level files place them.
|
|
7
|
+
import {
|
|
8
|
+
AdditiveBlending,
|
|
9
|
+
BoxGeometry,
|
|
10
|
+
BufferAttribute,
|
|
11
|
+
type BufferGeometry,
|
|
12
|
+
CircleGeometry,
|
|
13
|
+
Color,
|
|
14
|
+
ConeGeometry,
|
|
15
|
+
CylinderGeometry,
|
|
16
|
+
Group,
|
|
17
|
+
LatheGeometry,
|
|
18
|
+
type Material,
|
|
19
|
+
Mesh,
|
|
20
|
+
PointLight,
|
|
21
|
+
SphereGeometry,
|
|
22
|
+
Sprite,
|
|
23
|
+
TorusGeometry,
|
|
24
|
+
Vector2,
|
|
25
|
+
} from "three";
|
|
26
|
+
import { float, smoothstep, uv, vec3, vec4 } from "three/tsl";
|
|
27
|
+
import { SpriteNodeMaterial } from "three/webgpu";
|
|
28
|
+
import { mossBark } from "./foliage.js";
|
|
29
|
+
import { glow, lit, mottle } from "./materials.js";
|
|
30
|
+
import { C, palette } from "./palette.js";
|
|
31
|
+
import { surfaced } from "./surface.js";
|
|
32
|
+
|
|
33
|
+
function part(geometry: BufferGeometry, material: Material, x = 0, y = 0, z = 0): Mesh {
|
|
34
|
+
const mesh = new Mesh(geometry, material);
|
|
35
|
+
mesh.position.set(x, y, z);
|
|
36
|
+
mesh.castShadow = true;
|
|
37
|
+
mesh.receiveShadow = true;
|
|
38
|
+
return mesh;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface IChestRig {
|
|
42
|
+
readonly group: Group;
|
|
43
|
+
/** 0 closed, 1 open. */
|
|
44
|
+
setOpen(amount: number): void;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** A banded wooden chest. The lid pivots on its back edge. */
|
|
48
|
+
export function createChest(): IChestRig {
|
|
49
|
+
const group = new Group();
|
|
50
|
+
const wood = surfaced(C.wood, "planks");
|
|
51
|
+
const band = lit(palette.accent, { metalness: 0.7, roughness: 0.4 });
|
|
52
|
+
group.add(part(new BoxGeometry(0.9, 0.5, 0.6), wood, 0, 0.25));
|
|
53
|
+
for (const x of [-0.32, 0.32]) group.add(part(new BoxGeometry(0.07, 0.52, 0.62), band, x, 0.26));
|
|
54
|
+
const lid = new Group();
|
|
55
|
+
lid.position.set(0, 0.5, -0.3);
|
|
56
|
+
group.add(lid);
|
|
57
|
+
const top = part(new CylinderGeometry(0.3, 0.3, 0.9, 12, 1, false, 0, Math.PI), wood, 0, 0, 0.3);
|
|
58
|
+
top.rotation.z = Math.PI / 2;
|
|
59
|
+
lid.add(top);
|
|
60
|
+
lid.add(part(new BoxGeometry(0.12, 0.14, 0.05), band, 0, 0.02, 0.62));
|
|
61
|
+
return {
|
|
62
|
+
group,
|
|
63
|
+
setOpen(amount: number): void {
|
|
64
|
+
lid.rotation.x = -amount * 1.9;
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** A heavy door in a stone frame. `locked` adds the brass lock plate. Slides down to open. */
|
|
70
|
+
export function createDoor(width: number, height: number, locked: boolean): Group {
|
|
71
|
+
const group = new Group();
|
|
72
|
+
const plank = surfaced(C.woodDark, "planks");
|
|
73
|
+
group.add(part(new BoxGeometry(width, height, 0.22), plank, 0, height / 2));
|
|
74
|
+
for (const y of [0.4, height - 0.4])
|
|
75
|
+
group.add(part(new BoxGeometry(width, 0.12, 0.26), lit(C.iron, { metalness: 0.7 }), 0, y));
|
|
76
|
+
if (locked) {
|
|
77
|
+
group.add(
|
|
78
|
+
part(
|
|
79
|
+
new BoxGeometry(0.42, 0.5, 0.3),
|
|
80
|
+
lit(palette.accent, { metalness: 0.8, roughness: 0.35 }),
|
|
81
|
+
0,
|
|
82
|
+
1.2,
|
|
83
|
+
),
|
|
84
|
+
);
|
|
85
|
+
group.add(part(new CylinderGeometry(0.05, 0.05, 0.32, 8), lit(C.eye), 0, 1.15));
|
|
86
|
+
}
|
|
87
|
+
return group;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** An iron grate: vertical bars and two rails. Rises into the lintel to open. */
|
|
91
|
+
export function createGrate(width: number, height: number): Group {
|
|
92
|
+
const group = new Group();
|
|
93
|
+
const iron = lit(C.iron, { metalness: 0.8, roughness: 0.45 });
|
|
94
|
+
const bars = Math.round(width / 0.32);
|
|
95
|
+
for (let i = 0; i <= bars; i += 1)
|
|
96
|
+
group.add(
|
|
97
|
+
part(
|
|
98
|
+
new CylinderGeometry(0.04, 0.04, height, 6),
|
|
99
|
+
iron,
|
|
100
|
+
-width / 2 + (i * width) / bars,
|
|
101
|
+
height / 2,
|
|
102
|
+
),
|
|
103
|
+
);
|
|
104
|
+
for (const y of [0.3, height - 0.3])
|
|
105
|
+
group.add(part(new BoxGeometry(width, 0.1, 0.1), iron, 0, y));
|
|
106
|
+
return group;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** The 1 m push block: cut stone with a moss cap and a carved lantern glyph. */
|
|
110
|
+
export function createBlock(rng: () => number): Group {
|
|
111
|
+
const group = new Group();
|
|
112
|
+
group.add(
|
|
113
|
+
part(
|
|
114
|
+
mottle(new BoxGeometry(0.98, 0.98, 0.98, 2, 2, 2), 0.2, rng),
|
|
115
|
+
surfaced(C.stoneDark, "rock", { flat: true, vertexColors: true, local: true }),
|
|
116
|
+
0,
|
|
117
|
+
0.49,
|
|
118
|
+
),
|
|
119
|
+
);
|
|
120
|
+
group.add(part(new BoxGeometry(1, 0.08, 1), lit(C.moss), 0, 0.99));
|
|
121
|
+
for (const [x, z] of [
|
|
122
|
+
[0, 0.5],
|
|
123
|
+
[0, -0.5],
|
|
124
|
+
] as const)
|
|
125
|
+
group.add(part(new BoxGeometry(0.3, 0.3, 0.02), glow(palette.accent, 1.2), x, 0.5, z));
|
|
126
|
+
return group;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** The floor switch: a stone plate in a brass ring. `pressed` sinks it and lights the ring. */
|
|
130
|
+
export function createSwitchPlate(): { readonly group: Group; setPressed(pressed: boolean): void } {
|
|
131
|
+
const group = new Group();
|
|
132
|
+
const ring = part(
|
|
133
|
+
new CylinderGeometry(0.62, 0.62, 0.04, 20),
|
|
134
|
+
lit(C.brass, { metalness: 0.7, roughness: 0.4 }),
|
|
135
|
+
0,
|
|
136
|
+
0.02,
|
|
137
|
+
);
|
|
138
|
+
const plate = part(
|
|
139
|
+
new CylinderGeometry(0.5, 0.5, 0.1, 20),
|
|
140
|
+
surfaced(C.stoneDark, "rock"),
|
|
141
|
+
0,
|
|
142
|
+
0.06,
|
|
143
|
+
);
|
|
144
|
+
group.add(ring, plate);
|
|
145
|
+
return {
|
|
146
|
+
group,
|
|
147
|
+
setPressed(pressed: boolean): void {
|
|
148
|
+
plate.position.y = pressed ? 0.025 : 0.06;
|
|
149
|
+
ring.material = pressed
|
|
150
|
+
? glow(palette.accent, 2)
|
|
151
|
+
: lit(C.brass, { metalness: 0.7, roughness: 0.4 });
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** A signpost: a rough post, a plank with a pointed end, hand-lettered strokes and a moss cap. */
|
|
157
|
+
export function createSign(): Group {
|
|
158
|
+
const group = new Group();
|
|
159
|
+
group.add(
|
|
160
|
+
part(new CylinderGeometry(0.06, 0.08, 1.35, 6), surfaced(C.woodDark, "planks"), 0, 0.67),
|
|
161
|
+
);
|
|
162
|
+
group.add(part(new SphereGeometry(0.09, 6, 4), lit(C.forestMoss), 0, 1.36));
|
|
163
|
+
const board = new Group();
|
|
164
|
+
board.position.set(0, 1.1, 0.07);
|
|
165
|
+
board.rotation.z = 0.04;
|
|
166
|
+
group.add(board);
|
|
167
|
+
board.add(part(new BoxGeometry(0.9, 0.4, 0.06), surfaced(C.wood, "planks")));
|
|
168
|
+
const tip = part(new CylinderGeometry(0.2, 0.2, 0.06, 3), surfaced(C.wood, "planks"), 0.5);
|
|
169
|
+
tip.rotation.set(Math.PI / 2, 0, Math.PI / 2);
|
|
170
|
+
board.add(tip);
|
|
171
|
+
// The lettering: two lines of short brush strokes, as if painted by hand.
|
|
172
|
+
const ink = lit(0x2a1d14, { roughness: 1 });
|
|
173
|
+
for (let row = 0; row < 2; row += 1)
|
|
174
|
+
for (let i = 0; i < 7 - row * 2; i += 1) {
|
|
175
|
+
const tall = (i * 7 + row * 3) % 4 === 0;
|
|
176
|
+
const stroke = part(
|
|
177
|
+
new BoxGeometry(0.035, tall ? 0.11 : 0.07, 0.01),
|
|
178
|
+
ink,
|
|
179
|
+
-0.34 + i * 0.1,
|
|
180
|
+
0.08 - row * 0.15,
|
|
181
|
+
0.035,
|
|
182
|
+
);
|
|
183
|
+
stroke.rotation.z = ((i * 5 + row) % 3) * 0.35 - 0.35;
|
|
184
|
+
board.add(stroke);
|
|
185
|
+
}
|
|
186
|
+
return group;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The lantern-keeper's hut: a hollow tree-stump house with ridged, mossy walls, a round door in a
|
|
191
|
+
* wooden ring, a lit round window, a shaggy thatched roof with moss on its crown, and lanterns
|
|
192
|
+
* hanging from the eaves that cast one warm light. The door faces +Z.
|
|
193
|
+
*/
|
|
194
|
+
export function createHut(): { readonly group: Group; readonly lanterns: number } {
|
|
195
|
+
const group = new Group();
|
|
196
|
+
group.name = "hut";
|
|
197
|
+
// The trunk-house: a lathe, ridged like bark and coloured by `mossBark`.
|
|
198
|
+
const profile = [
|
|
199
|
+
[2.65, -0.4],
|
|
200
|
+
[2.45, 0.05],
|
|
201
|
+
[2.12, 0.55],
|
|
202
|
+
[1.98, 1.4],
|
|
203
|
+
[1.92, 2.3],
|
|
204
|
+
[1.8, 2.95],
|
|
205
|
+
[0.1, 3.05],
|
|
206
|
+
].map(([r, y]) => new Vector2(r, y));
|
|
207
|
+
const body = new LatheGeometry(profile, 20).toNonIndexed();
|
|
208
|
+
const position = body.attributes.position;
|
|
209
|
+
if (position !== undefined) {
|
|
210
|
+
for (let i = 0; i < position.count; i += 1) {
|
|
211
|
+
const x = position.getX(i);
|
|
212
|
+
const z = position.getZ(i);
|
|
213
|
+
const y = position.getY(i);
|
|
214
|
+
const a = Math.atan2(z, x);
|
|
215
|
+
const k = 1 + 0.06 * Math.sin(a * 7 + y * 1.7) + 0.03 * Math.sin(a * 13 - y * 3);
|
|
216
|
+
position.setXYZ(i, x * k, y, z * k);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
const walls = new Mesh(mossBark(body, 0.8), surfaced(0xffffff, "bark", { vertexColors: true }));
|
|
220
|
+
walls.castShadow = true;
|
|
221
|
+
walls.receiveShadow = true;
|
|
222
|
+
group.add(walls);
|
|
223
|
+
// The round door, its ring and a brass knob; a round window to its right.
|
|
224
|
+
group.add(part(new CircleGeometry(0.72, 18), surfaced(C.hutDoor, "planks"), 0, 0.85, 2.06));
|
|
225
|
+
group.add(
|
|
226
|
+
part(new TorusGeometry(0.76, 0.09, 6, 20), surfaced(C.woodDark, "planks"), 0, 0.85, 2.06),
|
|
227
|
+
);
|
|
228
|
+
group.add(
|
|
229
|
+
part(
|
|
230
|
+
new SphereGeometry(0.05, 6, 4),
|
|
231
|
+
lit(C.brass, { metalness: 0.7, roughness: 0.4 }),
|
|
232
|
+
0.42,
|
|
233
|
+
0.8,
|
|
234
|
+
2.12,
|
|
235
|
+
),
|
|
236
|
+
);
|
|
237
|
+
const window = part(new CircleGeometry(0.26, 12), glow(C.lanternGlow, 3));
|
|
238
|
+
window.position.set(Math.sin(0.75) * 1.97, 1.95, Math.cos(0.75) * 1.97);
|
|
239
|
+
window.rotation.y = 0.75;
|
|
240
|
+
group.add(window);
|
|
241
|
+
// The thatch: an open cone with a ragged hem, straw streaked dark, moss on its crown.
|
|
242
|
+
const roof = new ConeGeometry(3.15, 2.6, 24, 5, true).toNonIndexed();
|
|
243
|
+
const rp = roof.attributes.position;
|
|
244
|
+
const count = rp?.count ?? 0;
|
|
245
|
+
const colour = new Float32Array(count * 3);
|
|
246
|
+
const straw = new Color(C.thatch);
|
|
247
|
+
const dark = new Color(C.thatchDark);
|
|
248
|
+
const moss = new Color(C.forestMoss);
|
|
249
|
+
const c = new Color();
|
|
250
|
+
for (let i = 0; i < count && rp !== undefined; i += 1) {
|
|
251
|
+
const x = rp.getX(i);
|
|
252
|
+
const z = rp.getZ(i);
|
|
253
|
+
const y = rp.getY(i);
|
|
254
|
+
const a = Math.atan2(z, x);
|
|
255
|
+
const hem = y < -1.2 ? -0.12 - 0.14 * Math.abs(Math.sin(a * 11)) : 0;
|
|
256
|
+
const sag = 1 + 0.04 * Math.sin(a * 5);
|
|
257
|
+
rp.setXYZ(i, x * sag, y + hem, z * sag);
|
|
258
|
+
c.copy(straw).lerp(dark, 0.5 + 0.5 * Math.sin(a * 41 + y * 3));
|
|
259
|
+
c.lerp(moss, Math.max(0, (y - 0.2) / 1.1) * (0.6 + 0.4 * Math.sin(a * 3)));
|
|
260
|
+
colour.set([c.r, c.g, c.b], i * 3);
|
|
261
|
+
}
|
|
262
|
+
roof.setAttribute("color", new BufferAttribute(colour, 3));
|
|
263
|
+
roof.computeVertexNormals();
|
|
264
|
+
group.add(
|
|
265
|
+
part(roof, lit(0xffffff, { detail: true, doubleSided: true, vertexColors: true }), 0, 4.05),
|
|
266
|
+
);
|
|
267
|
+
group.add(part(new SphereGeometry(0.42, 8, 5), lit(C.forestMoss, { detail: true }), 0, 5.2));
|
|
268
|
+
// Lanterns on cords under the eaves, and the one warm light they share.
|
|
269
|
+
const angles = [-0.7, 0.05, 0.75];
|
|
270
|
+
const iron = lit(C.iron, { metalness: 0.6 });
|
|
271
|
+
for (const a of angles) {
|
|
272
|
+
const lantern = new Group();
|
|
273
|
+
lantern.position.set(Math.sin(a) * 2.75, 0, Math.cos(a) * 2.75);
|
|
274
|
+
lantern.add(part(new CylinderGeometry(0.008, 0.008, 0.6, 3), iron, 0, 2.85));
|
|
275
|
+
lantern.add(part(new CylinderGeometry(0.1, 0.12, 0.22, 6, 1, true), iron, 0, 2.42));
|
|
276
|
+
lantern.add(part(new ConeGeometry(0.13, 0.1, 6), iron, 0, 2.57));
|
|
277
|
+
lantern.add(part(new SphereGeometry(0.08, 8, 6), glow(C.lanternGlow, 9), 0, 2.42));
|
|
278
|
+
group.add(lantern);
|
|
279
|
+
}
|
|
280
|
+
const light = new PointLight(C.lanternGlow, 9, 9, 2);
|
|
281
|
+
light.position.set(0, 2.2, 3.1);
|
|
282
|
+
group.add(light);
|
|
283
|
+
return { group, lanterns: angles.length };
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** A glowing orange pitcher plant hung from a crooked stick: a lantern grown, not made. */
|
|
287
|
+
export function createPitcherLantern(): Group {
|
|
288
|
+
const group = new Group();
|
|
289
|
+
const stick = part(
|
|
290
|
+
new CylinderGeometry(0.03, 0.045, 1.7, 5),
|
|
291
|
+
surfaced(C.woodDark, "bark"),
|
|
292
|
+
0,
|
|
293
|
+
0.85,
|
|
294
|
+
);
|
|
295
|
+
stick.rotation.z = 0.06;
|
|
296
|
+
group.add(stick);
|
|
297
|
+
const arm = part(
|
|
298
|
+
new CylinderGeometry(0.02, 0.025, 0.38, 4),
|
|
299
|
+
surfaced(C.woodDark, "bark"),
|
|
300
|
+
-0.18,
|
|
301
|
+
1.62,
|
|
302
|
+
);
|
|
303
|
+
arm.rotation.z = Math.PI / 2 - 0.3;
|
|
304
|
+
group.add(arm);
|
|
305
|
+
const cup = new LatheGeometry(
|
|
306
|
+
[
|
|
307
|
+
[0.02, 0],
|
|
308
|
+
[0.1, 0.05],
|
|
309
|
+
[0.13, 0.15],
|
|
310
|
+
[0.11, 0.26],
|
|
311
|
+
[0.075, 0.32],
|
|
312
|
+
[0.11, 0.38],
|
|
313
|
+
].map(([r, y]) => new Vector2(r, y)),
|
|
314
|
+
10,
|
|
315
|
+
);
|
|
316
|
+
group.add(part(cup, glow(C.pitcher, 3.5), -0.34, 1.12));
|
|
317
|
+
const lid = part(new ConeGeometry(0.13, 0.05, 6), lit(C.broadleaf), -0.31, 1.55);
|
|
318
|
+
lid.rotation.z = -0.5;
|
|
319
|
+
group.add(lid);
|
|
320
|
+
group.add(part(new CylinderGeometry(0.01, 0.01, 0.12, 3), lit(C.broadleaf), -0.34, 1.53));
|
|
321
|
+
const light = new PointLight(C.pitcher, 2.5, 4, 2);
|
|
322
|
+
light.position.set(-0.34, 1.25, 0);
|
|
323
|
+
group.add(light);
|
|
324
|
+
return group;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Wren's companion: a small orb of soft white-blue light with a halo and a light of its own. It is
|
|
329
|
+
* an original design, a wisp: no wings, no face. `scenes/Play.ts` flies it and trails its sparks.
|
|
330
|
+
*/
|
|
331
|
+
export function createCompanion(): { readonly group: Group; readonly light: PointLight } {
|
|
332
|
+
const group = new Group();
|
|
333
|
+
group.name = "companion";
|
|
334
|
+
group.add(part(new SphereGeometry(0.07, 10, 8), glow(C.orb, 3)));
|
|
335
|
+
const halo = new SpriteNodeMaterial({
|
|
336
|
+
blending: AdditiveBlending,
|
|
337
|
+
depthWrite: false,
|
|
338
|
+
transparent: true,
|
|
339
|
+
});
|
|
340
|
+
const mask = float(1).sub(smoothstep(0, 0.5, uv().sub(0.5).length()));
|
|
341
|
+
const tint = new Color(C.orb);
|
|
342
|
+
halo.colorNode = vec4(vec3(tint.r, tint.g, tint.b).mul(2.2), mask.mul(mask).mul(0.7));
|
|
343
|
+
const sprite = new Sprite(halo);
|
|
344
|
+
sprite.scale.setScalar(0.28);
|
|
345
|
+
group.add(sprite);
|
|
346
|
+
const light = new PointLight(C.orb, 1.2, 4.5, 2);
|
|
347
|
+
group.add(light);
|
|
348
|
+
return { group, light };
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/** A wall torch: a bracket and a flame that is its own light source. */
|
|
352
|
+
export function createTorch(): Group {
|
|
353
|
+
const group = new Group();
|
|
354
|
+
group.add(
|
|
355
|
+
part(new CylinderGeometry(0.04, 0.06, 0.4, 6), lit(C.iron, { metalness: 0.6 }), 0, 0, 0),
|
|
356
|
+
);
|
|
357
|
+
group.add(part(new SphereGeometry(0.1, 8, 6), glow(C.ember, 10), 0, 0.27, 0));
|
|
358
|
+
group.add(part(new ConeGeometry(0.07, 0.22, 6), glow(C.lamp, 12), 0, 0.4, 0));
|
|
359
|
+
return group;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/** The heart vessel: a faceted red crystal heart that spins and bobs. */
|
|
363
|
+
export function createHeartVessel(): Group {
|
|
364
|
+
const group = new Group();
|
|
365
|
+
const crystal = glow(C.heart, 2.5);
|
|
366
|
+
for (const side of [-1, 1])
|
|
367
|
+
group.add(part(new SphereGeometry(0.2, 10, 8), crystal, 0.13 * side, 0.12, 0));
|
|
368
|
+
const point = part(new ConeGeometry(0.31, 0.42, 4), crystal, 0, -0.14, 0);
|
|
369
|
+
point.rotation.x = Math.PI;
|
|
370
|
+
point.rotation.y = Math.PI / 4;
|
|
371
|
+
group.add(point);
|
|
372
|
+
return group;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/** The small key: brass bow and bit. */
|
|
376
|
+
export function createKey(): Group {
|
|
377
|
+
const group = new Group();
|
|
378
|
+
const brass = glow(palette.accent, 1.5);
|
|
379
|
+
group.add(part(new CylinderGeometry(0.1, 0.1, 0.04, 12), brass, 0, 0.3));
|
|
380
|
+
group.add(part(new BoxGeometry(0.04, 0.32, 0.04), brass, 0, 0.1));
|
|
381
|
+
group.add(part(new BoxGeometry(0.1, 0.05, 0.04), brass, 0.05, -0.03));
|
|
382
|
+
return group;
|
|
383
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Generated for you. This is ordinary Three.js configuration — edit it freely.
|
|
2
|
+
//
|
|
3
|
+
// The look is a fresh Unreal 5.8.3 project's, and it comes from the engine core: the filmic
|
|
4
|
+
// tone curve, metered auto exposure, local exposure, Unreal's bloom and vignette, contact
|
|
5
|
+
// occlusion and temporal anti-aliasing on `high`. `qualityPreset(tier)` is that look per tier;
|
|
6
|
+
// this file only adds what this game changes on top of it, each change with its reason and its
|
|
7
|
+
// cost. It starts empty on purpose: no tone curve or exposure is pinned here, so the game looks
|
|
8
|
+
// like the engine default until you decide otherwise. The meter is the starter kits' shared one
|
|
9
|
+
// (`kitExposure.ts`: core's Unreal meter at 0 EV).
|
|
10
|
+
//
|
|
11
|
+
// Tiers: `high` (a desktop GPU, Unreal's Epic), `medium` (integrated GPUs and high-end phones)
|
|
12
|
+
// and `low` (other phones and software adapters). A budget breach drops `renderChainTier`, never
|
|
13
|
+
// the curve or the meter. Force one with `setupPost(renderer, scene, camera, { tier: "low" })`.
|
|
14
|
+
import {
|
|
15
|
+
type IWorldEnvironmentOptions,
|
|
16
|
+
type QualityTier,
|
|
17
|
+
qualityPreset as engineQualityPreset,
|
|
18
|
+
qualityTiers,
|
|
19
|
+
} from "@threenative/core";
|
|
20
|
+
import { kitExposureSettings } from "./kitExposure.js";
|
|
21
|
+
|
|
22
|
+
export type { QualityTier };
|
|
23
|
+
|
|
24
|
+
// What `high` changes on top of the engine's `high`. Nothing yet.
|
|
25
|
+
const high: IWorldEnvironmentOptions = {};
|
|
26
|
+
// What `medium` changes on top of the engine's `medium`. Nothing yet.
|
|
27
|
+
const medium: IWorldEnvironmentOptions = {};
|
|
28
|
+
// What `low` changes on top of the engine's `low`. Nothing yet.
|
|
29
|
+
const low: IWorldEnvironmentOptions = {};
|
|
30
|
+
|
|
31
|
+
const OVERRIDES: Record<QualityTier, IWorldEnvironmentOptions> = { high, low, medium };
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Picks the tier: an explicit `tier` wins, a software adapter gets `low`, then the GPU family,
|
|
35
|
+
* then `mobile`. An unknown tier name throws (in core) rather than rendering the default.
|
|
36
|
+
*/
|
|
37
|
+
export function resolveQualityTier(
|
|
38
|
+
request: Parameters<typeof qualityTiers.resolve>[0] = {},
|
|
39
|
+
): QualityTier {
|
|
40
|
+
return qualityTiers.resolve(request);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The engine's look for `tier`, with this game's overrides on top. */
|
|
44
|
+
export function qualityPreset(tier: QualityTier): IWorldEnvironmentOptions {
|
|
45
|
+
return { ...engineQualityPreset(tier), exposurePolicy: kitExposureSettings, ...OVERRIDES[tier] };
|
|
46
|
+
}
|