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,236 @@
|
|
|
1
|
+
// Generated from TypeScript source; run npm run types:generate.
|
|
2
|
+
/**
|
|
3
|
+
* glTF intake steps LayaAir 3.4.2's importer lacks. They read a glTF document,
|
|
4
|
+
* or rewrite its bytes, before the native parser sees it. Nothing here makes a
|
|
5
|
+
* Laya object, fetches a URL or allocates a GPU resource.
|
|
6
|
+
*/
|
|
7
|
+
type Json = Record<string, unknown>;
|
|
8
|
+
/** Texture-source extensions the engine resolves, in the order it prefers them. */
|
|
9
|
+
export type ZhudaGltfImageExtension = 'KHR_texture_basisu' | 'EXT_texture_avif' | 'EXT_texture_webp';
|
|
10
|
+
/** The picture formats the device is asked about. */
|
|
11
|
+
export type ZhudaProbedImageFormat = 'webp' | 'avif';
|
|
12
|
+
/** Whether this device decodes WebP and AVIF pictures (`probeZhudaImageDecode`). */
|
|
13
|
+
export interface ZhudaImageDecodeSupport {
|
|
14
|
+
readonly webp: boolean;
|
|
15
|
+
readonly avif: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Formats whose decoder gave no answer before the probe's deadline. They
|
|
18
|
+
* count as not decodable in this answer only; the next probe asks again.
|
|
19
|
+
* Absent when every format answered.
|
|
20
|
+
*/
|
|
21
|
+
readonly unanswered?: readonly ZhudaProbedImageFormat[];
|
|
22
|
+
/**
|
|
23
|
+
* Whether a Basis transcoder is at hand for KTX 2 images
|
|
24
|
+
* (`KHR_texture_basisu`): set by `ZhudaModelLibrary` from its own
|
|
25
|
+
* `basisTranscoder`, not by a probe of the device.
|
|
26
|
+
*/
|
|
27
|
+
readonly basis?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface ZhudaGltfTextureSource {
|
|
30
|
+
/** The image the texture loads, or null when the file offers nothing loadable. */
|
|
31
|
+
readonly image: number | null;
|
|
32
|
+
/** The extension that image came from; null for the core `source`. */
|
|
33
|
+
readonly extension: ZhudaGltfImageExtension | null;
|
|
34
|
+
/** Extensions whose image this device cannot decode. */
|
|
35
|
+
readonly unavailable: readonly ZhudaGltfImageExtension[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The image a glTF texture should load: its KTX 2 image when a Basis
|
|
39
|
+
* transcoder is at hand (the only one the graphics card samples as it is),
|
|
40
|
+
* then its AVIF, then its WebP source when the device decodes it, else the
|
|
41
|
+
* core `source` (the optional fallback). Without `support` the core source is
|
|
42
|
+
* preferred, and an extension image is used only when there is no fallback.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveZhudaGltfTextureSource(texture: unknown, support?: ZhudaImageDecodeSupport): ZhudaGltfTextureSource;
|
|
45
|
+
/** How long a probe waits for a decoder: `turns` timers of `turnMs` each. */
|
|
46
|
+
export interface ZhudaImageProbeDeadline {
|
|
47
|
+
turns?: number;
|
|
48
|
+
turnMs?: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A probe with its own memory, on `host`'s Image, Blob and URL (read when it is
|
|
52
|
+
* called). `probeZhudaImageDecode` is the page's one; tests make their own.
|
|
53
|
+
*/
|
|
54
|
+
export declare function createZhudaImageDecodeProbe(host?: unknown, deadline?: ZhudaImageProbeDeadline): () => Promise<ZhudaImageDecodeSupport>;
|
|
55
|
+
/**
|
|
56
|
+
* Decodes a one-pixel WebP and AVIF picture and remembers each decoder's answer
|
|
57
|
+
* for the page. A decoder that gives none in time is listed in `unanswered`,
|
|
58
|
+
* counted as no for that answer, and asked again by the next call.
|
|
59
|
+
*/
|
|
60
|
+
export declare const probeZhudaImageDecode: () => Promise<ZhudaImageDecodeSupport>;
|
|
61
|
+
/** One `KHR_lights_punctual` light, as the file gives it (glTF units). */
|
|
62
|
+
export interface ZhudaGltfLight {
|
|
63
|
+
readonly index: number;
|
|
64
|
+
readonly name: string;
|
|
65
|
+
readonly type: 'directional' | 'point' | 'spot';
|
|
66
|
+
/** Linear RGB, 0..1. */
|
|
67
|
+
readonly color: readonly [number, number, number];
|
|
68
|
+
/** Lux (lm/m²) for a directional light; candela (lm/sr) for point and spot. */
|
|
69
|
+
readonly intensity: number;
|
|
70
|
+
/** Metres; null when the file gives none (no cut-off). */
|
|
71
|
+
readonly range: number | null;
|
|
72
|
+
/** Spot cone half-angles in radians (glTF defaults: 0 and π/4). */
|
|
73
|
+
readonly innerConeAngle: number;
|
|
74
|
+
readonly outerConeAngle: number;
|
|
75
|
+
}
|
|
76
|
+
export interface ZhudaGltfProblem {
|
|
77
|
+
readonly index: number;
|
|
78
|
+
readonly message: string;
|
|
79
|
+
}
|
|
80
|
+
/** The file's punctual lights; an invalid one is null and named in `problems`. */
|
|
81
|
+
export declare function readZhudaGltfLights(document: unknown): {
|
|
82
|
+
lights: readonly (ZhudaGltfLight | null)[];
|
|
83
|
+
problems: readonly ZhudaGltfProblem[];
|
|
84
|
+
};
|
|
85
|
+
/** What `zhudaGltfLightToLaya` gives a LayaAir light component. */
|
|
86
|
+
export interface ZhudaLayaLightSettings {
|
|
87
|
+
readonly kind: 'directional' | 'point' | 'spot';
|
|
88
|
+
/** For `Light.color`, which LayaAir reads as sRGB-encoded: glTF's linear colour, encoded. */
|
|
89
|
+
readonly color: readonly [number, number, number];
|
|
90
|
+
readonly intensity: number;
|
|
91
|
+
/** Point and spot: LayaAir's `range`, where its falloff reaches zero. */
|
|
92
|
+
readonly range: number | null;
|
|
93
|
+
/** Spot: LayaAir's full cone angle in degrees (its inner edge is fixed at half of it). */
|
|
94
|
+
readonly spotAngleDeg: number | null;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* glTF light units to LayaAir's. LayaAir's diffuse term has no 1/π
|
|
98
|
+
* (`Fd_Lambert` returns 1), so a LayaAir intensity is radiance per unit of
|
|
99
|
+
* albedo; glTF gives lux and candela.
|
|
100
|
+
* - Directional: `scale × lux / π`.
|
|
101
|
+
* - Point and spot: LayaAir's falloff is `1/(1+25f²)` (and a fade past 0.87),
|
|
102
|
+
* f = distance/range, not glTF's inverse square. The range is the file's,
|
|
103
|
+
* or `4·√(scale·cd/π)` when it gives none: a quarter of it is where the glTF
|
|
104
|
+
* light makes a white surface white. The intensity makes LayaAir's curve equal
|
|
105
|
+
* glTF's recommended falloff at half the range. Without a file range the two
|
|
106
|
+
* stay within about 30 % from a quarter to nine tenths of it. With one,
|
|
107
|
+
* glTF's window closes faster: LayaAir's light is about 0.63 of it at a
|
|
108
|
+
* quarter of the range and about twice it at three quarters. Nearer than a
|
|
109
|
+
* quarter, LayaAir's light stays finite.
|
|
110
|
+
* - Spot: the full cone is twice glTF's outer angle (at most 179°). LayaAir puts
|
|
111
|
+
* the inner edge at half of it, whatever the file says, and dims the cone by
|
|
112
|
+
* the cosine to its axis as well.
|
|
113
|
+
* `scale` stands in for exposure: physical units can be very large.
|
|
114
|
+
*/
|
|
115
|
+
export declare function zhudaGltfLightToLaya(light: ZhudaGltfLight, options?: {
|
|
116
|
+
scale?: number;
|
|
117
|
+
}): ZhudaLayaLightSettings;
|
|
118
|
+
export type ZhudaGltfCamera = {
|
|
119
|
+
readonly index: number;
|
|
120
|
+
readonly name: string;
|
|
121
|
+
readonly type: 'perspective';
|
|
122
|
+
/** Vertical field of view in degrees. */
|
|
123
|
+
readonly yfovDeg: number;
|
|
124
|
+
/** Width over height when the file fixes one; LayaAir uses its viewport's. */
|
|
125
|
+
readonly aspectRatio: number | null;
|
|
126
|
+
readonly znear: number;
|
|
127
|
+
/** Null: no far plane in the file. */
|
|
128
|
+
readonly zfar: number | null;
|
|
129
|
+
} | {
|
|
130
|
+
readonly index: number;
|
|
131
|
+
readonly name: string;
|
|
132
|
+
readonly type: 'orthographic';
|
|
133
|
+
/** Half width and half height of the view, in metres. */
|
|
134
|
+
readonly xmag: number;
|
|
135
|
+
readonly ymag: number;
|
|
136
|
+
readonly znear: number;
|
|
137
|
+
readonly zfar: number;
|
|
138
|
+
};
|
|
139
|
+
/** The file's cameras; an invalid one is null and named in `problems`. */
|
|
140
|
+
export declare function readZhudaGltfCameras(document: unknown): {
|
|
141
|
+
cameras: readonly (ZhudaGltfCamera | null)[];
|
|
142
|
+
problems: readonly ZhudaGltfProblem[];
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Points a LayaAir camera as a glTF camera: its lens, and, given the Laya node
|
|
146
|
+
* the camera hangs on, that node's world position and rotation (both look down
|
|
147
|
+
* their local -Z). The aspect ratio stays the viewport's; an infinite far plane
|
|
148
|
+
* keeps the camera's own.
|
|
149
|
+
*/
|
|
150
|
+
export declare function applyZhudaGltfCamera(camera: Laya.Camera, data: ZhudaGltfCamera, node?: Laya.Sprite3D): void;
|
|
151
|
+
/** glTF node data LayaAir 3.4.2 drops on import: custom properties, a camera, a light. */
|
|
152
|
+
export interface ZhudaGltfNodeData {
|
|
153
|
+
readonly index: number;
|
|
154
|
+
/** The glTF name, or null (LayaAir then names the node `node_<n>`). */
|
|
155
|
+
readonly name: string | null;
|
|
156
|
+
/** A frozen copy of the node's `extras`, when it has any. */
|
|
157
|
+
readonly extras?: unknown;
|
|
158
|
+
readonly camera?: ZhudaGltfCamera;
|
|
159
|
+
readonly light?: ZhudaGltfLight;
|
|
160
|
+
/** `EXT_mesh_gpu_instancing`: the node's mesh is drawn this many times. */
|
|
161
|
+
readonly instancing?: ZhudaGltfInstancing;
|
|
162
|
+
}
|
|
163
|
+
/** Every node that carries extras, a valid camera, a valid light or copies of its mesh. */
|
|
164
|
+
export declare function readZhudaGltfNodeData(document: unknown): readonly ZhudaGltfNodeData[];
|
|
165
|
+
/** A node whose mesh is drawn many times (`EXT_mesh_gpu_instancing`), and the accessors that place its copies. */
|
|
166
|
+
export interface ZhudaGltfInstancing {
|
|
167
|
+
/** The glTF node. */
|
|
168
|
+
readonly index: number;
|
|
169
|
+
/** How many copies. */
|
|
170
|
+
readonly count: number;
|
|
171
|
+
/** Accessor indices; null where the file gives none (no move, no turn, no scale). */
|
|
172
|
+
readonly translation: number | null;
|
|
173
|
+
readonly rotation: number | null;
|
|
174
|
+
readonly scale: number | null;
|
|
175
|
+
}
|
|
176
|
+
/** Most copies one node may ask for: what one instanced mesh draws. */
|
|
177
|
+
export declare const ZHUDA_GLTF_MAX_INSTANCES = 200000;
|
|
178
|
+
/**
|
|
179
|
+
* The nodes that use `EXT_mesh_gpu_instancing`. A node whose attributes
|
|
180
|
+
* cannot be drawn is left out and named in `problems` (its mesh is then
|
|
181
|
+
* drawn once, where the node is).
|
|
182
|
+
*/
|
|
183
|
+
export declare function readZhudaGltfInstancing(document: unknown): {
|
|
184
|
+
instancing: readonly ZhudaGltfInstancing[];
|
|
185
|
+
problems: readonly ZhudaGltfProblem[];
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* The matrix of each copy (sixteen numbers, column by column, in the node's
|
|
189
|
+
* own space) from the three attributes as they lie in the file: three
|
|
190
|
+
* numbers a move, four a turn (a quaternion x, y, z, w; integers are read as
|
|
191
|
+
* -1..1 by `rotationScale`, 1/127 for bytes and 1/32767 for shorts), three a
|
|
192
|
+
* scale. A turn of no length is no turn. `mirrored` lists the copies whose
|
|
193
|
+
* scale turns the mesh inside out: one draw has one facing, so an instanced
|
|
194
|
+
* mesh cannot draw them with the rest.
|
|
195
|
+
*/
|
|
196
|
+
export declare function zhudaGltfInstanceMatrices(count: number, translation?: ArrayLike<number> | null, rotation?: ArrayLike<number> | null, scale?: ArrayLike<number> | null, rotationScale?: number): {
|
|
197
|
+
matrices: Float32Array;
|
|
198
|
+
mirrored: number[];
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Vertex attribute accessors LayaAir would read wrongly: integers, normalized or
|
|
202
|
+
* not (`KHR_mesh_quantization`, or core glTF's normalized texture coordinates
|
|
203
|
+
* and weights). LayaAir copies them into a float vertex buffer unscaled.
|
|
204
|
+
*/
|
|
205
|
+
export declare function quantizedZhudaGltfAccessors(document: unknown): number[];
|
|
206
|
+
/**
|
|
207
|
+
* The buffers a file's buffer views use but keeps outside itself (a `uri` that
|
|
208
|
+
* is not an embedded base64 one). `dequantizeZhudaGltf` has no bytes for them.
|
|
209
|
+
*/
|
|
210
|
+
export declare function externalZhudaGltfBuffers(document: unknown): number[];
|
|
211
|
+
export interface ZhudaDequantizeResult {
|
|
212
|
+
/** A GLB: the source data in one buffer, then the float copies. */
|
|
213
|
+
readonly bytes: Uint8Array;
|
|
214
|
+
/** Accessors turned into floats. */
|
|
215
|
+
readonly accessors: number;
|
|
216
|
+
/** Bytes of float data added. */
|
|
217
|
+
readonly floatBytes: number;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Turns quantized vertex attributes into 32-bit floats before LayaAir parses
|
|
221
|
+
* the file (see `quantizedZhudaGltfAccessors`). Node transforms are kept: they
|
|
222
|
+
* still carry `KHR_mesh_quantization`'s scale and offset. Needs embedded
|
|
223
|
+
* buffers. Returns null when nothing needs it. GPU memory becomes that of an
|
|
224
|
+
* unquantized export; the quantized source bytes stay in the file unread.
|
|
225
|
+
*/
|
|
226
|
+
export declare function dequantizeZhudaGltf(input: ArrayBuffer | Uint8Array, options?: {
|
|
227
|
+
maxOutputBytes?: number;
|
|
228
|
+
}): ZhudaDequantizeResult | null;
|
|
229
|
+
/** A glTF JSON or GLB file's document and, for a GLB, its binary chunk. */
|
|
230
|
+
export declare function readZhudaGltfBytes(bytes: Uint8Array): {
|
|
231
|
+
document: Json;
|
|
232
|
+
bin?: Uint8Array;
|
|
233
|
+
};
|
|
234
|
+
/** A GLB of a document and its one binary buffer. */
|
|
235
|
+
export declare function writeZhudaGlb(document: unknown, bin: Uint8Array): Uint8Array;
|
|
236
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Generated from TypeScript source; run npm run types:generate.
|
|
2
|
+
/**
|
|
3
|
+
* A glTF material's occlusion and emissive textures on the mesh's second set
|
|
4
|
+
* of texture coordinates (`texCoord: 1`): a baked map laid out on its own,
|
|
5
|
+
* apart from the tiling one the colour uses.
|
|
6
|
+
*
|
|
7
|
+
* LayaAir 3.4.2 loads `TEXCOORD_1` into the mesh and carries it to the pixel
|
|
8
|
+
* only for a lightmap; its glTF shader reads every texture by the first set
|
|
9
|
+
* and its loader says "non 0 uv channel unsupported" on the console. The
|
|
10
|
+
* text of two includes and of the glTF shader is changed as LayaAir
|
|
11
|
+
* registers them, and compiles to LayaAir's own code until a material asks.
|
|
12
|
+
* Vendor files are not modified.
|
|
13
|
+
*/
|
|
14
|
+
/** On a material one of whose textures reads the second set: the set is carried to the pixel. */
|
|
15
|
+
export declare const ZHUDA_UV1_DEFINE = "ZHUDA_UV1";
|
|
16
|
+
export declare const ZHUDA_OCCLUSION_UV1_DEFINE = "ZHUDA_OCCLUSION_UV1";
|
|
17
|
+
export declare const ZHUDA_EMISSION_UV1_DEFINE = "ZHUDA_EMISSION_UV1";
|
|
18
|
+
/** `ShadingCommon.glsl` with a varying for the second set. Pure. */
|
|
19
|
+
export declare function zhudaPatchSecondUvCommon(text: string): {
|
|
20
|
+
text: string;
|
|
21
|
+
reason?: string;
|
|
22
|
+
};
|
|
23
|
+
/** `ShadingVertex.glsl` handing the second set to the pixel. Pure. */
|
|
24
|
+
export declare function zhudaPatchSecondUvVertex(text: string): {
|
|
25
|
+
text: string;
|
|
26
|
+
reason?: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The glTF shader's fragment program reading occlusion and emission by the
|
|
30
|
+
* second set under their defines. A program without those lines (another
|
|
31
|
+
* shader, or the glTF shader's other passes) comes back as it was. Pure.
|
|
32
|
+
*/
|
|
33
|
+
export declare function zhudaPatchSecondUvGltf(fragment: string): {
|
|
34
|
+
text: string;
|
|
35
|
+
reason?: string;
|
|
36
|
+
};
|
|
37
|
+
export interface ZhudaSecondUvStatus {
|
|
38
|
+
/** The three texts were found and changed: a material may ask. */
|
|
39
|
+
ready: boolean;
|
|
40
|
+
/** Why not, when it is not. */
|
|
41
|
+
reason: string | null;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Changes the two includes and the glTF shader as LayaAir registers them.
|
|
45
|
+
* Must run before `Laya.init`; `ZhudaEngine.boot` calls it. If the vendored
|
|
46
|
+
* text no longer holds an anchor, nothing of that text is changed and
|
|
47
|
+
* `zhudaSecondUvStatus()` says why: such a texture is then drawn with the
|
|
48
|
+
* first set, and the model's report says so.
|
|
49
|
+
*/
|
|
50
|
+
export declare function installLaya342SecondUv(runtime?: any): boolean;
|
|
51
|
+
/** Whether a glTF material may read its occlusion and emissive textures by the second set. */
|
|
52
|
+
export declare function zhudaSecondUvStatus(runtime?: any): ZhudaSecondUvStatus;
|
|
53
|
+
/** Which set of texture coordinates a glTF texture reference asks for (`KHR_texture_transform` may say another). */
|
|
54
|
+
export declare function zhudaGltfTexCoord(info: unknown): number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Generated from TypeScript source; run npm run types:generate.
|
|
2
|
+
export interface ZhudaGraphicsTarget {
|
|
3
|
+
clear(...args: any[]): any;
|
|
4
|
+
drawRect(x: number, y: number, width: number, height: number, fillColor: any, lineColor?: any, lineWidth?: number, percent?: boolean): any;
|
|
5
|
+
drawRoundRect(x: number, y: number, width: number, height: number, lt: number, rt: number, lb: number, rb: number, fillColor: any, lineColor?: any, lineWidth?: number, percent?: boolean, minNum?: number, segPixel?: number): any;
|
|
6
|
+
drawCircle(x: number, y: number, radius: number, fillColor: any, lineColor?: any, lineWidth?: number, percent?: boolean): any;
|
|
7
|
+
drawEllipse(x: number, y: number, width: number, height: number, fillColor: any, lineColor?: any, lineWidth?: number, percent?: boolean): any;
|
|
8
|
+
}
|
|
9
|
+
/** Validates and clamps vector drawing inputs before they reach Laya.Graphics. */
|
|
10
|
+
export declare class ZhudaGraphicsGuard {
|
|
11
|
+
readonly target: ZhudaGraphicsTarget;
|
|
12
|
+
constructor(target: ZhudaGraphicsTarget);
|
|
13
|
+
clear(...args: any[]): any;
|
|
14
|
+
drawRect(x: number, y: number, width: number, height: number, fillColor: any, lineColor?: any, lineWidth?: number, percent?: boolean): any;
|
|
15
|
+
drawRoundRect(x: number, y: number, width: number, height: number, lt: number, rt: number, lb: number, rb: number, fillColor: any, lineColor?: any, lineWidth?: number, percent?: boolean, minNum?: number, segPixel?: number): any;
|
|
16
|
+
drawCircle(x: number, y: number, radius: number, fillColor: any, lineColor?: any, lineWidth?: number, percent?: boolean): any;
|
|
17
|
+
drawEllipse(x: number, y: number, width: number, height: number, fillColor: any, lineColor?: any, lineWidth?: number, percent?: boolean): any;
|
|
18
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
// Generated from TypeScript source; run npm run types:generate.
|
|
2
|
+
export interface ZhudaGrassOptions {
|
|
3
|
+
/** The land grass may cover, world metres. */
|
|
4
|
+
area: {
|
|
5
|
+
minX: number;
|
|
6
|
+
maxX: number;
|
|
7
|
+
minZ: number;
|
|
8
|
+
maxZ: number;
|
|
9
|
+
};
|
|
10
|
+
/** Height of the ground at a place, or null where there is none. */
|
|
11
|
+
ground: (x: number, z: number) => number | null;
|
|
12
|
+
/** False where nothing grows (a road, a floor, under water). Asked once a clump. */
|
|
13
|
+
grows?: (x: number, z: number, y: number) => boolean;
|
|
14
|
+
/** Blades on a square metre close to the eye, 20..1500 (default 400). */
|
|
15
|
+
density?: number;
|
|
16
|
+
/** Shortest and tallest blade, metres (default [0.14, 0.34]). */
|
|
17
|
+
heightM?: readonly number[];
|
|
18
|
+
/** Width of a blade at its foot, metres, 0.005..0.2 (default 0.03). */
|
|
19
|
+
widthM?: number;
|
|
20
|
+
/** How far from the eye grass is drawn, metres, 10..300 (default 60). */
|
|
21
|
+
distanceM?: number;
|
|
22
|
+
/** Within this distance every blade is drawn, metres (default a twelfth of `distanceM`). */
|
|
23
|
+
fullDensityM?: number;
|
|
24
|
+
/** Side of a patch of land, metres, 2..32 (default 6). */
|
|
25
|
+
patchM?: number;
|
|
26
|
+
/** Colour of a blade at its tip, display RGB 0..1 (default [0.46, 0.6, 0.22]). */
|
|
27
|
+
tip?: readonly number[];
|
|
28
|
+
/** Colour at its foot (default [0.1, 0.19, 0.06]). */
|
|
29
|
+
root?: readonly number[];
|
|
30
|
+
/** Colour dry blades turn toward (default [0.66, 0.62, 0.3]). */
|
|
31
|
+
dry?: readonly number[];
|
|
32
|
+
/** How much of the grass is dry, 0..1 (default 0.3). */
|
|
33
|
+
dryness?: number;
|
|
34
|
+
/** The wind: where it blows toward (degrees from +X toward +Z), how far it bends a blade (0..1) and how fast it moves. */
|
|
35
|
+
wind?: {
|
|
36
|
+
directionDeg?: number;
|
|
37
|
+
strength?: number;
|
|
38
|
+
speed?: number;
|
|
39
|
+
};
|
|
40
|
+
/** The same seed grows the same grass (default 1). */
|
|
41
|
+
seed?: number;
|
|
42
|
+
/** False leaves out the turf under the blades (default true). */
|
|
43
|
+
turf?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface ZhudaGrassResolved {
|
|
46
|
+
area: {
|
|
47
|
+
minX: number;
|
|
48
|
+
maxX: number;
|
|
49
|
+
minZ: number;
|
|
50
|
+
maxZ: number;
|
|
51
|
+
};
|
|
52
|
+
density: number;
|
|
53
|
+
heightM: [number, number];
|
|
54
|
+
widthM: number;
|
|
55
|
+
distanceM: number;
|
|
56
|
+
fullDensityM: number;
|
|
57
|
+
patchM: number;
|
|
58
|
+
tip: [number, number, number];
|
|
59
|
+
root: [number, number, number];
|
|
60
|
+
dry: [number, number, number];
|
|
61
|
+
dryness: number;
|
|
62
|
+
wind: {
|
|
63
|
+
directionDeg: number;
|
|
64
|
+
strength: number;
|
|
65
|
+
speed: number;
|
|
66
|
+
};
|
|
67
|
+
seed: number;
|
|
68
|
+
turf: boolean;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The blades of a patch are kept in five meshes by rank: the first holds the
|
|
72
|
+
* few that are drawn far from the eye, each further one those that are added
|
|
73
|
+
* nearer. A patch near the eye has all five, one far away the first only.
|
|
74
|
+
* Coming nearer makes only the blades that are new; going away drops a mesh.
|
|
75
|
+
* `segments` is how many pieces a blade is cut into along its length.
|
|
76
|
+
*/
|
|
77
|
+
export declare const ZHUDA_GRASS_BANDS: readonly {
|
|
78
|
+
from: number;
|
|
79
|
+
to: number;
|
|
80
|
+
segments: number;
|
|
81
|
+
}[];
|
|
82
|
+
/** Numbers a blade is stored as: x, y, z of its foot, height, facing angle, lean (a share of the height) and rank. */
|
|
83
|
+
export declare const ZHUDA_GRASS_BLADE_FLOATS = 7;
|
|
84
|
+
/** Problems with grass options; an empty list means a field can be made of them. */
|
|
85
|
+
export declare function validateZhudaGrass(options: ZhudaGrassOptions): string[];
|
|
86
|
+
/** The options with every default filled in. Throws what `validateZhudaGrass` lists. */
|
|
87
|
+
/** Lists what is wrong with a list of bodies for \`ZhudaGrassField.setBenders\`. */
|
|
88
|
+
export declare function validateZhudaGrassBenders(benders: unknown): string[];
|
|
89
|
+
export declare function resolveZhudaGrass(options: ZhudaGrassOptions): ZhudaGrassResolved;
|
|
90
|
+
/** The share of blades drawn at a distance from the eye: all of them close by, fewer further off, none past the end. */
|
|
91
|
+
export declare function zhudaGrassShown(distance: number, fullDensityM: number, distanceM: number): number;
|
|
92
|
+
/**
|
|
93
|
+
* How many of its meshes a patch whose nearest point is this far from the
|
|
94
|
+
* eye needs: all of `ZHUDA_GRASS_BANDS` close by, one far off, none past
|
|
95
|
+
* the end. A mesh is needed where a blade of its ranks is drawn.
|
|
96
|
+
*/
|
|
97
|
+
export declare function zhudaGrassBands(nearest: number, fullDensityM: number, distanceM: number): number;
|
|
98
|
+
/**
|
|
99
|
+
* How many patches of land the grass keeps a mesh for with the eye there, and
|
|
100
|
+
* how many meshes that is at least: one for each band a patch needs (see
|
|
101
|
+
* `zhudaGrassBands`) and one for its turf. Each mesh is a draw in every pass
|
|
102
|
+
* that draws the land, so this is the least the grass adds to a frame before
|
|
103
|
+
* the camera's own culling; a band too large for one mesh is cut into more.
|
|
104
|
+
* Distance is measured over the ground, as `ZhudaGrassField.update` measures
|
|
105
|
+
* it: an eye high above a field is as near to it as one standing in it. Pure.
|
|
106
|
+
*/
|
|
107
|
+
export declare function zhudaGrassMeshCount(options: Pick<ZhudaGrassOptions, 'area' | 'distanceM' | 'fullDensityM' | 'patchM' | 'turf'>, eye: readonly number[]): {
|
|
108
|
+
patches: number;
|
|
109
|
+
meshes: number;
|
|
110
|
+
};
|
|
111
|
+
/** How many clumps a patch of land has. */
|
|
112
|
+
export declare function zhudaGrassPatchClumps(resolved: ZhudaGrassResolved): number;
|
|
113
|
+
/**
|
|
114
|
+
* The blades of one patch of land, `ZHUDA_GRASS_BLADE_FLOATS` numbers each.
|
|
115
|
+
* A patch is the square `[px, px + 1) × [pz, pz + 1)` times `patchM`. Blades
|
|
116
|
+
* stand in clumps that open outward like a fountain; the land is thicker and
|
|
117
|
+
* taller in places and thin in others. The same patch always grows the same
|
|
118
|
+
* blades. `ranks` ([from, to), default all) keeps the blades of those ranks:
|
|
119
|
+
* the ranks of `ZHUDA_GRASS_BANDS` together give every blade once, and a
|
|
120
|
+
* narrow range is made quickly. `slice` ([first, end)) makes only those of
|
|
121
|
+
* the patch's clumps, for a patch made over several frames. Pure: no Laya
|
|
122
|
+
* needed.
|
|
123
|
+
*/
|
|
124
|
+
export declare function zhudaGrassPatchBlades(resolved: ZhudaGrassResolved, ground: (x: number, z: number) => number | null, grows: ((x: number, z: number, y: number) => boolean) | undefined, px: number, pz: number, ranks?: readonly number[], slice?: readonly number[]): Float32Array;
|
|
125
|
+
export interface ZhudaGrassMeshData {
|
|
126
|
+
/** POSITION, NORMAL, UV interleaved: eight numbers a vertex. */
|
|
127
|
+
vertices: Float32Array;
|
|
128
|
+
indices: Uint16Array;
|
|
129
|
+
blades: number;
|
|
130
|
+
min: [number, number, number];
|
|
131
|
+
max: [number, number, number];
|
|
132
|
+
}
|
|
133
|
+
/** How far the turf lies above the ground, metres. */
|
|
134
|
+
export declare const ZHUDA_GRASS_TURF_LIFT_M = 0.02;
|
|
135
|
+
/**
|
|
136
|
+
* The turf of one patch: a sheet over the ground in squares of about half a
|
|
137
|
+
* metre, or null where nothing grows. A corner where grass grows carries 1
|
|
138
|
+
* in its texture coordinate and one where it does not carries 0; the
|
|
139
|
+
* fragment program cuts a ragged edge between them. Squares with no growing
|
|
140
|
+
* corner, or with a corner off the ground, are left out. Pure: no Laya needed.
|
|
141
|
+
*/
|
|
142
|
+
export declare function zhudaGrassTurf(resolved: ZhudaGrassResolved, ground: (x: number, z: number) => number | null, grows: ((x: number, z: number, y: number) => boolean) | undefined, px: number, pz: number): ZhudaGrassMeshData | null;
|
|
143
|
+
/**
|
|
144
|
+
* Meshes of blades, each cut into `segments` pieces along its length, so
|
|
145
|
+
* that none has more than 65 535 vertices. Both edges of a blade are stored on its middle line;
|
|
146
|
+
* the vertex program opens them. The normal is the way the blade faces; the
|
|
147
|
+
* texture coordinate carries rank and edge in x; height, lean and place
|
|
148
|
+
* along the blade in y. Pure: no Laya needed.
|
|
149
|
+
*/
|
|
150
|
+
export declare function zhudaGrassMeshes(blades: Float32Array, segments: number): ZhudaGrassMeshData[];
|
|
151
|
+
/** Bodies in the grass (setBenders): at most this many at once. */
|
|
152
|
+
export declare const ZHUDA_GRASS_MAX_BENDERS = 4;
|
|
153
|
+
/**
|
|
154
|
+
* How far a body pushes a blade's point aside and down, as the vertex program
|
|
155
|
+
* does it: \`[dx, dy, dz]\` for a blade standing at \`foot\` (its foot, world),
|
|
156
|
+
* \`tall\` metres high, at \`t\` (0 at the foot, 1 at the tip), from a body at
|
|
157
|
+
* \`[x, y, z]\` (its lowest point) reaching \`radius\` metres. Blades within a
|
|
158
|
+
* third of the radius are pressed flat away from the body; the push fades to
|
|
159
|
+
* nothing at the radius, and as the body rises more than 0.15 m above the
|
|
160
|
+
* blade's foot (gone by 0.7 m). The foot stays where it is.
|
|
161
|
+
*/
|
|
162
|
+
export declare function zhudaGrassBend(foot: readonly [number, number, number], tall: number, t: number, body: readonly [number, number, number], radius: number): [number, number, number];
|
|
163
|
+
export interface ZhudaGrassStats {
|
|
164
|
+
/** Patches of land that have a mesh now. */
|
|
165
|
+
patches: number;
|
|
166
|
+
/** Blades in those meshes (those drawn are fewer: far ones are thinned). */
|
|
167
|
+
blades: number;
|
|
168
|
+
vertices: number;
|
|
169
|
+
/** Patches round the eye still waiting for their mesh. */
|
|
170
|
+
pending: number;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* A field of grass in a scene. Call `update` every frame with the eye and the
|
|
174
|
+
* time; it makes at most a few patches a call. `fill` makes every patch the
|
|
175
|
+
* eye needs at once (a first frame, a picture). `dispose` gives it all back.
|
|
176
|
+
*/
|
|
177
|
+
export declare class ZhudaGrassField {
|
|
178
|
+
readonly options: ZhudaGrassResolved;
|
|
179
|
+
private readonly scene;
|
|
180
|
+
private readonly ground;
|
|
181
|
+
private readonly grows?;
|
|
182
|
+
private readonly material;
|
|
183
|
+
private readonly patches;
|
|
184
|
+
private pending;
|
|
185
|
+
/** The patch being made, over several calls when it is a large one. */
|
|
186
|
+
private job;
|
|
187
|
+
private disposed;
|
|
188
|
+
constructor(scene: any, options: ZhudaGrassOptions);
|
|
189
|
+
/**
|
|
190
|
+
* Bodies standing in the grass this frame (a character's feet, a thing
|
|
191
|
+
* dropped on it): each pushes the blades within \`radius\` aside and presses
|
|
192
|
+
* them down, fading as the body rises above them (see \`zhudaGrassBend\`).
|
|
193
|
+
* At most \`ZHUDA_GRASS_MAX_BENDERS\`; an empty list lets the grass stand.
|
|
194
|
+
* \`position\` is the body's lowest point, world metres. Cheap enough for
|
|
195
|
+
* every frame; nothing is rebuilt.
|
|
196
|
+
*/
|
|
197
|
+
setBenders(benders: readonly {
|
|
198
|
+
position: readonly [number, number, number];
|
|
199
|
+
radius: number;
|
|
200
|
+
}[]): void;
|
|
201
|
+
/** Changes the wind in place. */
|
|
202
|
+
setWind(wind: {
|
|
203
|
+
directionDeg?: number;
|
|
204
|
+
strength?: number;
|
|
205
|
+
speed?: number;
|
|
206
|
+
}): void;
|
|
207
|
+
get stats(): ZhudaGrassStats;
|
|
208
|
+
/**
|
|
209
|
+
* Moves the grass to the eye and the time. Makes the meshes the eye needs,
|
|
210
|
+
* nearest first, until it has made `blades` blades (default 6000; always
|
|
211
|
+
* some), and returns how many patches are still short of a mesh. The mesh
|
|
212
|
+
* a patch near the eye gains is tens of thousands of blades: it is made
|
|
213
|
+
* over several calls and shown when it is whole.
|
|
214
|
+
*/
|
|
215
|
+
update(eye: readonly number[], seconds: number, blades?: number): number;
|
|
216
|
+
/** Makes every patch the eye needs now, however many. */
|
|
217
|
+
fill(eye: readonly number[], seconds: number): void;
|
|
218
|
+
/**
|
|
219
|
+
* Makes the next part of a band: some of the patch's clumps as meshes that
|
|
220
|
+
* are not drawn yet. With the last part of a patch's first band comes its
|
|
221
|
+
* turf, and a band that is whole is shown. Returns how many blades it made.
|
|
222
|
+
*/
|
|
223
|
+
private step;
|
|
224
|
+
private release;
|
|
225
|
+
dispose(): void;
|
|
226
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Generated from TypeScript source; run npm run types:generate.
|
|
2
|
+
/**
|
|
3
|
+
* Ambient occlusion by horizons (GTAO, after Jimenez and others, 2016):
|
|
4
|
+
* round each pixel a few slices are cut through the depth picture, the
|
|
5
|
+
* horizon is found on both sides of each, and the part of the sky's light
|
|
6
|
+
* that still reaches the point is worked out exactly for that slice, with
|
|
7
|
+
* the light weighted by the angle it falls at.
|
|
8
|
+
*
|
|
9
|
+
* Against LayaAir's own occlusion (`ScalableAO`):
|
|
10
|
+
* - open, flat ground stays as it is: a plane's horizons lie in the plane,
|
|
11
|
+
* where the other method's samples darken it a little everywhere;
|
|
12
|
+
* - the darkening in a crease is the share of the sky that the geometry
|
|
13
|
+
* within the radius hides, not a tuned amount, and the sky itself is
|
|
14
|
+
* never darkened;
|
|
15
|
+
* - it reads the depth picture only. LayaAir's needs the scene drawn once
|
|
16
|
+
* more for normals; here the normal is taken from the depth itself.
|
|
17
|
+
*
|
|
18
|
+
* Two passes: the occlusion (full size, or half size for a phone), and one
|
|
19
|
+
* that smooths it over four by four pixels without crossing a depth edge
|
|
20
|
+
* and darkens the scene by it. As any occlusion laid over a finished
|
|
21
|
+
* picture it darkens direct light as well as ambient light: keep it mild in
|
|
22
|
+
* sunlit scenes. Only the class needs the Laya runtime.
|
|
23
|
+
*/
|
|
24
|
+
export interface ZhudaGroundTruthAOOptions {
|
|
25
|
+
/**
|
|
26
|
+
* How strongly the scene is darkened, 0..4 (default 1): the light that
|
|
27
|
+
* reaches a point, raised to this power. 1 is what the geometry hides.
|
|
28
|
+
*/
|
|
29
|
+
intensity?: number;
|
|
30
|
+
/** How far occluders are looked for, in scene units, 0.05..10 (default 0.5). */
|
|
31
|
+
radius?: number;
|
|
32
|
+
/** Slices through each pixel, 1..4 (default 2). */
|
|
33
|
+
slices?: number;
|
|
34
|
+
/** Depth reads to each side of a slice, 2..8 (default 4). */
|
|
35
|
+
steps?: number;
|
|
36
|
+
/** Work the occlusion out at half size (default false): a quarter of the reads, softer contact. */
|
|
37
|
+
halfSize?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** Lists what is wrong with the options; empty when they are valid. */
|
|
40
|
+
export declare function validateZhudaGroundTruthAO(options: ZhudaGroundTruthAOOptions): string[];
|
|
41
|
+
/**
|
|
42
|
+
* The light that reaches a point through one slice, 0..1, for a sky lit
|
|
43
|
+
* evenly and weighted by the angle it falls at. `low` and `high` are the
|
|
44
|
+
* horizons to each side as angles from the direction to the eye, in radians
|
|
45
|
+
* (-PI/2..0 and 0..PI/2 for an open plane seen head on), and `normal` is
|
|
46
|
+
* the angle of the surface normal in the slice. The shader's arithmetic.
|
|
47
|
+
*/
|
|
48
|
+
export declare function zhudaHorizonVisibility(low: number, high: number, normal: number): number;
|
|
49
|
+
export declare class ZhudaGroundTruthAO {
|
|
50
|
+
/**
|
|
51
|
+
* The Laya post-process effect: first in a chain's linear part, before
|
|
52
|
+
* anything is added to the scene's light. `ZhudaFilmicPipeline` puts it
|
|
53
|
+
* there with `aoMethod: 'gtao'`.
|
|
54
|
+
*/
|
|
55
|
+
readonly effect: any;
|
|
56
|
+
private readonly materials;
|
|
57
|
+
private readonly values;
|
|
58
|
+
private disposed;
|
|
59
|
+
constructor(options?: ZhudaGroundTruthAOOptions);
|
|
60
|
+
/** New values in place; the same limits as the options. */
|
|
61
|
+
set(options: ZhudaGroundTruthAOOptions): void;
|
|
62
|
+
/** Call after the effect has been removed from its post-process chain. */
|
|
63
|
+
dispose(): void;
|
|
64
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Generated from TypeScript source; run npm run types:generate.
|
|
2
|
+
/** 16-bit floats, for light stored at half the size of 32-bit floats. Pure. */
|
|
3
|
+
/** A 32-bit float as the 16 bits of a half float, rounded to nearest; values past its range become its largest. */
|
|
4
|
+
export declare function zhudaFloatToHalf(value: number): number;
|
|
5
|
+
/** Float pixels as half floats. */
|
|
6
|
+
export declare function zhudaToHalfFloats(pixels: Float32Array): Uint16Array;
|
|
7
|
+
/**
|
|
8
|
+
* Scene-linear RGBA float pixels as LayaAir's RGBD: 8 bits a channel, with
|
|
9
|
+
* the colour divided by its largest channel where that is over 1 and the
|
|
10
|
+
* divisor's reciprocal in alpha (`decodeRGBD`: rgb / a). Reaches 255; coarse
|
|
11
|
+
* above 1, and filtered on encoded values.
|
|
12
|
+
*/
|
|
13
|
+
export declare function zhudaToRgbd(pixels: Float32Array): Uint8Array;
|