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,73 @@
|
|
|
1
|
+
# Prefab 隔離預覽與消費端工具路線圖
|
|
2
|
+
|
|
3
|
+
Status: Accepted
|
|
4
|
+
|
|
5
|
+
Owner: Engine tooling and consumer integration
|
|
6
|
+
|
|
7
|
+
Last reviewed: 2026-11-03
|
|
8
|
+
|
|
9
|
+
## Objective
|
|
10
|
+
|
|
11
|
+
從乾淨的遊戲 checkout,任何 agent 都能選定一個遊戲 Prefab 的子節點、狀態及動畫時間,重現美術比對,再用同一份定義組入 Scene。[開發順序](../prefab-workflow.md)是現行工作規則。1.1.0 已交付 P0 的公開接入、單 Prefab 預覽與消費端瀏覽器證據閘門;下表保留後續 P1/P2 工作。
|
|
12
|
+
|
|
13
|
+
## Current baseline
|
|
14
|
+
|
|
15
|
+
從消費遊戲的開發經驗可見三個問題:主畫面使用程式建立節點,建置卻校準的是引擎內建 Prefab;引擎副本與主庫會分歧;以字串比對驗證 UI 座標,無法察覺後續覆寫的位置。這些觀察促成工具需求,不能用來推算效能收益。
|
|
16
|
+
|
|
17
|
+
- 引擎已有[獨立 consumer build](../3d-integration.md)、[Provider 與 lease](../asset-loading.md)、序列化階層與實例化器。基線 `dee5bcf` 的套件根入口在執行時匯出 `ZhudaPrefab`、`ZhudaUI`,但公開型別入口缺少這兩個類別。消費端在遇到這類缺口時應建立引擎回歸案例。
|
|
18
|
+
- 引擎 checkout 內執行 `npm run build`、`npm start`,可開啟 `http://localhost:8890/preview.html?asset=NineSliceDialogFrame.lh`。工作台入口 `src/PreviewMain.ts` 從內建清單選擇示例。外部建置測試 `tests/consumer-build.test.mjs` 會確認遊戲輸出不含示例預覽頁。
|
|
19
|
+
- [視覺契約檢查](../../packages/compiler/visual-contract-audit.mjs)驗證指定呈現狀態與還原規則。[畫面輪廓比較](../../packages/core/effects/README.md)可量前景遮罩的重疊和重心。兩者均有明確範圍,單靠這些結果無法確認文字、內部色彩或裝置效能。
|
|
20
|
+
|
|
21
|
+
## Delivered in 1.1.0
|
|
22
|
+
|
|
23
|
+
- `ZhudaPrefabLibrary` uses the public `AssetProvider` cache/lease lifecycle,
|
|
24
|
+
validates static 2D hierarchies, exposes named child selection and records
|
|
25
|
+
source hashes for every instance.
|
|
26
|
+
- `runConsumerBuild` can emit an isolated `prefab-preview.html` from the
|
|
27
|
+
consumer's own definitions. `prefab-check.mjs` captures real desktop WebGL
|
|
28
|
+
draws, source provenance, fingerprints and pixel diffs; `prefabEvidence`
|
|
29
|
+
blocks stale or changed artifacts.
|
|
30
|
+
- `consumer-guards.mjs`, Doctor's `--project` mode and the MCP visual workflow
|
|
31
|
+
contract reject private engine imports, copied engine sources and untyped
|
|
32
|
+
`Laya` declarations. The neutral browser fixture covers wrong nodes, shifted
|
|
33
|
+
text, wrong same-sized textures, cancellation, timeout and 30 unload cycles.
|
|
34
|
+
|
|
35
|
+
## 1.4.0 candidate extension
|
|
36
|
+
|
|
37
|
+
The shared library/preview adds serializable primitive 3D trees, named sockets,
|
|
38
|
+
transform/material states, definition hashes and explicit mesh/material disposal.
|
|
39
|
+
See [the API](../procedural-prefabs.md) and
|
|
40
|
+
[candidate verification](records/consumer-runtime-hardening/verification.md).
|
|
41
|
+
This does not deliver arbitrary model factories or selective evidence invalidation.
|
|
42
|
+
|
|
43
|
+
## 1.14.0 Web editor delivery
|
|
44
|
+
|
|
45
|
+
`zhuda-prefab-editor` now provides a generic local 2D `.lh` editing loop. It
|
|
46
|
+
serves one consumer Prefab, renders that definition through the real
|
|
47
|
+
Zhuda/Laya runtime, exposes stable node selection and common layout/text
|
|
48
|
+
properties, supports design-pixel dragging plus undo/redo, and saves with
|
|
49
|
+
revision checks, schema validation, a `.bak` snapshot and atomic replacement.
|
|
50
|
+
The tool is intentionally separate from the consumer build and does not relax
|
|
51
|
+
Prefab evidence gates. It is not yet a Spine timeline, particle graph or 3D
|
|
52
|
+
model editor.
|
|
53
|
+
|
|
54
|
+
## Acceptance gates and staged work
|
|
55
|
+
|
|
56
|
+
各項依序取得證據再決定是否擴大。引擎提供通用資料格式、工具、公開型別和中性 fixtures;遊戲保存美術基準、媒體、情境及實機產物。
|
|
57
|
+
|
|
58
|
+
| 順序 | 引擎工作與選擇 | 可驗收的結果 |
|
|
59
|
+
| --- | --- | --- |
|
|
60
|
+
| P0 — 公開接入 | 補齊 Prefab/UI 必需的根入口型別。以一個外部專案鎖定引擎版本,沿用 consumer build。Doctor 優先檢查遊戲深層匯入、複製 engine/vendor、全域 Laya any 等可客觀判定的偏差;特殊渲染器保留具名 adapter。 | strict TypeScript fixture 只用公開入口即可建立實例;ESM/CJS 匯出與宣告一致。刻意加入私有匯入時應指出檔案、行號與修法。建置後遊戲原檔雜湊不變,不產生引擎範例。 |
|
|
61
|
+
| P0 — 單 Prefab 預覽 | 先用一個外部專案的中性面板打通真實資產。沿用 Provider/lease、實際 Prefab 定義與 renderer,增加 ID、子路徑、狀態、seed、時間、DPR 選擇,保存輸入版本與基準。隔離入口可注入最小相機/燈光和假資料。 | 不導入遊戲 Main、Scene 或後端即可畫出指定子節點;從預覽和 Scene 檢查相同資產 ID 與版本。未知 ID、子節點遺失、材質錯誤或缺檔須能定位;切換時取消舊請求,連續 30 次卸載後資源回到約定範圍。 |
|
|
62
|
+
| P0 — 把關卡接到消費端 CI | 建立 Prefab→子組件→Scene 的依賴索引及證據記錄。CI 從依賴變更算出待重驗集合,確認實際建置引用的 ID、比較用的版本與測試環境;將幾何、影像差異及行為分開判定。PR 檢查跑固定環境,本機可只跑受影響的 Prefab。 | 正常樣本通過。推歪文字須使幾何/影像測試失敗,換錯同尺寸貼圖也須失敗。私改 Scene 另畫一份、缺基準、引用示例報告、過期基準均不能放行。失敗輸出定位到 Prefab ID/子路徑,附預期、實圖及差異。SSIM 不能直接當像素位移。 |
|
|
63
|
+
| P1 — 常用 UI 與切片 | 用真實跑版案例擴充既有九宮格與文字佈局。內容區/光學中心由 Prefab 帶入,量測字形與描邊,明確指定 min/max 字級、RTL 和溢出策略。CLI 可精算指定 alpha 閾值下的外框;顏色推估的內容區只產生可覆寫建議。 | 測不對稱邊框、陰影、透明留白、長數字、不同字型與語系、不同尺寸與 DPR。可區分切片邊界和文字安全區;人工註記優先。先量既有容器是否足夠,再以多個案例及包體/排版成本決定是否導入 Yoga。 |
|
|
64
|
+
| P1 — 生命週期、時間與音訊 | 示範切頁暫停、回前景重算、清理指標輸入、對 Canvas 的 context-loss 處理及顯式釋放。重用既有 clock/音訊解鎖與靜音邏輯,讓消費端配置併發上限。 | 實際切頁後不補播過期事件、恢復時不重複執行遊戲動作;關面板後無晚到資源。用真實輸入、實際失去/重建 WebGL context、音訊手勢與 30 次拆除驗證。Worker 心跳或看到 suspend 字串均不能證明行為。 |
|
|
65
|
+
| P2 — 影片特效相容性原型 | 把下載完成、解碼就緒、首幀成功合成分開記錄。以同一個特效 Prefab 比較原生透明影片、單支 RGB/alpha 並排影片經 shader 合成、圖集/靜態降級。聲明 DOM 或 Canvas 顯示方式與輸入範圍。 | 在目標 iPhone Safari、Android Chrome 和桌面各看實際透明邊緣、層級、點擊、首幀延遲、記憶體與釋放。測取消/逾時/錯誤後能降級。只對通過的平台組合標示支援;保留原本可用路徑。 |
|
|
66
|
+
|
|
67
|
+
## Rollout and rollback
|
|
68
|
+
|
|
69
|
+
CI 的第一個具體案例可用同一塊數字牌走兩個入口。獨立預覽記錄 Prefab ID、子節點路徑、定義及依賴雜湊;Scene 測試在約定的掛點讀出**實際掛載實例**的來源與最終畫面。刻意讓 Scene 改用手畫副本或在掛載後修改字級,前一例應在來源檢查失敗,後一例應在幾何或畫面比對失敗。這使測試能區分「清單裡寫了」和「玩家看到的就是這個 Prefab」。
|
|
70
|
+
|
|
71
|
+
先用一個「有外框、長數字、描邊」的小面板完成前三項。以原遊戲畫面建立經核准的外觀參考,並為超界問題另列修正預期。先驗其文字和外框,再驗整塊面板,最後替換一個 Scene 掛點。記錄新增一個資產所需時間、回歸誤報及是否能定位差異。錯誤無法定位或外觀回歸時,還原該掛點至前一版本,保留失敗樣本供除錯,再決定是否遷移盤面、控制列及特效。
|
|
72
|
+
|
|
73
|
+
引擎缺陷以最小中性案例修正;RGS、下注、計分、語系內容、專屬美術與部署維持消費端所有。媒體解碼、裝置效能與新的 UI 演算法均需各自量測。目前無通用消費端工具可自動判定任意 Scene 是否遵守上述全部關卡。
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Agent task: preview-runtime-hardening
|
|
2
|
+
|
|
3
|
+
Status: Accepted
|
|
4
|
+
Owner: Codex
|
|
5
|
+
Last reviewed: 2026-11-07
|
|
6
|
+
|
|
7
|
+
## Source requirement
|
|
8
|
+
|
|
9
|
+
User request: strengthen the current 2D/Scene/3D preview-edit stack after the global runtime audit. The required fixes are foreign Laya realm protection, a selectable hidden-preview resource release policy, and an explicit lightweight 2D editor profile.
|
|
10
|
+
|
|
11
|
+
## Goal
|
|
12
|
+
|
|
13
|
+
A preview cannot silently attach to an already initialized foreign Laya realm; the shared showcase can release hidden Scene/3D preview resources by default; and the 2D editor's minimal feature/module profile is explicit and regression-tested.
|
|
14
|
+
|
|
15
|
+
## Invariants
|
|
16
|
+
|
|
17
|
+
- The public runtime remains LayaAir 3.4.2 and uses one renderer/backend per realm.
|
|
18
|
+
- DOM/SVG editor chrome remains outside the Laya canvas.
|
|
19
|
+
- Stable asset IDs, provider/cache leases, cancellation and disposal contracts remain unchanged.
|
|
20
|
+
- Existing consumers can boot and dispose the same Zhuda realm repeatedly.
|
|
21
|
+
- No consumer game assets are added to the engine source tree.
|
|
22
|
+
|
|
23
|
+
## Dependencies
|
|
24
|
+
|
|
25
|
+
- `packages/core/DeclarativeSDK.ts`
|
|
26
|
+
- `packages/core/TopologyGraph.ts`
|
|
27
|
+
- `packages/compiler/prefab-editor-server.mjs`
|
|
28
|
+
- `examples/slot-symbol-prefab/src/Main.ts`
|
|
29
|
+
- Existing runtime/editor tests and public type declarations.
|
|
30
|
+
|
|
31
|
+
## Scope
|
|
32
|
+
|
|
33
|
+
### Engine
|
|
34
|
+
|
|
35
|
+
- Add a runtime-realm inspection/guard used by `ZhudaEngine.boot`.
|
|
36
|
+
- Keep the 2D editor on the `core + 2d + ui` profile and make its files explicit.
|
|
37
|
+
|
|
38
|
+
### Consumer or adapter
|
|
39
|
+
|
|
40
|
+
- Update the engine-owned slot showcase's shared preview switch to release hidden Scene/3D handles by default, with an explicit retain query for fast iteration.
|
|
41
|
+
|
|
42
|
+
## Non-goals
|
|
43
|
+
|
|
44
|
+
- Do not merge multiple Laya realms into one page.
|
|
45
|
+
- Do not implement a full DCC editor or GPU-resource hot unload for arbitrary consumer scenes.
|
|
46
|
+
- Do not claim iframe/native context recovery is lossless.
|
|
47
|
+
|
|
48
|
+
## Acceptance evidence
|
|
49
|
+
|
|
50
|
+
1. A fake initialized foreign `Laya` realm is rejected with an actionable iframe/runtime-host error; an uninitialized Laya namespace remains boot-eligible.
|
|
51
|
+
2. The 2D editor server exposes exactly `laya.core.js`, `laya.webgl_2D.js`, and `laya.ui.js`, and its client boots only `core/2d/ui`.
|
|
52
|
+
3. The slot showcase defaults to release-hidden resource policy, accepts `?resources=retain`, and reports the policy.
|
|
53
|
+
4. `npm test`, `npm run typecheck`, `npm run verify`, and `git diff --check` pass.
|
|
54
|
+
|
|
55
|
+
## Evidence to attach
|
|
56
|
+
|
|
57
|
+
- Test/build output from the commands above.
|
|
58
|
+
- Runtime guard unit tests and editor/profile regression tests.
|
|
59
|
+
- Slot showcase typecheck/build result.
|
|
60
|
+
|
|
61
|
+
## Unverified limits
|
|
62
|
+
|
|
63
|
+
- A real external foreign Laya app and Windows/mobile device integration still require separate browser/device acceptance.
|
|
64
|
+
- DOM iframe rendering is not a substitute for native GPU lossless recovery.
|
|
65
|
+
|
|
66
|
+
## Rollback
|
|
67
|
+
|
|
68
|
+
Revert the files changed for this task to the last known good working tree state; the existing boot behavior and retained hidden preview resources remain the fallback.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Platform adapters
|
|
2
|
+
|
|
3
|
+
## NoSleep
|
|
4
|
+
|
|
5
|
+
The SDK includes `NoSleepAdapter` for the browser Screen Wake Lock API. It is
|
|
6
|
+
an engine utility, so a consumer does not need to add a third-party NoSleep
|
|
7
|
+
package for supported browsers.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { NoSleepAdapter } from 'zhuda-laya-engine';
|
|
11
|
+
|
|
12
|
+
const noSleep = new NoSleepAdapter({ autoEnableOnGesture: true });
|
|
13
|
+
// Or call `await noSleep.enable()` from the game's start button handler.
|
|
14
|
+
const diagnostics = noSleep.getDiagnostics();
|
|
15
|
+
// diagnostics.state is `enabled`, `unsupported`, `denied`, or `error`.
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The adapter releases its sentinel on page hide and blur, reacquires it when a
|
|
19
|
+
visible enabled owner returns, ignores stale request results, and releases all
|
|
20
|
+
owned resources on `dispose()`. `autoEnableOnGesture` defaults to `true`; the
|
|
21
|
+
first pointer, touch, mouse or keyboard gesture is still an explicit browser
|
|
22
|
+
user gesture. Consumers must inspect diagnostics and keep the result
|
|
23
|
+
`unsupported` when a browser does not expose `navigator.wakeLock`.
|
|
24
|
+
|
|
25
|
+
The service does not override operating-system power policy or keep a hidden
|
|
26
|
+
background tab awake. Real mobile support requires a browser/device check; the
|
|
27
|
+
Node fixtures only verify lifecycle and failure behavior.
|
|
28
|
+
|
|
29
|
+
## FairyGUI
|
|
30
|
+
|
|
31
|
+
FairyGUI is intentionally not part of the engine package, topology or SDK
|
|
32
|
+
bundle. A consumer that needs it installs the FairyGUI runtime compatible with
|
|
33
|
+
its pinned LayaAir version and owns the adapter, package/atlas/font assets,
|
|
34
|
+
input routing and disposal. Those UI assets remain outside this repository and
|
|
35
|
+
must follow the consumer's prefab isolation workflow.
|
|
36
|
+
|
|
37
|
+
## Runtime sizing, drivers and recovery (1.7.0)
|
|
38
|
+
|
|
39
|
+
`ZhudaEngine.boot({container, dprCap})` uses responsive **CSS-pixel design units**.
|
|
40
|
+
The canvas backing size scales by `min(devicePixelRatio, dprCap)`; a 198-unit
|
|
41
|
+
control remains 198 CSS px at DPR 1/2/3. Native Laya retinal mode supplies the
|
|
42
|
+
matching stage and input transforms. The adapter composes browser canvas CSS
|
|
43
|
+
resampling with the native Retina transform once, while preserving the native
|
|
44
|
+
backing-to-page matrix for input. The version-specific adapter restores the
|
|
45
|
+
browser ratio descriptor after synchronous sizing. Container placement and
|
|
46
|
+
ancestor scrolling are reflected in Laya pointer conversion. DOM
|
|
47
|
+
`ZhudaPointerInput` coordinates remain client CSS pixels; 3D screen queries use
|
|
48
|
+
the canvas CSS rect plus backing dimensions.
|
|
49
|
+
|
|
50
|
+
A container turned by a CSS transform reports a rectangle on screen that is not its layout: a
|
|
51
|
+
landscape game turned a quarter to fill an upright phone measures 390×844 where it is laid out
|
|
52
|
+
844×390, and the stage would be sized on its side. Give `boot({ layoutSize: () => ({ width, height }) })`
|
|
53
|
+
the layout size in CSS pixels; it is read on every `resize()` instead of the container's rectangle
|
|
54
|
+
(2.0.0; route [mobile-always-landscape](routes/mobile-always-landscape.md)). Pointer positions on a
|
|
55
|
+
turned page are the game's to convert: the engine's pointer conversion assumes an upright canvas.
|
|
56
|
+
|
|
57
|
+
For a fixed design that scales with the container, use
|
|
58
|
+
`designSize:{width:1280,height:720}` and optionally `scaleMode` (default show-all).
|
|
59
|
+
Boot `width` / `height` alone describe initial setup; they do not pin a responsive
|
|
60
|
+
container's design resolution. Remove old consumer compensation that multiplied
|
|
61
|
+
design coordinates by DPR, and recapture affected Prefab/Scene evidence. The
|
|
62
|
+
checker rejects a backing-correct canvas whose stage design dimensions shrink
|
|
63
|
+
content. The official preview uses responsive CSS units at its requested size;
|
|
64
|
+
fixed-design consumer captures must declare their own scaling expectations.
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
const context = await ZhudaEngine.boot({
|
|
68
|
+
container: '#game',
|
|
69
|
+
designSize: {width:1280, height:720},
|
|
70
|
+
driver: new ZhudaWorkerFrameDriver({intervalMs:100, onError:console.error}),
|
|
71
|
+
backgroundPolicy: 'continue',
|
|
72
|
+
recoveryPolicy: 'bounded',
|
|
73
|
+
maxFrameDeltaSec: .1,
|
|
74
|
+
clearInput: () => inputs.clear(),
|
|
75
|
+
onResume: report => console.log(report),
|
|
76
|
+
});
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The default driver is `ZhudaRafDriver`; default policies remain background
|
|
80
|
+
`pause` and recovery `discard`. `continue` advances the **same** runtime clock,
|
|
81
|
+
layers, timers and update task when the driver can deliver a frame. A Worker
|
|
82
|
+
sends wake messages in the background and RAF runs in the foreground. It does
|
|
83
|
+
not run gameplay in the Worker or create a second clock. Layers may still pause
|
|
84
|
+
presentation independently. A background RAF alone offers no timing guarantee.
|
|
85
|
+
|
|
86
|
+
`bounded` proposes one recovery delta capped at `maxFrameDeltaSec` (default
|
|
87
|
+
0.1, valid range greater than zero through one second). `onResume` reports the
|
|
88
|
+
background duration, proposed next-frame `advancedSec`, and missed time that
|
|
89
|
+
will be discarded. The proposed delta can be cancelled by pause/dispose. It
|
|
90
|
+
never replays the full suspension. Manual pause survives focus transitions;
|
|
91
|
+
duplicate/nonmonotonic timestamps and obsolete driver generations are ignored.
|
|
92
|
+
Consumers reconcile server/offline state through their own authority.
|
|
93
|
+
|
|
94
|
+
A custom `ZhudaRuntimeDriver` implements monotonic-millisecond `now`, `start`,
|
|
95
|
+
`setBackground`, `stop`, and idempotent `dispose`. The session owns it after
|
|
96
|
+
successful option validation. Worker construction can throw when unsupported or
|
|
97
|
+
blocked by CSP; handle this before boot and explicitly choose RAF if appropriate.
|
|
98
|
+
Worker errors stop that driver's updates and invoke `onError`. Do not silently
|
|
99
|
+
claim background execution. Session disposal terminates the owned Worker and
|
|
100
|
+
removes listeners. `workerFactory` can supply a CSP-compatible owned Worker;
|
|
101
|
+
its message protocol is `{type:'start', generation, intervalMs}` / `{type:'stop'}`,
|
|
102
|
+
with replies `{generation}`. Late-generation replies must not be retained.
|
|
103
|
+
|
|
104
|
+
Browsers and operating systems can throttle or freeze **both** threads. Desktop
|
|
105
|
+
Chrome switching/freeze and deterministic long-gap tests are measured; physical
|
|
106
|
+
iOS/Android background longevity and battery behavior remain unavailable.
|
|
107
|
+
|
|
108
|
+
## WebGPU (1.11.0)
|
|
109
|
+
|
|
110
|
+
The same runtime owns WebGL context loss and WebGPU device loss. See
|
|
111
|
+
[renderer selection, diagnostics, cancellation and fresh-realm recovery](webgpu.md).
|
|
112
|
+
Windows browser availability depends on its GPU/driver; native packaging is a
|
|
113
|
+
separate capability. Do not interpret WebGL fallback as WebGPU acceptance.
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# Post quality: curves, colour tables, edges, occlusion, flare
|
|
2
|
+
|
|
3
|
+
What the HDR chain (`ZhudaFilmicPipeline`, and a look's `grade`) can do
|
|
4
|
+
beyond LayaAir 3.4.2's own effects. All of it is drawn on WebGL and on WebGPU
|
|
5
|
+
by `npm run verify:post-quality`, and was run on a phone (the numbers below).
|
|
6
|
+
|
|
7
|
+
| What | Class or field | Passes it adds |
|
|
8
|
+
| -------------------------------------- | ---------------------------------------------- | -------------------------------------- |
|
|
9
|
+
| AgX, neutral and no tone curve | `toneMapping` | none |
|
|
10
|
+
| White balance, lift, gamma, gain | `temperature`, `tint`, `lift`, `gamma`, `gain` | none |
|
|
11
|
+
| A colour table from a `.cube` file | `ZhudaColorLut`, `grade.lut` | one |
|
|
12
|
+
| Edge smoothing by the shape of an edge | `ZhudaSmaa`, `antialias: 'smaa'` | three |
|
|
13
|
+
| Ambient occlusion by horizons | `ZhudaGroundTruthAO`, `aoMethod: 'gtao'` | two (LayaAir's: four and a scene pass) |
|
|
14
|
+
| Lens flare that a wall hides | `ZhudaLensFlare`, `look.lensFlare` | a copy, one pixel, a quad an element |
|
|
15
|
+
| Bloom's threshold, knee, shape, dirt | `bloomThreshold` and the fields beside it | none |
|
|
16
|
+
|
|
17
|
+
## Tone curves
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
const film = new ZhudaFilmicPipeline(camera, { toneMapping: 'agx' });
|
|
21
|
+
film.setGrade({ toneMapping: 'neutral' }); // while it runs
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- `aces` (default): LayaAir's filmic curve. Strong contrast; a bright red
|
|
25
|
+
turns toward orange before it whitens.
|
|
26
|
+
- `agx`: bright colours fade to white without changing hue; softer contrast.
|
|
27
|
+
- `neutral` (Khronos PBR Neutral): a colour whose brightest channel is below
|
|
28
|
+
0.76 comes out as it went in, less a lift of 0.04 at most taken off its
|
|
29
|
+
darkest channel. For a material that must match its swatch.
|
|
30
|
+
- `none`: no curve; above white is cut off.
|
|
31
|
+
|
|
32
|
+
A curve costs no pass. LayaAir's grade looks each pixel up in a small table
|
|
33
|
+
it draws once; with `agx`, `neutral` or `none` that lookup pass is this
|
|
34
|
+
engine's and works the curve out for each pixel after the table. Its table
|
|
35
|
+
starts at black and holds the graded light in the encoding it is looked up
|
|
36
|
+
by, so a grade that changes nothing changes nothing: on a chart of 21
|
|
37
|
+
patches (greys from black to 32 times white, colours, one colour beyond the
|
|
38
|
+
table) the screen is within 0.6 of 255 of the curve's arithmetic, and black
|
|
39
|
+
is 0. LayaAir's own table holds plain light and is up to 1.2 % off between
|
|
40
|
+
its entries; `aces` is LayaAir's path, untouched.
|
|
41
|
+
|
|
42
|
+
`zhudaAgxToneMap`, `zhudaNeutralToneMap` and `zhudaToneMap` are the same
|
|
43
|
+
arithmetic on the CPU, for tools.
|
|
44
|
+
|
|
45
|
+
## White balance, lift, gamma, gain
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
film.setGrade({ temperature: 20, tint: -5, lift: [0, 0, 0.02], gain: [1.1, 1, 0.95] });
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
- `temperature`, `tint`: -100..100. Above 0 `temperature` is warmer, `tint`
|
|
52
|
+
toward magenta; below 0 cooler, toward green.
|
|
53
|
+
- `lift`, `gamma`, `gain`: three numbers each for red, green and blue, on the
|
|
54
|
+
scene's light before the curve, as `(colour * gain + lift) ^ gamma`.
|
|
55
|
+
`gamma` above 1 darkens the middle. With `none` as the curve the screen
|
|
56
|
+
shows exactly that arithmetic (within 0.5 of 255).
|
|
57
|
+
|
|
58
|
+
They are LayaAir's own grading, switched on when a value differs from its
|
|
59
|
+
default, and cost nothing a frame.
|
|
60
|
+
|
|
61
|
+
## A colour table
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
import { parseZhudaCubeLut, ZhudaColorLut } from 'zhuda-laya-engine';
|
|
65
|
+
|
|
66
|
+
const table = new ZhudaColorLut(parseZhudaCubeLut(text), { intensity: 1 });
|
|
67
|
+
const film = new ZhudaFilmicPipeline(camera, { finishEffects: [table.effect] });
|
|
68
|
+
table.setIntensity(0.5); // half of the table's colour
|
|
69
|
+
table.setLut(another); // another table in place
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
- `parseZhudaCubeLut` reads the Adobe `.cube` format (`TITLE`,
|
|
73
|
+
`LUT_3D_SIZE` 2 to 256, `DOMAIN_MIN`, `DOMAIN_MAX`, comments, and the
|
|
74
|
+
`LUT_3D_INPUT_RANGE` line some tools write). Anything else is refused with
|
|
75
|
+
its line number: a one-dimensional table, a wrong number of entries.
|
|
76
|
+
- The table is applied to the finished picture, on the colours the screen
|
|
77
|
+
shows, which is what a grading tool exports it for. Put it first in
|
|
78
|
+
`finishEffects`.
|
|
79
|
+
- Up to 65 entries an edge are drawn with (the slices lie in rows of one
|
|
80
|
+
texture: 585 by 520 for 65). Sixteen-bit floats where the device blends
|
|
81
|
+
between them, else eight bits.
|
|
82
|
+
- `zhudaSampleCubeLut(table, colour)` is the lookup on the CPU.
|
|
83
|
+
|
|
84
|
+
In a film scene: `look.grade.lut: { asset: 'looks/dusk.cube', intensity }`.
|
|
85
|
+
The file is loaded with the scene (`loadZhudaFilmScene`; `ZhudaFilmAssets`
|
|
86
|
+
keeps parsed tables in `colorTables`). A game's `ZhudaSceneLook` loads
|
|
87
|
+
nothing: the game reads its own file and hands the table over with
|
|
88
|
+
`sceneLook.setColorTable(parseZhudaCubeLut(text))`; until then the picture is
|
|
89
|
+
as without a table. A running look can change `intensity`, not the asset.
|
|
90
|
+
|
|
91
|
+
## Edge smoothing by shape (SMAA)
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
const smaa = new ZhudaSmaa({ quality: 'high' });
|
|
95
|
+
const film = new ZhudaFilmicPipeline(camera, { finishEffects: [smaa.effect] });
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Where the picture steps, the method follows the step to both ends, works out
|
|
99
|
+
how much of each pixel the true edge would have covered, and mixes each
|
|
100
|
+
pixel with its neighbour by that much.
|
|
101
|
+
|
|
102
|
+
Distance from the true coverage, as a share of white, mean over the pixels an
|
|
103
|
+
edge crosses and those beside them (a hard-edged white half-plane on black,
|
|
104
|
+
480 by 300):
|
|
105
|
+
|
|
106
|
+
| Edge at | 4° | 12° | 27° | 45° | 63° | 83° |
|
|
107
|
+
| -------------------- | ----- | ----- | ----- | ----- | ----- | ----- |
|
|
108
|
+
| not smoothed | 0.085 | 0.083 | 0.082 | 0.063 | 0.082 | 0.084 |
|
|
109
|
+
| `ZhudaEdgeSmoothing` | 0.034 | 0.098 | 0.106 | 0.032 | 0.106 | 0.045 |
|
|
110
|
+
| `ZhudaSmaa` (`high`) | 0.010 | 0.017 | 0.037 | 0.012 | 0.038 | 0.011 |
|
|
111
|
+
|
|
112
|
+
- What is not an edge is left as it was: one colour, a slow ramp and grain
|
|
113
|
+
fainter than an edge came through with no pixel changed (on the phone 202
|
|
114
|
+
of 144 000 pixels of the grain were 1 of 255 off: a pass more rounds once
|
|
115
|
+
more there). FXAA changed 56 591 pixels of the grain.
|
|
116
|
+
- `quality`: how far an edge is followed and what counts as one. `low` 8
|
|
117
|
+
pixels to each side, `medium` 16, `high` 32 (default), `ultra` 64 and a
|
|
118
|
+
finer threshold. Only long, shallow steps need the reach (at 4° `low` is
|
|
119
|
+
twice as far off as the others).
|
|
120
|
+
- `cornerRounding` (default 0): a level or upright edge that ends in a
|
|
121
|
+
corner is left as it is. The reference rounds such corners by 0.25, which
|
|
122
|
+
lays a faint ramp along the edge: round a white box that changed 256
|
|
123
|
+
pixels by up to 15 of 255; at 0, 8 pixels by 2.
|
|
124
|
+
- It reads no depth and works after the curve; pixels are mixed as light.
|
|
125
|
+
|
|
126
|
+
Limits: it does not look for diagonal patterns, so edges near 30° and 60°
|
|
127
|
+
keep more of their steps (the table). A line thinner than a pixel is not
|
|
128
|
+
recovered. Three passes and two pictures of the frame's size at eight bits.
|
|
129
|
+
|
|
130
|
+
The method and its two lookup tables are SMAA 2.8 (Jimenez and others, MIT);
|
|
131
|
+
see `vendor/threejs-post/README.md`.
|
|
132
|
+
|
|
133
|
+
## Ambient occlusion by horizons (GTAO)
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
const film = new ZhudaFilmicPipeline(camera, { aoMethod: 'gtao', aoRadius: 0.5 });
|
|
137
|
+
film.groundAO.set({ slices: 3, steps: 6 });
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Round each pixel a few slices are cut through the depth picture, the horizon
|
|
141
|
+
is found to both sides of each, and the share of an evenly lit sky that still
|
|
142
|
+
reaches the point is worked out for that slice.
|
|
143
|
+
|
|
144
|
+
Light left, 1 is all of it (white surfaces under a white sky, radius 0.5):
|
|
145
|
+
|
|
146
|
+
| Distance from the foot of a wall | 0.04 | 0.1 | 0.2 | 0.3 | 0.45 and more | open floor | sky |
|
|
147
|
+
| -------------------------------- | ---- | ---- | ---- | ---- | ------------- | ---------- | ---- |
|
|
148
|
+
| `gtao` | 0.74 | 0.87 | 0.97 | 0.99 | 1.00 | 0.99 | 1.00 |
|
|
149
|
+
| `gtao`, half size | 0.76 | 0.83 | 0.95 | 0.98 | 1.00 | 0.99 | 0.99 |
|
|
150
|
+
| `sao` at 0.65 (LayaAir's) | 0.51 | 0.52 | 0.53 | 0.54 | 0.55 | 0.84 | 0.87 |
|
|
151
|
+
|
|
152
|
+
- Open ground, an open wall and the sky are left as they are. LayaAir's own
|
|
153
|
+
darkens all three.
|
|
154
|
+
- `aoIntensity` is a power, 0..4: 1 is what the geometry hides (the default
|
|
155
|
+
with `gtao`), 2 squares it.
|
|
156
|
+
- It reads the depth picture only and takes the surface normal from it.
|
|
157
|
+
LayaAir's needs the scene drawn once more for normals.
|
|
158
|
+
- Sixteen turns of the slices are spread over every four by four pixels and
|
|
159
|
+
the second pass averages exactly those: nothing of the pattern is left on
|
|
160
|
+
a flat surface.
|
|
161
|
+
- `aoHalfSize` works the occlusion out at half size: softer contact.
|
|
162
|
+
- As any occlusion laid over a finished picture, it darkens direct light as
|
|
163
|
+
well as ambient light: keep it mild in sunlit scenes.
|
|
164
|
+
|
|
165
|
+
In a look: `grade.aoMethod: 'gtao'`.
|
|
166
|
+
|
|
167
|
+
## Lens flare
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
const flare = new ZhudaLensFlare(); // the flare made for a low sun
|
|
171
|
+
const film = new ZhudaFilmicPipeline(camera, { sceneEffects: [flare.effect] });
|
|
172
|
+
flare.setLight({ toward: [0.3, 0.5, -0.8], color: [1, 0.95, 0.85] }); // or { position }
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
A glow round the light, a streak through it, and ghosts along the line from
|
|
176
|
+
the light through the middle of the picture. Each element is a shape drawn
|
|
177
|
+
by arithmetic (`glow`, `disc`, `ring`, `polygon`), so a flare needs no
|
|
178
|
+
pictures.
|
|
179
|
+
|
|
180
|
+
- **It is hidden by what hides the light.** Sixteen points round the light
|
|
181
|
+
are looked up in the depth picture and the flare is as strong as the share
|
|
182
|
+
of them that nothing stands in front of: behind a wall nothing is drawn,
|
|
183
|
+
with the wall's edge through the sun about half. A lamp (`position`) is
|
|
184
|
+
hidden by what is nearer than it. LayaAir 3.4.2's own `LensFlareEffect`
|
|
185
|
+
draws through everything.
|
|
186
|
+
- Outside the frame the flare fades over a third of the frame's width;
|
|
187
|
+
behind the camera there is none.
|
|
188
|
+
- An element: `shape`, `at` (0 on the light, 1 in the middle of the picture,
|
|
189
|
+
2 as far beyond), `size` (its width as a share of the picture's height),
|
|
190
|
+
`stretch` (width over height), `color`, `strength`, `rotationDeg`,
|
|
191
|
+
`follow`, and for the shapes `sides`, `softness`, `width`.
|
|
192
|
+
`ZHUDA_LENS_FLARE_SUN` is the default list; `validateZhudaLensFlare`
|
|
193
|
+
checks one without the runtime.
|
|
194
|
+
- It adds light to the scene before bloom and the curve.
|
|
195
|
+
|
|
196
|
+
Limit: clouds and fog drawn after the scene are not in the depth picture.
|
|
197
|
+
Lower `strength` under an overcast sky.
|
|
198
|
+
|
|
199
|
+
In a look: `lensFlare: true` or `{ strength, occlusionRadius, elements }`;
|
|
200
|
+
its place and colour follow the look's sun.
|
|
201
|
+
|
|
202
|
+
## Bloom
|
|
203
|
+
|
|
204
|
+
`bloomThreshold` (a display value: 1.2 is light above 1.55 of white),
|
|
205
|
+
`bloomSoftKnee` (0 a hard start, 1 gradual), `bloomAnamorphic` (-1..1:
|
|
206
|
+
stretched upright or sideways), `bloomDiffusion` (1..10: each step more
|
|
207
|
+
doubles the reach), and a picture of the marks on a lens that lights up
|
|
208
|
+
where the bloom falls on it:
|
|
209
|
+
|
|
210
|
+
```ts
|
|
211
|
+
film.setBloomDirt(texture, 2); // null takes it away; the texture stays the caller's
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
LayaAir 3.4.2 lays a dirt picture over the frame correctly only when their
|
|
215
|
+
shapes differ; the pipeline sets the cover for equal shapes.
|
|
216
|
+
|
|
217
|
+
## What it costs
|
|
218
|
+
|
|
219
|
+
A vivo V40 (Adreno 720), a picture of 823 by 1749, 36 balls and a floor
|
|
220
|
+
under a shadowed sun, median of 60 frames each drawn to the end, three runs:
|
|
221
|
+
|
|
222
|
+
| Chain | ms a frame |
|
|
223
|
+
| ---------------------------- | ---------------- |
|
|
224
|
+
| graded, ACES | 19.6, 17.4, 16.6 |
|
|
225
|
+
| AgX | 19.9, 15.0, 16.2 |
|
|
226
|
+
| neutral | 21.5, 20.5, 19.4 |
|
|
227
|
+
| FXAA | 19.9, 20.9, 20.5 |
|
|
228
|
+
| SMAA `low` | 21.8, 22.0, 22.6 |
|
|
229
|
+
| SMAA `high` | 21.9, 21.9, 21.9 |
|
|
230
|
+
| colour table, 33 | 20.8, 19.2, 20.6 |
|
|
231
|
+
| occlusion: LayaAir's | 36.7, 36.9, 37.6 |
|
|
232
|
+
| occlusion: by horizons | 25.7, 25.2, 25.5 |
|
|
233
|
+
| occlusion: by horizons, half | 23.3, 21.5, 23.2 |
|
|
234
|
+
| lens flare | 20.7, 20.3, 19.9 |
|
|
235
|
+
|
|
236
|
+
The plain chain varies by 3 ms between runs, so differences under that are
|
|
237
|
+
not told apart here: the curves, the table and the flare are within it.
|
|
238
|
+
SMAA is 1 to 2 ms over FXAA. Occlusion by horizons is about 11 ms a frame
|
|
239
|
+
cheaper than LayaAir's, and at half size about 14. One phone, one scene.
|
|
240
|
+
|
|
241
|
+
The same page ran its checks on that phone with the same results as on the
|
|
242
|
+
desktop GPU. WebGPU on a phone and iPhone are not measured.
|