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.
Files changed (740) hide show
  1. package/AGENTS.md +236 -0
  2. package/CHANGELOG.md +431 -0
  3. package/LICENSE +41 -0
  4. package/README.md +247 -2
  5. package/assets/branding/layaair-tribute-mark.svg +5 -0
  6. package/assets/branding/zhuda-layaair-mark.svg +34 -0
  7. package/assets/prefabs/CoinFountainVfx.lh +197 -0
  8. package/assets/prefabs/ConfirmActionButton.lh +87 -0
  9. package/assets/prefabs/LevelUpAuraVfx.lh +136 -0
  10. package/assets/prefabs/MineExplosionParticle.lh +352 -0
  11. package/assets/prefabs/NineSliceDialogFrame.lh +171 -0
  12. package/assets/prefabs/SwordSlashTrailVfx.lh +117 -0
  13. package/assets/prefabs/TacticalHudBar.lh +134 -0
  14. package/assets/prefabs/TelemetryDashboard.lh +87 -0
  15. package/assets/prefabs/UnityCrystalGuardian.lh +144 -0
  16. package/assets/prefabs/ZhudaSpine42Mascot.lh +183 -0
  17. package/assets/scenes/MinesweeperStage.ls +1180 -0
  18. package/dist/asset-calibration-report.json +969 -0
  19. package/dist/build-manifest.json +254 -0
  20. package/dist/sdk/zhuda-laya-csg.cjs +710 -0
  21. package/dist/sdk/zhuda-laya-csg.esm.js +683 -0
  22. package/dist/sdk/zhuda-laya-csg.min.cjs +7 -0
  23. package/dist/sdk/zhuda-laya-csg.min.esm.js +7 -0
  24. package/dist/sdk/zhuda-laya-demo.cjs +5990 -0
  25. package/dist/sdk/zhuda-laya-demo.esm.js +5956 -0
  26. package/dist/sdk/zhuda-laya-demo.min.cjs +12 -0
  27. package/dist/sdk/zhuda-laya-demo.min.esm.js +12 -0
  28. package/dist/sdk/zhuda-laya-engine.cjs +52628 -0
  29. package/dist/sdk/zhuda-laya-engine.esm.js +51848 -0
  30. package/dist/sdk/zhuda-laya-engine.min.cjs +2710 -0
  31. package/dist/sdk/zhuda-laya-engine.min.esm.js +2710 -0
  32. package/docs/3d-acceptance.md +47 -0
  33. package/docs/3d-integration.md +190 -0
  34. package/docs/README.md +112 -0
  35. package/docs/SUPPORT.md +21 -0
  36. package/docs/agent-development.md +219 -0
  37. package/docs/animation-control.md +213 -0
  38. package/docs/asset-loading.md +97 -0
  39. package/docs/assets/reference-games.jpg +0 -0
  40. package/docs/assets/solana-qr.png +0 -0
  41. package/docs/assets/sponsor-pass.svg +32 -0
  42. package/docs/audio.md +319 -0
  43. package/docs/backend-delivery.md +218 -0
  44. package/docs/basis-textures.md +94 -0
  45. package/docs/browser-sdk-releases.json +204 -0
  46. package/docs/browser-sdk.md +187 -0
  47. package/docs/cinematics.md +267 -0
  48. package/docs/cloth.md +280 -0
  49. package/docs/combat-runtime.md +82 -0
  50. package/docs/consumer-route.md +169 -0
  51. package/docs/consumer-tooling.md +518 -0
  52. package/docs/crowd-runtime.md +195 -0
  53. package/docs/developer-tooling.md +191 -0
  54. package/docs/film-scenes.md +1504 -0
  55. package/docs/filmic-rendering.md +743 -0
  56. package/docs/flythrough.md +89 -0
  57. package/docs/gpu-depth.md +207 -0
  58. package/docs/grass.md +127 -0
  59. package/docs/hdr-environment.md +76 -0
  60. package/docs/instanced-meshes.md +137 -0
  61. package/docs/layout-and-media.md +37 -0
  62. package/docs/layout-wireframe.md +80 -0
  63. package/docs/lighting-depth.md +185 -0
  64. package/docs/minigame-packaging.md +79 -0
  65. package/docs/model-editor.md +66 -0
  66. package/docs/model-lod.md +122 -0
  67. package/docs/model-pipeline.md +74 -0
  68. package/docs/model-showcase.md +365 -0
  69. package/docs/overview.md +183 -0
  70. package/docs/plans/README.md +133 -0
  71. package/docs/plans/TASK-TEMPLATE.md +64 -0
  72. package/docs/plans/TASK-spine38-isolated-topology-20261106.md +89 -0
  73. package/docs/plans/TEMPLATE.md +44 -0
  74. package/docs/plans/VERIFICATION-TEMPLATE.md +45 -0
  75. package/docs/plans/asset-packaging.md +140 -0
  76. package/docs/plans/cinematic-production/task.md +97 -0
  77. package/docs/plans/cinematic-production/verification.md +49 -0
  78. package/docs/plans/consumer-delivery-followups.md +129 -0
  79. package/docs/plans/desktop-and-agent-gates/hardening-task.md +85 -0
  80. package/docs/plans/desktop-and-agent-gates/hardening-verification.md +109 -0
  81. package/docs/plans/desktop-and-agent-gates/task.md +94 -0
  82. package/docs/plans/desktop-and-agent-gates/verification.md +60 -0
  83. package/docs/plans/prefab-toolchain.md +73 -0
  84. package/docs/plans/preview-runtime-hardening.md +68 -0
  85. package/docs/platform-adapters.md +113 -0
  86. package/docs/post-quality.md +242 -0
  87. package/docs/prefab-editor.md +194 -0
  88. package/docs/prefab-library.md +94 -0
  89. package/docs/prefab-workflow.md +75 -0
  90. package/docs/procedural-assets.md +463 -0
  91. package/docs/procedural-prefabs.md +133 -0
  92. package/docs/quality-route.md +386 -0
  93. package/docs/release-policy.md +79 -0
  94. package/docs/routes/README.md +180 -0
  95. package/docs/routes/TEMPLATE.md +54 -0
  96. package/docs/routes/action-adventure-3d-minigame.md +238 -0
  97. package/docs/routes/apocalypse-survival-3d.md +219 -0
  98. package/docs/routes/aqua-freeze-2d-minigame.md +183 -0
  99. package/docs/routes/astral-minimal-film-look.md +141 -0
  100. package/docs/routes/cascade-slot.md +93 -0
  101. package/docs/routes/clip-free-garments.md +229 -0
  102. package/docs/routes/drop-merge-2d-minigame.md +200 -0
  103. package/docs/routes/dungeon-line-slot.md +87 -0
  104. package/docs/routes/film-as-data.md +131 -0
  105. package/docs/routes/film-fight-that-lands.md +198 -0
  106. package/docs/routes/film-ink-lines.md +120 -0
  107. package/docs/routes/floating-island.md +229 -0
  108. package/docs/routes/game-2d.md +168 -0
  109. package/docs/routes/game-rules-first.md +89 -0
  110. package/docs/routes/game-to-prefabs.md +249 -0
  111. package/docs/routes/go-game-server.md +95 -0
  112. package/docs/routes/good-looking-3d-scene.md +99 -0
  113. package/docs/routes/high-quality-character.md +263 -0
  114. package/docs/routes/humanoid-from-shapes.md +97 -0
  115. package/docs/routes/hunting-action-3d.md +76 -0
  116. package/docs/routes/idle-gacha-2d.md +67 -0
  117. package/docs/routes/interactive-film-viewer.md +141 -0
  118. package/docs/routes/isometric-mystery-2d.md +217 -0
  119. package/docs/routes/key-art-to-animated-title.md +132 -0
  120. package/docs/routes/laya-ide-project-cli-web.md +125 -0
  121. package/docs/routes/layered-cloth-on-body.md +240 -0
  122. package/docs/routes/low-poly-character-from-shapes.md +475 -0
  123. package/docs/routes/match-three-2d.md +64 -0
  124. package/docs/routes/merge-2d.md +59 -0
  125. package/docs/routes/mini-game-build.md +80 -0
  126. package/docs/routes/mobile-always-landscape.md +149 -0
  127. package/docs/routes/mobile-web-fullscreen.md +255 -0
  128. package/docs/routes/model-from-dcc.md +106 -0
  129. package/docs/routes/new-game-project.md +100 -0
  130. package/docs/routes/onboarding-tutorial-2d.md +54 -0
  131. package/docs/routes/online-lockstep-match.md +473 -0
  132. package/docs/routes/outdoor-landscape.md +134 -0
  133. package/docs/routes/outfit-swap-3d.md +144 -0
  134. package/docs/routes/papercraft-diorama.md +186 -0
  135. package/docs/routes/platform-fighter-2d.md +235 -0
  136. package/docs/routes/platformer-2d.md +69 -0
  137. package/docs/routes/pole-rescue-arcade-3d.md +198 -0
  138. package/docs/routes/pose-atlas-motion.md +188 -0
  139. package/docs/routes/prototype-to-center.md +162 -0
  140. package/docs/routes/raft-brawl-3d-minigame.md +205 -0
  141. package/docs/routes/rhythm-2d.md +82 -0
  142. package/docs/routes/rigged-phone-character.md +120 -0
  143. package/docs/routes/screen-fit-game-box.md +127 -0
  144. package/docs/routes/shared-islands.md +195 -0
  145. package/docs/routes/side-view-duel.md +266 -0
  146. package/docs/routes/single-html-page.md +83 -0
  147. package/docs/routes/smooth-character-motion.md +162 -0
  148. package/docs/routes/spine-character.md +175 -0
  149. package/docs/routes/story-counting-2d.md +219 -0
  150. package/docs/routes/survivors-2d.md +60 -0
  151. package/docs/routes/third-person-town-3d.md +240 -0
  152. package/docs/routes/tower-defence-3d.md +67 -0
  153. package/docs/routes/ui-test-by-probe.md +219 -0
  154. package/docs/routes/underwater.md +138 -0
  155. package/docs/routes/visual-content-prefab.md +101 -0
  156. package/docs/runtime-hardening.md +108 -0
  157. package/docs/shader-warm-up.md +125 -0
  158. package/docs/spring-bones.md +79 -0
  159. package/docs/stylized-shading.md +171 -0
  160. package/docs/terrain-shader.md +130 -0
  161. package/docs/vrm.md +128 -0
  162. package/docs/walking.md +97 -0
  163. package/docs/webgpu.md +225 -0
  164. package/docs/white-label-themes.md +212 -0
  165. package/docs/zh-CN/README.md +130 -0
  166. package/examples/browser-sdk/2d-webgpu.html +46 -0
  167. package/examples/browser-sdk/2d.html +46 -0
  168. package/examples/browser-sdk/3d-gltf-webgpu.html +50 -0
  169. package/examples/browser-sdk/3d-gltf.html +50 -0
  170. package/examples/browser-sdk/3d-webgpu.html +46 -0
  171. package/examples/browser-sdk/3d.html +46 -0
  172. package/examples/cinematic-capture/Main.ts +294 -0
  173. package/examples/cinematic-capture/README.md +27 -0
  174. package/examples/model-inspector/README.md +15 -0
  175. package/examples/model-inspector/asset.gltf +158 -0
  176. package/examples/windows-webgpu/README.md +57 -0
  177. package/examples/windows-webgpu/bundle.mjs +122 -0
  178. package/examples/windows-webgpu/main.mjs +302 -0
  179. package/examples/windows-webgpu/package-lock.json +2353 -0
  180. package/examples/windows-webgpu/package.json +40 -0
  181. package/examples/windows-webgpu/squirrel.mjs +66 -0
  182. package/package.json +259 -4
  183. package/packages/ci-gate/export-film.mjs +347 -0
  184. package/packages/ci-gate/verify-sequence.mjs +285 -0
  185. package/packages/compiler/agent-contract.mjs +545 -0
  186. package/packages/compiler/ast-scanner.mjs +254 -0
  187. package/packages/compiler/backend-loader.mjs +62 -0
  188. package/packages/compiler/branding-assets.mjs +32 -0
  189. package/packages/compiler/branding.mjs +324 -0
  190. package/packages/compiler/browser-auto-example.mjs +31 -0
  191. package/packages/compiler/browser-model-example.mjs +53 -0
  192. package/packages/compiler/browser-process.mjs +344 -0
  193. package/packages/compiler/browser-sdk-example.mjs +50 -0
  194. package/packages/compiler/browser-sdk.mjs +342 -0
  195. package/packages/compiler/chrome-host.mjs +196 -0
  196. package/packages/compiler/cli.mjs +22 -0
  197. package/packages/compiler/compiler-runtime.mjs +41 -0
  198. package/packages/compiler/consumer-accept.mjs +89 -0
  199. package/packages/compiler/consumer-build.mjs +641 -0
  200. package/packages/compiler/consumer-guards.mjs +422 -0
  201. package/packages/compiler/consumer-publication.mjs +56 -0
  202. package/packages/compiler/consumer-scripts.mjs +134 -0
  203. package/packages/compiler/consumer-starter-2d.mjs +54 -0
  204. package/packages/compiler/consumer-starter-minigame.mjs +30 -0
  205. package/packages/compiler/editor-http.mjs +210 -0
  206. package/packages/compiler/editor-request.ts +12 -0
  207. package/packages/compiler/film-host-client.ts +249 -0
  208. package/packages/compiler/flythrough-file.mjs +144 -0
  209. package/packages/compiler/json-locate.mjs +85 -0
  210. package/packages/compiler/layout-contract.mjs +472 -0
  211. package/packages/compiler/minigame-bootstrap.mjs +24 -0
  212. package/packages/compiler/minigame-bridge.mjs +66 -0
  213. package/packages/compiler/minigame-guards.mjs +107 -0
  214. package/packages/compiler/minigame-toolchain.mjs +241 -0
  215. package/packages/compiler/model-crown.mjs +173 -0
  216. package/packages/compiler/model-editor-client.ts +809 -0
  217. package/packages/compiler/model-editor.mjs +242 -0
  218. package/packages/compiler/model-lod.mjs +547 -0
  219. package/packages/compiler/prefab-check.mjs +288 -0
  220. package/packages/compiler/prefab-checks.mjs +74 -0
  221. package/packages/compiler/prefab-dependencies.mjs +102 -0
  222. package/packages/compiler/prefab-editor-client.ts +950 -0
  223. package/packages/compiler/prefab-editor-preview.ts +89 -0
  224. package/packages/compiler/prefab-editor-server.mjs +585 -0
  225. package/packages/compiler/prefab-editor.mjs +43 -0
  226. package/packages/compiler/prefab-environment.mjs +107 -0
  227. package/packages/compiler/prefab-lifecycle.mjs +60 -0
  228. package/packages/compiler/prefab-preview.mjs +159 -0
  229. package/packages/compiler/prefab-watch.mjs +459 -0
  230. package/packages/compiler/runtime3d-types.mjs +91 -0
  231. package/packages/compiler/stage-probe.mjs +557 -0
  232. package/packages/compiler/visual-asset-audit.mjs +609 -0
  233. package/packages/compiler/visual-contract-audit.mjs +173 -0
  234. package/packages/compiler/webgpu-loader.mjs +153 -0
  235. package/packages/compiler/zhuda-build.mjs +714 -0
  236. package/packages/compiler/zhuda-doctor.mjs +186 -0
  237. package/packages/compiler/zhuda-init.mjs +353 -0
  238. package/packages/compiler/zhuda-layout.mjs +163 -0
  239. package/packages/compiler/zhuda-minigame.mjs +636 -0
  240. package/packages/core/BenchmarkEngine.ts +2 -0
  241. package/packages/core/BitmapFontContract.ts +159 -0
  242. package/packages/core/DeclarativeSDK.ts +686 -0
  243. package/packages/core/IframeSoundAdapter.ts +1824 -0
  244. package/packages/core/NoSleepAdapter.ts +302 -0
  245. package/packages/core/PixelCalibrationEngine.ts +602 -0
  246. package/packages/core/Prefab.ts +314 -0
  247. package/packages/core/RealmGuards.ts +111 -0
  248. package/packages/core/ResponsiveLayout.ts +149 -0
  249. package/packages/core/RuntimeGuards.ts +261 -0
  250. package/packages/core/SpineCharacter.ts +243 -0
  251. package/packages/core/SpineVisualContract.ts +238 -0
  252. package/packages/core/SplashSignal.ts +72 -0
  253. package/packages/core/StaticAssetPipeline.ts +3 -0
  254. package/packages/core/TopologyGraph.ts +693 -0
  255. package/packages/core/UnityBridgePipeline.ts +2 -0
  256. package/packages/core/VideoSurface.ts +75 -0
  257. package/packages/core/ViewportMatrixEngine.ts +237 -0
  258. package/packages/core/VisualFocusContract.ts +76 -0
  259. package/packages/core/VisualMigrationPipeline.ts +245 -0
  260. package/packages/core/WebViewSurface.ts +116 -0
  261. package/packages/core/audio/OfflineMix.ts +186 -0
  262. package/packages/core/audio/Spatial.ts +312 -0
  263. package/packages/core/audio/StreamVoice.ts +161 -0
  264. package/packages/core/csg/Bsp.ts +310 -0
  265. package/packages/core/csg/index.ts +589 -0
  266. package/packages/core/effects/Effect2D.ts +286 -0
  267. package/packages/core/effects/Effect3D.ts +213 -0
  268. package/packages/core/effects/EffectBudget.ts +695 -0
  269. package/packages/core/effects/EffectDirector.ts +254 -0
  270. package/packages/core/effects/EffectPresets.ts +843 -0
  271. package/packages/core/effects/EffectPresets2D.ts +1011 -0
  272. package/packages/core/effects/EffectSprites.ts +143 -0
  273. package/packages/core/effects/ParticleEventLink.ts +53 -0
  274. package/packages/core/effects/README.md +108 -0
  275. package/packages/core/effects/VfxMaterial.ts +253 -0
  276. package/packages/core/film/BakeKey.ts +21 -0
  277. package/packages/core/film/ColorValues.ts +44 -0
  278. package/packages/core/film/FilmLint.ts +353 -0
  279. package/packages/core/film/FilmPrefab.ts +82 -0
  280. package/packages/core/film/FilmReview.ts +84 -0
  281. package/packages/core/film/FilmScene.ts +3442 -0
  282. package/packages/core/film/FilmStage.ts +2148 -0
  283. package/packages/core/film/Flythrough.ts +169 -0
  284. package/packages/core/film/FlythroughReport.ts +326 -0
  285. package/packages/core/film/FrameMetrics.ts +167 -0
  286. package/packages/core/film/LiveLook.ts +242 -0
  287. package/packages/core/film/LookQuality.ts +94 -0
  288. package/packages/core/film/Projection.ts +74 -0
  289. package/packages/core/film/SceneLook.ts +363 -0
  290. package/packages/core/film/index.ts +12 -0
  291. package/packages/core/index.ts +48 -0
  292. package/packages/core/particles/EffectEnvelope.ts +52 -0
  293. package/packages/core/particles/LayaParticleRenderer.ts +182 -0
  294. package/packages/core/particles/LayaParticleRenderer3D.ts +218 -0
  295. package/packages/core/particles/ParticleExtras.ts +163 -0
  296. package/packages/core/particles/ParticleMesh3D.ts +156 -0
  297. package/packages/core/particles/ParticleSystem.ts +324 -0
  298. package/packages/core/particles/ParticleSystem3D.ts +411 -0
  299. package/packages/core/particles/ParticleTypes.ts +230 -0
  300. package/packages/core/particles/ParticleTypes3D.ts +115 -0
  301. package/packages/core/particles/README.md +181 -0
  302. package/packages/core/particles/RibbonPath3D.ts +234 -0
  303. package/packages/core/particles/RibbonTrail.ts +145 -0
  304. package/packages/core/particles/RibbonTrail3D.ts +166 -0
  305. package/packages/core/particles/index.ts +12 -0
  306. package/packages/core/prefabs/PrefabLibrary.ts +692 -0
  307. package/packages/core/prefabs/PrefabTree3D.ts +291 -0
  308. package/packages/core/prefabs/index.ts +10 -0
  309. package/packages/core/procedural/Geometry.ts +1871 -0
  310. package/packages/core/procedural/Hand.ts +1510 -0
  311. package/packages/core/procedural/Isosurface.ts +1035 -0
  312. package/packages/core/procedural/ModuleHarness.ts +180 -0
  313. package/packages/core/procedural/Noise.ts +123 -0
  314. package/packages/core/procedural/PhotoMaterial.ts +283 -0
  315. package/packages/core/procedural/ProceduralAssetProvider.ts +105 -0
  316. package/packages/core/procedural/ProceduralMaterial.ts +184 -0
  317. package/packages/core/procedural/PropFactory.ts +307 -0
  318. package/packages/core/procedural/Random.ts +70 -0
  319. package/packages/core/procedural/SynthAudio.ts +221 -0
  320. package/packages/core/procedural/TerrainMesh.ts +207 -0
  321. package/packages/core/procedural/TextureRecipe.ts +464 -0
  322. package/packages/core/procedural/TriplanarMaterial.ts +169 -0
  323. package/packages/core/procedural/Variation.ts +94 -0
  324. package/packages/core/procedural/index.ts +15 -0
  325. package/packages/core/runtime3d/ActionFrames.ts +245 -0
  326. package/packages/core/runtime3d/AnimationBlend.ts +282 -0
  327. package/packages/core/runtime3d/AnimationBlendMath.ts +98 -0
  328. package/packages/core/runtime3d/AssetProvider.ts +775 -0
  329. package/packages/core/runtime3d/AssetShowcase.ts +190 -0
  330. package/packages/core/runtime3d/Assets.ts +801 -0
  331. package/packages/core/runtime3d/AsyncDeadline.ts +53 -0
  332. package/packages/core/runtime3d/AsyncOperation.ts +39 -0
  333. package/packages/core/runtime3d/BackendChoice.ts +359 -0
  334. package/packages/core/runtime3d/BakedCrowd.ts +575 -0
  335. package/packages/core/runtime3d/BasisTexture.ts +657 -0
  336. package/packages/core/runtime3d/CameraCollision.ts +69 -0
  337. package/packages/core/runtime3d/CameraEffects.ts +752 -0
  338. package/packages/core/runtime3d/CameraRig.ts +70 -0
  339. package/packages/core/runtime3d/CharacterController.ts +272 -0
  340. package/packages/core/runtime3d/CinematicCapture.ts +457 -0
  341. package/packages/core/runtime3d/Clocks.ts +724 -0
  342. package/packages/core/runtime3d/Cloth.ts +183 -0
  343. package/packages/core/runtime3d/Clouds.ts +462 -0
  344. package/packages/core/runtime3d/ColorLut.ts +351 -0
  345. package/packages/core/runtime3d/CombatQueries.ts +240 -0
  346. package/packages/core/runtime3d/ComputePass.ts +582 -0
  347. package/packages/core/runtime3d/CrowdPresentation.ts +368 -0
  348. package/packages/core/runtime3d/DebugDraw.ts +567 -0
  349. package/packages/core/runtime3d/DebugStats.ts +35 -0
  350. package/packages/core/runtime3d/Decals.ts +309 -0
  351. package/packages/core/runtime3d/DensityVolume.ts +238 -0
  352. package/packages/core/runtime3d/DistanceBricks.ts +349 -0
  353. package/packages/core/runtime3d/Dither.ts +199 -0
  354. package/packages/core/runtime3d/DrawWarmUp.ts +217 -0
  355. package/packages/core/runtime3d/EdgeSmoothing.ts +108 -0
  356. package/packages/core/runtime3d/EnvironmentProbe.ts +656 -0
  357. package/packages/core/runtime3d/Filmic.ts +973 -0
  358. package/packages/core/runtime3d/Foliage.ts +367 -0
  359. package/packages/core/runtime3d/GltfIntake.ts +914 -0
  360. package/packages/core/runtime3d/GltfSecondUv.ts +153 -0
  361. package/packages/core/runtime3d/GraphicsGuard.ts +171 -0
  362. package/packages/core/runtime3d/Grass.ts +1080 -0
  363. package/packages/core/runtime3d/GroundTruthAO.ts +360 -0
  364. package/packages/core/runtime3d/HalfFloat.ts +44 -0
  365. package/packages/core/runtime3d/HdrEnvironment.ts +588 -0
  366. package/packages/core/runtime3d/Ik.ts +392 -0
  367. package/packages/core/runtime3d/InputBuffer.ts +165 -0
  368. package/packages/core/runtime3d/InstancedMesh.ts +460 -0
  369. package/packages/core/runtime3d/Laya342Adapters.ts +1095 -0
  370. package/packages/core/runtime3d/Laya342GltfAdapter.ts +751 -0
  371. package/packages/core/runtime3d/LensFinish.ts +153 -0
  372. package/packages/core/runtime3d/LensFlare.ts +490 -0
  373. package/packages/core/runtime3d/LightFog.ts +1008 -0
  374. package/packages/core/runtime3d/LightingDepth.ts +544 -0
  375. package/packages/core/runtime3d/Lightmap.ts +238 -0
  376. package/packages/core/runtime3d/Math3D.ts +84 -0
  377. package/packages/core/runtime3d/MeshQuery.ts +547 -0
  378. package/packages/core/runtime3d/MeshoptModelDecoder.ts +354 -0
  379. package/packages/core/runtime3d/MiniGameSplash.ts +70 -0
  380. package/packages/core/runtime3d/ModelAnimationSampler.ts +97 -0
  381. package/packages/core/runtime3d/ModelCompatibility.ts +890 -0
  382. package/packages/core/runtime3d/ModelDecoder.ts +294 -0
  383. package/packages/core/runtime3d/ModelInspector.ts +226 -0
  384. package/packages/core/runtime3d/ModelLod.ts +163 -0
  385. package/packages/core/runtime3d/ModelPlacements.ts +426 -0
  386. package/packages/core/runtime3d/ObjectMotion.ts +217 -0
  387. package/packages/core/runtime3d/PhysicalCamera.ts +190 -0
  388. package/packages/core/runtime3d/PointShadow.ts +500 -0
  389. package/packages/core/runtime3d/PointShadowSchedule.ts +201 -0
  390. package/packages/core/runtime3d/Pool.ts +120 -0
  391. package/packages/core/runtime3d/ProbeVolume.ts +695 -0
  392. package/packages/core/runtime3d/QualityGovernor.ts +385 -0
  393. package/packages/core/runtime3d/QualityMemory.ts +200 -0
  394. package/packages/core/runtime3d/RenderScale.ts +356 -0
  395. package/packages/core/runtime3d/RenderSpaces.ts +105 -0
  396. package/packages/core/runtime3d/Renderer.ts +377 -0
  397. package/packages/core/runtime3d/ResultPlayback.ts +239 -0
  398. package/packages/core/runtime3d/Runtime.ts +507 -0
  399. package/packages/core/runtime3d/RuntimeDriver.ts +127 -0
  400. package/packages/core/runtime3d/SceneLifecycle.ts +211 -0
  401. package/packages/core/runtime3d/SceneMutation.ts +107 -0
  402. package/packages/core/runtime3d/SceneQueries.ts +191 -0
  403. package/packages/core/runtime3d/ScreenReflections.ts +595 -0
  404. package/packages/core/runtime3d/SelectionOutline.ts +389 -0
  405. package/packages/core/runtime3d/ShaderErrors.ts +104 -0
  406. package/packages/core/runtime3d/ShaderRegistry.ts +34 -0
  407. package/packages/core/runtime3d/ShaderWarmUp.ts +473 -0
  408. package/packages/core/runtime3d/ShadowUpdates.ts +287 -0
  409. package/packages/core/runtime3d/SkinBinding.ts +235 -0
  410. package/packages/core/runtime3d/Smaa.ts +386 -0
  411. package/packages/core/runtime3d/SmaaTables.ts +244 -0
  412. package/packages/core/runtime3d/SpringBones.ts +184 -0
  413. package/packages/core/runtime3d/SurfaceBuffer.ts +76 -0
  414. package/packages/core/runtime3d/Surfaces.ts +1105 -0
  415. package/packages/core/runtime3d/Themes.ts +344 -0
  416. package/packages/core/runtime3d/Timeline.ts +362 -0
  417. package/packages/core/runtime3d/ToneCurves.ts +292 -0
  418. package/packages/core/runtime3d/TransformGizmo.ts +539 -0
  419. package/packages/core/runtime3d/TriangleMask.ts +250 -0
  420. package/packages/core/runtime3d/Underwater.ts +778 -0
  421. package/packages/core/runtime3d/Utf8.ts +87 -0
  422. package/packages/core/runtime3d/Vrm.ts +773 -0
  423. package/packages/core/runtime3d/VrmDocument.ts +1830 -0
  424. package/packages/core/runtime3d/WalkGrid.ts +471 -0
  425. package/packages/core/runtime3d/WebGPU342Adapters.ts +280 -0
  426. package/packages/core/runtime3d/index.ts +147 -0
  427. package/packages/core/shaders/Laya342ShaderTemplates.ts +6 -0
  428. package/packages/core/shaders/LitSurfaceMaterial.ts +1076 -0
  429. package/packages/core/shaders/LitSurfaceTemplates.ts +13 -0
  430. package/packages/core/shaders/ReflectiveSurface.ts +285 -0
  431. package/packages/core/shaders/ShaderMaterials.ts +387 -0
  432. package/packages/core/shaders/ToonMaterial.ts +559 -0
  433. package/packages/core/shaders/WaterRipples.ts +170 -0
  434. package/packages/core/shaders/WaterSurface.ts +480 -0
  435. package/packages/core/shaders/ZhudaCommon.ts +109 -0
  436. package/packages/core/shaders/index.ts +6 -0
  437. package/packages/core/simulation/Cloth.ts +1541 -0
  438. package/packages/core/simulation/ParticleCore.ts +498 -0
  439. package/packages/core/simulation/SpringBones.ts +553 -0
  440. package/packages/core/simulation/index.ts +3 -0
  441. package/packages/core/terrain/Heightfield.ts +385 -0
  442. package/packages/core/terrain/Terrain2D.ts +324 -0
  443. package/packages/core/terrain/Terrain3D.ts +452 -0
  444. package/packages/core/terrain/TerrainShell.ts +94 -0
  445. package/packages/core/terrain/index.ts +3 -0
  446. package/packages/demo/BenchmarkEngine.ts +184 -0
  447. package/packages/demo/PixelCalibrationEngine.ts +36 -0
  448. package/packages/demo/ProceduralStarter.ts +312 -0
  449. package/packages/demo/StaticAssetPipeline.ts +1631 -0
  450. package/packages/demo/UnityBridgePipeline.ts +485 -0
  451. package/packages/demo/index.ts +6 -0
  452. package/packages/mcp-server/arguments.mjs +81 -0
  453. package/packages/mcp-server/corpus.mjs +627 -0
  454. package/packages/mcp-server/film-host.mjs +627 -0
  455. package/packages/mcp-server/film-session.mjs +95 -0
  456. package/packages/mcp-server/film-tools.mjs +460 -0
  457. package/packages/mcp-server/index.mjs +931 -0
  458. package/packages/mcp-server/quality-route.mjs +332 -0
  459. package/packages/mcp-server/roots.mjs +72 -0
  460. package/packages/mcp-server/runtime.mjs +81 -0
  461. package/packages/types/BitmapFontContract.d.ts +19 -0
  462. package/packages/types/DeclarativeSDK.d.ts +137 -0
  463. package/packages/types/IframeSoundAdapter.d.ts +173 -0
  464. package/packages/types/NoSleepAdapter.d.ts +50 -0
  465. package/packages/types/PixelCalibrationEngine.d.ts +83 -0
  466. package/packages/types/Prefab.d.ts +11 -0
  467. package/packages/types/RealmGuards.d.ts +26 -0
  468. package/packages/types/ResponsiveLayout.d.ts +10 -0
  469. package/packages/types/RuntimeGuards.d.ts +55 -0
  470. package/packages/types/SpineCharacter.d.ts +94 -0
  471. package/packages/types/SpineVisualContract.d.ts +50 -0
  472. package/packages/types/SplashSignal.d.ts +27 -0
  473. package/packages/types/TopologyGraph.d.ts +76 -0
  474. package/packages/types/VideoSurface.d.ts +21 -0
  475. package/packages/types/ViewportMatrixEngine.d.ts +27 -0
  476. package/packages/types/VisualFocusContract.d.ts +32 -0
  477. package/packages/types/VisualMigrationPipeline.d.ts +53 -0
  478. package/packages/types/WebViewSurface.d.ts +26 -0
  479. package/packages/types/audio/OfflineMix.d.ts +10 -0
  480. package/packages/types/audio/Spatial.d.ts +63 -0
  481. package/packages/types/audio/StreamVoice.d.ts +31 -0
  482. package/packages/types/browser.d.ts +44 -0
  483. package/packages/types/csg/Bsp.d.ts +85 -0
  484. package/packages/types/csg/index.d.ts +81 -0
  485. package/packages/types/demo/BenchmarkEngine.d.ts +61 -0
  486. package/packages/types/demo/PixelCalibrationEngine.d.ts +13 -0
  487. package/packages/types/demo/ProceduralStarter.d.ts +11 -0
  488. package/packages/types/demo/StaticAssetPipeline.d.ts +87 -0
  489. package/packages/types/demo/UnityBridgePipeline.d.ts +49 -0
  490. package/packages/types/demo/index.d.ts +7 -0
  491. package/packages/types/editor-preview.d.ts +27 -0
  492. package/packages/types/effects/Effect2D.d.ts +65 -0
  493. package/packages/types/effects/Effect3D.d.ts +42 -0
  494. package/packages/types/effects/EffectBudget.d.ts +179 -0
  495. package/packages/types/effects/EffectDirector.d.ts +68 -0
  496. package/packages/types/effects/EffectPresets.d.ts +27 -0
  497. package/packages/types/effects/EffectPresets2D.d.ts +32 -0
  498. package/packages/types/effects/EffectSprites.d.ts +23 -0
  499. package/packages/types/effects/ParticleEventLink.d.ts +16 -0
  500. package/packages/types/effects/VfxMaterial.d.ts +52 -0
  501. package/packages/types/film/BakeKey.d.ts +9 -0
  502. package/packages/types/film/ColorValues.d.ts +25 -0
  503. package/packages/types/film/FilmLint.d.ts +40 -0
  504. package/packages/types/film/FilmPrefab.d.ts +22 -0
  505. package/packages/types/film/FilmReview.d.ts +27 -0
  506. package/packages/types/film/FilmScene.d.ts +1214 -0
  507. package/packages/types/film/FilmStage.d.ts +237 -0
  508. package/packages/types/film/Flythrough.d.ts +44 -0
  509. package/packages/types/film/FlythroughReport.d.ts +132 -0
  510. package/packages/types/film/FrameMetrics.d.ts +49 -0
  511. package/packages/types/film/LiveLook.d.ts +60 -0
  512. package/packages/types/film/LookQuality.d.ts +24 -0
  513. package/packages/types/film/Projection.d.ts +20 -0
  514. package/packages/types/film/SceneLook.d.ts +122 -0
  515. package/packages/types/film/index.d.ts +13 -0
  516. package/packages/types/index.d.ts +49 -0
  517. package/packages/types/particles/EffectEnvelope.d.ts +18 -0
  518. package/packages/types/particles/LayaParticleRenderer.d.ts +30 -0
  519. package/packages/types/particles/LayaParticleRenderer3D.d.ts +29 -0
  520. package/packages/types/particles/ParticleExtras.d.ts +50 -0
  521. package/packages/types/particles/ParticleMesh3D.d.ts +24 -0
  522. package/packages/types/particles/ParticleSystem.d.ts +52 -0
  523. package/packages/types/particles/ParticleSystem3D.d.ts +69 -0
  524. package/packages/types/particles/ParticleTypes.d.ts +89 -0
  525. package/packages/types/particles/ParticleTypes3D.d.ts +56 -0
  526. package/packages/types/particles/RibbonPath3D.d.ts +32 -0
  527. package/packages/types/particles/RibbonTrail.d.ts +38 -0
  528. package/packages/types/particles/RibbonTrail3D.d.ts +22 -0
  529. package/packages/types/particles/index.d.ts +13 -0
  530. package/packages/types/prefabs/PrefabLibrary.d.ts +176 -0
  531. package/packages/types/prefabs/PrefabTree3D.d.ts +59 -0
  532. package/packages/types/prefabs/index.d.ts +4 -0
  533. package/packages/types/procedural/Geometry.d.ts +252 -0
  534. package/packages/types/procedural/Hand.d.ts +150 -0
  535. package/packages/types/procedural/Isosurface.d.ts +181 -0
  536. package/packages/types/procedural/ModuleHarness.d.ts +90 -0
  537. package/packages/types/procedural/Noise.d.ts +15 -0
  538. package/packages/types/procedural/PhotoMaterial.d.ts +49 -0
  539. package/packages/types/procedural/ProceduralAssetProvider.d.ts +31 -0
  540. package/packages/types/procedural/ProceduralMaterial.d.ts +63 -0
  541. package/packages/types/procedural/PropFactory.d.ts +94 -0
  542. package/packages/types/procedural/Random.d.ts +26 -0
  543. package/packages/types/procedural/SynthAudio.d.ts +49 -0
  544. package/packages/types/procedural/TerrainMesh.d.ts +55 -0
  545. package/packages/types/procedural/TextureRecipe.d.ts +125 -0
  546. package/packages/types/procedural/TriplanarMaterial.d.ts +27 -0
  547. package/packages/types/procedural/Variation.d.ts +23 -0
  548. package/packages/types/procedural/index.d.ts +16 -0
  549. package/packages/types/runtime3d/ActionFrames.d.ts +62 -0
  550. package/packages/types/runtime3d/AnimationBlend.d.ts +57 -0
  551. package/packages/types/runtime3d/AnimationBlendMath.d.ts +27 -0
  552. package/packages/types/runtime3d/AssetProvider.d.ts +167 -0
  553. package/packages/types/runtime3d/AssetShowcase.d.ts +44 -0
  554. package/packages/types/runtime3d/Assets.d.ts +166 -0
  555. package/packages/types/runtime3d/AsyncDeadline.d.ts +6 -0
  556. package/packages/types/runtime3d/AsyncOperation.d.ts +3 -0
  557. package/packages/types/runtime3d/BackendChoice.d.ts +130 -0
  558. package/packages/types/runtime3d/BakedCrowd.d.ts +156 -0
  559. package/packages/types/runtime3d/BasisTexture.d.ts +169 -0
  560. package/packages/types/runtime3d/CameraCollision.d.ts +20 -0
  561. package/packages/types/runtime3d/CameraEffects.d.ts +134 -0
  562. package/packages/types/runtime3d/CameraRig.d.ts +27 -0
  563. package/packages/types/runtime3d/CharacterController.d.ts +71 -0
  564. package/packages/types/runtime3d/CinematicCapture.d.ts +103 -0
  565. package/packages/types/runtime3d/Clocks.d.ts +200 -0
  566. package/packages/types/runtime3d/Cloth.d.ts +57 -0
  567. package/packages/types/runtime3d/Clouds.d.ts +69 -0
  568. package/packages/types/runtime3d/ColorLut.d.ts +73 -0
  569. package/packages/types/runtime3d/CombatQueries.d.ts +50 -0
  570. package/packages/types/runtime3d/ComputePass.d.ts +134 -0
  571. package/packages/types/runtime3d/CrowdPresentation.d.ts +104 -0
  572. package/packages/types/runtime3d/DebugDraw.d.ts +161 -0
  573. package/packages/types/runtime3d/DebugStats.d.ts +24 -0
  574. package/packages/types/runtime3d/Decals.d.ts +65 -0
  575. package/packages/types/runtime3d/DensityVolume.d.ts +39 -0
  576. package/packages/types/runtime3d/DistanceBricks.d.ts +97 -0
  577. package/packages/types/runtime3d/Dither.d.ts +78 -0
  578. package/packages/types/runtime3d/DrawWarmUp.d.ts +93 -0
  579. package/packages/types/runtime3d/EdgeSmoothing.d.ts +10 -0
  580. package/packages/types/runtime3d/EnvironmentProbe.d.ts +139 -0
  581. package/packages/types/runtime3d/Filmic.d.ts +243 -0
  582. package/packages/types/runtime3d/Foliage.d.ts +95 -0
  583. package/packages/types/runtime3d/GltfIntake.d.ts +236 -0
  584. package/packages/types/runtime3d/GltfSecondUv.d.ts +54 -0
  585. package/packages/types/runtime3d/GraphicsGuard.d.ts +18 -0
  586. package/packages/types/runtime3d/Grass.d.ts +226 -0
  587. package/packages/types/runtime3d/GroundTruthAO.d.ts +64 -0
  588. package/packages/types/runtime3d/HalfFloat.d.ts +13 -0
  589. package/packages/types/runtime3d/HdrEnvironment.d.ts +144 -0
  590. package/packages/types/runtime3d/Ik.d.ts +123 -0
  591. package/packages/types/runtime3d/InputBuffer.d.ts +49 -0
  592. package/packages/types/runtime3d/InstancedMesh.d.ts +116 -0
  593. package/packages/types/runtime3d/Laya342Adapters.d.ts +306 -0
  594. package/packages/types/runtime3d/Laya342GltfAdapter.d.ts +105 -0
  595. package/packages/types/runtime3d/LensFinish.d.ts +38 -0
  596. package/packages/types/runtime3d/LensFlare.d.ts +114 -0
  597. package/packages/types/runtime3d/LightFog.d.ts +190 -0
  598. package/packages/types/runtime3d/LightingDepth.d.ts +128 -0
  599. package/packages/types/runtime3d/Lightmap.d.ts +55 -0
  600. package/packages/types/runtime3d/Math3D.d.ts +19 -0
  601. package/packages/types/runtime3d/MeshQuery.d.ts +107 -0
  602. package/packages/types/runtime3d/MeshoptModelDecoder.d.ts +34 -0
  603. package/packages/types/runtime3d/MiniGameSplash.d.ts +4 -0
  604. package/packages/types/runtime3d/ModelAnimationSampler.d.ts +26 -0
  605. package/packages/types/runtime3d/ModelCompatibility.d.ts +169 -0
  606. package/packages/types/runtime3d/ModelDecoder.d.ts +66 -0
  607. package/packages/types/runtime3d/ModelInspector.d.ts +77 -0
  608. package/packages/types/runtime3d/ModelLod.d.ts +61 -0
  609. package/packages/types/runtime3d/ModelPlacements.d.ts +77 -0
  610. package/packages/types/runtime3d/ObjectMotion.d.ts +43 -0
  611. package/packages/types/runtime3d/PhysicalCamera.d.ts +51 -0
  612. package/packages/types/runtime3d/PointShadow.d.ts +71 -0
  613. package/packages/types/runtime3d/PointShadowSchedule.d.ts +74 -0
  614. package/packages/types/runtime3d/Pool.d.ts +33 -0
  615. package/packages/types/runtime3d/ProbeVolume.d.ts +123 -0
  616. package/packages/types/runtime3d/QualityGovernor.d.ts +201 -0
  617. package/packages/types/runtime3d/QualityMemory.d.ts +83 -0
  618. package/packages/types/runtime3d/RenderScale.d.ts +69 -0
  619. package/packages/types/runtime3d/RenderSpaces.d.ts +44 -0
  620. package/packages/types/runtime3d/Renderer.d.ts +62 -0
  621. package/packages/types/runtime3d/ResultPlayback.d.ts +70 -0
  622. package/packages/types/runtime3d/Runtime.d.ts +136 -0
  623. package/packages/types/runtime3d/RuntimeDriver.d.ts +42 -0
  624. package/packages/types/runtime3d/SceneLifecycle.d.ts +84 -0
  625. package/packages/types/runtime3d/SceneMutation.d.ts +34 -0
  626. package/packages/types/runtime3d/SceneQueries.d.ts +71 -0
  627. package/packages/types/runtime3d/ScreenReflections.d.ts +78 -0
  628. package/packages/types/runtime3d/SelectionOutline.d.ts +68 -0
  629. package/packages/types/runtime3d/ShaderErrors.d.ts +27 -0
  630. package/packages/types/runtime3d/ShaderRegistry.d.ts +10 -0
  631. package/packages/types/runtime3d/ShaderWarmUp.d.ts +162 -0
  632. package/packages/types/runtime3d/ShadowUpdates.d.ts +125 -0
  633. package/packages/types/runtime3d/SkinBinding.d.ts +53 -0
  634. package/packages/types/runtime3d/Smaa.d.ts +60 -0
  635. package/packages/types/runtime3d/SmaaTables.d.ts +12 -0
  636. package/packages/types/runtime3d/SpringBones.d.ts +69 -0
  637. package/packages/types/runtime3d/SurfaceBuffer.d.ts +28 -0
  638. package/packages/types/runtime3d/Surfaces.d.ts +326 -0
  639. package/packages/types/runtime3d/Themes.d.ts +70 -0
  640. package/packages/types/runtime3d/Timeline.d.ts +88 -0
  641. package/packages/types/runtime3d/ToneCurves.d.ts +59 -0
  642. package/packages/types/runtime3d/TransformGizmo.d.ts +139 -0
  643. package/packages/types/runtime3d/TriangleMask.d.ts +84 -0
  644. package/packages/types/runtime3d/Underwater.d.ts +120 -0
  645. package/packages/types/runtime3d/Utf8.d.ts +12 -0
  646. package/packages/types/runtime3d/Vrm.d.ts +120 -0
  647. package/packages/types/runtime3d/VrmDocument.d.ts +381 -0
  648. package/packages/types/runtime3d/WalkGrid.d.ts +94 -0
  649. package/packages/types/runtime3d/WebGPU342Adapters.d.ts +27 -0
  650. package/packages/types/runtime3d/index.d.ts +102 -0
  651. package/packages/types/shaders/Laya342ShaderTemplates.d.ts +3 -0
  652. package/packages/types/shaders/LitSurfaceMaterial.d.ts +257 -0
  653. package/packages/types/shaders/LitSurfaceTemplates.d.ts +7 -0
  654. package/packages/types/shaders/ReflectiveSurface.d.ts +58 -0
  655. package/packages/types/shaders/ShaderMaterials.d.ts +60 -0
  656. package/packages/types/shaders/ToonMaterial.d.ts +176 -0
  657. package/packages/types/shaders/WaterRipples.d.ts +48 -0
  658. package/packages/types/shaders/WaterSurface.d.ts +110 -0
  659. package/packages/types/shaders/ZhudaCommon.d.ts +31 -0
  660. package/packages/types/shaders/index.d.ts +7 -0
  661. package/packages/types/simulation/Cloth.d.ts +381 -0
  662. package/packages/types/simulation/ParticleCore.d.ts +125 -0
  663. package/packages/types/simulation/SpringBones.d.ts +107 -0
  664. package/packages/types/simulation/index.d.ts +4 -0
  665. package/packages/types/terrain/Heightfield.d.ts +67 -0
  666. package/packages/types/terrain/Terrain2D.d.ts +81 -0
  667. package/packages/types/terrain/Terrain3D.d.ts +80 -0
  668. package/packages/types/terrain/TerrainShell.d.ts +8 -0
  669. package/packages/types/terrain/index.d.ts +4 -0
  670. package/packages/types/vendor/LayaAir.runtime.d.ts +97440 -0
  671. package/packages/types/vendor/REPAIRS.md +30 -0
  672. package/packages/types/vendor/restored-3.4.2.json +142 -0
  673. package/packages/types/vendor/spine.runtime.d.ts +1507 -0
  674. package/packages/types/vendor/wechat-media.d.ts +877 -0
  675. package/packages/types/zhuda-2d-ui.d.ts +244 -0
  676. package/packages/types/zhuda-3d-physics.d.ts +34 -0
  677. package/packages/types/zhuda-audio.d.ts +128 -0
  678. package/packages/types/zhuda-bootstrap.d.ts +100 -0
  679. package/packages/types/zhuda-branding.d.ts +6 -0
  680. package/packages/types/zhuda-core.d.ts +46 -0
  681. package/packages/types/zhuda-declarative.d.ts +81 -0
  682. package/packages/types/zhuda-effects.d.ts +302 -0
  683. package/packages/types/zhuda-layout.d.ts +96 -0
  684. package/packages/types/zhuda-particles.d.ts +477 -0
  685. package/packages/types/zhuda-spine42.d.ts +23 -0
  686. package/packages/types/zhuda-static-assets.d.ts +389 -0
  687. package/packages/types/zhuda-video.d.ts +24 -0
  688. package/packages/types/zhuda-visual-contract.d.ts +52 -0
  689. package/packages/types/zhuda-webview.d.ts +43 -0
  690. package/vendor/basis/LICENSE.txt +55 -0
  691. package/vendor/basis/README.md +25 -0
  692. package/vendor/basis/basis_transcoder.js +19 -0
  693. package/vendor/basis/basis_transcoder.wasm +0 -0
  694. package/vendor/laya-3.4.2/WEBGPU-LICENSES.txt +1259 -0
  695. package/vendor/laya-3.4.2/libs/laya.ani.js +1 -0
  696. package/vendor/laya-3.4.2/libs/laya.box2D.js +1209 -0
  697. package/vendor/laya-3.4.2/libs/laya.bridge.js +2273 -0
  698. package/vendor/laya-3.4.2/libs/laya.bullet.js +1 -0
  699. package/vendor/laya-3.4.2/libs/laya.core.js +1 -0
  700. package/vendor/laya-3.4.2/libs/laya.d3.js +1 -0
  701. package/vendor/laya-3.4.2/libs/laya.device.js +1 -0
  702. package/vendor/laya-3.4.2/libs/laya.gltf.js +1 -0
  703. package/vendor/laya-3.4.2/libs/laya.ik.js +1 -0
  704. package/vendor/laya-3.4.2/libs/laya.light2D.js +1 -0
  705. package/vendor/laya-3.4.2/libs/laya.line2D.js +1 -0
  706. package/vendor/laya-3.4.2/libs/laya.native-spine42.js +7672 -0
  707. package/vendor/laya-3.4.2/libs/laya.navMesh2d.js +1 -0
  708. package/vendor/laya-3.4.2/libs/laya.navMesh3d.js +1 -0
  709. package/vendor/laya-3.4.2/libs/laya.navMeshCommon.js +1 -0
  710. package/vendor/laya-3.4.2/libs/laya.particle.js +1 -0
  711. package/vendor/laya-3.4.2/libs/laya.particle3D.js +1 -0
  712. package/vendor/laya-3.4.2/libs/laya.particleCommon.js +1 -0
  713. package/vendor/laya-3.4.2/libs/laya.physics2D.js +3774 -0
  714. package/vendor/laya-3.4.2/libs/laya.physics3D.js +1 -0
  715. package/vendor/laya-3.4.2/libs/laya.postProcess.js +1 -0
  716. package/vendor/laya-3.4.2/libs/laya.spine.js +1 -0
  717. package/vendor/laya-3.4.2/libs/laya.spine3D.js +1 -0
  718. package/vendor/laya-3.4.2/libs/laya.tilemap.js +1 -0
  719. package/vendor/laya-3.4.2/libs/laya.trail2D.js +1 -0
  720. package/vendor/laya-3.4.2/libs/laya.trail3D.js +1 -0
  721. package/vendor/laya-3.4.2/libs/laya.trailCommon.js +1 -0
  722. package/vendor/laya-3.4.2/libs/laya.ui.js +1 -0
  723. package/vendor/laya-3.4.2/libs/laya.ui2.js +9904 -0
  724. package/vendor/laya-3.4.2/libs/laya.vfx.js +6754 -0
  725. package/vendor/laya-3.4.2/libs/laya.webgl_2D.js +1 -0
  726. package/vendor/laya-3.4.2/libs/laya.webgl_3D.js +1 -0
  727. package/vendor/laya-3.4.2/libs/laya.webgpu_2D.js +18576 -0
  728. package/vendor/laya-3.4.2/libs/laya.webgpu_3D.js +6729 -0
  729. package/vendor/laya-3.4.2/libs/nagabind.js +395 -0
  730. package/vendor/laya-3.4.2/libs/nagabind_bg.wasm +0 -0
  731. package/vendor/laya-3.4.2/libs/shader_compiler_web.js +22 -0
  732. package/vendor/laya-3.4.2/libs/shader_compiler_web.wasm +0 -0
  733. package/vendor/laya-3.4.2/libs/spine-core-3.8.js +1 -0
  734. package/vendor/laya-3.4.2/libs/spine-core-4.2.js +10216 -0
  735. package/vendor/laya-3.4.2/webgpu-provenance.json +41 -0
  736. package/vendor/meshoptimizer/LICENSE.txt +21 -0
  737. package/vendor/meshoptimizer/README.md +13 -0
  738. package/vendor/threejs-post/LICENSE.txt +53 -0
  739. package/vendor/threejs-post/README.md +54 -0
  740. 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.