zhuda-laya-engine 0.0.0-stage → 2.1.0
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/AGENTS.md +236 -0
- package/CHANGELOG.md +431 -0
- package/LICENSE +41 -0
- package/README.md +247 -2
- package/assets/branding/layaair-tribute-mark.svg +5 -0
- package/assets/branding/zhuda-layaair-mark.svg +34 -0
- package/assets/prefabs/CoinFountainVfx.lh +197 -0
- package/assets/prefabs/ConfirmActionButton.lh +87 -0
- package/assets/prefabs/LevelUpAuraVfx.lh +136 -0
- package/assets/prefabs/MineExplosionParticle.lh +352 -0
- package/assets/prefabs/NineSliceDialogFrame.lh +171 -0
- package/assets/prefabs/SwordSlashTrailVfx.lh +117 -0
- package/assets/prefabs/TacticalHudBar.lh +134 -0
- package/assets/prefabs/TelemetryDashboard.lh +87 -0
- package/assets/prefabs/UnityCrystalGuardian.lh +144 -0
- package/assets/prefabs/ZhudaSpine42Mascot.lh +183 -0
- package/assets/scenes/MinesweeperStage.ls +1180 -0
- package/dist/asset-calibration-report.json +969 -0
- package/dist/build-manifest.json +254 -0
- package/dist/sdk/zhuda-laya-csg.cjs +710 -0
- package/dist/sdk/zhuda-laya-csg.esm.js +683 -0
- package/dist/sdk/zhuda-laya-csg.min.cjs +7 -0
- package/dist/sdk/zhuda-laya-csg.min.esm.js +7 -0
- package/dist/sdk/zhuda-laya-demo.cjs +5990 -0
- package/dist/sdk/zhuda-laya-demo.esm.js +5956 -0
- package/dist/sdk/zhuda-laya-demo.min.cjs +12 -0
- package/dist/sdk/zhuda-laya-demo.min.esm.js +12 -0
- package/dist/sdk/zhuda-laya-engine.cjs +52628 -0
- package/dist/sdk/zhuda-laya-engine.esm.js +51848 -0
- package/dist/sdk/zhuda-laya-engine.min.cjs +2710 -0
- package/dist/sdk/zhuda-laya-engine.min.esm.js +2710 -0
- package/docs/3d-acceptance.md +47 -0
- package/docs/3d-integration.md +190 -0
- package/docs/README.md +112 -0
- package/docs/SUPPORT.md +21 -0
- package/docs/agent-development.md +219 -0
- package/docs/animation-control.md +213 -0
- package/docs/asset-loading.md +97 -0
- package/docs/assets/reference-games.jpg +0 -0
- package/docs/assets/solana-qr.png +0 -0
- package/docs/assets/sponsor-pass.svg +32 -0
- package/docs/audio.md +319 -0
- package/docs/backend-delivery.md +218 -0
- package/docs/basis-textures.md +94 -0
- package/docs/browser-sdk-releases.json +204 -0
- package/docs/browser-sdk.md +187 -0
- package/docs/cinematics.md +267 -0
- package/docs/cloth.md +280 -0
- package/docs/combat-runtime.md +82 -0
- package/docs/consumer-route.md +169 -0
- package/docs/consumer-tooling.md +518 -0
- package/docs/crowd-runtime.md +195 -0
- package/docs/developer-tooling.md +191 -0
- package/docs/film-scenes.md +1504 -0
- package/docs/filmic-rendering.md +743 -0
- package/docs/flythrough.md +89 -0
- package/docs/gpu-depth.md +207 -0
- package/docs/grass.md +127 -0
- package/docs/hdr-environment.md +76 -0
- package/docs/instanced-meshes.md +137 -0
- package/docs/layout-and-media.md +37 -0
- package/docs/layout-wireframe.md +80 -0
- package/docs/lighting-depth.md +185 -0
- package/docs/minigame-packaging.md +79 -0
- package/docs/model-editor.md +66 -0
- package/docs/model-lod.md +122 -0
- package/docs/model-pipeline.md +74 -0
- package/docs/model-showcase.md +365 -0
- package/docs/overview.md +183 -0
- package/docs/plans/README.md +133 -0
- package/docs/plans/TASK-TEMPLATE.md +64 -0
- package/docs/plans/TASK-spine38-isolated-topology-20261106.md +89 -0
- package/docs/plans/TEMPLATE.md +44 -0
- package/docs/plans/VERIFICATION-TEMPLATE.md +45 -0
- package/docs/plans/asset-packaging.md +140 -0
- package/docs/plans/cinematic-production/task.md +97 -0
- package/docs/plans/cinematic-production/verification.md +49 -0
- package/docs/plans/consumer-delivery-followups.md +129 -0
- package/docs/plans/desktop-and-agent-gates/hardening-task.md +85 -0
- package/docs/plans/desktop-and-agent-gates/hardening-verification.md +109 -0
- package/docs/plans/desktop-and-agent-gates/task.md +94 -0
- package/docs/plans/desktop-and-agent-gates/verification.md +60 -0
- package/docs/plans/prefab-toolchain.md +73 -0
- package/docs/plans/preview-runtime-hardening.md +68 -0
- package/docs/platform-adapters.md +113 -0
- package/docs/post-quality.md +242 -0
- package/docs/prefab-editor.md +194 -0
- package/docs/prefab-library.md +94 -0
- package/docs/prefab-workflow.md +75 -0
- package/docs/procedural-assets.md +463 -0
- package/docs/procedural-prefabs.md +133 -0
- package/docs/quality-route.md +386 -0
- package/docs/release-policy.md +79 -0
- package/docs/routes/README.md +180 -0
- package/docs/routes/TEMPLATE.md +54 -0
- package/docs/routes/action-adventure-3d-minigame.md +238 -0
- package/docs/routes/apocalypse-survival-3d.md +219 -0
- package/docs/routes/aqua-freeze-2d-minigame.md +183 -0
- package/docs/routes/astral-minimal-film-look.md +141 -0
- package/docs/routes/cascade-slot.md +93 -0
- package/docs/routes/clip-free-garments.md +229 -0
- package/docs/routes/drop-merge-2d-minigame.md +200 -0
- package/docs/routes/dungeon-line-slot.md +87 -0
- package/docs/routes/film-as-data.md +131 -0
- package/docs/routes/film-fight-that-lands.md +198 -0
- package/docs/routes/film-ink-lines.md +120 -0
- package/docs/routes/floating-island.md +229 -0
- package/docs/routes/game-2d.md +168 -0
- package/docs/routes/game-rules-first.md +89 -0
- package/docs/routes/game-to-prefabs.md +249 -0
- package/docs/routes/go-game-server.md +95 -0
- package/docs/routes/good-looking-3d-scene.md +99 -0
- package/docs/routes/high-quality-character.md +263 -0
- package/docs/routes/humanoid-from-shapes.md +97 -0
- package/docs/routes/hunting-action-3d.md +76 -0
- package/docs/routes/idle-gacha-2d.md +67 -0
- package/docs/routes/interactive-film-viewer.md +141 -0
- package/docs/routes/isometric-mystery-2d.md +217 -0
- package/docs/routes/key-art-to-animated-title.md +132 -0
- package/docs/routes/laya-ide-project-cli-web.md +125 -0
- package/docs/routes/layered-cloth-on-body.md +240 -0
- package/docs/routes/low-poly-character-from-shapes.md +475 -0
- package/docs/routes/match-three-2d.md +64 -0
- package/docs/routes/merge-2d.md +59 -0
- package/docs/routes/mini-game-build.md +80 -0
- package/docs/routes/mobile-always-landscape.md +149 -0
- package/docs/routes/mobile-web-fullscreen.md +255 -0
- package/docs/routes/model-from-dcc.md +106 -0
- package/docs/routes/new-game-project.md +100 -0
- package/docs/routes/onboarding-tutorial-2d.md +54 -0
- package/docs/routes/online-lockstep-match.md +473 -0
- package/docs/routes/outdoor-landscape.md +134 -0
- package/docs/routes/outfit-swap-3d.md +144 -0
- package/docs/routes/papercraft-diorama.md +186 -0
- package/docs/routes/platform-fighter-2d.md +235 -0
- package/docs/routes/platformer-2d.md +69 -0
- package/docs/routes/pole-rescue-arcade-3d.md +198 -0
- package/docs/routes/pose-atlas-motion.md +188 -0
- package/docs/routes/prototype-to-center.md +162 -0
- package/docs/routes/raft-brawl-3d-minigame.md +205 -0
- package/docs/routes/rhythm-2d.md +82 -0
- package/docs/routes/rigged-phone-character.md +120 -0
- package/docs/routes/screen-fit-game-box.md +127 -0
- package/docs/routes/shared-islands.md +195 -0
- package/docs/routes/side-view-duel.md +266 -0
- package/docs/routes/single-html-page.md +83 -0
- package/docs/routes/smooth-character-motion.md +162 -0
- package/docs/routes/spine-character.md +175 -0
- package/docs/routes/story-counting-2d.md +219 -0
- package/docs/routes/survivors-2d.md +60 -0
- package/docs/routes/third-person-town-3d.md +240 -0
- package/docs/routes/tower-defence-3d.md +67 -0
- package/docs/routes/ui-test-by-probe.md +219 -0
- package/docs/routes/underwater.md +138 -0
- package/docs/routes/visual-content-prefab.md +101 -0
- package/docs/runtime-hardening.md +108 -0
- package/docs/shader-warm-up.md +125 -0
- package/docs/spring-bones.md +79 -0
- package/docs/stylized-shading.md +171 -0
- package/docs/terrain-shader.md +130 -0
- package/docs/vrm.md +128 -0
- package/docs/walking.md +97 -0
- package/docs/webgpu.md +225 -0
- package/docs/white-label-themes.md +212 -0
- package/docs/zh-CN/README.md +130 -0
- package/examples/browser-sdk/2d-webgpu.html +46 -0
- package/examples/browser-sdk/2d.html +46 -0
- package/examples/browser-sdk/3d-gltf-webgpu.html +50 -0
- package/examples/browser-sdk/3d-gltf.html +50 -0
- package/examples/browser-sdk/3d-webgpu.html +46 -0
- package/examples/browser-sdk/3d.html +46 -0
- package/examples/cinematic-capture/Main.ts +294 -0
- package/examples/cinematic-capture/README.md +27 -0
- package/examples/model-inspector/README.md +15 -0
- package/examples/model-inspector/asset.gltf +158 -0
- package/examples/windows-webgpu/README.md +57 -0
- package/examples/windows-webgpu/bundle.mjs +122 -0
- package/examples/windows-webgpu/main.mjs +302 -0
- package/examples/windows-webgpu/package-lock.json +2353 -0
- package/examples/windows-webgpu/package.json +40 -0
- package/examples/windows-webgpu/squirrel.mjs +66 -0
- package/package.json +259 -4
- package/packages/ci-gate/export-film.mjs +347 -0
- package/packages/ci-gate/verify-sequence.mjs +285 -0
- package/packages/compiler/agent-contract.mjs +545 -0
- package/packages/compiler/ast-scanner.mjs +254 -0
- package/packages/compiler/backend-loader.mjs +62 -0
- package/packages/compiler/branding-assets.mjs +32 -0
- package/packages/compiler/branding.mjs +324 -0
- package/packages/compiler/browser-auto-example.mjs +31 -0
- package/packages/compiler/browser-model-example.mjs +53 -0
- package/packages/compiler/browser-process.mjs +344 -0
- package/packages/compiler/browser-sdk-example.mjs +50 -0
- package/packages/compiler/browser-sdk.mjs +342 -0
- package/packages/compiler/chrome-host.mjs +196 -0
- package/packages/compiler/cli.mjs +22 -0
- package/packages/compiler/compiler-runtime.mjs +41 -0
- package/packages/compiler/consumer-accept.mjs +89 -0
- package/packages/compiler/consumer-build.mjs +641 -0
- package/packages/compiler/consumer-guards.mjs +422 -0
- package/packages/compiler/consumer-publication.mjs +56 -0
- package/packages/compiler/consumer-scripts.mjs +134 -0
- package/packages/compiler/consumer-starter-2d.mjs +54 -0
- package/packages/compiler/consumer-starter-minigame.mjs +30 -0
- package/packages/compiler/editor-http.mjs +210 -0
- package/packages/compiler/editor-request.ts +12 -0
- package/packages/compiler/film-host-client.ts +249 -0
- package/packages/compiler/flythrough-file.mjs +144 -0
- package/packages/compiler/json-locate.mjs +85 -0
- package/packages/compiler/layout-contract.mjs +472 -0
- package/packages/compiler/minigame-bootstrap.mjs +24 -0
- package/packages/compiler/minigame-bridge.mjs +66 -0
- package/packages/compiler/minigame-guards.mjs +107 -0
- package/packages/compiler/minigame-toolchain.mjs +241 -0
- package/packages/compiler/model-crown.mjs +173 -0
- package/packages/compiler/model-editor-client.ts +809 -0
- package/packages/compiler/model-editor.mjs +242 -0
- package/packages/compiler/model-lod.mjs +547 -0
- package/packages/compiler/prefab-check.mjs +288 -0
- package/packages/compiler/prefab-checks.mjs +74 -0
- package/packages/compiler/prefab-dependencies.mjs +102 -0
- package/packages/compiler/prefab-editor-client.ts +950 -0
- package/packages/compiler/prefab-editor-preview.ts +89 -0
- package/packages/compiler/prefab-editor-server.mjs +585 -0
- package/packages/compiler/prefab-editor.mjs +43 -0
- package/packages/compiler/prefab-environment.mjs +107 -0
- package/packages/compiler/prefab-lifecycle.mjs +60 -0
- package/packages/compiler/prefab-preview.mjs +159 -0
- package/packages/compiler/prefab-watch.mjs +459 -0
- package/packages/compiler/runtime3d-types.mjs +91 -0
- package/packages/compiler/stage-probe.mjs +557 -0
- package/packages/compiler/visual-asset-audit.mjs +609 -0
- package/packages/compiler/visual-contract-audit.mjs +173 -0
- package/packages/compiler/webgpu-loader.mjs +153 -0
- package/packages/compiler/zhuda-build.mjs +714 -0
- package/packages/compiler/zhuda-doctor.mjs +186 -0
- package/packages/compiler/zhuda-init.mjs +353 -0
- package/packages/compiler/zhuda-layout.mjs +163 -0
- package/packages/compiler/zhuda-minigame.mjs +636 -0
- package/packages/core/BenchmarkEngine.ts +2 -0
- package/packages/core/BitmapFontContract.ts +159 -0
- package/packages/core/DeclarativeSDK.ts +686 -0
- package/packages/core/IframeSoundAdapter.ts +1824 -0
- package/packages/core/NoSleepAdapter.ts +302 -0
- package/packages/core/PixelCalibrationEngine.ts +602 -0
- package/packages/core/Prefab.ts +314 -0
- package/packages/core/RealmGuards.ts +111 -0
- package/packages/core/ResponsiveLayout.ts +149 -0
- package/packages/core/RuntimeGuards.ts +261 -0
- package/packages/core/SpineCharacter.ts +243 -0
- package/packages/core/SpineVisualContract.ts +238 -0
- package/packages/core/SplashSignal.ts +72 -0
- package/packages/core/StaticAssetPipeline.ts +3 -0
- package/packages/core/TopologyGraph.ts +693 -0
- package/packages/core/UnityBridgePipeline.ts +2 -0
- package/packages/core/VideoSurface.ts +75 -0
- package/packages/core/ViewportMatrixEngine.ts +237 -0
- package/packages/core/VisualFocusContract.ts +76 -0
- package/packages/core/VisualMigrationPipeline.ts +245 -0
- package/packages/core/WebViewSurface.ts +116 -0
- package/packages/core/audio/OfflineMix.ts +186 -0
- package/packages/core/audio/Spatial.ts +312 -0
- package/packages/core/audio/StreamVoice.ts +161 -0
- package/packages/core/csg/Bsp.ts +310 -0
- package/packages/core/csg/index.ts +589 -0
- package/packages/core/effects/Effect2D.ts +286 -0
- package/packages/core/effects/Effect3D.ts +213 -0
- package/packages/core/effects/EffectBudget.ts +695 -0
- package/packages/core/effects/EffectDirector.ts +254 -0
- package/packages/core/effects/EffectPresets.ts +843 -0
- package/packages/core/effects/EffectPresets2D.ts +1011 -0
- package/packages/core/effects/EffectSprites.ts +143 -0
- package/packages/core/effects/ParticleEventLink.ts +53 -0
- package/packages/core/effects/README.md +108 -0
- package/packages/core/effects/VfxMaterial.ts +253 -0
- package/packages/core/film/BakeKey.ts +21 -0
- package/packages/core/film/ColorValues.ts +44 -0
- package/packages/core/film/FilmLint.ts +353 -0
- package/packages/core/film/FilmPrefab.ts +82 -0
- package/packages/core/film/FilmReview.ts +84 -0
- package/packages/core/film/FilmScene.ts +3442 -0
- package/packages/core/film/FilmStage.ts +2148 -0
- package/packages/core/film/Flythrough.ts +169 -0
- package/packages/core/film/FlythroughReport.ts +326 -0
- package/packages/core/film/FrameMetrics.ts +167 -0
- package/packages/core/film/LiveLook.ts +242 -0
- package/packages/core/film/LookQuality.ts +94 -0
- package/packages/core/film/Projection.ts +74 -0
- package/packages/core/film/SceneLook.ts +363 -0
- package/packages/core/film/index.ts +12 -0
- package/packages/core/index.ts +48 -0
- package/packages/core/particles/EffectEnvelope.ts +52 -0
- package/packages/core/particles/LayaParticleRenderer.ts +182 -0
- package/packages/core/particles/LayaParticleRenderer3D.ts +218 -0
- package/packages/core/particles/ParticleExtras.ts +163 -0
- package/packages/core/particles/ParticleMesh3D.ts +156 -0
- package/packages/core/particles/ParticleSystem.ts +324 -0
- package/packages/core/particles/ParticleSystem3D.ts +411 -0
- package/packages/core/particles/ParticleTypes.ts +230 -0
- package/packages/core/particles/ParticleTypes3D.ts +115 -0
- package/packages/core/particles/README.md +181 -0
- package/packages/core/particles/RibbonPath3D.ts +234 -0
- package/packages/core/particles/RibbonTrail.ts +145 -0
- package/packages/core/particles/RibbonTrail3D.ts +166 -0
- package/packages/core/particles/index.ts +12 -0
- package/packages/core/prefabs/PrefabLibrary.ts +692 -0
- package/packages/core/prefabs/PrefabTree3D.ts +291 -0
- package/packages/core/prefabs/index.ts +10 -0
- package/packages/core/procedural/Geometry.ts +1871 -0
- package/packages/core/procedural/Hand.ts +1510 -0
- package/packages/core/procedural/Isosurface.ts +1035 -0
- package/packages/core/procedural/ModuleHarness.ts +180 -0
- package/packages/core/procedural/Noise.ts +123 -0
- package/packages/core/procedural/PhotoMaterial.ts +283 -0
- package/packages/core/procedural/ProceduralAssetProvider.ts +105 -0
- package/packages/core/procedural/ProceduralMaterial.ts +184 -0
- package/packages/core/procedural/PropFactory.ts +307 -0
- package/packages/core/procedural/Random.ts +70 -0
- package/packages/core/procedural/SynthAudio.ts +221 -0
- package/packages/core/procedural/TerrainMesh.ts +207 -0
- package/packages/core/procedural/TextureRecipe.ts +464 -0
- package/packages/core/procedural/TriplanarMaterial.ts +169 -0
- package/packages/core/procedural/Variation.ts +94 -0
- package/packages/core/procedural/index.ts +15 -0
- package/packages/core/runtime3d/ActionFrames.ts +245 -0
- package/packages/core/runtime3d/AnimationBlend.ts +282 -0
- package/packages/core/runtime3d/AnimationBlendMath.ts +98 -0
- package/packages/core/runtime3d/AssetProvider.ts +775 -0
- package/packages/core/runtime3d/AssetShowcase.ts +190 -0
- package/packages/core/runtime3d/Assets.ts +801 -0
- package/packages/core/runtime3d/AsyncDeadline.ts +53 -0
- package/packages/core/runtime3d/AsyncOperation.ts +39 -0
- package/packages/core/runtime3d/BackendChoice.ts +359 -0
- package/packages/core/runtime3d/BakedCrowd.ts +575 -0
- package/packages/core/runtime3d/BasisTexture.ts +657 -0
- package/packages/core/runtime3d/CameraCollision.ts +69 -0
- package/packages/core/runtime3d/CameraEffects.ts +752 -0
- package/packages/core/runtime3d/CameraRig.ts +70 -0
- package/packages/core/runtime3d/CharacterController.ts +272 -0
- package/packages/core/runtime3d/CinematicCapture.ts +457 -0
- package/packages/core/runtime3d/Clocks.ts +724 -0
- package/packages/core/runtime3d/Cloth.ts +183 -0
- package/packages/core/runtime3d/Clouds.ts +462 -0
- package/packages/core/runtime3d/ColorLut.ts +351 -0
- package/packages/core/runtime3d/CombatQueries.ts +240 -0
- package/packages/core/runtime3d/ComputePass.ts +582 -0
- package/packages/core/runtime3d/CrowdPresentation.ts +368 -0
- package/packages/core/runtime3d/DebugDraw.ts +567 -0
- package/packages/core/runtime3d/DebugStats.ts +35 -0
- package/packages/core/runtime3d/Decals.ts +309 -0
- package/packages/core/runtime3d/DensityVolume.ts +238 -0
- package/packages/core/runtime3d/DistanceBricks.ts +349 -0
- package/packages/core/runtime3d/Dither.ts +199 -0
- package/packages/core/runtime3d/DrawWarmUp.ts +217 -0
- package/packages/core/runtime3d/EdgeSmoothing.ts +108 -0
- package/packages/core/runtime3d/EnvironmentProbe.ts +656 -0
- package/packages/core/runtime3d/Filmic.ts +973 -0
- package/packages/core/runtime3d/Foliage.ts +367 -0
- package/packages/core/runtime3d/GltfIntake.ts +914 -0
- package/packages/core/runtime3d/GltfSecondUv.ts +153 -0
- package/packages/core/runtime3d/GraphicsGuard.ts +171 -0
- package/packages/core/runtime3d/Grass.ts +1080 -0
- package/packages/core/runtime3d/GroundTruthAO.ts +360 -0
- package/packages/core/runtime3d/HalfFloat.ts +44 -0
- package/packages/core/runtime3d/HdrEnvironment.ts +588 -0
- package/packages/core/runtime3d/Ik.ts +392 -0
- package/packages/core/runtime3d/InputBuffer.ts +165 -0
- package/packages/core/runtime3d/InstancedMesh.ts +460 -0
- package/packages/core/runtime3d/Laya342Adapters.ts +1095 -0
- package/packages/core/runtime3d/Laya342GltfAdapter.ts +751 -0
- package/packages/core/runtime3d/LensFinish.ts +153 -0
- package/packages/core/runtime3d/LensFlare.ts +490 -0
- package/packages/core/runtime3d/LightFog.ts +1008 -0
- package/packages/core/runtime3d/LightingDepth.ts +544 -0
- package/packages/core/runtime3d/Lightmap.ts +238 -0
- package/packages/core/runtime3d/Math3D.ts +84 -0
- package/packages/core/runtime3d/MeshQuery.ts +547 -0
- package/packages/core/runtime3d/MeshoptModelDecoder.ts +354 -0
- package/packages/core/runtime3d/MiniGameSplash.ts +70 -0
- package/packages/core/runtime3d/ModelAnimationSampler.ts +97 -0
- package/packages/core/runtime3d/ModelCompatibility.ts +890 -0
- package/packages/core/runtime3d/ModelDecoder.ts +294 -0
- package/packages/core/runtime3d/ModelInspector.ts +226 -0
- package/packages/core/runtime3d/ModelLod.ts +163 -0
- package/packages/core/runtime3d/ModelPlacements.ts +426 -0
- package/packages/core/runtime3d/ObjectMotion.ts +217 -0
- package/packages/core/runtime3d/PhysicalCamera.ts +190 -0
- package/packages/core/runtime3d/PointShadow.ts +500 -0
- package/packages/core/runtime3d/PointShadowSchedule.ts +201 -0
- package/packages/core/runtime3d/Pool.ts +120 -0
- package/packages/core/runtime3d/ProbeVolume.ts +695 -0
- package/packages/core/runtime3d/QualityGovernor.ts +385 -0
- package/packages/core/runtime3d/QualityMemory.ts +200 -0
- package/packages/core/runtime3d/RenderScale.ts +356 -0
- package/packages/core/runtime3d/RenderSpaces.ts +105 -0
- package/packages/core/runtime3d/Renderer.ts +377 -0
- package/packages/core/runtime3d/ResultPlayback.ts +239 -0
- package/packages/core/runtime3d/Runtime.ts +507 -0
- package/packages/core/runtime3d/RuntimeDriver.ts +127 -0
- package/packages/core/runtime3d/SceneLifecycle.ts +211 -0
- package/packages/core/runtime3d/SceneMutation.ts +107 -0
- package/packages/core/runtime3d/SceneQueries.ts +191 -0
- package/packages/core/runtime3d/ScreenReflections.ts +595 -0
- package/packages/core/runtime3d/SelectionOutline.ts +389 -0
- package/packages/core/runtime3d/ShaderErrors.ts +104 -0
- package/packages/core/runtime3d/ShaderRegistry.ts +34 -0
- package/packages/core/runtime3d/ShaderWarmUp.ts +473 -0
- package/packages/core/runtime3d/ShadowUpdates.ts +287 -0
- package/packages/core/runtime3d/SkinBinding.ts +235 -0
- package/packages/core/runtime3d/Smaa.ts +386 -0
- package/packages/core/runtime3d/SmaaTables.ts +244 -0
- package/packages/core/runtime3d/SpringBones.ts +184 -0
- package/packages/core/runtime3d/SurfaceBuffer.ts +76 -0
- package/packages/core/runtime3d/Surfaces.ts +1105 -0
- package/packages/core/runtime3d/Themes.ts +344 -0
- package/packages/core/runtime3d/Timeline.ts +362 -0
- package/packages/core/runtime3d/ToneCurves.ts +292 -0
- package/packages/core/runtime3d/TransformGizmo.ts +539 -0
- package/packages/core/runtime3d/TriangleMask.ts +250 -0
- package/packages/core/runtime3d/Underwater.ts +778 -0
- package/packages/core/runtime3d/Utf8.ts +87 -0
- package/packages/core/runtime3d/Vrm.ts +773 -0
- package/packages/core/runtime3d/VrmDocument.ts +1830 -0
- package/packages/core/runtime3d/WalkGrid.ts +471 -0
- package/packages/core/runtime3d/WebGPU342Adapters.ts +280 -0
- package/packages/core/runtime3d/index.ts +147 -0
- package/packages/core/shaders/Laya342ShaderTemplates.ts +6 -0
- package/packages/core/shaders/LitSurfaceMaterial.ts +1076 -0
- package/packages/core/shaders/LitSurfaceTemplates.ts +13 -0
- package/packages/core/shaders/ReflectiveSurface.ts +285 -0
- package/packages/core/shaders/ShaderMaterials.ts +387 -0
- package/packages/core/shaders/ToonMaterial.ts +559 -0
- package/packages/core/shaders/WaterRipples.ts +170 -0
- package/packages/core/shaders/WaterSurface.ts +480 -0
- package/packages/core/shaders/ZhudaCommon.ts +109 -0
- package/packages/core/shaders/index.ts +6 -0
- package/packages/core/simulation/Cloth.ts +1541 -0
- package/packages/core/simulation/ParticleCore.ts +498 -0
- package/packages/core/simulation/SpringBones.ts +553 -0
- package/packages/core/simulation/index.ts +3 -0
- package/packages/core/terrain/Heightfield.ts +385 -0
- package/packages/core/terrain/Terrain2D.ts +324 -0
- package/packages/core/terrain/Terrain3D.ts +452 -0
- package/packages/core/terrain/TerrainShell.ts +94 -0
- package/packages/core/terrain/index.ts +3 -0
- package/packages/demo/BenchmarkEngine.ts +184 -0
- package/packages/demo/PixelCalibrationEngine.ts +36 -0
- package/packages/demo/ProceduralStarter.ts +312 -0
- package/packages/demo/StaticAssetPipeline.ts +1631 -0
- package/packages/demo/UnityBridgePipeline.ts +485 -0
- package/packages/demo/index.ts +6 -0
- package/packages/mcp-server/arguments.mjs +81 -0
- package/packages/mcp-server/corpus.mjs +627 -0
- package/packages/mcp-server/film-host.mjs +627 -0
- package/packages/mcp-server/film-session.mjs +95 -0
- package/packages/mcp-server/film-tools.mjs +460 -0
- package/packages/mcp-server/index.mjs +931 -0
- package/packages/mcp-server/quality-route.mjs +332 -0
- package/packages/mcp-server/roots.mjs +72 -0
- package/packages/mcp-server/runtime.mjs +81 -0
- package/packages/types/BitmapFontContract.d.ts +19 -0
- package/packages/types/DeclarativeSDK.d.ts +137 -0
- package/packages/types/IframeSoundAdapter.d.ts +173 -0
- package/packages/types/NoSleepAdapter.d.ts +50 -0
- package/packages/types/PixelCalibrationEngine.d.ts +83 -0
- package/packages/types/Prefab.d.ts +11 -0
- package/packages/types/RealmGuards.d.ts +26 -0
- package/packages/types/ResponsiveLayout.d.ts +10 -0
- package/packages/types/RuntimeGuards.d.ts +55 -0
- package/packages/types/SpineCharacter.d.ts +94 -0
- package/packages/types/SpineVisualContract.d.ts +50 -0
- package/packages/types/SplashSignal.d.ts +27 -0
- package/packages/types/TopologyGraph.d.ts +76 -0
- package/packages/types/VideoSurface.d.ts +21 -0
- package/packages/types/ViewportMatrixEngine.d.ts +27 -0
- package/packages/types/VisualFocusContract.d.ts +32 -0
- package/packages/types/VisualMigrationPipeline.d.ts +53 -0
- package/packages/types/WebViewSurface.d.ts +26 -0
- package/packages/types/audio/OfflineMix.d.ts +10 -0
- package/packages/types/audio/Spatial.d.ts +63 -0
- package/packages/types/audio/StreamVoice.d.ts +31 -0
- package/packages/types/browser.d.ts +44 -0
- package/packages/types/csg/Bsp.d.ts +85 -0
- package/packages/types/csg/index.d.ts +81 -0
- package/packages/types/demo/BenchmarkEngine.d.ts +61 -0
- package/packages/types/demo/PixelCalibrationEngine.d.ts +13 -0
- package/packages/types/demo/ProceduralStarter.d.ts +11 -0
- package/packages/types/demo/StaticAssetPipeline.d.ts +87 -0
- package/packages/types/demo/UnityBridgePipeline.d.ts +49 -0
- package/packages/types/demo/index.d.ts +7 -0
- package/packages/types/editor-preview.d.ts +27 -0
- package/packages/types/effects/Effect2D.d.ts +65 -0
- package/packages/types/effects/Effect3D.d.ts +42 -0
- package/packages/types/effects/EffectBudget.d.ts +179 -0
- package/packages/types/effects/EffectDirector.d.ts +68 -0
- package/packages/types/effects/EffectPresets.d.ts +27 -0
- package/packages/types/effects/EffectPresets2D.d.ts +32 -0
- package/packages/types/effects/EffectSprites.d.ts +23 -0
- package/packages/types/effects/ParticleEventLink.d.ts +16 -0
- package/packages/types/effects/VfxMaterial.d.ts +52 -0
- package/packages/types/film/BakeKey.d.ts +9 -0
- package/packages/types/film/ColorValues.d.ts +25 -0
- package/packages/types/film/FilmLint.d.ts +40 -0
- package/packages/types/film/FilmPrefab.d.ts +22 -0
- package/packages/types/film/FilmReview.d.ts +27 -0
- package/packages/types/film/FilmScene.d.ts +1214 -0
- package/packages/types/film/FilmStage.d.ts +237 -0
- package/packages/types/film/Flythrough.d.ts +44 -0
- package/packages/types/film/FlythroughReport.d.ts +132 -0
- package/packages/types/film/FrameMetrics.d.ts +49 -0
- package/packages/types/film/LiveLook.d.ts +60 -0
- package/packages/types/film/LookQuality.d.ts +24 -0
- package/packages/types/film/Projection.d.ts +20 -0
- package/packages/types/film/SceneLook.d.ts +122 -0
- package/packages/types/film/index.d.ts +13 -0
- package/packages/types/index.d.ts +49 -0
- package/packages/types/particles/EffectEnvelope.d.ts +18 -0
- package/packages/types/particles/LayaParticleRenderer.d.ts +30 -0
- package/packages/types/particles/LayaParticleRenderer3D.d.ts +29 -0
- package/packages/types/particles/ParticleExtras.d.ts +50 -0
- package/packages/types/particles/ParticleMesh3D.d.ts +24 -0
- package/packages/types/particles/ParticleSystem.d.ts +52 -0
- package/packages/types/particles/ParticleSystem3D.d.ts +69 -0
- package/packages/types/particles/ParticleTypes.d.ts +89 -0
- package/packages/types/particles/ParticleTypes3D.d.ts +56 -0
- package/packages/types/particles/RibbonPath3D.d.ts +32 -0
- package/packages/types/particles/RibbonTrail.d.ts +38 -0
- package/packages/types/particles/RibbonTrail3D.d.ts +22 -0
- package/packages/types/particles/index.d.ts +13 -0
- package/packages/types/prefabs/PrefabLibrary.d.ts +176 -0
- package/packages/types/prefabs/PrefabTree3D.d.ts +59 -0
- package/packages/types/prefabs/index.d.ts +4 -0
- package/packages/types/procedural/Geometry.d.ts +252 -0
- package/packages/types/procedural/Hand.d.ts +150 -0
- package/packages/types/procedural/Isosurface.d.ts +181 -0
- package/packages/types/procedural/ModuleHarness.d.ts +90 -0
- package/packages/types/procedural/Noise.d.ts +15 -0
- package/packages/types/procedural/PhotoMaterial.d.ts +49 -0
- package/packages/types/procedural/ProceduralAssetProvider.d.ts +31 -0
- package/packages/types/procedural/ProceduralMaterial.d.ts +63 -0
- package/packages/types/procedural/PropFactory.d.ts +94 -0
- package/packages/types/procedural/Random.d.ts +26 -0
- package/packages/types/procedural/SynthAudio.d.ts +49 -0
- package/packages/types/procedural/TerrainMesh.d.ts +55 -0
- package/packages/types/procedural/TextureRecipe.d.ts +125 -0
- package/packages/types/procedural/TriplanarMaterial.d.ts +27 -0
- package/packages/types/procedural/Variation.d.ts +23 -0
- package/packages/types/procedural/index.d.ts +16 -0
- package/packages/types/runtime3d/ActionFrames.d.ts +62 -0
- package/packages/types/runtime3d/AnimationBlend.d.ts +57 -0
- package/packages/types/runtime3d/AnimationBlendMath.d.ts +27 -0
- package/packages/types/runtime3d/AssetProvider.d.ts +167 -0
- package/packages/types/runtime3d/AssetShowcase.d.ts +44 -0
- package/packages/types/runtime3d/Assets.d.ts +166 -0
- package/packages/types/runtime3d/AsyncDeadline.d.ts +6 -0
- package/packages/types/runtime3d/AsyncOperation.d.ts +3 -0
- package/packages/types/runtime3d/BackendChoice.d.ts +130 -0
- package/packages/types/runtime3d/BakedCrowd.d.ts +156 -0
- package/packages/types/runtime3d/BasisTexture.d.ts +169 -0
- package/packages/types/runtime3d/CameraCollision.d.ts +20 -0
- package/packages/types/runtime3d/CameraEffects.d.ts +134 -0
- package/packages/types/runtime3d/CameraRig.d.ts +27 -0
- package/packages/types/runtime3d/CharacterController.d.ts +71 -0
- package/packages/types/runtime3d/CinematicCapture.d.ts +103 -0
- package/packages/types/runtime3d/Clocks.d.ts +200 -0
- package/packages/types/runtime3d/Cloth.d.ts +57 -0
- package/packages/types/runtime3d/Clouds.d.ts +69 -0
- package/packages/types/runtime3d/ColorLut.d.ts +73 -0
- package/packages/types/runtime3d/CombatQueries.d.ts +50 -0
- package/packages/types/runtime3d/ComputePass.d.ts +134 -0
- package/packages/types/runtime3d/CrowdPresentation.d.ts +104 -0
- package/packages/types/runtime3d/DebugDraw.d.ts +161 -0
- package/packages/types/runtime3d/DebugStats.d.ts +24 -0
- package/packages/types/runtime3d/Decals.d.ts +65 -0
- package/packages/types/runtime3d/DensityVolume.d.ts +39 -0
- package/packages/types/runtime3d/DistanceBricks.d.ts +97 -0
- package/packages/types/runtime3d/Dither.d.ts +78 -0
- package/packages/types/runtime3d/DrawWarmUp.d.ts +93 -0
- package/packages/types/runtime3d/EdgeSmoothing.d.ts +10 -0
- package/packages/types/runtime3d/EnvironmentProbe.d.ts +139 -0
- package/packages/types/runtime3d/Filmic.d.ts +243 -0
- package/packages/types/runtime3d/Foliage.d.ts +95 -0
- package/packages/types/runtime3d/GltfIntake.d.ts +236 -0
- package/packages/types/runtime3d/GltfSecondUv.d.ts +54 -0
- package/packages/types/runtime3d/GraphicsGuard.d.ts +18 -0
- package/packages/types/runtime3d/Grass.d.ts +226 -0
- package/packages/types/runtime3d/GroundTruthAO.d.ts +64 -0
- package/packages/types/runtime3d/HalfFloat.d.ts +13 -0
- package/packages/types/runtime3d/HdrEnvironment.d.ts +144 -0
- package/packages/types/runtime3d/Ik.d.ts +123 -0
- package/packages/types/runtime3d/InputBuffer.d.ts +49 -0
- package/packages/types/runtime3d/InstancedMesh.d.ts +116 -0
- package/packages/types/runtime3d/Laya342Adapters.d.ts +306 -0
- package/packages/types/runtime3d/Laya342GltfAdapter.d.ts +105 -0
- package/packages/types/runtime3d/LensFinish.d.ts +38 -0
- package/packages/types/runtime3d/LensFlare.d.ts +114 -0
- package/packages/types/runtime3d/LightFog.d.ts +190 -0
- package/packages/types/runtime3d/LightingDepth.d.ts +128 -0
- package/packages/types/runtime3d/Lightmap.d.ts +55 -0
- package/packages/types/runtime3d/Math3D.d.ts +19 -0
- package/packages/types/runtime3d/MeshQuery.d.ts +107 -0
- package/packages/types/runtime3d/MeshoptModelDecoder.d.ts +34 -0
- package/packages/types/runtime3d/MiniGameSplash.d.ts +4 -0
- package/packages/types/runtime3d/ModelAnimationSampler.d.ts +26 -0
- package/packages/types/runtime3d/ModelCompatibility.d.ts +169 -0
- package/packages/types/runtime3d/ModelDecoder.d.ts +66 -0
- package/packages/types/runtime3d/ModelInspector.d.ts +77 -0
- package/packages/types/runtime3d/ModelLod.d.ts +61 -0
- package/packages/types/runtime3d/ModelPlacements.d.ts +77 -0
- package/packages/types/runtime3d/ObjectMotion.d.ts +43 -0
- package/packages/types/runtime3d/PhysicalCamera.d.ts +51 -0
- package/packages/types/runtime3d/PointShadow.d.ts +71 -0
- package/packages/types/runtime3d/PointShadowSchedule.d.ts +74 -0
- package/packages/types/runtime3d/Pool.d.ts +33 -0
- package/packages/types/runtime3d/ProbeVolume.d.ts +123 -0
- package/packages/types/runtime3d/QualityGovernor.d.ts +201 -0
- package/packages/types/runtime3d/QualityMemory.d.ts +83 -0
- package/packages/types/runtime3d/RenderScale.d.ts +69 -0
- package/packages/types/runtime3d/RenderSpaces.d.ts +44 -0
- package/packages/types/runtime3d/Renderer.d.ts +62 -0
- package/packages/types/runtime3d/ResultPlayback.d.ts +70 -0
- package/packages/types/runtime3d/Runtime.d.ts +136 -0
- package/packages/types/runtime3d/RuntimeDriver.d.ts +42 -0
- package/packages/types/runtime3d/SceneLifecycle.d.ts +84 -0
- package/packages/types/runtime3d/SceneMutation.d.ts +34 -0
- package/packages/types/runtime3d/SceneQueries.d.ts +71 -0
- package/packages/types/runtime3d/ScreenReflections.d.ts +78 -0
- package/packages/types/runtime3d/SelectionOutline.d.ts +68 -0
- package/packages/types/runtime3d/ShaderErrors.d.ts +27 -0
- package/packages/types/runtime3d/ShaderRegistry.d.ts +10 -0
- package/packages/types/runtime3d/ShaderWarmUp.d.ts +162 -0
- package/packages/types/runtime3d/ShadowUpdates.d.ts +125 -0
- package/packages/types/runtime3d/SkinBinding.d.ts +53 -0
- package/packages/types/runtime3d/Smaa.d.ts +60 -0
- package/packages/types/runtime3d/SmaaTables.d.ts +12 -0
- package/packages/types/runtime3d/SpringBones.d.ts +69 -0
- package/packages/types/runtime3d/SurfaceBuffer.d.ts +28 -0
- package/packages/types/runtime3d/Surfaces.d.ts +326 -0
- package/packages/types/runtime3d/Themes.d.ts +70 -0
- package/packages/types/runtime3d/Timeline.d.ts +88 -0
- package/packages/types/runtime3d/ToneCurves.d.ts +59 -0
- package/packages/types/runtime3d/TransformGizmo.d.ts +139 -0
- package/packages/types/runtime3d/TriangleMask.d.ts +84 -0
- package/packages/types/runtime3d/Underwater.d.ts +120 -0
- package/packages/types/runtime3d/Utf8.d.ts +12 -0
- package/packages/types/runtime3d/Vrm.d.ts +120 -0
- package/packages/types/runtime3d/VrmDocument.d.ts +381 -0
- package/packages/types/runtime3d/WalkGrid.d.ts +94 -0
- package/packages/types/runtime3d/WebGPU342Adapters.d.ts +27 -0
- package/packages/types/runtime3d/index.d.ts +102 -0
- package/packages/types/shaders/Laya342ShaderTemplates.d.ts +3 -0
- package/packages/types/shaders/LitSurfaceMaterial.d.ts +257 -0
- package/packages/types/shaders/LitSurfaceTemplates.d.ts +7 -0
- package/packages/types/shaders/ReflectiveSurface.d.ts +58 -0
- package/packages/types/shaders/ShaderMaterials.d.ts +60 -0
- package/packages/types/shaders/ToonMaterial.d.ts +176 -0
- package/packages/types/shaders/WaterRipples.d.ts +48 -0
- package/packages/types/shaders/WaterSurface.d.ts +110 -0
- package/packages/types/shaders/ZhudaCommon.d.ts +31 -0
- package/packages/types/shaders/index.d.ts +7 -0
- package/packages/types/simulation/Cloth.d.ts +381 -0
- package/packages/types/simulation/ParticleCore.d.ts +125 -0
- package/packages/types/simulation/SpringBones.d.ts +107 -0
- package/packages/types/simulation/index.d.ts +4 -0
- package/packages/types/terrain/Heightfield.d.ts +67 -0
- package/packages/types/terrain/Terrain2D.d.ts +81 -0
- package/packages/types/terrain/Terrain3D.d.ts +80 -0
- package/packages/types/terrain/TerrainShell.d.ts +8 -0
- package/packages/types/terrain/index.d.ts +4 -0
- package/packages/types/vendor/LayaAir.runtime.d.ts +97440 -0
- package/packages/types/vendor/REPAIRS.md +30 -0
- package/packages/types/vendor/restored-3.4.2.json +142 -0
- package/packages/types/vendor/spine.runtime.d.ts +1507 -0
- package/packages/types/vendor/wechat-media.d.ts +877 -0
- package/packages/types/zhuda-2d-ui.d.ts +244 -0
- package/packages/types/zhuda-3d-physics.d.ts +34 -0
- package/packages/types/zhuda-audio.d.ts +128 -0
- package/packages/types/zhuda-bootstrap.d.ts +100 -0
- package/packages/types/zhuda-branding.d.ts +6 -0
- package/packages/types/zhuda-core.d.ts +46 -0
- package/packages/types/zhuda-declarative.d.ts +81 -0
- package/packages/types/zhuda-effects.d.ts +302 -0
- package/packages/types/zhuda-layout.d.ts +96 -0
- package/packages/types/zhuda-particles.d.ts +477 -0
- package/packages/types/zhuda-spine42.d.ts +23 -0
- package/packages/types/zhuda-static-assets.d.ts +389 -0
- package/packages/types/zhuda-video.d.ts +24 -0
- package/packages/types/zhuda-visual-contract.d.ts +52 -0
- package/packages/types/zhuda-webview.d.ts +43 -0
- package/vendor/basis/LICENSE.txt +55 -0
- package/vendor/basis/README.md +25 -0
- package/vendor/basis/basis_transcoder.js +19 -0
- package/vendor/basis/basis_transcoder.wasm +0 -0
- package/vendor/laya-3.4.2/WEBGPU-LICENSES.txt +1259 -0
- package/vendor/laya-3.4.2/libs/laya.ani.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.box2D.js +1209 -0
- package/vendor/laya-3.4.2/libs/laya.bridge.js +2273 -0
- package/vendor/laya-3.4.2/libs/laya.bullet.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.core.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.d3.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.device.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.gltf.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.ik.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.light2D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.line2D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.native-spine42.js +7672 -0
- package/vendor/laya-3.4.2/libs/laya.navMesh2d.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.navMesh3d.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.navMeshCommon.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.particle.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.particle3D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.particleCommon.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.physics2D.js +3774 -0
- package/vendor/laya-3.4.2/libs/laya.physics3D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.postProcess.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.spine.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.spine3D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.tilemap.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.trail2D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.trail3D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.trailCommon.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.ui.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.ui2.js +9904 -0
- package/vendor/laya-3.4.2/libs/laya.vfx.js +6754 -0
- package/vendor/laya-3.4.2/libs/laya.webgl_2D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.webgl_3D.js +1 -0
- package/vendor/laya-3.4.2/libs/laya.webgpu_2D.js +18576 -0
- package/vendor/laya-3.4.2/libs/laya.webgpu_3D.js +6729 -0
- package/vendor/laya-3.4.2/libs/nagabind.js +395 -0
- package/vendor/laya-3.4.2/libs/nagabind_bg.wasm +0 -0
- package/vendor/laya-3.4.2/libs/shader_compiler_web.js +22 -0
- package/vendor/laya-3.4.2/libs/shader_compiler_web.wasm +0 -0
- package/vendor/laya-3.4.2/libs/spine-core-3.8.js +1 -0
- package/vendor/laya-3.4.2/libs/spine-core-4.2.js +10216 -0
- package/vendor/laya-3.4.2/webgpu-provenance.json +41 -0
- package/vendor/meshoptimizer/LICENSE.txt +21 -0
- package/vendor/meshoptimizer/README.md +13 -0
- package/vendor/threejs-post/LICENSE.txt +53 -0
- package/vendor/threejs-post/README.md +54 -0
- package/zhuda.config.json +22 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Route: A 3D post-apocalyptic survival shooter with a Windows package
|
|
2
|
+
|
|
3
|
+
One survivor with a carbine in a fenced street block about 40 m across: collect three batteries, hold off infected that grab, shelter in a safehouse, call the extraction. Keyboard and mouse drive it; an authored camera plays the intro and the shelter scenes; a Go service holds the session boundary. Recorded on desktop WebGPU only (headless Chrome and an Electron smoke run on an Apple GPU).
|
|
4
|
+
|
|
5
|
+
- **Id:** `apocalypse-survival-3d`
|
|
6
|
+
- **Kind:** workflow
|
|
7
|
+
- **For:** building a single-player 3D survival shooter on WebGPU from heavy GLB/PBR assets, with a prefab gate, particles, voiced story shots, a Go session service and an Electron package for Windows
|
|
8
|
+
- **Checked on:** desktop WebGPU (headless Chrome 157 on an Apple GPU through Metal; Electron 45.2.3 smoke run on macOS, Apple M4); desktop Safari measured too slow before a fix and not measured after; no Windows GPU, no WebGL build, no phone
|
|
9
|
+
- **Status:** written on 2026-11-26 from the game's records, nothing was run for this page; last recorded `npm run verify` on 2026-11-13: 44 tests, Doctor healthy, 3 Prefab checks with 0 differing pixels; Windows hardware, phones and a person's full play-through are not recorded
|
|
10
|
+
- **Reference consumer:** ZhudaGameCenter `games/pigfall-apocalypse` (outside this repository; the workspace is not under version control)
|
|
11
|
+
- **Engine version:** zhuda-laya-engine 1.18.0 at `d61f6dbd7ff48f53ba0d253046286b7c25573b6e` (raised on 2026-11-13 from `dd9b5fd`, 1.15.0). Moved to 2.0.0 (`91d21f79`) on 2026-11-26: `npm run verify` 44 of 44 with Doctor HEALTHY, the three prefabs accepted at 0 different pixels against the kept baselines (WebGPU, headless Chrome 158), Go tests ok; the Windows package was not rebuilt
|
|
12
|
+
|
|
13
|
+
Read [new-game-project](new-game-project.md), [game-rules-first](game-rules-first.md) and [visual-content-prefab](visual-content-prefab.md) first.
|
|
14
|
+
|
|
15
|
+
## When to take this route
|
|
16
|
+
|
|
17
|
+
A single-player action game in one small 3D arena, built from large generated models, that ships
|
|
18
|
+
as a WebGPU web build and as a Windows desktop package, and that was moved in from a prototype
|
|
19
|
+
(`prototype-to-center` covers the move itself).
|
|
20
|
+
|
|
21
|
+
Not this route: one large boss with dodge frames ([hunting-action-3d](hunting-action-3d.md));
|
|
22
|
+
hundreds of enemies ([survivors-2d](survivors-2d.md)); a real online match (`go-game-server`,
|
|
23
|
+
`online-lockstep-match`: the server here is a seam, not a match); a phone game (no touch controls,
|
|
24
|
+
386 MB of assets); a page that must also run on WebGL (`"renderer": "auto"`,
|
|
25
|
+
[backend delivery](../backend-delivery.md)).
|
|
26
|
+
|
|
27
|
+
## Tools
|
|
28
|
+
|
|
29
|
+
- Engine pinned by commit in `client/package.json`; Node 24 or later; TypeScript 5.9.3; `esbuild`
|
|
30
|
+
0.27.1 for the tests, which arrives with the engine package and is not declared by the game.
|
|
31
|
+
Engine commands: `zhuda-laya-build` (`--candidate`), `zhuda-laya-accept`, `zhuda-laya-doctor`.
|
|
32
|
+
- Electron 45.2.3 (Chromium 156) and `@electron/packager` 20.3.0. Go 1.23, standard library only.
|
|
33
|
+
- Models: image-to-3D with Pixal3D on the owner's machine (MIT licence text in
|
|
34
|
+
`client/public/licenses/`) and two character files the owner supplied, reduced and rigged in
|
|
35
|
+
headless Blender (5.2 in the game's record) by `client/scripts/prepare-*.py`; source and target
|
|
36
|
+
hashes and triangle counts are in `client/source/`. No licence is recorded for the models.
|
|
37
|
+
- Sound: effects synthesised by `client/scripts/create-audio.py`, later filtered; seven voice
|
|
38
|
+
lines from the owner's local text-to-speech; a sting composed locally; the score is a
|
|
39
|
+
third-party track under CC BY 4.0, credited in the game's credits (`client/src/menu-panels.ts`).
|
|
40
|
+
- `node_modules/`, `dist/`, `release/`, `temp/` are ignored; evidence goes to `client/temp/`.
|
|
41
|
+
|
|
42
|
+
## Steps
|
|
43
|
+
|
|
44
|
+
1. **Split the prototype.** `client/` imports only the engine's public root; `server/` is Go.
|
|
45
|
+
`MIGRATION_INVENTORY.md` lists what moved and what was left out on purpose.
|
|
46
|
+
2. **Configure.** `client/zhuda.config.json`: features `core, 2d, 3d, ui, gltf, postProcess`,
|
|
47
|
+
`"renderer": "webgpu"`, `"maxPackageBytes": 500000000` (the default limit is 50 MB),
|
|
48
|
+
`prefabPreview` and three `prefabChecks`. Boot in `client/src/Main.ts` with `dprCap`, `signal`,
|
|
49
|
+
`bootTimeoutMs: 30000`, `clearInput`, `onContextLost` ([consumer route](../consumer-route.md),
|
|
50
|
+
[WebGPU](../webgpu.md)). Check: `npm run doctor`.
|
|
51
|
+
3. **Rules in plain TypeScript.** `client/src/rules.ts`: one `Save` object, a seeded generator,
|
|
52
|
+
`update(dt, input)` returning events. Moves are `ZhudaActionFrameSpec` at 60 frames a second on
|
|
53
|
+
`ZhudaActionStateMachine` ([combat runtime](../combat-runtime.md)): shot 9 frames (fires on 1),
|
|
54
|
+
reload 72 (loaded on 60), stock swing 20 (lands on 6), escape shove 36 (lands on 17). Win:
|
|
55
|
+
three batteries, then 3 s within 1.55 m of the radio. Check: `npm test`.
|
|
56
|
+
4. **One layout for feet, bullets and the camera.** `client/src/layout.ts`: boxes on the ground
|
|
57
|
+
with an optional yaw; `pushOut` moves first, then pushes the circle out of what it overlaps, so
|
|
58
|
+
bodies slide along walls; `raySolid` wraps the engine's `rayBox`
|
|
59
|
+
([3D integration](../3d-integration.md)). `python3 scripts/make-colliders.py` fits one turned
|
|
60
|
+
box per placed model from its GLB vertices into `src/colliders-generated.ts`; `?colliders`
|
|
61
|
+
outlines them. Check: `tests/colliders.test.mjs` fails when a model moved without a re-run.
|
|
62
|
+
5. **Provider and manifest.** `npm run assets:manifest` writes each asset's bytes and SHA-256 to
|
|
63
|
+
`src/asset-manifest.ts`. Previews, scene and sound share one `DirectoryAssetProvider` factory
|
|
64
|
+
in `src/prefabs.ts`, `maxBytes: 60000000` for a 56.7 MB model ([asset loading](../asset-loading.md)).
|
|
65
|
+
6. **Prefab gate for built geometry.** Shelter, supply case and radio are `Prefab3DDefinition`
|
|
66
|
+
trees of boxes (`src/shelter.ts`, `src/prefabs.ts`), checked at 640 by 480, DPR 1, 30 cycles.
|
|
67
|
+
Order: `npm run build:candidate`, `npm run accept:prefabs -- --capture`, look at the pictures,
|
|
68
|
+
`npm run accept:prefabs`, `npm run build` ([prefab workflow](../prefab-workflow.md)); from 1.18
|
|
69
|
+
the release build refuses stale evidence, so repeat it after every source change. The scene
|
|
70
|
+
mounts the same definitions through `ZhudaPrefabLibrary` (`src/world.ts`).
|
|
71
|
+
7. **GLB through the model library.** `src/scene-assets.ts` holds recipes (id, file, position,
|
|
72
|
+
rotation, scale) for `ZhudaModelLibrary.instantiate` with `independentMaterials: true`. Each is
|
|
73
|
+
seen alone first: `?preview=asset&id=<recipe>`, `?preview=character&character=zombie`,
|
|
74
|
+
`?preview=effects`. Budgets used: props 18,000 to 36,000 triangles with 2048 px textures;
|
|
75
|
+
asset-pack pieces 24,000 to 50,000 with 1024 px; survivor 120,000, infected 40,000
|
|
76
|
+
([model pipeline](../model-pipeline.md), [model-from-dcc](model-from-dcc.md)).
|
|
77
|
+
8. **Characters.** `src/characters.ts`: `ZhudaModelInspector` finds the animation root and the
|
|
78
|
+
`Muzzle` and `Aim` nodes; cross-fades of 0.13 s keep the phase between walk and run clips; an
|
|
79
|
+
upper-body override layer masked to spine and head plays the recoil
|
|
80
|
+
([animation control](../animation-control.md)). Ten infected are loaded up front.
|
|
81
|
+
9. **Look.** `src/game.ts`: sun with `SoftLow` shadows, 768 px over 22 m (`SoftHigh` at 2048 px
|
|
82
|
+
only under `?capture`); `ZhudaFilmicPipeline` at exposure 1.16, contrast 1.08, saturation 0.75,
|
|
83
|
+
bloom 0.06, with ambient occlusion and temporal anti-aliasing only under `?capture`;
|
|
84
|
+
`createPrefilteredEnvironment` from `environment/evening.f32`; ground and walls on
|
|
85
|
+
`ZhudaLitSurfaceMaterial`; puddles on a 192 by 108 `ZhudaPlanarReflection` updated every twelfth
|
|
86
|
+
frame ([filmic rendering](../filmic-rendering.md), [good-looking-3d-scene](good-looking-3d-scene.md)).
|
|
87
|
+
10. **Time and input.** Rules step on `runtime.layers.sample('world').scaledDeltaTime`, the HUD on
|
|
88
|
+
the `ui` layer; `world, player, enemy, vfx` pause outside play. Reload and interact go through
|
|
89
|
+
a `ZhudaInputBuffer` (0.18 s). Keys clear on blur, `pagehide`, hidden page and pause.
|
|
90
|
+
11. **Controls the player accepted** (`src/action-controls.ts`, `src/shoulder-camera.ts`):
|
|
91
|
+
direction keys are directions on screen; the survivor turns at 21 rad/s to where he walks;
|
|
92
|
+
fire goes straight ahead and snaps to the nearest infected within 0.56 rad and 18 m; the
|
|
93
|
+
camera is fixed 6 m behind and 8.5 m up, looks 1.2 m ahead, field of view 52, and never turns.
|
|
94
|
+
12. **Authored camera.** `src/director.ts` picks a shot (eye, target, field of view) by rule
|
|
95
|
+
status: three intro shots that hand back to the live camera by 8.5 s, a cut at 2.7 s when
|
|
96
|
+
entering the shelter, a slow push while resting. Shots blend in yaw, pitch and distance; a cut
|
|
97
|
+
calls `film.resetHistory()`; the first pointer input ends the intro pose. Subtitles and voice
|
|
98
|
+
share `src/lines.ts`. `ZhudaTimelineSequencer` ([cinematics](../cinematics.md)) was not used.
|
|
99
|
+
13. **Particles.** `src/effects.ts`: six `ParticleEmitterSpec3D` (muzzle, smoke, sparks, dust,
|
|
100
|
+
debris, casing; 24 to 128 particles, seed 42, `rate: 0` and `burst`) on `ZhudaParticleSystem3D`
|
|
101
|
+
with `ZhudaLayaParticleRenderer3D` ([particles](../../packages/core/particles/README.md));
|
|
102
|
+
textures painted in code; tracers are 32 quads on two `ZhudaDynamicMesh`.
|
|
103
|
+
14. **Sound.** One `IframeSoundAdapter` on the same provider, 20 voices, overflow `fifo`; 13
|
|
104
|
+
samples (the score among them) and 7 voice lines loaded with `loadSample` before the title;
|
|
105
|
+
channels `bgm` (score, looped, `peakGain: 0.33`), `sfx` and `ui` (voice, one id with
|
|
106
|
+
`replace`); `unlockAudio` on the first press ([audio](../audio.md)).
|
|
107
|
+
15. **Menus from the prefab library.** `zhuda-engine-prefabs/ui/game-menu`, `zhuda-engine-prefabs/ui/settings-form` and
|
|
108
|
+
`zhuda-engine-prefabs/ui/dom` (library 0.2.0 in `client/common-prefabs.lock.json`), copied with
|
|
109
|
+
`node node_modules/zhuda-engine-prefabs/scripts/sync.mjs . ui/game-menu ui/settings-form`.
|
|
110
|
+
Colours are the `--cp-menu-*` variables in `client/public/main-menu.css`; never edit the copies.
|
|
111
|
+
16. **Loading and fallbacks.** World and survivor load together; the close-up model loads on the
|
|
112
|
+
loading screen; twelve frames behind the title draw it and every infected (`?nowarm` skips).
|
|
113
|
+
Safari renders at scale 1 (`?dpr=N` overrides). In play, a median frame over 40 ms across 180
|
|
114
|
+
frames turns shadows off once. Device loss: the rules snapshot goes to `sessionStorage` and the
|
|
115
|
+
page reloads. No WebGL fallback: a failed boot shows an error. Checks read `pigfall.report()`.
|
|
116
|
+
17. **Windows package.** `npm run package:win` (`client/scripts/package.mjs`) packs `electron/`
|
|
117
|
+
and `dist/web` for win32 x64 with asar. `client/electron/main.cjs` serves the build from a
|
|
118
|
+
privileged `pigfall://app` scheme with a content security policy that allows
|
|
119
|
+
`'wasm-unsafe-eval'`, cancels requests to any other scheme, forces the high-performance GPU
|
|
120
|
+
and grants only pointer lock. `scripts/check-package.mjs` compares packed files with the build
|
|
121
|
+
by SHA-256. Acceptance entry: `npm run accept:windows` starts the packed program with
|
|
122
|
+
`--acceptance`: `electron/qa/verify-webgpu.mjs`, then `game-acceptance.mjs` with real input.
|
|
123
|
+
18. **Go service.** `server/internal/session`: an in-memory `Store` behind a mutex; HTTP on port
|
|
124
|
+
8788: `GET /healthz`, `POST /api/v1/sessions`, `GET` and `POST /api/v1/sessions/{id}` with
|
|
125
|
+
`{"kind":"move|shoot|pickup|pause|reset"}`. It is the authority for session id, status,
|
|
126
|
+
position (a move is clamped to 1 per axis), health, ammunition, collected flags and revision.
|
|
127
|
+
The client does not call it yet; all play rules run in the client.
|
|
128
|
+
19. **Size.** Recorded on 2026-11-13: ZIP 388,281,766 bytes, 424,562,315 unpacked, 88 entries. By
|
|
129
|
+
file size on 2026-11-26: props 180 MB, models 95 MB, environment 90 MB, sound 24 MB.
|
|
130
|
+
|
|
131
|
+
## Pitfalls
|
|
132
|
+
|
|
133
|
+
- **Controls and camera were redone round after round on 2026-11-13.** The player said moving
|
|
134
|
+
stuck and aiming was wrong; measured, the page held 60 frames a second (p99 16.8 ms), so it was
|
|
135
|
+
design. Shoulder camera with crosshair, free cursor, then pointer lock were all rejected; step
|
|
136
|
+
11 is what stayed. Measure first, then let a person play before tuning further.
|
|
137
|
+
- **Models could be walked through, then bodies stuck on corners.** Only some props had
|
|
138
|
+
hand-written boxes, blocking was tested per axis, the arena edge was invisible. Fix: step 4 and
|
|
139
|
+
a visible fence. A sweep (a point every 2 m, eight directions) found the worst boxes.
|
|
140
|
+
- **Left and right were mirrored.** The camera's right was taken as +X; looking along +Z the
|
|
141
|
+
screen's right is -X. Three places changed (move vector, shoulder side, mouse turn).
|
|
142
|
+
- **Z-up exports stood as 2 m walls.** `cracked-floor.glb` and `weed-clump.glb` needed 90 degrees
|
|
143
|
+
about X. `boundary-fence.glb` only looked the same: its origin is at mid-height (lift 1.25 m).
|
|
144
|
+
- **Retina drew a quarter of the canvas.** The engine applied the CSS scale twice before 1.18.0
|
|
145
|
+
(commit `391db93`). Headless checks at DPR 1 missed it: run them at DPR 2 as well.
|
|
146
|
+
- **The intro froze 2.6 s.** A 56 MB close-up model loaded when the camera first came near. After
|
|
147
|
+
step 16 the longest intro frame was 67 to 83 ms in three runs.
|
|
148
|
+
- **He kept walking after the keys were released.** Rules normalised any input above zero to full
|
|
149
|
+
speed and the eased input never reached zero. Speed now follows input size; under 5% is 0.
|
|
150
|
+
- **Infected flickered and jumped.** Models were bound to enemies by list index, and rules set
|
|
151
|
+
positions directly in three places. Bind by id; walk to the place at a speed.
|
|
152
|
+
- **A drone through the whole run.** A second `playSample` with `replace` on the music channel
|
|
153
|
+
swapped the score for a synthetic ambience. Footsteps (-15.9 LUFS, now -29) beat the gunshots.
|
|
154
|
+
- **Pointer lock refused without a word.** Browsers reject, fire `pointerlockerror`, or do
|
|
155
|
+
nothing. Not locked 0.5 s after asking means fall back to the cursor and say so.
|
|
156
|
+
- **Safari.** About 80 s to load and one frame in 15 s at 2814 by 1758; Chrome on the same
|
|
157
|
+
machine held 60. Render scale 1 for Safari; the result was not measured.
|
|
158
|
+
- **A grab could hold the player until death,** and the stock swing was slower than the grab.
|
|
159
|
+
A grab now ends by itself in 1.8 s; the swing has its own fast spec and a 0.9 s cooldown.
|
|
160
|
+
- **Smaller ones.** A turn of exactly half a circle shook until `turnToward` kept its last side.
|
|
161
|
+
Temporal anti-aliasing smeared moving bodies. `.modal-copy button` painted the shared menu's
|
|
162
|
+
buttons (use `>`). Automated screenshots tripped the quality drop until its window was widened.
|
|
163
|
+
|
|
164
|
+
## Engine gaps and their workarounds
|
|
165
|
+
|
|
166
|
+
- No footprint colliders from a GLB and no circle-against-turned-box push-out: the game's
|
|
167
|
+
`make-colliders.py` and `layout.ts`. No plan item known.
|
|
168
|
+
- No follow or overhead camera rig with a boom (`src/shoulder-camera.ts` on `ZhudaSceneQueries`)
|
|
169
|
+
and no static merge of a prefab tree (`src/static-batch.ts` merges by material).
|
|
170
|
+
- No desktop packaging command: the game carries its own Electron host and checks. The engine's
|
|
171
|
+
example host ([packaged Windows application](../webgpu.md#packaged-windows-application)) existed
|
|
172
|
+
at the pin and was not used; this route did not compare the two.
|
|
173
|
+
- From the prototype's pin, not re-tested: normalised vertex colours in a GLB were not accepted
|
|
174
|
+
(`scripts/normalize-gltf-colors.py` rewrites them as floats); the browser fixture raced Chrome's
|
|
175
|
+
profile folder on Windows (`scripts/windows-browser-compat.mjs` retries, kills the process tree).
|
|
176
|
+
- Arrived after the pin, so unused by the game; use in new work: [shader warm-up](../shader-warm-up.md)
|
|
177
|
+
for step 16's hand-drawn frames; `"renderer": "auto"` with `retryZhudaBackend` for a page that
|
|
178
|
+
only fails; `zhuda-laya-lod` ([model levels of detail](../model-lod.md)) for the close-up swap.
|
|
179
|
+
- Unexplained: once at load `laya.webgpu_3D.js` threw on `Render3DModuleDataFactory` of undefined
|
|
180
|
+
(a reload cleared it); a hidden tab logs `RenderTextureMRT dimensions must be positive integers`.
|
|
181
|
+
|
|
182
|
+
## Checks
|
|
183
|
+
|
|
184
|
+
- From the game's records, each with its date. `cd client && npm run verify` (release build with
|
|
185
|
+
the Prefab and size gates, `tsc --noEmit`, Doctor, `node --test`): 44 of 44 tests, Doctor
|
|
186
|
+
healthy, 2026-11-13 (HANDOFF, twelfth round).
|
|
187
|
+
- `npm run accept:prefabs`: 3 prefabs, 0 differing pixels, 30 mount cycles each; Chrome
|
|
188
|
+
157.0.8103.39, WebGPU, Apple adapter on Metal 3, not a fallback adapter; files of 2026-11-13.
|
|
189
|
+
- Headless Chrome on WebGPU, 2026-11-13: title, settings, start, intro, pause and back to title
|
|
190
|
+
with no renderer or console error; 6 s of walking and firing at 60 frames a second at DPR 1
|
|
191
|
+
and 2; at DPR 2 the canvas is 780 by 880 with no extra transform.
|
|
192
|
+
- Electron on macOS (Apple M4), 2026-11-08, at the earlier pin: `--smoke` passed with WebGPU
|
|
193
|
+
ready on a hardware adapter; in a separate run a mouse drag turned the camera (yaw 0 to 0.72).
|
|
194
|
+
The full synthetic route did not pass: the scripted player died; recorded as unavailable.
|
|
195
|
+
- `npm run package:win`, 2026-11-08, earlier pin: 73 files, asar 422,370,625 bytes. Its report's
|
|
196
|
+
`engine` field was hard-coded then; the script now reads `package.json`.
|
|
197
|
+
- `cd server && go test ./...` passes (HANDOFF, 2026-11-13); `go test -race` and `go vet` pass
|
|
198
|
+
(verification report, 2026-11-08).
|
|
199
|
+
|
|
200
|
+
## Not checked
|
|
201
|
+
|
|
202
|
+
- Windows: hardware WebGPU, the packed program and `npm run accept:windows` were not run after
|
|
203
|
+
the move; the prototype's earlier Windows delivery was left behind with its results.
|
|
204
|
+
- Phones and touch. WebGL. Safari after the scale change. Pointer-lock feel in a real browser.
|
|
205
|
+
- A person playing to extraction after the control changes; difficulty (the record says easy);
|
|
206
|
+
loot and the double on screen (rules are tested, pictures were not looked at); sound by ear.
|
|
207
|
+
- `electron/qa/main-menu.mjs` still expects the earlier menu. The package and the Electron runs
|
|
208
|
+
were not repeated after the upgrade to 1.18.0. Nothing was run at 2.0.0.
|
|
209
|
+
- The client against the server; more than one player; persistence; GPU time. Publishing: on
|
|
210
|
+
none of the owner's portals (see `PORTALS.md` in the workspace). Open picture defects:
|
|
211
|
+
untextured far buildings, floating debris in the intro, seams in the ground plates.
|
|
212
|
+
|
|
213
|
+
## Boundaries
|
|
214
|
+
|
|
215
|
+
The game keeps its rules, layout, recipes, assets and their provenance, story lines, voice, shots,
|
|
216
|
+
Electron host with its checks, and the Go session service. The prefab library holds the menus
|
|
217
|
+
(`zhuda-engine-prefabs/ui/*`); the game's HANDOFF names the supply case, radio and shelter as next to move
|
|
218
|
+
there (`game-to-prefabs`). The engine owns boot, libraries, provider, particles, sound, the filmic
|
|
219
|
+
pipeline, action frame data and the build gates; it takes no game rules and none of its assets.
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Route: a fluid-freezing puzzle platformer moved from a DOM interface to a WeChat mini game
|
|
2
|
+
|
|
3
|
+
A portrait 2D puzzle platformer (AquaFreeze, 凝流躍杯): a 120 Hz deterministic particle fluid that
|
|
4
|
+
the player catches in a cup, throws, and freezes into ice steps, drawn by custom 2D post-process
|
|
5
|
+
shaders (metaballs, a 3 px white outline, a shockwave). It came into the workspace with its
|
|
6
|
+
interface in HTML over the canvas; to package it for WeChat the interface was redrawn on the Laya
|
|
7
|
+
stage, so one code base now builds the web page and the `wxgame` package. Touch, mouse or keyboard.
|
|
8
|
+
Checked in headless Chrome at three window shapes, in the `weixin-minigame-helper` simulator (with
|
|
9
|
+
one test-only shim) and by the WeChat developer tools' preview build; no phone run recorded.
|
|
10
|
+
|
|
11
|
+
- **Id:** `aqua-freeze-2d-minigame`
|
|
12
|
+
- **Kind:** workflow
|
|
13
|
+
- **For:** Moving a 2D game whose menus, HUD and touch pad are HTML over the engine canvas into a WeChat mini game: the interface drawn on the Laya stage, the stage fitted to tall phones, prefab textures, sound and saving without browser APIs, and the checks that replace DOM selectors.
|
|
14
|
+
- **Checked on:** desktop headless Chrome 158 (Apple M4, ANGLE Metal) at 720×1280, 390×844 (touch, DPR 2) and 1280×720; the `weixin-minigame-helper` simulator (390×844, DPR 3); WeChat developer tools preview on the owner's phone in WeChat (played; model and frame rate not recorded)
|
|
15
|
+
- **Status:** 2026-11-26: `npm run verify` (build, types, Doctor HEALTHY, 52 tests) and `npm run verify:browser` (ten levels, a recorded 1-1 clear, the 3 px outline, two-finger touch, 60 FPS with P95 16.7–16.8 ms) pass; `npm run build:wx` 2,775,928 bytes under the 4 MB gate, no syntax newer than ES2017; title, play, freeze, level select and level 1-7 seen in the simulator; a preview QR was made by the developer tools; nothing uploaded
|
|
16
|
+
- **Reference consumer:** ZhudaGameCenter `games/zhuda-aqua-freeze` (outside this repository): `src/ui/GameUI.ts`, `src/platform/screen.ts`, `src/platform/wx-polyfills.ts`, `src/audio/ToneSynth.ts`, `src/prefabs.ts`, `tools/patch-wx.mjs`, `scripts/verify-browser.mjs`
|
|
17
|
+
- **Engine version:** zhuda-laya-engine 2.0.0 (`91d21f79`, LayaAir 3.4.2)
|
|
18
|
+
|
|
19
|
+
## When to take this route
|
|
20
|
+
|
|
21
|
+
- Fits: a 2D game (or a 2D game's interface) built for the browser with HTML buttons, panels and
|
|
22
|
+
`pointer` events over the canvas, that must also run as a WeChat mini game; any game whose
|
|
23
|
+
prefabs carry textures and must load inside a mini game.
|
|
24
|
+
- Does not fit: a new game (start DOM-free: [new-game-project](new-game-project.md),
|
|
25
|
+
[drop-merge-2d-minigame](drop-merge-2d-minigame.md)); a 3D mini game
|
|
26
|
+
([raft-brawl-3d-minigame](raft-brawl-3d-minigame.md),
|
|
27
|
+
[action-adventure-3d-minigame](action-adventure-3d-minigame.md)); a browser-only game, which can
|
|
28
|
+
keep its DOM interface ([mobile-web-fullscreen](mobile-web-fullscreen.md)).
|
|
29
|
+
- Packaging itself is [mini-game-build](mini-game-build.md); bringing the project into the
|
|
30
|
+
workspace is [prototype-to-center](prototype-to-center.md).
|
|
31
|
+
|
|
32
|
+
## Tools
|
|
33
|
+
|
|
34
|
+
- Engine pinned as in the header; `features: ["core","2d","ui"]`, `renderer: "webgl"`;
|
|
35
|
+
`zhuda-laya-build`, `zhuda-laya-doctor`, `zhuda-laya-minigame` with LayaAir 3.4.2 at
|
|
36
|
+
`~/.layaair/3.4.2`.
|
|
37
|
+
- Prefab module `systems/minigame-host` (host bridge, polyfills, `PlatformAssetProvider`), copied
|
|
38
|
+
with `npx zhuda-prefabs-sync . systems/minigame-host`.
|
|
39
|
+
- Node 26.13.1, TypeScript 5.9.3, esbuild 0.27.1 (through the engine), Playwright core 1.62.1 with
|
|
40
|
+
the installed Google Chrome (`CHROME_BIN`, found by the script on macOS and Windows).
|
|
41
|
+
- WeChat developer tools (Stable, arm64) and its command line through the owner's
|
|
42
|
+
`zhuda-wechat-game` skill (`check-pkg`, `preview`); the `weixin-minigame-helper` MCP server for a
|
|
43
|
+
simulator in the browser.
|
|
44
|
+
|
|
45
|
+
## Steps
|
|
46
|
+
|
|
47
|
+
1. **Find every browser API first.** Build once with `npm run build:wx`: the mini-game tool audits
|
|
48
|
+
each reachable source and refuses `DirectoryAssetProvider`, `IframeSoundAdapter`,
|
|
49
|
+
`document.*`, `window.addEventListener`/`localStorage`, and a `container` in `boot`
|
|
50
|
+
(`[MINIGAME_BROWSER_API]`, with file and line). A runtime branch does not help: the audit is
|
|
51
|
+
static, so the browser-only code must leave the entry's import graph, for the web build too.
|
|
52
|
+
2. **Boot without a container, the stage shaped to the screen.** `ZhudaEngine.boot({ designSize:
|
|
53
|
+
{ width: 720, height: H }, scaleMode: 'showall', dprCap: isWeChat ? 2 : 3, onResize })` where
|
|
54
|
+
`H = clamp(round(720 × windowHeight / windowWidth), 1280, 1720)` (`src/platform/screen.ts`;
|
|
55
|
+
WeChat: `wx.getSystemInfoSync().windowWidth/Height`). A 390×844 phone gets 720×1558 and fills
|
|
56
|
+
the screen; a desktop window gets 720×1280, letterboxed at the sides. The 720×1280 world is the
|
|
57
|
+
prefab root moved down by `worldY = (H − 1280) / 2`; the HUD lives in the top bar, the touch
|
|
58
|
+
pad in the bottom bar. The runtime aligns the stage top-left, so centre it with
|
|
59
|
+
`Laya.stage.offset` (CSS pixels) from `onResize`, and call `context.resize()` once after
|
|
60
|
+
`boot` returns: the first `onResize` runs inside `boot`, before the context exists. Check: the
|
|
61
|
+
canvas rectangle is centred and `720 × H` scaled (`assertStageFrame` in the consumer's script).
|
|
62
|
+
3. **Draw the interface on the stage.** `src/ui/GameUI.ts`: one `Button` class (a `Laya.Sprite`
|
|
63
|
+
with `drawRoundRect` and `Laya.Text`, a stage-space rectangle, a style) for every former HTML
|
|
64
|
+
button; screens are sprites toggled by `visible`. The old CSS sizes became design pixels at
|
|
65
|
+
about 1.8 × (CSS pixels on a 390-wide phone), so a 44 px touch target is 80 design pixels.
|
|
66
|
+
Hit tests are the game's own (topmost visible button containing the point).
|
|
67
|
+
4. **Input from the stage, finger by finger.** `Laya.InputManager.multiTouchEnabled = true`;
|
|
68
|
+
`stage.on(MOUSE_DOWN/MOUSE_UP)` with `event.touchId` and `event.touchPos` (stage coordinates).
|
|
69
|
+
A held control is owned by its `touchId` until that finger lifts, wherever it slides (as pointer
|
|
70
|
+
capture did); taps fire on release inside the same button. Keys: `stage.on(KEY_DOWN/KEY_UP)`,
|
|
71
|
+
`event.nativeEvent.code`, `preventDefault` for game keys; right button `RIGHT_MOUSE_DOWN`.
|
|
72
|
+
Clear held input on `Laya.Event.BLUR` and through `boot({ clearInput })`.
|
|
73
|
+
4a. **Touch controls as the owner asked after the first phone run (2026-11-26): a floating
|
|
74
|
+
joystick and two round buttons.** Left/right/jump buttons were "hard to use". Now: a press on
|
|
75
|
+
the empty lower-left (left half, below 45% of the stage and the HUD) grabs a joystick whose
|
|
76
|
+
base (radius 112) moves under the finger; x beyond ±0.28 of the radius walks, up beyond 0.45
|
|
77
|
+
jumps and releases below 0.3 (hysteresis; holding up keeps the variable jump high); it follows
|
|
78
|
+
`MOUSE_MOVE` of its own `touchId` and lets go on that finger's `MOUSE_UP`. Right side: freeze
|
|
79
|
+
(radius 84, bottom-right) and toss (radius 64, up and left of it), circular hit tests at 1.12
|
|
80
|
+
× radius. The check drives the stick with `page.mouse` drags and CDP touch moves.
|
|
81
|
+
5. **Prefab textures in WeChat.** `ZhudaPrefabLibrary` decodes a texture as
|
|
82
|
+
`URL.createObjectURL(new Blob([bytes]))`, records `crypto.subtle.digest('SHA-256')` and hashes
|
|
83
|
+
definitions through `new TextEncoder()`; WeChat on iOS has none of these. A UTF-8
|
|
84
|
+
`TextEncoder` is installed wherever one is missing. `src/platform/wx-polyfills.ts`, imported first, installs under
|
|
85
|
+
`wx` only: a byte-backed `Blob` (always, even where a native one exists), `createObjectURL`
|
|
86
|
+
that returns the **package path** when the bytes are a package file the provider just read
|
|
87
|
+
(`rememberPackageFile`, called by a `PlatformAssetProvider` subclass in `src/prefabs.ts`) and
|
|
88
|
+
otherwise writes `USER_DATA_PATH/…png` with `writeFileSync`, a JavaScript SHA-256, and
|
|
89
|
+
`DOMException`. Check: `tests/wx-polyfills.test.mjs` (SHA-256 against Node's at the 55/56/63/
|
|
90
|
+
64/65-byte padding edges and 1 MB; a fake `wx` in a child process).
|
|
91
|
+
6. **Sound without the browser mixer.** `src/audio/ToneSynth.ts` repeats the envelope of
|
|
92
|
+
`IframeSoundAdapter.scheduleTone`: oscillator from `startFreq` to `endFreq` exponentially, gain
|
|
93
|
+
from `peakGain` to 0.0008 exponentially, through one gain of master 0.85 × sfx 0.9; the context
|
|
94
|
+
is `AudioContext` in a browser and `wx.createWebAudioContext()` in WeChat, created and resumed
|
|
95
|
+
on the first touch or key. Mute is saved with `saveNumber`.
|
|
96
|
+
7. **Saving.** `loadNumber`/`saveNumber` from the host bridge; the cleared levels became one
|
|
97
|
+
bitmask number (`aquafreeze.chapter1.clearedMask`).
|
|
98
|
+
8. **Package.** `npm run build:wx` = `zhuda-laya-minigame --platform wxgame && node
|
|
99
|
+
tools/patch-wx.mjs`: every `.js` lowered to ES2017 with esbuild, `project.config.json` (`es6`,
|
|
100
|
+
`enhance`, `minified`, `postcss` on, `urlCheck` off, AppID from `WX_APPID` or the config, the
|
|
101
|
+
project name), `game.json` `deviceOrientation: portrait`, and a 4 MB main-package check.
|
|
102
|
+
9. **Replace the DOM checks.** The game reports its buttons in stage coordinates
|
|
103
|
+
(`__AQUAFREEZE__.ui.buttons`, `panels`, `texts`, `cleared`) and `stageHeight`, `worldOffsetY`;
|
|
104
|
+
the browser script maps them through the canvas rectangle and presses them with
|
|
105
|
+
`page.mouse`, `page.touchscreen` and CDP `Input.dispatchTouchEvent` (two fingers). Layout checks
|
|
106
|
+
(inside the stage, no overlap, text fits, at least 80×72) replace `elementFromPoint`; pixel
|
|
107
|
+
checks keep their 720×1280 world mapping by using the world rectangle instead of the canvas.
|
|
108
|
+
|
|
109
|
+
## Pitfalls
|
|
110
|
+
|
|
111
|
+
- **The first phone run showed the boot logo, then only the stage colour.** WeChat on iOS has no
|
|
112
|
+
`TextEncoder`, and `ZhudaPrefabLibrary.instantiate` hashes the definition with
|
|
113
|
+
`new TextEncoder()`; no game had used the prefab library in a mini game before. The simulator
|
|
114
|
+
never showed it because it runs in a browser. Reproduced in a simulator copy whose shim also
|
|
115
|
+
removes `TextEncoder` (`TypeError: TextEncoder is not a constructor` right after the library
|
|
116
|
+
step); a UTF-8 `TextEncoder` in `src/platform/wx-polyfills.ts`, installed only when missing,
|
|
117
|
+
fixed that copy. Emulate the host's gaps before trusting a simulator: the owner's
|
|
118
|
+
`zhuda-wechat-game` notes list what WeChat on iOS lacks (`TextDecoder`, `TextEncoder`, `Blob`,
|
|
119
|
+
`URL.createObjectURL`, `crypto.subtle`).
|
|
120
|
+
- **Show boot errors on the device.** With no console on the phone a failed `main()` is a blank
|
|
121
|
+
screen. `src/platform/boot-report.ts` records each boot step and shows the first error with
|
|
122
|
+
`wx.showModal` (and on the stage), with the steps reached and what each polyfill did.
|
|
123
|
+
- **The helper simulator cannot run any engine game as it is.** `weixin-minigame-helper` runs the
|
|
124
|
+
package in a browser sandbox where `globalThis` is not the game's `window`; the engine reads
|
|
125
|
+
`globalThis.Laya` and stops with `Cannot read properties of undefined (reading 'LayaGL')`. The
|
|
126
|
+
owner's 猪大合一合 package, uploaded to WeChat before, fails the same way, so it is the simulator.
|
|
127
|
+
Test with a copy of the package whose `game.js` requires a shim before `js/index.js` that
|
|
128
|
+
defines getters `globalThis.Laya`/`wx` → `window.Laya`/`wx`; never ship the shim.
|
|
129
|
+
- **A native `Blob` in the simulator broke the first polyfill.** It kept the browser `Blob`, whose
|
|
130
|
+
bytes cannot be read synchronously (`l.bytes.slice is not a function`). Replace `Blob` whenever
|
|
131
|
+
`wx` exists.
|
|
132
|
+
- **The simulator refuses images from `wxfile://`** (its CSP allows `wxvfs:` and `data:`); real
|
|
133
|
+
WeChat accepts `USER_DATA_PATH` files. Returning the package path for package files avoids the
|
|
134
|
+
temporary file in both.
|
|
135
|
+
- **The first tap in the simulator can be lost**: focus moving into its iframe sends a blur,
|
|
136
|
+
which clears held input and latched presses on purpose. A second tap works.
|
|
137
|
+
- **A full-width victory card covered the win.** At phone sizes the card spans the world; place it
|
|
138
|
+
low when the player finished in the upper part of the world and high otherwise.
|
|
139
|
+
- **On a 9:16 window the pad covers the bottom of the world** (no spare bar): the drain-shaft pixel
|
|
140
|
+
check collapses the pad for its screenshot.
|
|
141
|
+
- **`setScreenSize` honours `stage.offset` but the runtime's first resize runs inside `boot`.**
|
|
142
|
+
Without the extra `context.resize()` the desktop stage stayed at the left edge.
|
|
143
|
+
|
|
144
|
+
## Engine gaps and their workarounds
|
|
145
|
+
|
|
146
|
+
| Gap | Workaround |
|
|
147
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
148
|
+
| `ZhudaPrefabLibrary` needs `TextEncoder`, `Blob`, `URL.createObjectURL`, `crypto.subtle` and `DOMException`, which a WeChat mini game (iOS) lacks | `src/platform/wx-polyfills.ts` (step 5); a candidate for `zhuda-engine-prefabs/systems/minigame-host/polyfills.ts` |
|
|
149
|
+
| No accepted mini-game audio backend (`IframeSoundAdapter` is refused) | `src/audio/ToneSynth.ts` (step 6) |
|
|
150
|
+
| `zhuda-laya-minigame` at 2.0.0 has no syntax target and no orientation (both added after `91d21f79`) | `tools/patch-wx.mjs` (step 8) |
|
|
151
|
+
| No Laya-drawn interface module in the prefab library (`ui/*` modules are DOM) | `src/ui/GameUI.ts` |
|
|
152
|
+
| No helper that maps a game's stage-space buttons to page coordinates for a browser check | the consumer's `button()` and `geometry()` in `scripts/verify-browser.mjs` |
|
|
153
|
+
|
|
154
|
+
## Checks
|
|
155
|
+
|
|
156
|
+
```sh
|
|
157
|
+
cd <workspace>/games/zhuda-aqua-freeze
|
|
158
|
+
npm run verify # 2026-11-26: Doctor HEALTHY, 52 tests
|
|
159
|
+
npm run verify:browser # 2026-11-26: ten levels, 1-1 clear in 1369–1373 steps, outline 3 px, 60 FPS P95 16.7–16.8 ms
|
|
160
|
+
npm run build:wx # 2026-11-26: 23 files, 2,775,928 bytes, limit 4,194,304
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
The skill's `check-pkg` reported 2.61 MB, AppID set, no modern syntax; its `preview` made a QR in
|
|
164
|
+
34.5 s. Simulator screenshots: the consumer's `evidence/wechat-sim-2026-11-26/`.
|
|
165
|
+
|
|
166
|
+
## Not checked
|
|
167
|
+
|
|
168
|
+
- Anything measured on the phone: the owner played the fixed preview (the first build showed only the stage colour) and asked for the joystick; the joystick build's preview was made, its result is not recorded. Not checked either: the developer tools'
|
|
169
|
+
own simulator, and any frame rate, memory or load time in a host.
|
|
170
|
+
- Sound in a host: `wx.createWebAudioContext()` and its `OscillatorNode` were not heard.
|
|
171
|
+
- Saving, the capsule inset and the bottom safe area on a real WeChat client; Android.
|
|
172
|
+
- The prefab gates of [prototype-to-center](prototype-to-center.md) (`prefabChecks`,
|
|
173
|
+
`accept:prefabs`): the game declares `prefabPreview` only.
|
|
174
|
+
- In 4 runs of the browser script one failed at "the cup's water below the rim while filling"
|
|
175
|
+
(fill 6, no cup-water pixels in that frame); not investigated.
|
|
176
|
+
|
|
177
|
+
## Boundaries
|
|
178
|
+
|
|
179
|
+
- Game: levels, simulation, shaders, art, `GameUI.ts`, the polyfills and the tone synth until the
|
|
180
|
+
library takes them, its evidence and its AppID.
|
|
181
|
+
- Prefab library: the host bridge it copies; candidates for it: the WeChat polyfills, the tone
|
|
182
|
+
synth, a stage-drawn button and screen set.
|
|
183
|
+
- Engine: boot, sizing, the build, the Doctor, the mini-game tool and its audit.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Route: a restrained, layered dusk look for a film scene (Astral Minimalist)
|
|
2
|
+
|
|
3
|
+
The look asked for as 「孤旅大气分层风 Astral Minimalist」 (《Journey》 ×
|
|
4
|
+
《Firewatch》 × 《Monument Valley》): a few large clean colour fields, a low sunset
|
|
5
|
+
casting long slanted geometric shadows, strong air layering (dark foreground,
|
|
6
|
+
bright middle, airy pale distance) and very few fragments with strong silhouettes.
|
|
7
|
+
Built as a film scene with flat-colour materials, a sun placed against the camera
|
|
8
|
+
paths, a row of slabs off camera to cut shadow bands, a painted sky panorama and
|
|
9
|
+
fog matched to its horizon. Checked on a desktop with WebGPU.
|
|
10
|
+
|
|
11
|
+
- **Id:** `astral-minimal-film-look`
|
|
12
|
+
- **Kind:** scene
|
|
13
|
+
- **For:** A minimalist sunset set for a film or still as data: flat colour fields, a low sun behind the camera's shoulder, shadow bands cut by slabs placed off camera, a painted dusk panorama, fog equal to the horizon colour so distance turns pale.
|
|
14
|
+
- **Checked on:** desktop WebGPU (Apple M4, macOS 27.2.1, headless Chrome through the MCP server); no phone
|
|
15
|
+
- **Status:** 《黑與紅》 version 3 (2026-11-26): four look iterations at 960 and
|
|
16
|
+
1280 px, then 29 shots rendered and every shot looked at in sampled frames. The
|
|
17
|
+
user has not reviewed version 3 yet.
|
|
18
|
+
- **Reference consumer:** `films/black-red-duel` in the ZhudaGameCenter workspace
|
|
19
|
+
(outside this repository): `scene3.mjs`, `tools/sky.py`, `lookdev.mjs`,
|
|
20
|
+
`assets/sky/dusk3.png`; iterations in `frames/look3`, `look3b`, `look3c`, `look3d`.
|
|
21
|
+
- **Engine version:** zhuda-laya-engine 2.0.0, `unified` branch worktree (HEAD
|
|
22
|
+
`44228176` on 2026-11-26).
|
|
23
|
+
|
|
24
|
+
## When to take this route
|
|
25
|
+
|
|
26
|
+
For a quiet, graphic, open-air setting at sunset or dawn where people must read
|
|
27
|
+
clearly as silhouettes or warm-lit figures: duels, journeys, title shots. Take
|
|
28
|
+
[film-as-data](film-as-data.md) for the format and render, and
|
|
29
|
+
[good-looking-3d-scene](good-looking-3d-scene.md) for the general order of look
|
|
30
|
+
settings. For a detailed, textured, realistic landscape take
|
|
31
|
+
[outdoor-landscape](outdoor-landscape.md); for a night or a wet street this look is
|
|
32
|
+
wrong. Add [film-ink-lines](film-ink-lines.md) for the storybook lines that the
|
|
33
|
+
brief paired with it.
|
|
34
|
+
|
|
35
|
+
## Tools
|
|
36
|
+
|
|
37
|
+
- MCP film tools with `--film-assets <dir>` (for the panorama picture):
|
|
38
|
+
`film_scene_create`, `film_scene_preview`, `film_scene_review`, `film_render_job`.
|
|
39
|
+
- Python 3 with numpy 2.0.2 and Pillow 11.3.0 for the sky (`tools/sky.py`).
|
|
40
|
+
- `lookdev.mjs`: one preview frame of named shots at named times
|
|
41
|
+
(`SHOTLIST=shots3.mjs DIR=look3 node lookdev.mjs v08-guard:0.5 v11-combo:0.76`),
|
|
42
|
+
about 4 s a frame.
|
|
43
|
+
|
|
44
|
+
## Steps
|
|
45
|
+
|
|
46
|
+
1. **Put the sun behind the cameras' shoulder.** List where the cameras of the film
|
|
47
|
+
look (here most look along -X from +X). Put the sun low behind and to one side of
|
|
48
|
+
them: azimuth 150°, elevation 9° (`azimuthDeg` turns about +Y; at 0 the light
|
|
49
|
+
travels toward -Z; at θ it travels toward `(-sin θ, -cos θ)`; so 150 puts the sun
|
|
50
|
+
at +X, -Z). Figures get warm three-quarter light and shadows run away from the
|
|
51
|
+
camera on a slant. A sun in front of the camera gives silhouettes and loses the
|
|
52
|
+
red character's colour; use it only for chosen shots.
|
|
53
|
+
2. **Cut shadow bands with slabs the camera does not see.** On a line 13 m from the
|
|
54
|
+
centre toward the sun, perpendicular to it, stand a few tall slabs
|
|
55
|
+
(`box`, 7.5 to 10 m tall, 2.2 to 3 m wide, 1.4 m thick, yaw -30 so their face is
|
|
56
|
+
to the sun). A ground point P is in a slab's shadow when `s = P · across` falls
|
|
57
|
+
within that slab's width, where `across = (0.866, 0.5)` here; leave the range of s
|
|
58
|
+
where the action happens free (here -2.3 to 2.5) so the fighters stand in a lit
|
|
59
|
+
band. At 9° the shadow of a 10 m slab is 63 m long. Shadows: `distance 70`,
|
|
60
|
+
`resolution 4096`, `cascades 4`, `soft`, `strength 0.92`, `blend true`.
|
|
61
|
+
3. **Large flat colours, few things.** Materials are plain colours, no recipes:
|
|
62
|
+
sand `[0.86, 0.6, 0.43]` roughness 0.96, stone `[0.74, 0.47, 0.41]` roughness 0.9.
|
|
63
|
+
One block behind the action (the second fighter's platform, which half catches a
|
|
64
|
+
shadow band), a gate of two 15 m pillars and a lintel 24 m away in the main
|
|
65
|
+
cameras' background, one leaning shard (`sweep` with a triangular profile), two
|
|
66
|
+
four-sided cones far away (`lathe` with 4 segments: 42 m tall at 135 m), and three
|
|
67
|
+
small fragments. Ground 140 m; beyond it a `terrain` of 520 m with dunes
|
|
68
|
+
(`heightM 16`, `scaleM 95`) pressed under the ground in the middle 110 m.
|
|
69
|
+
4. **Paint the sky.** A 4096×2048 equirectangular PNG (`tools/sky.py`): zenith
|
|
70
|
+
`[0.41, 0.45, 0.68]` → 60° `[0.52, 0.54, 0.75]` → 30° lavender `[0.75, 0.67, 0.82]`
|
|
71
|
+
→ 12° rose `[0.94, 0.73, 0.73]` → 4° peach `[0.99, 0.81, 0.71]` → horizon pale gold
|
|
72
|
+
`[1.0, 0.87, 0.74]`; warmer toward the sun, a glow around it, and opposite the sun
|
|
73
|
+
a pink band at 6 to 18° (the Belt of Venus) over a lilac earth shadow at 0 to 5°.
|
|
74
|
+
Give it to the look as `panorama: { asset: 'sky/dusk3.png' }`. The panorama's
|
|
75
|
+
orientation, measured with a four-colour test picture: u = 0 is +X, 0.25 is +Z,
|
|
76
|
+
0.5 is -X, 0.75 is -Z; v runs from straight up to straight down. The sun of step 1
|
|
77
|
+
is at u = 0.833, v = 0.45.
|
|
78
|
+
5. **Fog equal to the horizon.** `fog: { color: [1.0, 0.73, 0.51], start: 6, end: 140 }`
|
|
79
|
+
(the horizon colour in linear values); `lightFog: { density: 0.012, falloffMeters: 7, scatter: 0, color: [1.0, 0.87, 0.74], shafts: { strength: 1.0, distance: 80 } }`.
|
|
80
|
+
The middle (20 to 40 m) keeps its colour and gets brighter, the cones at 120 m are
|
|
81
|
+
pale shapes, the near ground in shadow stays deep: dark front, bright middle,
|
|
82
|
+
airy distance.
|
|
83
|
+
6. **Light the shadows cool.** `ambient [0.4, 0.4, 0.76]`, `ambientGround [0.46, 0.3, 0.32]`,
|
|
84
|
+
sun `[1, 0.76, 0.58]` intensity 3.0, preset `dusk`. Grade: exposure 1.0, contrast
|
|
85
|
+
1.1, saturation 1.0, bloom 0.28, ao 0.6 radius 0.4, grain 0.1, vignette 0.38;
|
|
86
|
+
`lensFlare: true` for the shots that face the sun.
|
|
87
|
+
7. **Look at four kinds of shot before rendering**: a wide shot, a close fight shot,
|
|
88
|
+
one into the sun, one from above. Preview frames at 960 px take about 4 s each.
|
|
89
|
+
|
|
90
|
+
## Pitfalls
|
|
91
|
+
|
|
92
|
+
1. **The `dusk` preset's sky is yellow-green.** Its procedural atmosphere, with the
|
|
93
|
+
fog defaulting to the horizon colour, gave a greenish-yellow sky, also with the one
|
|
94
|
+
`skyTint` tried (`[0.55, 0.42, 0.75]`, thickness 1.4). The painted panorama
|
|
95
|
+
(step 4) gave the lavender-to-peach sky asked for.
|
|
96
|
+
2. **A light in the light fog becomes a visible orb.** The fighters' fill lights
|
|
97
|
+
showed as purple balls in the yard shot (`lightFog.scatter` 0.6). Set `scatter: 0`;
|
|
98
|
+
the sun shafts are separate (`shafts.strength`). A shot rendered before the change
|
|
99
|
+
had to be rendered again.
|
|
100
|
+
3. **An orange sun turns a red figure orange.** Sun `[1, 0.66, 0.42]` made the red
|
|
101
|
+
fighter read as orange; `[1, 0.76, 0.58]` keeps red red and the scene warm.
|
|
102
|
+
4. **Without a fog colour the middle distance stayed saturated.** With the first fog
|
|
103
|
+
(`start 5`, `end 150`, colour by default), the gate 24 m away was as orange as the
|
|
104
|
+
foreground: no layering. A fog colour equal to the painted horizon fixed it; a
|
|
105
|
+
stronger fog (`end 95`) washed the middle out, `end 140` was the balance.
|
|
106
|
+
5. **Huge far shapes dominate.** A 70 m cone at 125 m filled a third of the frame
|
|
107
|
+
height; 42 m at 135 m reads as distance.
|
|
108
|
+
6. **Slabs in front of a reverse shot.** A shot looking toward the sun sees the slab
|
|
109
|
+
row as dark pillars; it works as a backlit silhouette shot, but a dark figure in
|
|
110
|
+
front of them is lost.
|
|
111
|
+
|
|
112
|
+
## Engine gaps and their workarounds
|
|
113
|
+
|
|
114
|
+
| Gap | Workaround here |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| The panorama's orientation is not documented | Measured with a test picture (step 4) |
|
|
117
|
+
| The procedural sky cannot be pushed to a lavender dusk | A painted panorama |
|
|
118
|
+
| No gradient or painted sky other than a picture | `tools/sky.py` writes one from colour stops |
|
|
119
|
+
|
|
120
|
+
## Checks
|
|
121
|
+
|
|
122
|
+
- `lookdev.mjs` frames of four shot kinds after each change (`frames/look3`, `look3b`,
|
|
123
|
+
`look3c`, `look3d`): sky lavender to peach, middle bright, far cones pale, near
|
|
124
|
+
shadow cool and deep, red stays red.
|
|
125
|
+
- Sampled frames of all 29 rendered shots (`frames/chk3/all-*.jpg`): no orbs after
|
|
126
|
+
`scatter: 0`, fighters in the lit band in the fight shots.
|
|
127
|
+
|
|
128
|
+
## Not checked
|
|
129
|
+
|
|
130
|
+
- Other times of day, other sun positions, or a camera plan that circles the action.
|
|
131
|
+
- Whether the look matches the references for a person: the user has not seen the
|
|
132
|
+
finished version 3.
|
|
133
|
+
- Render cost alone: renders ran while another session used the GPU (about 1.8 to
|
|
134
|
+
4.5 s a frame at 4 samples, 1280×720).
|
|
135
|
+
- Any phone or game use of this look.
|
|
136
|
+
|
|
137
|
+
## Boundaries
|
|
138
|
+
|
|
139
|
+
The set, the sky picture and the look values stay in the consumer. A documented
|
|
140
|
+
panorama orientation, and a sky made from colour stops without a picture, would be
|
|
141
|
+
the engine's.
|