evomeme 0.1.9 → 0.1.10-beta.3
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/dist/canvas-public/app.js +509 -5999
- package/dist/canvas-public/assets/presets/catalog.json +47 -0
- package/dist/canvas-public/assets/presets/tiles/A_01_CaoDi.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_02_ShaMo.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_03_TianKong.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_04_ShuiBo.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_05_HaiMian.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_06_MuDiBan.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_07_ShiZhuan.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_08_AnRongYan.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_09_QingTaiShi.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_10_ShenHai.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_11_HuiYanShi.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_12_HongTu.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_13_GengDi.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_14_HuoShanYan.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_15_NiTu.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_16_HuangSha.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_17_CongLin.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_18_ZiYanShi.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_19_MoGuTu.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_20_HuaDian.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_21_HaiLang.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_22_GanTu.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_23_QingTaiShiBan.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_24_XingKong.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_25_MoFaFuWen.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_26_ShiTuYeDi.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_27_LanZhuan.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_28_HongZhuan.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_29_YueQiu.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_30_JinShuGe.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_31_JinShuJingGai.png +0 -0
- package/dist/canvas-public/assets/presets/tiles/A_32_ShuZiChuang.png +0 -0
- package/dist/canvas-public/canvas/actions.js +143 -0
- package/dist/canvas-public/canvas/camera.js +28 -0
- package/dist/canvas-public/canvas/chrome.js +13 -0
- package/dist/canvas-public/canvas/data.js +123 -0
- package/dist/canvas-public/canvas/dependencies.js +19 -0
- package/dist/canvas-public/canvas/interactions.js +544 -0
- package/dist/canvas-public/canvas/panel-resize.js +5 -0
- package/dist/canvas-public/canvas/renderer.js +297 -0
- package/dist/canvas-public/canvas/selection.js +62 -0
- package/dist/canvas-public/canvas/serialization.js +118 -0
- package/dist/canvas-public/canvas/sync.js +202 -0
- package/dist/canvas-public/core/api.js +27 -0
- package/dist/canvas-public/core/feature-registry.js +29 -0
- package/dist/canvas-public/core/feature-state.js +228 -0
- package/dist/canvas-public/core/layout.js +133 -0
- package/dist/canvas-public/core/operations.js +38 -0
- package/dist/canvas-public/core/project.js +203 -0
- package/dist/canvas-public/core/state.js +27 -0
- package/dist/canvas-public/dialogs/context-menu.js +118 -0
- package/dist/canvas-public/elements/base.js +100 -0
- package/dist/canvas-public/elements/connections.js +105 -0
- package/dist/canvas-public/elements/drag.js +53 -0
- package/dist/canvas-public/elements/image.js +259 -0
- package/dist/canvas-public/elements/loading-recovery.js +5 -0
- package/dist/canvas-public/elements/loading.js +21 -0
- package/dist/canvas-public/elements/map.js +64 -0
- package/dist/canvas-public/elements/registry.js +58 -0
- package/dist/canvas-public/elements/replacement.js +78 -0
- package/dist/canvas-public/elements/resize.js +210 -0
- package/dist/canvas-public/elements/task-pipeline.js +234 -0
- package/dist/canvas-public/elements/types.js +21 -0
- package/dist/canvas-public/elements/ui.js +14 -0
- package/dist/canvas-public/elements/video.js +64 -0
- package/dist/canvas-public/features/assets/local-assets.js +72 -0
- package/dist/canvas-public/features/assets/official-assets.js +538 -0
- package/dist/canvas-public/features/editing/canvas-size.js +532 -0
- package/dist/canvas-public/features/editing/color-key.js +469 -0
- package/dist/canvas-public/features/editing/cutout.js +20 -0
- package/dist/canvas-public/features/editing/interactive-image-editing.js +981 -0
- package/dist/canvas-public/features/editing/layer-decomposition.js +44 -0
- package/dist/canvas-public/features/editing/manual-split.js +114 -0
- package/dist/canvas-public/features/editing/perfect-pixel.js +336 -0
- package/dist/canvas-public/features/editing/scroll-preview.js +129 -0
- package/dist/canvas-public/features/editing/scroll-seam-elimination.js +71 -0
- package/dist/canvas-public/features/editing/seam-elimination.js +46 -0
- package/dist/canvas-public/features/editing/smart-split.js +48 -0
- package/dist/canvas-public/features/editing/source-preview.js +43 -0
- package/dist/canvas-public/features/editing/video-cycle.js +49 -0
- package/dist/canvas-public/features/editing/video-frames.js +35 -0
- package/dist/canvas-public/features/frame-editor/frame-editing.js +755 -0
- package/dist/canvas-public/features/frame-editor/frame-model.js +63 -0
- package/dist/canvas-public/features/frame-editor/playback.js +83 -0
- package/dist/canvas-public/features/frame-editor/preview.js +149 -0
- package/dist/canvas-public/features/generation/animation.js +272 -0
- package/dist/canvas-public/features/generation/asset-batch.js +102 -0
- package/dist/canvas-public/features/generation/direction.js +163 -0
- package/dist/canvas-public/features/generation/fields.js +73 -0
- package/dist/canvas-public/features/generation/game-ui.js +64 -0
- package/dist/canvas-public/features/generation/image.js +96 -0
- package/dist/canvas-public/features/generation/scroll-image.js +157 -0
- package/dist/canvas-public/features/generation/seamless-tile.js +52 -0
- package/dist/canvas-public/features/generation/tile-transition-atlas.js +79 -0
- package/dist/canvas-public/features/generation/video.js +105 -0
- package/dist/canvas-public/features/map/creation.js +73 -0
- package/dist/canvas-public/features/map/tile-map-editor.js +2518 -0
- package/dist/canvas-public/features/registry.js +59 -0
- package/dist/canvas-public/index.html +84 -259
- package/dist/canvas-public/inspector/controls.js +49 -0
- package/dist/canvas-public/inspector/frame-preview.js +11 -0
- package/dist/canvas-public/inspector/inspector.js +190 -0
- package/dist/canvas-public/inspector/media-inspector.js +517 -0
- package/dist/canvas-public/inspector/media-preview.js +56 -0
- package/dist/canvas-public/inspector/number-stepper.js +96 -0
- package/dist/canvas-public/inspector/resize.js +88 -0
- package/dist/canvas-public/inspector/scroll-preview.js +11 -0
- package/dist/canvas-public/inspector/ui-inspector.js +14 -0
- package/dist/canvas-public/language/en-US.js +1059 -0
- package/dist/canvas-public/language/index.js +79 -0
- package/dist/canvas-public/language/zh-CN.js +1059 -0
- package/dist/canvas-public/map/export.js +9 -0
- package/dist/canvas-public/map/inspector.js +8 -0
- package/dist/canvas-public/map/model.js +409 -0
- package/dist/canvas-public/map/tile-map-editor.js +2 -0
- package/dist/canvas-public/media/metadata.js +183 -0
- package/dist/canvas-public/media/support.js +183 -0
- package/dist/canvas-public/styles/base.css +49 -0
- package/dist/canvas-public/styles/canvas.css +127 -0
- package/dist/canvas-public/styles/controls.css +203 -0
- package/dist/canvas-public/styles/dialogs.css +521 -0
- package/dist/canvas-public/styles/feature-form.css +409 -0
- package/dist/canvas-public/styles/inspector.css +441 -0
- package/dist/canvas-public/styles/layout.css +344 -0
- package/dist/canvas-public/styles/map.css +11 -0
- package/dist/canvas-public/styles/nodes.css +636 -0
- package/dist/canvas-public/styles.css +9 -2247
- package/dist/canvas-public/ui/controls.js +222 -0
- package/dist/canvas-public/ui/elements.js +9 -0
- package/dist/canvas-public/ui/feature-controller.js +296 -0
- package/dist/canvas-public/ui/feature-form.js +401 -0
- package/dist/canvas-public/ui/settings.js +83 -0
- package/dist/canvas-public/ui/toolbar.js +55 -0
- package/dist/canvas-public/vendor/pixi-tilemap.js +126 -0
- package/dist/canvas-public/vendor/pixi.min.js +2340 -0
- package/dist/canvas-public/workers/color-key-worker.js +289 -0
- package/dist/canvas-public/workers/perfect-pixel-worker.js +510 -0
- package/dist/index.js +42004 -12938
- package/dist/skills/en-US/evomeme-canvas/SKILL.md +52 -0
- package/dist/skills/en-US/evomeme-canvas/agents/openai.yaml +7 -0
- package/dist/skills/en-US/evomeme-cloud-fs/SKILL.md +197 -0
- package/dist/skills/en-US/evomeme-cloud-fs/agents/openai.yaml +7 -0
- package/dist/skills/en-US/evomeme-cover/SKILL.md +131 -0
- package/dist/skills/en-US/evomeme-cover/agents/openai.yaml +7 -0
- package/dist/skills/en-US/evomeme-game-maker/SKILL.md +288 -0
- package/dist/skills/en-US/evomeme-game-maker/agents/openai.yaml +4 -0
- package/dist/skills/en-US/evomeme-login/SKILL.md +92 -0
- package/dist/skills/en-US/evomeme-login/agents/openai.yaml +7 -0
- package/dist/skills/en-US/evomeme-native-bridge-sdk/SKILL.md +286 -0
- package/dist/skills/en-US/evomeme-native-bridge-sdk/agents/openai.yaml +8 -0
- package/dist/skills/en-US/evomeme-tos-upload/SKILL.md +47 -0
- package/dist/skills/en-US/evomeme-tos-upload/agents/openai.yaml +5 -0
- package/dist/skills/en-US/evomeme-ui/SKILL.md +123 -0
- package/dist/skills/en-US/evomeme-ui/agents/openai.yaml +4 -0
- package/dist/skills/en-US/evomeme-ui/references/host-layout.md +69 -0
- package/dist/skills/en-US/game-art/SKILL.md +121 -0
- package/dist/skills/en-US/game-art/agents/openai.yaml +8 -0
- package/dist/skills/en-US/game-asset-align/SKILL.md +45 -0
- package/dist/skills/en-US/game-asset-align/agents/openai.yaml +8 -0
- package/dist/skills/en-US/game-asset-align/references/alignment-contract.md +61 -0
- package/dist/skills/en-US/game-asset-align/references/blender-scene-pipeline.md +45 -0
- package/dist/skills/en-US/game-asset-align/references/canonical-package.md +26 -0
- package/dist/skills/en-US/game-asset-align/references/engine-capabilities.md +14 -0
- package/dist/skills/en-US/game-asset-align/references/lightweight-review.md +32 -0
- package/dist/skills/en-US/game-asset-align/references/repair-policy.md +30 -0
- package/dist/skills/en-US/game-asset-align/references/tool-contract.md +39 -0
- package/dist/skills/en-US/game-asset-align/references/visual-review.md +26 -0
- package/dist/skills/en-US/game-asset-image-generator/SKILL.md +64 -0
- package/dist/skills/en-US/game-asset-image-generator/agents/openai.yaml +7 -0
- package/dist/skills/en-US/game-asset-image-generator/references/background.md +32 -0
- package/dist/skills/en-US/game-asset-image-generator/references/static-game-assets.md +38 -0
- package/dist/skills/en-US/game-audio/SKILL.md +82 -0
- package/dist/skills/en-US/game-audio/agents/openai.yaml +4 -0
- package/dist/skills/en-US/game-demo/SKILL.md +103 -0
- package/dist/skills/en-US/game-demo/agents/openai.yaml +7 -0
- package/dist/skills/en-US/game-maker/SKILL.md +111 -0
- package/dist/skills/en-US/game-maker/agents/openai.yaml +4 -0
- package/dist/skills/en-US/game-test/SKILL.md +58 -0
- package/dist/skills/en-US/game-test/agents/openai.yaml +7 -0
- package/dist/skills/en-US/game-ui/SKILL.md +177 -0
- package/dist/skills/en-US/game-ui/agents/openai.yaml +4 -0
- package/dist/skills/en-US/godot-3d-game/SKILL.md +39 -0
- package/dist/skills/en-US/godot-3d-game/agents/openai.yaml +8 -0
- package/dist/skills/en-US/godot-3d-game/references/alignment-gates.md +26 -0
- package/dist/skills/en-US/godot-3d-game/references/appearance-alignment.md +52 -0
- package/dist/skills/en-US/godot-3d-game/references/build-and-qa.md +22 -0
- package/dist/skills/en-US/godot-3d-game/references/canonical-asset-runtime.md +27 -0
- package/dist/skills/en-US/godot-3d-game/references/import-and-wrapper-scenes.md +20 -0
- package/dist/skills/en-US/godot-3d-game/references/physics-colliders.md +13 -0
- package/dist/skills/en-US/godot-3d-game/references/project-structure.md +22 -0
- package/dist/skills/en-US/godot-3d-game/references/skeleton-animation.md +16 -0
- package/dist/skills/en-US/phaser-2d-game/SKILL.md +127 -0
- package/dist/skills/en-US/phaser-2d-game/agents/openai.yaml +8 -0
- package/dist/skills/en-US/phaser-2d-game/references/engine-performance.md +64 -0
- package/dist/skills/en-US/phaser-2d-game/references/engine-physics.md +139 -0
- package/dist/skills/en-US/phaser-2d-game/references/engine-runtime.md +129 -0
- package/dist/skills/en-US/phaser-2d-game/references/engine-spritesheets.md +99 -0
- package/dist/skills/en-US/phaser-2d-game/references/engine-tilemaps.md +80 -0
- package/dist/skills/en-US/phaser-2d-game/references/file-structure.md +94 -0
- package/dist/skills/en-US/phaser-2d-graphics-builder/SKILL.md +68 -0
- package/dist/skills/en-US/phaser-2d-graphics-builder/agents/openai.yaml +7 -0
- package/dist/skills/en-US/threejs-3d-game/SKILL.md +117 -0
- package/dist/skills/en-US/threejs-3d-game/agents/openai.yaml +7 -0
- package/dist/skills/en-US/threejs-3d-game/references/engine-asset-pipeline.md +153 -0
- package/dist/skills/en-US/threejs-3d-game/references/engine-audio.md +70 -0
- package/dist/skills/en-US/threejs-3d-game/references/engine-input-camera.md +84 -0
- package/dist/skills/en-US/threejs-3d-game/references/engine-performance.md +96 -0
- package/dist/skills/en-US/threejs-3d-game/references/engine-physics.md +142 -0
- package/dist/skills/en-US/threejs-3d-game/references/engine-runtime.md +199 -0
- package/dist/skills/en-US/threejs-3d-game/references/file-structure.md +353 -0
- package/dist/skills/en-US/threejs-aaa-graphics-builder/SKILL.md +62 -0
- package/dist/skills/en-US/threejs-aaa-graphics-builder/agents/openai.yaml +7 -0
- package/{skills → dist/skills/zh-CN}/evomeme-cloud-fs/SKILL.md +28 -7
- package/{skills → dist/skills/zh-CN}/evomeme-cover/SKILL.md +7 -8
- package/{skills → dist/skills/zh-CN}/evomeme-game-maker/SKILL.md +91 -88
- package/{skills → dist/skills/zh-CN}/evomeme-tos-upload/SKILL.md +6 -5
- package/dist/skills/zh-CN/evomeme-ui/SKILL.md +123 -0
- package/dist/skills/zh-CN/evomeme-ui/agents/openai.yaml +4 -0
- package/dist/skills/zh-CN/evomeme-ui/references/host-layout.md +69 -0
- package/dist/skills/zh-CN/game-asset-align/SKILL.md +45 -0
- package/dist/skills/zh-CN/game-asset-align/agents/openai.yaml +8 -0
- package/dist/skills/zh-CN/game-asset-align/references/alignment-contract.md +61 -0
- package/dist/skills/zh-CN/game-asset-align/references/blender-scene-pipeline.md +45 -0
- package/dist/skills/zh-CN/game-asset-align/references/canonical-package.md +26 -0
- package/dist/skills/zh-CN/game-asset-align/references/engine-capabilities.md +14 -0
- package/dist/skills/zh-CN/game-asset-align/references/lightweight-review.md +32 -0
- package/dist/skills/zh-CN/game-asset-align/references/repair-policy.md +30 -0
- package/dist/skills/zh-CN/game-asset-align/references/tool-contract.md +39 -0
- package/dist/skills/zh-CN/game-asset-align/references/visual-review.md +26 -0
- package/dist/skills/zh-CN/game-asset-image-generator/SKILL.md +64 -0
- package/{skills → dist/skills/zh-CN}/game-asset-image-generator/references/background.md +1 -1
- package/{skills → dist/skills/zh-CN}/game-asset-image-generator/references/static-game-assets.md +2 -2
- package/dist/skills/zh-CN/game-audio/references/bgm-cdn.md +127 -0
- package/dist/skills/zh-CN/game-audio/references/sfx-cdn.md +77 -0
- package/dist/skills/zh-CN/game-test/references/checklists/playtest-qa.md +12 -0
- package/{skills → dist/skills/zh-CN}/game-ui/SKILL.md +9 -1
- package/dist/skills/zh-CN/game-ui/references/checklists/game-ui-quality.md +14 -0
- package/dist/skills/zh-CN/game-ui/references/checklists/hud-readability.md +12 -0
- package/dist/skills/zh-CN/game-ui/references/checklists/mobile-input.md +12 -0
- package/dist/skills/zh-CN/game-ui/references/checklists/responsive-ui-fit.md +12 -0
- package/dist/skills/zh-CN/game-ui/references/ui-patterns.md +140 -0
- package/dist/skills/zh-CN/game-ui/references/ui-prompt-templates.md +63 -0
- package/dist/skills/zh-CN/godot-3d-game/SKILL.md +39 -0
- package/dist/skills/zh-CN/godot-3d-game/agents/openai.yaml +8 -0
- package/dist/skills/zh-CN/godot-3d-game/references/alignment-gates.md +26 -0
- package/dist/skills/zh-CN/godot-3d-game/references/appearance-alignment.md +52 -0
- package/dist/skills/zh-CN/godot-3d-game/references/build-and-qa.md +22 -0
- package/dist/skills/zh-CN/godot-3d-game/references/canonical-asset-runtime.md +27 -0
- package/dist/skills/zh-CN/godot-3d-game/references/import-and-wrapper-scenes.md +20 -0
- package/dist/skills/zh-CN/godot-3d-game/references/physics-colliders.md +13 -0
- package/dist/skills/zh-CN/godot-3d-game/references/project-structure.md +22 -0
- package/dist/skills/zh-CN/godot-3d-game/references/skeleton-animation.md +16 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/assets/scorecard-anchors/scene-1.jpeg +0 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/assets/scorecard-anchors/scene-2.jpeg +0 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/assets/scorecard-anchors/scene-3.jpg +0 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/checklists/compose-quality.md +10 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/checklists/performance-safe-visual-detail.md +9 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/checklists/premium-game-quality-gate.md +15 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/checklists/sprite-quality.md +10 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/checklists/technical-art-quality.md +9 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/checklists/visual-scorecard.md +9 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/compose-recipes.md +71 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/graphics-prompt-templates.md +33 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/implementation-blueprint.md +82 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/sprite-recipes.md +90 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/technical-art.md +67 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/vfx-recipes.md +67 -0
- package/dist/skills/zh-CN/phaser-2d-graphics-builder/references/visual-scorecard.md +129 -0
- package/{skills → dist/skills/zh-CN}/threejs-3d-game/SKILL.md +6 -2
- package/{skills → dist/skills/zh-CN}/threejs-3d-game/references/engine-asset-pipeline.md +52 -15
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/assets/scorecard-anchors/scene-1.jpg +0 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/assets/scorecard-anchors/scene-2.jpg +0 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/assets/scorecard-anchors/scene-3.jpg +0 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/checklists/aaa-game-quality-gate.md +23 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/checklists/aaa-visual-scorecard.md +19 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/checklists/material-lighting-quality.md +14 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/checklists/performance-safe-visual-detail.md +14 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/checklists/procedural-model-quality.md +15 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/checklists/technical-art-quality.md +17 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/graphics-prompt-templates.md +236 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/implementation-blueprint.md +161 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/model-recipes.md +146 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/render-recipes.md +90 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/shader-cookbook.md +292 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/technical-art.md +167 -0
- package/dist/skills/zh-CN/threejs-aaa-graphics-builder/references/visual-scorecard.md +147 -0
- package/dist/stage-blender/bake_materials.py +102 -0
- package/dist/stage-blender/export_scene.py +275 -0
- package/dist/stage-blender/preview_camera.py +90 -0
- package/dist/stage-blender/repair_mesh.py +112 -0
- package/dist/stage-public/app.js +759 -0
- package/dist/stage-public/baked/bakePilot.js +44 -0
- package/dist/stage-public/baked/bakedScene.js +129 -0
- package/dist/stage-public/baked/sceneAppearance.js +225 -0
- package/dist/stage-public/baked/sceneCamera.js +45 -0
- package/dist/stage-public/comparison-contract.js +28 -0
- package/dist/stage-public/delivery.html +4 -0
- package/dist/stage-public/delivery.js +17 -0
- package/dist/stage-public/godot/appearance.gd +170 -0
- package/dist/stage-public/godot/preview.gd +79 -0
- package/dist/stage-public/index.html +141 -0
- package/dist/stage-public/review-app.js +289 -0
- package/dist/stage-public/review-runtime.js +63 -0
- package/dist/stage-public/review.css +24 -0
- package/dist/stage-public/review.html +47 -0
- package/dist/stage-public/scene-runtime.js +212 -0
- package/dist/stage-public/sceneContractRuntime.js +235 -0
- package/dist/stage-public/styles.css +328 -0
- package/dist/stage-public/three-appearance.js +104 -0
- package/dist/stage-public/vendor/three170/LICENSE +21 -0
- package/dist/stage-public/vendor/three170/build/three.module.js +54571 -0
- package/dist/stage-public/vendor/three170/examples/jsm/controls/OrbitControls.js +1523 -0
- package/dist/stage-public/vendor/three170/examples/jsm/environments/RoomEnvironment.js +144 -0
- package/dist/stage-public/vendor/three170/examples/jsm/libs/fflate.module.js +2672 -0
- package/dist/stage-public/vendor/three170/examples/jsm/loaders/EXRLoader.js +2563 -0
- package/dist/stage-public/vendor/three170/examples/jsm/loaders/GLTFLoader.js +4727 -0
- package/dist/stage-public/vendor/three170/examples/jsm/utils/BufferGeometryUtils.js +1373 -0
- package/dist/tile-transition-mask.svg +40 -0
- package/package.json +21 -7
- package/dist/canvas-public/cycle-detect.js +0 -166
- package/dist/canvas-public/smart-split.js +0 -185
- package/skills/game-asset-image-generator/SKILL.md +0 -104
- /package/{skills → dist/skills/en-US}/game-audio/references/bgm-cdn.md +0 -0
- /package/{skills → dist/skills/en-US}/game-audio/references/sfx-cdn.md +0 -0
- /package/{skills → dist/skills/en-US}/game-test/references/checklists/playtest-qa.md +0 -0
- /package/{skills → dist/skills/en-US}/game-ui/references/checklists/game-ui-quality.md +0 -0
- /package/{skills → dist/skills/en-US}/game-ui/references/checklists/hud-readability.md +0 -0
- /package/{skills → dist/skills/en-US}/game-ui/references/checklists/mobile-input.md +0 -0
- /package/{skills → dist/skills/en-US}/game-ui/references/checklists/responsive-ui-fit.md +0 -0
- /package/{skills → dist/skills/en-US}/game-ui/references/ui-patterns.md +0 -0
- /package/{skills → dist/skills/en-US}/game-ui/references/ui-prompt-templates.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/assets/scorecard-anchors/scene-1.jpeg +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/assets/scorecard-anchors/scene-2.jpeg +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/assets/scorecard-anchors/scene-3.jpg +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/checklists/compose-quality.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/checklists/performance-safe-visual-detail.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/checklists/premium-game-quality-gate.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/checklists/sprite-quality.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/checklists/technical-art-quality.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/checklists/visual-scorecard.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/compose-recipes.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/graphics-prompt-templates.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/implementation-blueprint.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/sprite-recipes.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/technical-art.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/vfx-recipes.md +0 -0
- /package/{skills → dist/skills/en-US}/phaser-2d-graphics-builder/references/visual-scorecard.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/assets/scorecard-anchors/scene-1.jpg +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/assets/scorecard-anchors/scene-2.jpg +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/assets/scorecard-anchors/scene-3.jpg +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/checklists/aaa-game-quality-gate.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/checklists/aaa-visual-scorecard.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/checklists/material-lighting-quality.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/checklists/performance-safe-visual-detail.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/checklists/procedural-model-quality.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/checklists/technical-art-quality.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/graphics-prompt-templates.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/implementation-blueprint.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/model-recipes.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/render-recipes.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/shader-cookbook.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/technical-art.md +0 -0
- /package/{skills → dist/skills/en-US}/threejs-aaa-graphics-builder/references/visual-scorecard.md +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-canvas/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-canvas/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-cloud-fs/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-cover/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-game-maker/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-login/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-login/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-native-bridge-sdk/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-native-bridge-sdk/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/evomeme-tos-upload/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/game-art/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/game-art/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/game-asset-image-generator/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/game-audio/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/game-audio/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/game-demo/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/game-demo/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/game-maker/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/game-maker/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/game-test/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/game-test/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/game-ui/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/references/engine-performance.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/references/engine-physics.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/references/engine-runtime.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/references/engine-spritesheets.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/references/engine-tilemaps.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-game/references/file-structure.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-graphics-builder/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/phaser-2d-graphics-builder/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-3d-game/agents/openai.yaml +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-3d-game/references/engine-audio.md +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-3d-game/references/engine-input-camera.md +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-3d-game/references/engine-performance.md +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-3d-game/references/engine-physics.md +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-3d-game/references/engine-runtime.md +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-3d-game/references/file-structure.md +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-aaa-graphics-builder/SKILL.md +0 -0
- /package/{skills → dist/skills/zh-CN}/threejs-aaa-graphics-builder/agents/openai.yaml +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Procedural Model Recipes
|
|
2
|
+
|
|
3
|
+
These recipes are for scratch-built Three.js models when external art assets are unavailable. The goal is not photorealism; it is authored, layered, readable, premium browser-game art.
|
|
4
|
+
|
|
5
|
+
## Modeling Principles
|
|
6
|
+
|
|
7
|
+
- Start with silhouette. A model should be recognizable as a dark shape before materials or glow.
|
|
8
|
+
- Combine primitive bases with authored geometry: extrusions, bevels, curves, tubes, lathes, custom buffers, decals, trim, and instanced micro-detail.
|
|
9
|
+
- Use asymmetry and functional parts: hinges, fins, vents, handles, rails, brackets, sensors, cables, panels, bolts.
|
|
10
|
+
- Put detail where the camera sees it. Spend triangles on player-facing surfaces, not hidden undersides.
|
|
11
|
+
- Create state variants through material swaps, animated child parts, emissive strips, and VFX sockets.
|
|
12
|
+
- Keep a simple collision proxy separate from the detailed visual group.
|
|
13
|
+
- Use shared geometries/materials and instancing for repeated bolts, panels, lights, windows, spikes, rocks, or rail segments.
|
|
14
|
+
- Name important child meshes: `cockpitGlass`, `leftEngine`, `hazardTeeth`, `pickupCore`, `collisionProxy`.
|
|
15
|
+
|
|
16
|
+
## Minimum Premium Asset Pass
|
|
17
|
+
|
|
18
|
+
For a game that asks for premium/AAA/showcase quality, build at least:
|
|
19
|
+
|
|
20
|
+
- One hero/player model with readable front/up/side and three state cues.
|
|
21
|
+
- Three obstacle/enemy variants with unique silhouettes and telegraphs.
|
|
22
|
+
- Two reward/interactable variants with idle and collect states.
|
|
23
|
+
- One world prop kit with at least eight reusable parts.
|
|
24
|
+
- One material kit with trim, decals, panel lines, and emissive masks.
|
|
25
|
+
- Collision proxies and renderer diagnostics for the above.
|
|
26
|
+
|
|
27
|
+
## Hero Vehicle Recipe
|
|
28
|
+
|
|
29
|
+
Use for runners, racers, hovercraft, spaceships, drones, or arcade vehicles.
|
|
30
|
+
|
|
31
|
+
- Core hull: `ExtrudeGeometry` or custom tapered `BufferGeometry`, not just a box.
|
|
32
|
+
- Nose/front: wedge, intake, sensor strip, bumper, or blade shape.
|
|
33
|
+
- Cockpit/core: glass dome from sphere/lathe segments, beveled capsule, or faceted canopy.
|
|
34
|
+
- Engines: cylinders/cones/tubes with nozzle rings, inner emissive discs, heat fins, and trail sockets.
|
|
35
|
+
- Wings/fins: extruded triangular or curved plates with bevel/trim lines.
|
|
36
|
+
- Undercarriage: skids, landing pads, rail clamps, suspension arms, or thruster pods.
|
|
37
|
+
- Decals: panel lines, numeric marks, faction glyph, hazard ticks, small bolts.
|
|
38
|
+
- State cues: boost flares, shield shell, damage scorch, pickup glow, overheat red.
|
|
39
|
+
- Collision proxy: one capsule/box/sphere group matching gameplay footprint.
|
|
40
|
+
|
|
41
|
+
Reject if the hero is mostly a box with two cylinders and a glow.
|
|
42
|
+
|
|
43
|
+
## Hero Character Recipe
|
|
44
|
+
|
|
45
|
+
Use for arena fighters, brawlers, platformers, or stylized third-person games.
|
|
46
|
+
|
|
47
|
+
- Body mass: torso, pelvis, head/helmet, limbs with tapered capsule/cylinder custom scales.
|
|
48
|
+
- Rig illusion: separate shoulders, elbows, knees, wrists, ankles, belt, backpack, armor plates.
|
|
49
|
+
- Face/identity: visor, mask, hair/helmet crest, color-blocked silhouette, weapon/tool.
|
|
50
|
+
- Animation-ready pivots: group limbs under named joints even if animation is procedural.
|
|
51
|
+
- Material zones: skin/fabric/armor/metal/glass/emissive accents.
|
|
52
|
+
- State cues: hit flash material, shield ring, attack trail socket, stamina/charge glow.
|
|
53
|
+
- Collision proxy: capsule or cylinder independent of mesh detail.
|
|
54
|
+
|
|
55
|
+
Reject if the character reads as stacked spheres/cylinders with no costume, joints, or silhouette.
|
|
56
|
+
|
|
57
|
+
## Obstacle And Enemy Families
|
|
58
|
+
|
|
59
|
+
Build distinct gameplay reads:
|
|
60
|
+
|
|
61
|
+
- Low barrier: ground-hugging slab, spikes, rails, caution panels, animated warning light.
|
|
62
|
+
- Gate/arch: overhead frame, side posts, pulsing pass/avoid lane, moving shutters.
|
|
63
|
+
- Moving hazard: rotating arm, sweeper beam, drone, crusher, sliding block, orbiting mines.
|
|
64
|
+
- Trap/zone: laser grid, electric puddle, collapsing tile, gravity well, proximity mine.
|
|
65
|
+
- Enemy: body core, sensor/head, weapon, shield, locomotion/hover base, attack telegraph.
|
|
66
|
+
|
|
67
|
+
Each variant needs:
|
|
68
|
+
|
|
69
|
+
- Unique silhouette.
|
|
70
|
+
- Material cue for danger.
|
|
71
|
+
- Telegraph from distance.
|
|
72
|
+
- Animation or state change.
|
|
73
|
+
- Collision proxy.
|
|
74
|
+
- Low-cost repeated detail.
|
|
75
|
+
|
|
76
|
+
Reject if all hazards are recolored cubes/cones.
|
|
77
|
+
|
|
78
|
+
## Reward And Interactable Recipes
|
|
79
|
+
|
|
80
|
+
Rewards should be readable and desirable during motion.
|
|
81
|
+
|
|
82
|
+
- Token: outer ring, inner core, value icon, shimmer cards, collect burst socket.
|
|
83
|
+
- Shard: faceted crystal, metal bracket, orbiting chips, emissive seam.
|
|
84
|
+
- Capsule: glass shell, suspended item, end caps, rotating label strip.
|
|
85
|
+
- Power-up: icon silhouette matched to effect, color and shape differ from score pickups.
|
|
86
|
+
- Objective item: larger scale, unique motion, UI echo, stronger lighting/VFX.
|
|
87
|
+
|
|
88
|
+
States:
|
|
89
|
+
|
|
90
|
+
- Idle: slow rotation, pulse, bob, or orbit.
|
|
91
|
+
- Attract: line/trail toward player.
|
|
92
|
+
- Collect: vanish, burst, score trail, HUD meter update.
|
|
93
|
+
|
|
94
|
+
Reject if rewards are plain spheres or torus rings without state feedback.
|
|
95
|
+
|
|
96
|
+
## World Prop Kit
|
|
97
|
+
|
|
98
|
+
Build modular props that can be instanced and recombined:
|
|
99
|
+
|
|
100
|
+
- Track/road: lane plates, seams, arrows, side rails, guard segments, repair panels.
|
|
101
|
+
- Arena: boundary rings, floor tiles, spawn pads, cover blocks, goal markers.
|
|
102
|
+
- City/sci-fi: window strips, antennas, rooftop units, bridge trusses, pylons, billboards.
|
|
103
|
+
- Nature: rocks from custom faceted buffers, cliffs, roots, crystals, grasses as cards.
|
|
104
|
+
- Industrial: pipes, vents, cables, tanks, crates, gantries, lights, warning signs.
|
|
105
|
+
- Space/air: debris panels, satellites, buoys, asteroid chunks, parallax dust.
|
|
106
|
+
|
|
107
|
+
Layer the kit:
|
|
108
|
+
|
|
109
|
+
- Near props create speed and scale.
|
|
110
|
+
- Mid props define the playable corridor.
|
|
111
|
+
- Far props create depth without stealing draw calls.
|
|
112
|
+
|
|
113
|
+
Reject if the world is mostly stretched boxes or a flat plane.
|
|
114
|
+
|
|
115
|
+
## Procedural Geometry Techniques
|
|
116
|
+
|
|
117
|
+
- `ExtrudeGeometry`: panels, fins, wings, badges, UI/world glyphs, signs.
|
|
118
|
+
- `LatheGeometry`: capsules, domes, engines, pipes, bottles, turret bases.
|
|
119
|
+
- `TubeGeometry`: cables, rails, trails, conduits, curved weapons.
|
|
120
|
+
- Custom `BufferGeometry`: tapered hulls, rocks, shards, wedges, low-poly terrain.
|
|
121
|
+
- `ShapeGeometry`: decals, flat icons, trim strips, hazard markers.
|
|
122
|
+
- `InstancedMesh`: windows, bolts, lane markers, debris, grass, lights, small props.
|
|
123
|
+
- `LOD`: hero/background variants and dense prop reductions.
|
|
124
|
+
|
|
125
|
+
Use bevel-like layering when real bevel geometry is too expensive: duplicate thin trim meshes, edge strips, or slightly offset darker panels.
|
|
126
|
+
|
|
127
|
+
## Material And Detail Rules
|
|
128
|
+
|
|
129
|
+
- Use roughness/metalness contrast, not only hue contrast.
|
|
130
|
+
- Use emissive for authored signals, not entire objects.
|
|
131
|
+
- Use glass/clearcoat sparingly on hero details.
|
|
132
|
+
- Add darker contact material under important objects.
|
|
133
|
+
- Use decals to imply scale and function.
|
|
134
|
+
- Reuse UI icon shapes as world decals for cohesion.
|
|
135
|
+
|
|
136
|
+
## Diagnostics Checklist
|
|
137
|
+
|
|
138
|
+
After a model pass, report:
|
|
139
|
+
|
|
140
|
+
- Mesh count.
|
|
141
|
+
- Instanced mesh count.
|
|
142
|
+
- Unique geometries/materials/textures.
|
|
143
|
+
- Approximate triangle count if available.
|
|
144
|
+
- Collision proxies included.
|
|
145
|
+
- LOD or culling strategy for repeated/background props.
|
|
146
|
+
- Active-play screenshots, not only showroom renders.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Render, Lighting, And VFX Recipes
|
|
2
|
+
|
|
3
|
+
Use this after authored forms exist. Rendering polish cannot compensate for missing models, props, or readable gameplay silhouettes.
|
|
4
|
+
|
|
5
|
+
## Renderer Setup
|
|
6
|
+
|
|
7
|
+
- Set `renderer.outputColorSpace = THREE.SRGBColorSpace`.
|
|
8
|
+
- Choose tone mapping deliberately. `ACESFilmicToneMapping` often works for cinematic stylized scenes; simpler tone mapping can be better for bright arcade readability.
|
|
9
|
+
- Tune exposure against active gameplay, not a static title view.
|
|
10
|
+
- Cap DPR, especially on mobile. Start around `Math.min(devicePixelRatio, 1.5 or 2)` and profile.
|
|
11
|
+
- Update renderer, camera, composer, and CSS UI dimensions on resize.
|
|
12
|
+
- Use a transparent or explicit background only when composition requires it.
|
|
13
|
+
|
|
14
|
+
## Camera Composition
|
|
15
|
+
|
|
16
|
+
- Keep the next decision visible. The camera should show player, immediate threat/reward, and route.
|
|
17
|
+
- Add depth layers: foreground speed elements, playable midground, background scale cues.
|
|
18
|
+
- Use FOV and camera distance to communicate speed without hiding hazards.
|
|
19
|
+
- Use camera shake sparingly and clamp intensity.
|
|
20
|
+
- Add camera impulses for hits/near misses/boosts, then ease back quickly.
|
|
21
|
+
- Check mobile framing separately; vertical and narrow layouts often need different offsets.
|
|
22
|
+
|
|
23
|
+
## Lighting Stack
|
|
24
|
+
|
|
25
|
+
Use a small readable stack:
|
|
26
|
+
|
|
27
|
+
- Key light: defines form and direction.
|
|
28
|
+
- Fill light: keeps gameplay objects legible.
|
|
29
|
+
- Rim/back light: separates player and hazards from background.
|
|
30
|
+
- Practical/emissive lights: authored beacons, engines, pickups, arena markers.
|
|
31
|
+
- Contact shadows or shadow blobs: ground important objects.
|
|
32
|
+
|
|
33
|
+
Avoid many unmeasured dynamic lights. Prefer baked-looking material/emissive cues, light cards, or small unlit decals for repeated signals.
|
|
34
|
+
|
|
35
|
+
## Shadows And Contact
|
|
36
|
+
|
|
37
|
+
- Use shadows for hero/player, major hazards, and large world anchors.
|
|
38
|
+
- Use smaller shadow maps and limited shadow casters when profiling shows cost.
|
|
39
|
+
- Add cheap contact discs or transparent planes for pickups/hovering objects.
|
|
40
|
+
- Tune bias to avoid acne and peter-panning.
|
|
41
|
+
- Do not let shadows hide collision reads.
|
|
42
|
+
|
|
43
|
+
## Materials
|
|
44
|
+
|
|
45
|
+
Define material roles with the material kit in `technical-art.md` (`MeshStandardMaterial` for most surfaces, `MeshPhysicalMaterial` only where the premium feature is visible). At render time:
|
|
46
|
+
|
|
47
|
+
- Prefer material contrast before post effects: matte vs glossy, metal vs plastic, transparent vs opaque, bright trim vs dark contact.
|
|
48
|
+
- Use emissive maps or small emissive parts for signals instead of making entire objects glow.
|
|
49
|
+
- Keep material roles matched across UI and world: danger, reward, shield, boost, objective.
|
|
50
|
+
|
|
51
|
+
## Fog, Background, And Depth
|
|
52
|
+
|
|
53
|
+
- Fog should reveal depth and mood, not hide empty worlds.
|
|
54
|
+
- Layer background silhouettes at varied scales and heights.
|
|
55
|
+
- Add parallax or slow-moving far layers for motion-heavy games.
|
|
56
|
+
- Avoid single flat sky colors when the world needs scale; use gradients only as support, not the whole art direction.
|
|
57
|
+
- Keep hazards/rewards readable against fog and background values.
|
|
58
|
+
|
|
59
|
+
## Post-Processing
|
|
60
|
+
|
|
61
|
+
Use post as a finishing pass:
|
|
62
|
+
|
|
63
|
+
- Bloom: only authored emissive elements, not all bright materials.
|
|
64
|
+
- Vignette: subtle focus, never heavy darkness.
|
|
65
|
+
- Film grain/noise: low opacity; avoid compression-like artifacts.
|
|
66
|
+
- Chromatic aberration: only brief event-driven impacts or very subtle style.
|
|
67
|
+
- Motion blur/trails: prefer geometry trails or particles that preserve gameplay clarity.
|
|
68
|
+
|
|
69
|
+
Always compare screenshots with post enabled/disabled and profile the cost.
|
|
70
|
+
|
|
71
|
+
## Event-Driven VFX
|
|
72
|
+
|
|
73
|
+
Tie effects to state using the event-driven VFX language in `technical-art.md` (pickup, hit/fail, boost/speed, near miss/combo, shield/invulnerable, spawn/despawn). Pool effects, reuse geometries/materials, and keep permanent particle fields cheap and sparse.
|
|
74
|
+
|
|
75
|
+
## Readability Checks
|
|
76
|
+
|
|
77
|
+
During active play, confirm:
|
|
78
|
+
|
|
79
|
+
- Player orientation is clear.
|
|
80
|
+
- Threats differ from rewards by both shape and material.
|
|
81
|
+
- Important pickups are visible before reaction time expires.
|
|
82
|
+
- UI feedback does not cover the play path.
|
|
83
|
+
- VFX clarifies state instead of obscuring collisions.
|
|
84
|
+
- Background contrast does not swallow dark objects.
|
|
85
|
+
|
|
86
|
+
## Performance Checks
|
|
87
|
+
|
|
88
|
+
After render changes, report the renderer diagnostics from `technical-art.md` (calls, triangles, geometries, textures, materials, DPR/post/shadow settings), plus FPS/frame time and composer/post pass count when available.
|
|
89
|
+
|
|
90
|
+
If performance drops, reduce post/shadow cost first, then cull/LOD/instance, then reduce asset density only where it is least visible.
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# Shader And Material Cookbook
|
|
2
|
+
|
|
3
|
+
Concrete material, shader, and post-processing recipes. Use with `technical-art.md` (budgets, when shader work is justified) and `render-recipes.md` (render pipeline).
|
|
4
|
+
|
|
5
|
+
Targets three.js `^0.184`; imports use the `three/addons/*` alias (maps to `examples/jsm`). Every entry lists **When**, **Cost** (draw calls / fill rate / compile), and **Read** (the rule: effects clarify gameplay, never hide missing geometry).
|
|
6
|
+
|
|
7
|
+
## Prerequisite: Renderer And Environment Map
|
|
8
|
+
|
|
9
|
+
Metals and glossy dielectrics read as flat gray without an environment map to reflect. Set this up once before PBR materials.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import * as THREE from 'three';
|
|
13
|
+
import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';
|
|
14
|
+
|
|
15
|
+
renderer.outputColorSpace = THREE.SRGBColorSpace;
|
|
16
|
+
renderer.toneMapping = THREE.ACESFilmicToneMapping; // simpler tone mapping for bright arcade reads
|
|
17
|
+
renderer.toneMappingExposure = 1.0;
|
|
18
|
+
renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
|
|
19
|
+
|
|
20
|
+
// 5-line env map: neutral studio IBL, no HDR file needed.
|
|
21
|
+
const pmrem = new THREE.PMREMGenerator(renderer);
|
|
22
|
+
scene.environment = pmrem.fromScene(new RoomEnvironment(), 0.04).texture; // r184: RoomEnvironment() takes no args
|
|
23
|
+
scene.environmentIntensity = 1.0; // r184 global multiplier over per-material envMapIntensity
|
|
24
|
+
pmrem.dispose();
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Needed by any scene with metal, ceramic, glass, or clearcoat. Cost is one PMREM bake at startup, near-zero per frame; it lights support surfaces so hero emissive/trim still wins attention.
|
|
28
|
+
|
|
29
|
+
## PBR Material Recipes
|
|
30
|
+
|
|
31
|
+
Copy the config; tune `color` to the palette. `envMapIntensity` values assume the env map above. Use `MeshStandardMaterial` unless a `MeshPhysicalMaterial`-only feature (clearcoat, transmission, sheen) is visible during play.
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
// Painted metal (car body, ship hull panel) — dielectric paint over metal read via clearcoat.
|
|
35
|
+
new THREE.MeshPhysicalMaterial({ color: 0x1f6feb, metalness: 0.0, roughness: 0.5,
|
|
36
|
+
clearcoat: 0.9, clearcoatRoughness: 0.15, envMapIntensity: 1.0 });
|
|
37
|
+
|
|
38
|
+
// Bare brushed metal (raw steel, gun frame) — needs the env map to look metallic.
|
|
39
|
+
new THREE.MeshStandardMaterial({ color: 0xaeb4bd, metalness: 1.0, roughness: 0.4, envMapIntensity: 1.1 });
|
|
40
|
+
|
|
41
|
+
// Rubber / tire — near-black, no reflection, kills the env map.
|
|
42
|
+
new THREE.MeshStandardMaterial({ color: 0x0a0a0b, metalness: 0.0, roughness: 0.92, envMapIntensity: 0.35 });
|
|
43
|
+
|
|
44
|
+
// Matte plastic (housings, crates) — dielectric, mid roughness, muted reflection.
|
|
45
|
+
new THREE.MeshStandardMaterial({ color: 0xd23b3b, metalness: 0.0, roughness: 0.62, envMapIntensity: 0.6 });
|
|
46
|
+
|
|
47
|
+
// Glossy ceramic / clean hull — sharp reflection, add clearcoat for wet-look premium.
|
|
48
|
+
new THREE.MeshPhysicalMaterial({ color: 0xf5f5f5, metalness: 0.0, roughness: 0.12,
|
|
49
|
+
clearcoat: 1.0, clearcoatRoughness: 0.05, envMapIntensity: 1.0 });
|
|
50
|
+
|
|
51
|
+
// Emissive signal (beacon, pickup core) — dark base so only the glow reads; >1 intensity feeds bloom.
|
|
52
|
+
new THREE.MeshStandardMaterial({ color: 0x101010, emissive: 0x18e0ff, emissiveIntensity: 2.5,
|
|
53
|
+
metalness: 0.0, roughness: 0.4 });
|
|
54
|
+
|
|
55
|
+
// Cloth / fabric — high roughness + sheen for the soft edge highlight.
|
|
56
|
+
new THREE.MeshPhysicalMaterial({ color: 0x3a4a6b, metalness: 0.0, roughness: 0.9,
|
|
57
|
+
sheen: 1.0, sheenRoughness: 0.5, sheenColor: new THREE.Color(0x8899bb), envMapIntensity: 0.5 });
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Read:** separate roles by roughness/metalness contrast (matte vs glossy, metal vs plastic), not hue alone.
|
|
61
|
+
|
|
62
|
+
### Glass: real vs fake
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
// REAL refractive glass — MeshPhysicalMaterial transmission.
|
|
66
|
+
new THREE.MeshPhysicalMaterial({ metalness: 0.0, roughness: 0.05, transmission: 1.0,
|
|
67
|
+
thickness: 0.5, ior: 1.5, envMapIntensity: 1.0 });
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- **When:** one or two hero surfaces (cockpit canopy, potion vial) at close range.
|
|
71
|
+
- **Cost:** high. Each transmissive material triggers an extra scene render into a transmission buffer every frame; fill-rate heavy and multiplies with resolution. Never use on repeated/instanced props.
|
|
72
|
+
- **Read:** refraction must not smear the hazard behind it into unreadability.
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
// CHEAP fake glass — no transmission buffer. Use for repeated windows, visors, shields.
|
|
76
|
+
new THREE.MeshPhysicalMaterial({ color: 0x88ccff, metalness: 0.0, roughness: 0.1,
|
|
77
|
+
transparent: true, opacity: 0.25, clearcoat: 1.0, envMapIntensity: 1.5, depthWrite: false });
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
- **Cost:** one transparent draw call, no extra render target. Add the fresnel rim below for a readable edge.
|
|
81
|
+
|
|
82
|
+
## onBeforeCompile Patterns
|
|
83
|
+
|
|
84
|
+
Inject GLSL into stock materials to keep PBR lighting for free. Rules that make this safe with shared materials:
|
|
85
|
+
|
|
86
|
+
- **Cache key:** any material whose `onBeforeCompile` injects code MUST set `customProgramCacheKey` returning a string unique to that injection. Without it three can hand back a cached program compiled from a different (un-injected) material of the same type, silently dropping your code.
|
|
87
|
+
- **Sharing:** `onBeforeCompile` runs once per compiled program. Reuse one material instance across meshes and its uniforms update once for all. For per-object variation, use separate material instances (same cache key → program is still reused) or drive it from `instanceMatrix` / `instanceColor`.
|
|
88
|
+
- **Animating uniforms:** `onBeforeCompile` fires once, so stash the shader (`material.userData.shader = shader`) and write the uniform each frame: `if (m.userData.shader) m.userData.shader.uniforms.uTime.value = t;`. The snippets below use this pattern.
|
|
89
|
+
|
|
90
|
+
### (a) Fresnel rim glow
|
|
91
|
+
|
|
92
|
+
`vNormal` and `vViewPosition` (both view space) exist in the Standard/Physical fragment shader; `saturate` is defined in `<common>`.
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
material.onBeforeCompile = (shader) => {
|
|
96
|
+
shader.uniforms.uRimColor = { value: new THREE.Color(0x33ccff) };
|
|
97
|
+
shader.uniforms.uRimPower = { value: 3.0 };
|
|
98
|
+
shader.uniforms.uRimStrength = { value: 1.5 };
|
|
99
|
+
shader.fragmentShader =
|
|
100
|
+
'uniform vec3 uRimColor;\nuniform float uRimPower;\nuniform float uRimStrength;\n' +
|
|
101
|
+
shader.fragmentShader.replace(
|
|
102
|
+
'#include <emissivemap_fragment>',
|
|
103
|
+
`#include <emissivemap_fragment>
|
|
104
|
+
float fres = pow(1.0 - saturate(dot(normalize(vNormal), normalize(vViewPosition))), uRimPower);
|
|
105
|
+
totalEmissiveRadiance += uRimColor * fres * uRimStrength;`
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
material.customProgramCacheKey = () => 'fresnel-rim';
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
- **When:** shields, cloak/invuln states, silhouette separation from a busy background.
|
|
112
|
+
- **Cost:** a few ALU ops, no extra passes.
|
|
113
|
+
- **Read:** the rim marks a state change; keep base color readable when the rim is off.
|
|
114
|
+
|
|
115
|
+
### (b) Scrolling emissive panels
|
|
116
|
+
|
|
117
|
+
Inject a private UV varying so it works without a map assigned.
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
material.onBeforeCompile = (shader) => {
|
|
121
|
+
shader.uniforms.uTime = { value: 0 };
|
|
122
|
+
shader.uniforms.uPanelColor = { value: new THREE.Color(0x18e0ff) };
|
|
123
|
+
material.userData.shader = shader;
|
|
124
|
+
shader.vertexShader = 'varying vec2 vCookUv;\n' + shader.vertexShader.replace(
|
|
125
|
+
'#include <begin_vertex>', '#include <begin_vertex>\n vCookUv = uv;');
|
|
126
|
+
shader.fragmentShader =
|
|
127
|
+
'uniform float uTime;\nuniform vec3 uPanelColor;\nvarying vec2 vCookUv;\n' +
|
|
128
|
+
shader.fragmentShader.replace(
|
|
129
|
+
'#include <emissivemap_fragment>',
|
|
130
|
+
`#include <emissivemap_fragment>
|
|
131
|
+
float scroll = fract(vCookUv.y * 6.0 - uTime * 0.5);
|
|
132
|
+
float band = smoothstep(0.46, 0.5, scroll) * smoothstep(0.54, 0.5, scroll);
|
|
133
|
+
totalEmissiveRadiance += uPanelColor * band * 2.0;`
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
material.customProgramCacheKey = () => 'scroll-emissive';
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
- **When:** energy conduits, reactor walls, loading/charge bars, boost lanes.
|
|
140
|
+
- **Cost:** one `fract`/`smoothstep`, no textures.
|
|
141
|
+
- **Read:** scroll direction/speed should encode state (charging up, draining down).
|
|
142
|
+
|
|
143
|
+
### (c) Wind sway (foliage / flags)
|
|
144
|
+
|
|
145
|
+
`transformed` is object space and displaced before `<project_vertex>` applies `instanceMatrix`, so read the instance translation column for per-instance phase. Assumes model origin at the base, up = +Y.
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
material.onBeforeCompile = (shader) => {
|
|
149
|
+
shader.uniforms.uTime = { value: 0 };
|
|
150
|
+
material.userData.shader = shader;
|
|
151
|
+
shader.vertexShader = 'uniform float uTime;\n' + shader.vertexShader.replace(
|
|
152
|
+
'#include <begin_vertex>',
|
|
153
|
+
`#include <begin_vertex>
|
|
154
|
+
#ifdef USE_INSTANCING
|
|
155
|
+
float phase = instanceMatrix[3].x + instanceMatrix[3].z; // instance world offset
|
|
156
|
+
#else
|
|
157
|
+
float phase = 0.0;
|
|
158
|
+
#endif
|
|
159
|
+
float h = max(position.y, 0.0); // base stays planted, tips move most
|
|
160
|
+
transformed.x += sin(uTime * 1.5 + phase) * 0.08 * h;
|
|
161
|
+
transformed.z += cos(uTime * 1.1 + phase) * 0.05 * h;`
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
material.customProgramCacheKey = () => 'wind-sway';
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
- **When:** grass cards, banners, antennae, kelp — background life, not gameplay geometry.
|
|
168
|
+
- **Cost:** two trig ops per vertex; free on an `InstancedMesh`.
|
|
169
|
+
- **Read:** sway is ambient motion; never move collidable/interactable geometry with it.
|
|
170
|
+
|
|
171
|
+
### (d) Dissolve / spawn
|
|
172
|
+
|
|
173
|
+
Threshold-discard with a glowing edge. Inject a local-position varying and a hash; drive `uProgress` 0→1 to despawn, 1→0 to spawn.
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
material.onBeforeCompile = (shader) => {
|
|
177
|
+
shader.uniforms.uProgress = { value: 0 };
|
|
178
|
+
shader.uniforms.uEdgeColor = { value: new THREE.Color(0xff6a00) };
|
|
179
|
+
material.userData.shader = shader;
|
|
180
|
+
shader.vertexShader = 'varying vec3 vDisPos;\n' + shader.vertexShader.replace(
|
|
181
|
+
'#include <begin_vertex>', '#include <begin_vertex>\n vDisPos = position;');
|
|
182
|
+
shader.fragmentShader =
|
|
183
|
+
`uniform float uProgress;\nuniform vec3 uEdgeColor;\nvarying vec3 vDisPos;
|
|
184
|
+
float hash13(vec3 p){ p = fract(p * 0.1031); p += dot(p, p.yzx + 33.33); return fract((p.x + p.y) * p.z); }\n` +
|
|
185
|
+
shader.fragmentShader.replace(
|
|
186
|
+
'#include <dithering_fragment>',
|
|
187
|
+
`float n = hash13(floor(vDisPos * 12.0));
|
|
188
|
+
if (n < uProgress) discard;
|
|
189
|
+
float edge = smoothstep(uProgress, uProgress + 0.08, n);
|
|
190
|
+
gl_FragColor.rgb += uEdgeColor * (1.0 - edge) * 3.0; // post-tonemap add feeds bloom
|
|
191
|
+
#include <dithering_fragment>`
|
|
192
|
+
);
|
|
193
|
+
};
|
|
194
|
+
material.customProgramCacheKey = () => 'dissolve';
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
- **When:** enemy death, teleport-in, pickup spawn, object streaming.
|
|
198
|
+
- **Cost:** one hash + `discard` (discard disables early-Z; keep it to spawning objects, not the whole scene).
|
|
199
|
+
- **Read:** the edge color/direction telegraphs the event — spawn vs destroy must look different.
|
|
200
|
+
|
|
201
|
+
## Gradient Sky Dome
|
|
202
|
+
|
|
203
|
+
Cheaper than a cubemap for stylized scenes: a `BackSide` sphere with a top/horizon lerp plus a sun disc and halo.
|
|
204
|
+
|
|
205
|
+
```ts
|
|
206
|
+
const skyUniforms = {
|
|
207
|
+
uTop: { value: new THREE.Color(0x3a6fb0) },
|
|
208
|
+
uHorizon: { value: new THREE.Color(0xcfe4f5) },
|
|
209
|
+
uSunColor: { value: new THREE.Color(0xfff2cc) },
|
|
210
|
+
uSunDir: { value: new THREE.Vector3(0.4, 0.28, 0.6).normalize() },
|
|
211
|
+
};
|
|
212
|
+
const sky = new THREE.Mesh(
|
|
213
|
+
new THREE.SphereGeometry(500, 32, 16),
|
|
214
|
+
new THREE.ShaderMaterial({
|
|
215
|
+
side: THREE.BackSide, depthWrite: false, uniforms: skyUniforms,
|
|
216
|
+
vertexShader: `varying vec3 vDir;
|
|
217
|
+
void main(){ vDir = normalize(position); gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`,
|
|
218
|
+
fragmentShader: `varying vec3 vDir;
|
|
219
|
+
uniform vec3 uTop, uHorizon, uSunColor, uSunDir;
|
|
220
|
+
void main(){
|
|
221
|
+
float h = clamp(vDir.y * 0.5 + 0.5, 0.0, 1.0);
|
|
222
|
+
vec3 col = mix(uHorizon, uTop, pow(h, 0.6));
|
|
223
|
+
float d = clamp(dot(normalize(vDir), normalize(uSunDir)), 0.0, 1.0);
|
|
224
|
+
col += uSunColor * (pow(d, 800.0) + pow(d, 8.0) * 0.25); // disc + halo
|
|
225
|
+
gl_FragColor = vec4(col, 1.0);
|
|
226
|
+
}`,
|
|
227
|
+
})
|
|
228
|
+
);
|
|
229
|
+
sky.frustumCulled = false;
|
|
230
|
+
scene.add(sky);
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
- **When:** any stylized outdoor scene without a photographic backdrop.
|
|
234
|
+
- **Cost:** one draw call, no cubemap textures, no mips.
|
|
235
|
+
- **Read:** a raw `ShaderMaterial` bypasses tone mapping and sRGB conversion — author colors in display space; if the scene runs ACES, nudge them brighter. Keep horizon value distinct from hazards silhouetted against it.
|
|
236
|
+
|
|
237
|
+
## Post-Processing Chain
|
|
238
|
+
|
|
239
|
+
Finishing pass only. Move tone mapping/sRGB to `OutputPass`; keep `renderer.toneMapping` set so it reads it.
|
|
240
|
+
|
|
241
|
+
```ts
|
|
242
|
+
import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
|
|
243
|
+
import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
|
|
244
|
+
import { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js';
|
|
245
|
+
import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js';
|
|
246
|
+
import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';
|
|
247
|
+
|
|
248
|
+
const composer = new EffectComposer(renderer);
|
|
249
|
+
composer.addPass(new RenderPass(scene, camera));
|
|
250
|
+
|
|
251
|
+
// UnrealBloomPass(resolution, strength, radius, threshold)
|
|
252
|
+
const bloom = new UnrealBloomPass(new THREE.Vector2(innerWidth, innerHeight),
|
|
253
|
+
0.45, // strength: 0.35-0.6
|
|
254
|
+
0.3, // radius: 0.2-0.4
|
|
255
|
+
0.85); // threshold: only pixels brighter than this bloom
|
|
256
|
+
composer.addPass(bloom);
|
|
257
|
+
|
|
258
|
+
const VignetteShader = {
|
|
259
|
+
uniforms: { tDiffuse: { value: null }, uStrength: { value: 0.85 }, uSize: { value: 0.72 } },
|
|
260
|
+
vertexShader: `varying vec2 vUv; void main(){ vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`,
|
|
261
|
+
fragmentShader: `uniform sampler2D tDiffuse; uniform float uStrength, uSize; varying vec2 vUv;
|
|
262
|
+
void main(){
|
|
263
|
+
vec4 c = texture2D(tDiffuse, vUv);
|
|
264
|
+
float d = distance(vUv, vec2(0.5));
|
|
265
|
+
c.rgb *= mix(1.0, smoothstep(uSize, uSize - 0.45, d), uStrength);
|
|
266
|
+
gl_FragColor = c;
|
|
267
|
+
}`,
|
|
268
|
+
};
|
|
269
|
+
composer.addPass(new ShaderPass(VignetteShader));
|
|
270
|
+
composer.addPass(new OutputPass()); // ALWAYS last: tone mapping + sRGB
|
|
271
|
+
|
|
272
|
+
// In R3F projects: call composer.render() inside useFrame and disable the
|
|
273
|
+
// default R3F present path for that frame; do not also run a separate outer
|
|
274
|
+
// renderer.render() game loop. Imperative-only demos may replace renderer.render().
|
|
275
|
+
// In R3F projects: call composer.render() inside useFrame and disable the
|
|
276
|
+
// default R3F present path for that frame; do not also run a separate outer
|
|
277
|
+
// renderer.render() game loop. Imperative-only demos may replace renderer.render().
|
|
278
|
+
// loop: composer.render() instead of renderer.render()
|
|
279
|
+
// resize: composer.setSize(w, h); composer.setPixelRatio(Math.min(devicePixelRatio, 2));
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
- **Bloom rule:** bloom sells authored emissive (threshold 0.85 keeps mid-bright materials out). It must never be the main source of detail — if a shape only reads because it glows, the geometry is missing.
|
|
283
|
+
- **Vignette cost:** one full-screen ShaderPass; keep `uStrength` subtle, never darken the play path.
|
|
284
|
+
- **Mobile:** the composer allocates full-resolution HDR targets, so cost scales with DPR². Cap DPR before adding passes. On low-end, skip the composer (call `renderer.render`) or run bloom-only via `composer.setPixelRatio(Math.min(devicePixelRatio, 1.25))`. Compare screenshots with post on/off and profile.
|
|
285
|
+
|
|
286
|
+
## Cheap Tricks
|
|
287
|
+
|
|
288
|
+
- **Vertex-color AO** — bake occlusion into the mesh: `geometry.setAttribute('color', new THREE.BufferAttribute(colors, 3))`, material `{ vertexColors: true }`, darken cavities/creases. **When:** static props/terrain. **Cost:** one attribute, zero draw calls. **Read:** ground shapes with contact darkness; don't tint gameplay-critical surfaces.
|
|
289
|
+
- **Polygon-offset decals** — coplanar decal mesh with `{ polygonOffset: true, polygonOffsetFactor: -1, polygonOffsetUnits: -1, transparent: true }` to kill z-fighting. **When:** panel lines, numbers, faction glyphs. **Cost:** +1 draw call each — instance repeats. **Read:** decals imply function/scale, not random surface noise.
|
|
290
|
+
- **Fake contact shadow** — flat `PlaneGeometry` with a radial-gradient `CanvasTexture`, `{ transparent: true, depthWrite: false }`, under the object; scale/fade alpha with height. **When:** hovering or moving props that don't warrant a shadow map. **Cost:** one draw call, no shadow pass. **Read:** anchors floating objects so position reads.
|
|
291
|
+
- **Emissive LOD signals** — swap `emissiveIntensity` or material by distance so far pickups/beacons still read, add geometry detail only up close. **When:** dense repeated signals. **Cost:** a material/uniform swap. **Read:** keep the signal color constant across LOD so identity survives the transition.
|
|
292
|
+
- **Matcap props** — `new THREE.MeshMatcapMaterial({ matcap })` bakes lighting into one texture; no lights or env needed. **When:** background/stylized props. **Cost:** the cheapest lit-looking material, one texture. **Read:** matcap ignores scene lights, so never use it where a dynamic light or state glow must show on the surface.
|