@aura3d/engine 4.6.1 → 4.7.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/dist/assets/asset-corpus/ProductionGLTFRenderPipeline.d.ts +12 -0
- package/dist/assets/asset-corpus/ProductionGLTFRenderPipeline.d.ts.map +1 -1
- package/dist/assets/asset-corpus/ProductionGLTFRenderPipeline.js +26 -1
- package/dist/assets/asset-corpus/ProductionGLTFRenderPipeline.js.map +1 -1
- package/dist/assets/vfx/LICENSE.md +1 -0
- package/dist/assets/vfx/aura-vfx-1k.png +0 -0
- package/dist/assets/vfx/aura-vfx-2k.png +0 -0
- package/dist/aura3d-cli/admission/cubeLut.d.ts +18 -0
- package/dist/aura3d-cli/admission/cubeLut.d.ts.map +1 -0
- package/dist/aura3d-cli/admission/cubeLut.js +53 -0
- package/dist/aura3d-cli/admission/cubeLut.js.map +1 -0
- package/dist/aura3d-cli/asset-core-types.d.ts +7 -4
- package/dist/aura3d-cli/asset-core-types.d.ts.map +1 -1
- package/dist/aura3d-cli/cli-help.d.ts.map +1 -1
- package/dist/aura3d-cli/cli-help.js +7 -4
- package/dist/aura3d-cli/cli-help.js.map +1 -1
- package/dist/aura3d-cli/cli-options.d.ts +1 -1
- package/dist/aura3d-cli/cli-options.d.ts.map +1 -1
- package/dist/aura3d-cli/cli-options.js +2 -2
- package/dist/aura3d-cli/cli-options.js.map +1 -1
- package/dist/aura3d-cli/cli.js +3 -2
- package/dist/aura3d-cli/cli.js.map +1 -1
- package/dist/aura3d-cli/commands/assets/certifyCategories.d.ts +26 -0
- package/dist/aura3d-cli/commands/assets/certifyCategories.d.ts.map +1 -0
- package/dist/aura3d-cli/commands/assets/certifyCategories.js +31 -0
- package/dist/aura3d-cli/commands/assets/certifyCategories.js.map +1 -0
- package/dist/aura3d-cli/commands/assets/optimize.d.ts +66 -0
- package/dist/aura3d-cli/commands/assets/optimize.d.ts.map +1 -1
- package/dist/aura3d-cli/commands/assets/optimize.js +270 -1
- package/dist/aura3d-cli/commands/assets/optimize.js.map +1 -1
- package/dist/aura3d-cli/commands/assets/optimizeVerb.d.ts.map +1 -1
- package/dist/aura3d-cli/commands/assets/optimizeVerb.js +26 -1
- package/dist/aura3d-cli/commands/assets/optimizeVerb.js.map +1 -1
- package/dist/aura3d-cli/commands/evidence/judge.d.ts +50 -1
- package/dist/aura3d-cli/commands/evidence/judge.d.ts.map +1 -1
- package/dist/aura3d-cli/commands/evidence/judge.js +154 -6
- package/dist/aura3d-cli/commands/evidence/judge.js.map +1 -1
- package/dist/aura3d-cli/commands/prd05/index.js +1 -1
- package/dist/aura3d-cli/commands/prd05/index.js.map +1 -1
- package/dist/aura3d-cli/index.d.ts.map +1 -1
- package/dist/aura3d-cli/index.js +25 -9
- package/dist/aura3d-cli/index.js.map +1 -1
- package/dist/aura3d-cli/look/judge.d.ts +53 -5
- package/dist/aura3d-cli/look/judge.d.ts.map +1 -1
- package/dist/aura3d-cli/look/judge.js +226 -50
- package/dist/aura3d-cli/look/judge.js.map +1 -1
- package/dist/create-aura3d/index.js +1 -1
- package/dist/engine/agent-api/RootRuntimeSupport.d.ts +7 -0
- package/dist/engine/agent-api/RootRuntimeSupport.d.ts.map +1 -1
- package/dist/engine/agent-api/RootRuntimeSupport.js +7 -0
- package/dist/engine/agent-api/RootRuntimeSupport.js.map +1 -1
- package/dist/engine/agent-api/app/actorAnimationHandle.d.ts +2 -0
- package/dist/engine/agent-api/app/actorAnimationHandle.d.ts.map +1 -1
- package/dist/engine/agent-api/app/actorAnimationHandle.js +149 -2
- package/dist/engine/agent-api/app/actorAnimationHandle.js.map +1 -1
- package/dist/engine/agent-api/app/createAuraApp.d.ts.map +1 -1
- package/dist/engine/agent-api/app/createAuraApp.js +13 -1
- package/dist/engine/agent-api/app/createAuraApp.js.map +1 -1
- package/dist/engine/agent-api/app/frameLoop.d.ts.map +1 -1
- package/dist/engine/agent-api/app/frameLoop.js +4 -2
- package/dist/engine/agent-api/app/frameLoop.js.map +1 -1
- package/dist/engine/agent-api/camera/layers/cinematicBars.d.ts +2 -0
- package/dist/engine/agent-api/camera/layers/cinematicBars.d.ts.map +1 -1
- package/dist/engine/agent-api/camera/layers/cinematicBars.js +4 -0
- package/dist/engine/agent-api/camera/layers/cinematicBars.js.map +1 -1
- package/dist/engine/agent-api/compiler/compileScene.d.ts +11 -1
- package/dist/engine/agent-api/compiler/compileScene.d.ts.map +1 -1
- package/dist/engine/agent-api/compiler/compileScene.js +27 -1
- package/dist/engine/agent-api/compiler/compileScene.js.map +1 -1
- package/dist/engine/agent-api/compiler/customMaterial.d.ts +16 -5
- package/dist/engine/agent-api/compiler/customMaterial.d.ts.map +1 -1
- package/dist/engine/agent-api/compiler/customMaterial.js +149 -20
- package/dist/engine/agent-api/compiler/customMaterial.js.map +1 -1
- package/dist/engine/agent-api/compiler/environment.d.ts +57 -1
- package/dist/engine/agent-api/compiler/environment.d.ts.map +1 -1
- package/dist/engine/agent-api/compiler/environment.js +170 -5
- package/dist/engine/agent-api/compiler/environment.js.map +1 -1
- package/dist/engine/agent-api/compiler/fog.js +1 -1
- package/dist/engine/agent-api/compiler/fog.js.map +1 -1
- package/dist/engine/agent-api/compiler/lights.d.ts +92 -0
- package/dist/engine/agent-api/compiler/lights.d.ts.map +1 -1
- package/dist/engine/agent-api/compiler/lights.js +358 -1
- package/dist/engine/agent-api/compiler/lights.js.map +1 -1
- package/dist/engine/agent-api/compiler/observations.d.ts +34 -0
- package/dist/engine/agent-api/compiler/observations.d.ts.map +1 -1
- package/dist/engine/agent-api/compiler/observations.js +77 -5
- package/dist/engine/agent-api/compiler/observations.js.map +1 -1
- package/dist/engine/agent-api/compiler/postprocess.d.ts +10 -0
- package/dist/engine/agent-api/compiler/postprocess.d.ts.map +1 -1
- package/dist/engine/agent-api/compiler/postprocess.js +28 -7
- package/dist/engine/agent-api/compiler/postprocess.js.map +1 -1
- package/dist/engine/agent-api/compiler/renderInput.d.ts +2 -0
- package/dist/engine/agent-api/compiler/renderInput.d.ts.map +1 -1
- package/dist/engine/agent-api/compiler/renderInput.js +15 -2
- package/dist/engine/agent-api/compiler/renderInput.js.map +1 -1
- package/dist/engine/agent-api/compiler/renderer.d.ts +6 -0
- package/dist/engine/agent-api/compiler/renderer.d.ts.map +1 -1
- package/dist/engine/agent-api/compiler/renderer.js +14 -3
- package/dist/engine/agent-api/compiler/renderer.js.map +1 -1
- package/dist/engine/agent-api/diagnostics.d.ts +16 -0
- package/dist/engine/agent-api/diagnostics.d.ts.map +1 -1
- package/dist/engine/agent-api/diagnostics.js +45 -2
- package/dist/engine/agent-api/diagnostics.js.map +1 -1
- package/dist/engine/agent-api/index.d.ts +2 -0
- package/dist/engine/agent-api/index.d.ts.map +1 -1
- package/dist/engine/agent-api/index.js +3 -0
- package/dist/engine/agent-api/index.js.map +1 -1
- package/dist/engine/agent-api/looks/lookPresets.d.ts +2 -0
- package/dist/engine/agent-api/looks/lookPresets.d.ts.map +1 -1
- package/dist/engine/agent-api/looks/lookPresets.js.map +1 -1
- package/dist/engine/agent-api/looks/looks.d.ts +12 -2
- package/dist/engine/agent-api/looks/looks.d.ts.map +1 -1
- package/dist/engine/agent-api/looks/looks.js +365 -65
- package/dist/engine/agent-api/looks/looks.js.map +1 -1
- package/dist/engine/agent-api/nodes/builder.d.ts +8 -0
- package/dist/engine/agent-api/nodes/builder.d.ts.map +1 -1
- package/dist/engine/agent-api/nodes/builder.js +15 -0
- package/dist/engine/agent-api/nodes/builder.js.map +1 -1
- package/dist/engine/agent-api/nodes/effects.composite.d.ts +13 -9
- package/dist/engine/agent-api/nodes/effects.composite.d.ts.map +1 -1
- package/dist/engine/agent-api/nodes/effects.d.ts +65 -14
- package/dist/engine/agent-api/nodes/effects.d.ts.map +1 -1
- package/dist/engine/agent-api/nodes/effects.js +49 -16
- package/dist/engine/agent-api/nodes/effects.js.map +1 -1
- package/dist/engine/agent-api/nodes/effects.post.d.ts +62 -5
- package/dist/engine/agent-api/nodes/effects.post.d.ts.map +1 -1
- package/dist/engine/agent-api/nodes/effects.post.js +30 -17
- package/dist/engine/agent-api/nodes/effects.post.js.map +1 -1
- package/dist/engine/agent-api/nodes/effects.toon.d.ts +65 -1
- package/dist/engine/agent-api/nodes/effects.toon.d.ts.map +1 -1
- package/dist/engine/agent-api/nodes/effects.toon.js +186 -23
- package/dist/engine/agent-api/nodes/effects.toon.js.map +1 -1
- package/dist/engine/agent-api/nodes/groups.d.ts.map +1 -1
- package/dist/engine/agent-api/nodes/groups.js +2 -2
- package/dist/engine/agent-api/nodes/groups.js.map +1 -1
- package/dist/engine/agent-api/nodes/instances.d.ts +130 -90
- package/dist/engine/agent-api/nodes/instances.d.ts.map +1 -1
- package/dist/engine/agent-api/nodes/instances.js +192 -48
- package/dist/engine/agent-api/nodes/instances.js.map +1 -1
- package/dist/engine/agent-api/nodes/material.d.ts +8 -1
- package/dist/engine/agent-api/nodes/material.d.ts.map +1 -1
- package/dist/engine/agent-api/nodes/material.js +82 -0
- package/dist/engine/agent-api/nodes/material.js.map +1 -1
- package/dist/engine/agent-api/nodes/outlineTargets.d.ts +16 -0
- package/dist/engine/agent-api/nodes/outlineTargets.d.ts.map +1 -0
- package/dist/engine/agent-api/nodes/outlineTargets.js +46 -0
- package/dist/engine/agent-api/nodes/outlineTargets.js.map +1 -0
- package/dist/engine/agent-api/nodes/scene.d.ts.map +1 -1
- package/dist/engine/agent-api/nodes/scene.js +2 -2
- package/dist/engine/agent-api/nodes/scene.js.map +1 -1
- package/dist/engine/agent-api/nodes/sky.d.ts +23 -6
- package/dist/engine/agent-api/nodes/sky.d.ts.map +1 -1
- package/dist/engine/agent-api/nodes/sky.js +2 -0
- package/dist/engine/agent-api/nodes/sky.js.map +1 -1
- package/dist/engine/agent-api/nodes/types/runtime.d.ts +28 -1
- package/dist/engine/agent-api/nodes/types/runtime.d.ts.map +1 -1
- package/dist/engine/agent-api/nodes/types.d.ts +71 -3
- package/dist/engine/agent-api/nodes/types.d.ts.map +1 -1
- package/dist/engine/agent-api/performanceEvidence.js +7 -2
- package/dist/engine/agent-api/performanceEvidence.js.map +1 -1
- package/dist/engine/agent-api/postBridge.d.ts +75 -3
- package/dist/engine/agent-api/postBridge.d.ts.map +1 -1
- package/dist/engine/agent-api/postBridge.js +436 -33
- package/dist/engine/agent-api/postBridge.js.map +1 -1
- package/dist/engine/agent-api/postPresets.d.ts +8 -4
- package/dist/engine/agent-api/postPresets.d.ts.map +1 -1
- package/dist/engine/agent-api/postPresets.js +12 -11
- package/dist/engine/agent-api/postPresets.js.map +1 -1
- package/dist/engine/agent-api/publishedUnion.d.ts +7 -4
- package/dist/engine/agent-api/publishedUnion.d.ts.map +1 -1
- package/dist/engine/agent-api/publishedUnion.js +1 -1
- package/dist/engine/agent-api/publishedUnion.js.map +1 -1
- package/dist/engine/agent-api/rendererDiagnostics.js +4 -6
- package/dist/engine/agent-api/rendererDiagnostics.js.map +1 -1
- package/dist/engine/agent-api/vfx/atmosphere-api.d.ts +2 -4
- package/dist/engine/agent-api/vfx/atmosphere-api.d.ts.map +1 -1
- package/dist/engine/agent-api/vfx/atmosphere-api.js +2 -1
- package/dist/engine/agent-api/vfx/atmosphere-api.js.map +1 -1
- package/dist/engine/agent-api/vfx/effects-api.d.ts +3 -0
- package/dist/engine/agent-api/vfx/effects-api.d.ts.map +1 -1
- package/dist/engine/agent-api/vfx/effects-api.js +337 -74
- package/dist/engine/agent-api/vfx/effects-api.js.map +1 -1
- package/dist/engine/agent-api/world/flags.d.ts +33 -3
- package/dist/engine/agent-api/world/flags.d.ts.map +1 -1
- package/dist/engine/agent-api/world/flags.js +44 -12
- package/dist/engine/agent-api/world/flags.js.map +1 -1
- package/dist/engine/agent-api/world/index.d.ts +10 -1
- package/dist/engine/agent-api/world/index.d.ts.map +1 -1
- package/dist/engine/agent-api/world/index.js +11 -2
- package/dist/engine/agent-api/world/index.js.map +1 -1
- package/dist/engine/agent-api/world/scatter.d.ts +50 -3
- package/dist/engine/agent-api/world/scatter.d.ts.map +1 -1
- package/dist/engine/agent-api/world/scatter.js +93 -7
- package/dist/engine/agent-api/world/scatter.js.map +1 -1
- package/dist/engine/agent-api/world/terrain.d.ts +8 -0
- package/dist/engine/agent-api/world/terrain.d.ts.map +1 -1
- package/dist/engine/agent-api/world/terrain.js +6 -1
- package/dist/engine/agent-api/world/terrain.js.map +1 -1
- package/dist/engine/contracts/animation.d.ts +30 -12
- package/dist/engine/contracts/animation.d.ts.map +1 -1
- package/dist/engine/contracts/animation.js +2 -0
- package/dist/engine/contracts/animation.js.map +1 -1
- package/dist/engine/contracts/art.d.ts +1 -1
- package/dist/engine/contracts/art.d.ts.map +1 -1
- package/dist/engine/contracts/atmosphere.d.ts +43 -9
- package/dist/engine/contracts/atmosphere.d.ts.map +1 -1
- package/dist/engine/contracts/atmosphere.js.map +1 -1
- package/dist/engine/contracts/camera.d.ts +8 -2
- package/dist/engine/contracts/camera.d.ts.map +1 -1
- package/dist/engine/contracts/camera.js +14 -3
- package/dist/engine/contracts/camera.js.map +1 -1
- package/dist/engine/contracts/effects.d.ts +83 -37
- package/dist/engine/contracts/effects.d.ts.map +1 -1
- package/dist/engine/contracts/effects.js +2 -1
- package/dist/engine/contracts/effects.js.map +1 -1
- package/dist/engine/contracts/flags.d.ts.map +1 -1
- package/dist/engine/contracts/flags.js +29 -4
- package/dist/engine/contracts/flags.js.map +1 -1
- package/dist/engine/contracts/lighting.d.ts +33 -1
- package/dist/engine/contracts/lighting.d.ts.map +1 -1
- package/dist/engine/contracts/lighting.js +13 -1
- package/dist/engine/contracts/lighting.js.map +1 -1
- package/dist/engine/contracts/looks.d.ts +57 -1
- package/dist/engine/contracts/looks.d.ts.map +1 -1
- package/dist/engine/contracts/looks.js.map +1 -1
- package/dist/engine/contracts/materials.d.ts +25 -0
- package/dist/engine/contracts/materials.d.ts.map +1 -1
- package/dist/engine/contracts/materials.js +4 -1
- package/dist/engine/contracts/materials.js.map +1 -1
- package/dist/engine/contracts/post.d.ts +14 -0
- package/dist/engine/contracts/post.d.ts.map +1 -1
- package/dist/engine/contracts/post.js +2 -0
- package/dist/engine/contracts/post.js.map +1 -1
- package/dist/engine/instances-model/CrowdKit.d.ts +231 -0
- package/dist/engine/instances-model/CrowdKit.d.ts.map +1 -0
- package/dist/engine/instances-model/CrowdKit.js +496 -0
- package/dist/engine/instances-model/CrowdKit.js.map +1 -0
- package/dist/engine/lanes/prd02.d.ts +36 -2
- package/dist/engine/lanes/prd02.d.ts.map +1 -1
- package/dist/engine/lanes/prd02.js +120 -7
- package/dist/engine/lanes/prd02.js.map +1 -1
- package/dist/engine/lanes/prd03.d.ts.map +1 -1
- package/dist/engine/lanes/prd03.js +9 -1
- package/dist/engine/lanes/prd03.js.map +1 -1
- package/dist/engine/lanes/prd07.d.ts.map +1 -1
- package/dist/engine/lanes/prd07.js +12 -7
- package/dist/engine/lanes/prd07.js.map +1 -1
- package/dist/engine/production-runtime/GlbResourceCache.d.ts +140 -0
- package/dist/engine/production-runtime/GlbResourceCache.d.ts.map +1 -0
- package/dist/engine/production-runtime/GlbResourceCache.js +237 -0
- package/dist/engine/production-runtime/GlbResourceCache.js.map +1 -0
- package/dist/engine/production-runtime/ModelMaterialOverrides.d.ts +53 -2
- package/dist/engine/production-runtime/ModelMaterialOverrides.d.ts.map +1 -1
- package/dist/engine/production-runtime/ModelMaterialOverrides.js +142 -1
- package/dist/engine/production-runtime/ModelMaterialOverrides.js.map +1 -1
- package/dist/engine/production-runtime/TypedGLBActor.d.ts +55 -0
- package/dist/engine/production-runtime/TypedGLBActor.d.ts.map +1 -1
- package/dist/engine/production-runtime/TypedGLBActor.js +205 -3
- package/dist/engine/production-runtime/TypedGLBActor.js.map +1 -1
- package/dist/engine/production-runtime/actor/ModelTextureShare.d.ts.map +1 -1
- package/dist/engine/production-runtime/actor/ModelTextureShare.js +5 -2
- package/dist/engine/production-runtime/actor/ModelTextureShare.js.map +1 -1
- package/dist/engine/production-runtime/actor/TypedGLBActorMaterials.d.ts.map +1 -1
- package/dist/engine/production-runtime/actor/TypedGLBActorMaterials.js +10 -1
- package/dist/engine/production-runtime/actor/TypedGLBActorMaterials.js.map +1 -1
- package/dist/engine/production-runtime/effects/EffectNodeLowering.d.ts +55 -0
- package/dist/engine/production-runtime/effects/EffectNodeLowering.d.ts.map +1 -1
- package/dist/engine/production-runtime/effects/EffectNodeLowering.js +71 -7
- package/dist/engine/production-runtime/effects/EffectNodeLowering.js.map +1 -1
- package/dist/engine/production-runtime/effects/FlipbookAtlas.d.ts +85 -0
- package/dist/engine/production-runtime/effects/FlipbookAtlas.d.ts.map +1 -1
- package/dist/engine/production-runtime/effects/FlipbookAtlas.js +164 -0
- package/dist/engine/production-runtime/effects/FlipbookAtlas.js.map +1 -1
- package/dist/engine/production-runtime/effects/LiveAtmosphere.d.ts +37 -6
- package/dist/engine/production-runtime/effects/LiveAtmosphere.d.ts.map +1 -1
- package/dist/engine/production-runtime/effects/LiveAtmosphere.js +93 -10
- package/dist/engine/production-runtime/effects/LiveAtmosphere.js.map +1 -1
- package/dist/engine/production-runtime/effects/ProductionEffectSystem.d.ts +71 -1
- package/dist/engine/production-runtime/effects/ProductionEffectSystem.d.ts.map +1 -1
- package/dist/engine/production-runtime/effects/ProductionEffectSystem.js +356 -6
- package/dist/engine/production-runtime/effects/ProductionEffectSystem.js.map +1 -1
- package/dist/engine/production-runtime/world/WaterRuntime.d.ts +9 -0
- package/dist/engine/production-runtime/world/WaterRuntime.d.ts.map +1 -1
- package/dist/engine/production-runtime/world/WaterRuntime.js +27 -11
- package/dist/engine/production-runtime/world/WaterRuntime.js.map +1 -1
- package/dist/engine/production-runtime/world/WorldFramePasses.d.ts +11 -1
- package/dist/engine/production-runtime/world/WorldFramePasses.d.ts.map +1 -1
- package/dist/engine/production-runtime/world/WorldFramePasses.js +37 -1
- package/dist/engine/production-runtime/world/WorldFramePasses.js.map +1 -1
- package/dist/engine/public/index.d.ts +22 -0
- package/dist/engine/public/index.d.ts.map +1 -1
- package/dist/engine/public/index.js +14 -0
- package/dist/engine/public/index.js.map +1 -1
- package/dist/game/art/define.d.ts +1 -1
- package/dist/game/art/define.d.ts.map +1 -1
- package/dist/game/art/define.js +1 -1
- package/dist/game/art/define.js.map +1 -1
- package/dist/game/fonts/register.d.ts +16 -1
- package/dist/game/fonts/register.d.ts.map +1 -1
- package/dist/game/fonts/register.js +18 -7
- package/dist/game/fonts/register.js.map +1 -1
- package/dist/game/hud/themes.d.ts +33 -8
- package/dist/game/hud/themes.d.ts.map +1 -1
- package/dist/game/hud/themes.js +125 -22
- package/dist/game/hud/themes.js.map +1 -1
- package/dist/game/index.d.ts +4 -2
- package/dist/game/index.d.ts.map +1 -1
- package/dist/game/index.js +2 -1
- package/dist/game/index.js.map +1 -1
- package/dist/game/juice/audioReactive.d.ts +42 -0
- package/dist/game/juice/audioReactive.d.ts.map +1 -0
- package/dist/game/juice/audioReactive.js +68 -0
- package/dist/game/juice/audioReactive.js.map +1 -0
- package/dist/game/styles/themes/arcade-neon.css +2 -1
- package/dist/game/styles/themes/fighting.css +2 -1
- package/dist/game/styles/themes/ink-scroll.css +15 -0
- package/dist/game/styles/themes/motorsport.css +2 -1
- package/dist/game/styles/themes/plain.css +2 -1
- package/dist/game/styles/themes/sci-fi-telemetry.css +2 -1
- package/dist/game/styles/themes/sky-expedition.css +15 -0
- package/dist/game/styles/themes/sports-broadcast.css +2 -1
- package/dist/game/styles/themes/storybook.css +15 -0
- package/dist/game/styles/themes/tabletop.css +2 -1
- package/dist/game/styles.css +3 -1
- package/dist/rendering/ClusteredForwardLighting.d.ts.map +1 -1
- package/dist/rendering/ClusteredForwardLighting.js +3 -1
- package/dist/rendering/ClusteredForwardLighting.js.map +1 -1
- package/dist/rendering/DepthPass.d.ts +25 -0
- package/dist/rendering/DepthPass.d.ts.map +1 -1
- package/dist/rendering/DepthPass.js +149 -1
- package/dist/rendering/DepthPass.js.map +1 -1
- package/dist/rendering/ForwardPass.d.ts +84 -0
- package/dist/rendering/ForwardPass.d.ts.map +1 -1
- package/dist/rendering/ForwardPass.js +236 -12
- package/dist/rendering/ForwardPass.js.map +1 -1
- package/dist/rendering/LightUniforms.d.ts +12 -0
- package/dist/rendering/LightUniforms.d.ts.map +1 -1
- package/dist/rendering/LightUniforms.js +9 -1
- package/dist/rendering/LightUniforms.js.map +1 -1
- package/dist/rendering/atmosphere/CloudLayer.d.ts +15 -0
- package/dist/rendering/atmosphere/CloudLayer.d.ts.map +1 -1
- package/dist/rendering/atmosphere/CloudLayer.js +27 -5
- package/dist/rendering/atmosphere/CloudLayer.js.map +1 -1
- package/dist/rendering/atmosphere/GradientSky.d.ts +3 -3
- package/dist/rendering/atmosphere/GradientSky.d.ts.map +1 -1
- package/dist/rendering/atmosphere/GradientSky.js +20 -9
- package/dist/rendering/atmosphere/GradientSky.js.map +1 -1
- package/dist/rendering/atmosphere/HeightFog.d.ts.map +1 -1
- package/dist/rendering/atmosphere/HeightFog.js +9 -0
- package/dist/rendering/atmosphere/HeightFog.js.map +1 -1
- package/dist/rendering/atmosphere/SkyBackgroundPass.d.ts +11 -0
- package/dist/rendering/atmosphere/SkyBackgroundPass.d.ts.map +1 -1
- package/dist/rendering/atmosphere/SkyBackgroundPass.js +40 -7
- package/dist/rendering/atmosphere/SkyBackgroundPass.js.map +1 -1
- package/dist/rendering/atmosphere/StarField.d.ts +21 -0
- package/dist/rendering/atmosphere/StarField.d.ts.map +1 -1
- package/dist/rendering/atmosphere/StarField.js +24 -1
- package/dist/rendering/atmosphere/StarField.js.map +1 -1
- package/dist/rendering/atmosphere/sky.glsl.d.ts.map +1 -1
- package/dist/rendering/atmosphere/sky.glsl.js +8 -0
- package/dist/rendering/atmosphere/sky.glsl.js.map +1 -1
- package/dist/rendering/contracts/flags.state.d.ts.map +1 -1
- package/dist/rendering/contracts/flags.state.js +19 -0
- package/dist/rendering/contracts/flags.state.js.map +1 -1
- package/dist/rendering/forward/Lighting.d.ts +7 -1
- package/dist/rendering/forward/Lighting.d.ts.map +1 -1
- package/dist/rendering/forward/Lighting.js +24 -1
- package/dist/rendering/forward/Lighting.js.map +1 -1
- package/dist/rendering/forward/Velocity.d.ts +8 -0
- package/dist/rendering/forward/Velocity.d.ts.map +1 -1
- package/dist/rendering/forward/Velocity.js +10 -0
- package/dist/rendering/forward/Velocity.js.map +1 -1
- package/dist/rendering/lanes/prd03.d.ts +1 -1
- package/dist/rendering/lanes/prd03.d.ts.map +1 -1
- package/dist/rendering/lanes/prd03.js +6 -1
- package/dist/rendering/lanes/prd03.js.map +1 -1
- package/dist/rendering/lanes/prd07.d.ts.map +1 -1
- package/dist/rendering/lanes/prd07.js +5 -2
- package/dist/rendering/lanes/prd07.js.map +1 -1
- package/dist/rendering/post/DisplayLutCache.d.ts +10 -2
- package/dist/rendering/post/DisplayLutCache.d.ts.map +1 -1
- package/dist/rendering/post/DisplayLutCache.js +15 -3
- package/dist/rendering/post/DisplayLutCache.js.map +1 -1
- package/dist/rendering/post/PostGraph.d.ts +23 -0
- package/dist/rendering/post/PostGraph.d.ts.map +1 -1
- package/dist/rendering/post/PostGraph.js.map +1 -1
- package/dist/rendering/post/PostQualityTiers.d.ts +36 -0
- package/dist/rendering/post/PostQualityTiers.d.ts.map +1 -1
- package/dist/rendering/post/PostQualityTiers.js +75 -0
- package/dist/rendering/post/PostQualityTiers.js.map +1 -1
- package/dist/rendering/post/chunks/velocity.glsl.d.ts +7 -0
- package/dist/rendering/post/chunks/velocity.glsl.d.ts.map +1 -1
- package/dist/rendering/post/chunks/velocity.glsl.js +12 -1
- package/dist/rendering/post/chunks/velocity.glsl.js.map +1 -1
- package/dist/rendering/post/shaders/displayGrade.glsl.d.ts +15 -1
- package/dist/rendering/post/shaders/displayGrade.glsl.d.ts.map +1 -1
- package/dist/rendering/post/shaders/displayGrade.glsl.js +26 -2
- package/dist/rendering/post/shaders/displayGrade.glsl.js.map +1 -1
- package/dist/rendering/post/shaders/dof.glsl.d.ts +11 -1
- package/dist/rendering/post/shaders/dof.glsl.d.ts.map +1 -1
- package/dist/rendering/post/shaders/dof.glsl.js +22 -0
- package/dist/rendering/post/shaders/dof.glsl.js.map +1 -1
- package/dist/rendering/post/shaders/finalize.glsl.d.ts +1 -1
- package/dist/rendering/post/shaders/finalize.glsl.d.ts.map +1 -1
- package/dist/rendering/post/shaders/finalize.glsl.js +3 -2
- package/dist/rendering/post/shaders/finalize.glsl.js.map +1 -1
- package/dist/rendering/post/shaders/godrays.glsl.d.ts +24 -1
- package/dist/rendering/post/shaders/godrays.glsl.d.ts.map +1 -1
- package/dist/rendering/post/shaders/godrays.glsl.js +45 -5
- package/dist/rendering/post/shaders/godrays.glsl.js.map +1 -1
- package/dist/rendering/post/shaders/hdrGrade.glsl.d.ts +66 -0
- package/dist/rendering/post/shaders/hdrGrade.glsl.d.ts.map +1 -0
- package/dist/rendering/post/shaders/hdrGrade.glsl.js +159 -0
- package/dist/rendering/post/shaders/hdrGrade.glsl.js.map +1 -0
- package/dist/rendering/post/shaders/ssr.glsl.d.ts +39 -0
- package/dist/rendering/post/shaders/ssr.glsl.d.ts.map +1 -0
- package/dist/rendering/post/shaders/ssr.glsl.js +163 -0
- package/dist/rendering/post/shaders/ssr.glsl.js.map +1 -0
- package/dist/rendering/post/v2Stages.d.ts +53 -0
- package/dist/rendering/post/v2Stages.d.ts.map +1 -1
- package/dist/rendering/post/v2Stages.js +314 -23
- package/dist/rendering/post/v2Stages.js.map +1 -1
- package/dist/rendering/postprocess/NativeBloomPyramid.d.ts +19 -0
- package/dist/rendering/postprocess/NativeBloomPyramid.d.ts.map +1 -1
- package/dist/rendering/postprocess/NativeBloomPyramid.js +37 -0
- package/dist/rendering/postprocess/NativeBloomPyramid.js.map +1 -1
- package/dist/rendering/program/ProgramGenerator.d.ts.map +1 -1
- package/dist/rendering/program/ProgramGenerator.js +12 -1
- package/dist/rendering/program/ProgramGenerator.js.map +1 -1
- package/dist/rendering/program/chunks/shadow_forward.glsl.d.ts +12 -0
- package/dist/rendering/program/chunks/shadow_forward.glsl.d.ts.map +1 -1
- package/dist/rendering/program/chunks/shadow_forward.glsl.js +57 -0
- package/dist/rendering/program/chunks/shadow_forward.glsl.js.map +1 -1
- package/dist/rendering/renderer/Background.d.ts.map +1 -1
- package/dist/rendering/renderer/Background.js +26 -2
- package/dist/rendering/renderer/Background.js.map +1 -1
- package/dist/rendering/renderer/FrameGraph.d.ts +8 -0
- package/dist/rendering/renderer/FrameGraph.d.ts.map +1 -1
- package/dist/rendering/renderer/FrameGraph.js +46 -7
- package/dist/rendering/renderer/FrameGraph.js.map +1 -1
- package/dist/rendering/renderer/OutlineTargets.d.ts +99 -0
- package/dist/rendering/renderer/OutlineTargets.d.ts.map +1 -0
- package/dist/rendering/renderer/OutlineTargets.js +286 -0
- package/dist/rendering/renderer/OutlineTargets.js.map +1 -0
- package/dist/rendering/renderer/PostprocessExecution.d.ts +5 -0
- package/dist/rendering/renderer/PostprocessExecution.d.ts.map +1 -1
- package/dist/rendering/renderer/PostprocessExecution.js +70 -4
- package/dist/rendering/renderer/PostprocessExecution.js.map +1 -1
- package/dist/rendering/renderer/postSkipped.d.ts +6 -0
- package/dist/rendering/renderer/postSkipped.d.ts.map +1 -1
- package/dist/rendering/renderer/postSkipped.js +8 -0
- package/dist/rendering/renderer/postSkipped.js.map +1 -1
- package/dist/rendering/shaders/chunks/author/ibl.glsl.d.ts +20 -0
- package/dist/rendering/shaders/chunks/author/ibl.glsl.d.ts.map +1 -0
- package/dist/rendering/shaders/chunks/author/ibl.glsl.js +84 -0
- package/dist/rendering/shaders/chunks/author/ibl.glsl.js.map +1 -0
- package/dist/rendering/shaders/chunks/author/index.d.ts +3 -1
- package/dist/rendering/shaders/chunks/author/index.d.ts.map +1 -1
- package/dist/rendering/shaders/chunks/author/index.js +38 -3
- package/dist/rendering/shaders/chunks/author/index.js.map +1 -1
- package/dist/rendering/shaders/chunks/author/lights.glsl.d.ts +16 -0
- package/dist/rendering/shaders/chunks/author/lights.glsl.d.ts.map +1 -0
- package/dist/rendering/shaders/chunks/author/lights.glsl.js +112 -0
- package/dist/rendering/shaders/chunks/author/lights.glsl.js.map +1 -0
- package/dist/rendering/shaders/chunks/author/shadow.glsl.d.ts +16 -2
- package/dist/rendering/shaders/chunks/author/shadow.glsl.d.ts.map +1 -1
- package/dist/rendering/shaders/chunks/author/shadow.glsl.js +46 -2
- package/dist/rendering/shaders/chunks/author/shadow.glsl.js.map +1 -1
- package/dist/rendering/shaders/chunks/instance_color_target.glsl.d.ts +34 -0
- package/dist/rendering/shaders/chunks/instance_color_target.glsl.d.ts.map +1 -0
- package/dist/rendering/shaders/chunks/instance_color_target.glsl.js +101 -0
- package/dist/rendering/shaders/chunks/instance_color_target.glsl.js.map +1 -0
- package/dist/rendering/shaders/chunks/rim.glsl.d.ts +37 -0
- package/dist/rendering/shaders/chunks/rim.glsl.d.ts.map +1 -0
- package/dist/rendering/shaders/chunks/rim.glsl.js +50 -0
- package/dist/rendering/shaders/chunks/rim.glsl.js.map +1 -0
- package/dist/rendering/shadows/Prd02ShadowBridge.d.ts +26 -3
- package/dist/rendering/shadows/Prd02ShadowBridge.d.ts.map +1 -1
- package/dist/rendering/shadows/Prd02ShadowBridge.js +134 -8
- package/dist/rendering/shadows/Prd02ShadowBridge.js.map +1 -1
- package/dist/rendering/shadows/Prd02ShadowsContributor.d.ts.map +1 -1
- package/dist/rendering/shadows/Prd02ShadowsContributor.js +4 -16
- package/dist/rendering/shadows/Prd02ShadowsContributor.js.map +1 -1
- package/dist/rendering/vfx/VfxAtlas.d.ts +10 -0
- package/dist/rendering/vfx/VfxAtlas.d.ts.map +1 -1
- package/dist/rendering/vfx/VfxAtlas.js +18 -3
- package/dist/rendering/vfx/VfxAtlas.js.map +1 -1
- package/dist/rendering/webgl2/LegacyPost.d.ts +9 -1
- package/dist/rendering/webgl2/LegacyPost.d.ts.map +1 -1
- package/dist/rendering/webgl2/LegacyPost.js +23 -7
- package/dist/rendering/webgl2/LegacyPost.js.map +1 -1
- package/dist/rendering/webgl2/MultiDraw.d.ts.map +1 -1
- package/dist/rendering/webgl2/MultiDraw.js +51 -1
- package/dist/rendering/webgl2/MultiDraw.js.map +1 -1
- package/dist/rendering/world/vegetation/WindField.d.ts.map +1 -1
- package/dist/rendering/world/vegetation/WindField.js +4 -1
- package/dist/rendering/world/vegetation/WindField.js.map +1 -1
- package/dist/rendering/world/water/ReflectionViewPass.d.ts.map +1 -1
- package/dist/rendering/world/water/ReflectionViewPass.js +12 -2
- package/dist/rendering/world/water/ReflectionViewPass.js.map +1 -1
- package/dist/rendering/world/water/SceneCopyFallback.d.ts.map +1 -1
- package/dist/rendering/world/water/SceneCopyFallback.js +9 -2
- package/dist/rendering/world/water/SceneCopyFallback.js.map +1 -1
- package/dist/rendering/world/water/WaterMaterial.d.ts.map +1 -1
- package/dist/rendering/world/water/WaterMaterial.js +8 -2
- package/dist/rendering/world/water/WaterMaterial.js.map +1 -1
- package/package.json +25 -25
- package/templates/cinematic-scene/package.json +2 -2
- package/templates/mini-game/package.json +2 -2
- package/templates/product-viewer/package.json +2 -2
- package/templates/production-asset-inspector/package.json +1 -1
- package/templates/production-material-studio/package.json +1 -1
- package/templates/production-product-configurator/package.json +1 -1
- package/templates/production-product-viewer/package.json +1 -1
|
@@ -37,9 +37,37 @@ import { packA3DEnvironmentUniforms } from "./environment/EnvUniforms.js";
|
|
|
37
37
|
import { dfgLutBinding, dfgLutTexture } from "./program/DFGLut.js";
|
|
38
38
|
// PR 0b-2 re-imports for moved carve-out modules (CONTRACTS.md §3.3).
|
|
39
39
|
import { SkinningPaletteUploadManager, applyGpuMorphUniforms, resolveRenderGeometry } from "./forward/Deform.js";
|
|
40
|
-
import { FORWARD_DIRECT_LIGHT_CAPACITY, applyClusteredLightingUniforms, applyForwardShadowMapUniforms, resolveForwardClusteredLighting, selectForwardShadowMap } from "./forward/Lighting.js";
|
|
40
|
+
import { FORWARD_DIRECT_LIGHT_CAPACITY, applyClusteredLightingUniforms, applyForwardLocalShadowUniforms, applyForwardShadowMapUniforms, resolveForwardClusteredLighting, selectForwardShadowMap } from "./forward/Lighting.js";
|
|
41
41
|
import { flushMultiDrawQueue, submitDraw } from "./forward/DrawSubmit.js";
|
|
42
42
|
import { bindVelocityUniforms } from "./forward/Velocity.js";
|
|
43
|
+
import { A3D_INSTANCE_EMISSIVE_ATTRIBUTE, materialInstanceColorTarget, registerInstanceColorTargetFeature } from "./shaders/chunks/instance_color_target.glsl.js";
|
|
44
|
+
/**
|
|
45
|
+
* GU47 E-D: the `prd04.instanceColorTarget` ShaderFeature. Registered when this module loads, so the renderer warmup
|
|
46
|
+
* sees it, and again (idempotently) by every ForwardPass in case a module cycle deferred the first call. It never selects
|
|
47
|
+
* for a material that does not carry its parameter, so existing programs are unchanged. (The rim term is the existing
|
|
48
|
+
* PRD-04 `prd04.rim` feature, registered by `lanes/prd04.ts`; see `shaders/chunks/rim.glsl.ts`.)
|
|
49
|
+
*/
|
|
50
|
+
function ensureGu47ForwardFeatures() {
|
|
51
|
+
registerInstanceColorTargetFeature();
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
ensureGu47ForwardFeatures();
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
// contracts/program not initialised yet (import cycle): the ForwardPass constructor registers them.
|
|
58
|
+
}
|
|
59
|
+
const forwardDrawHooks = [];
|
|
60
|
+
/** Registers a per-draw uniform hook; returns its unregister function. A duplicate id throws. */
|
|
61
|
+
export function registerForwardDrawHook(hook) {
|
|
62
|
+
if (forwardDrawHooks.some((entry) => entry.id === hook.id))
|
|
63
|
+
throw new Error(`FORWARD_DRAW_HOOK_DUPLICATE:${hook.id}`);
|
|
64
|
+
forwardDrawHooks.push(hook);
|
|
65
|
+
return () => {
|
|
66
|
+
const index = forwardDrawHooks.indexOf(hook);
|
|
67
|
+
if (index >= 0)
|
|
68
|
+
forwardDrawHooks.splice(index, 1);
|
|
69
|
+
};
|
|
70
|
+
}
|
|
43
71
|
/** Joints addressable through the uniform-array palette. Re-exported for shaders. */
|
|
44
72
|
export const MAX_UNIFORM_SKINNING_JOINTS = SHADER_MAX_UNIFORM_SKINNING_JOINTS;
|
|
45
73
|
/**
|
|
@@ -52,6 +80,29 @@ export const MAX_SKINNING_JOINTS = 1024;
|
|
|
52
80
|
export const MAX_GPU_MORPH_VERTICES = 64;
|
|
53
81
|
export const MAX_GPU_MORPH_TARGETS = 4;
|
|
54
82
|
export const MAX_GPU_INSTANCES = 64;
|
|
83
|
+
/** Most PRD-02 local-light atlas tiles a frame binds (`shadows/ShadowSystem.ts` MAX_LOCAL_TILES). */
|
|
84
|
+
export const MAX_FORWARD_LOCAL_SHADOW_TILES = 6;
|
|
85
|
+
/**
|
|
86
|
+
* GU47 eint (EB-3): the lights as the forward programs see them. On a PRD-02 bridge frame (`localShadows` set) a
|
|
87
|
+
* shadow-casting spot / point light keeps lighting but drops its `castsShadow` gate (the bound forward map is the
|
|
88
|
+
* sun's), and carries `localShadowSlot` when it got atlas tiles. Any other frame returns `lights` itself.
|
|
89
|
+
*/
|
|
90
|
+
export function forwardShadedLights(lights, localShadows) {
|
|
91
|
+
if (!lights)
|
|
92
|
+
return [];
|
|
93
|
+
if (!localShadows)
|
|
94
|
+
return lights;
|
|
95
|
+
let changed = false;
|
|
96
|
+
const shaded = lights.map((light) => {
|
|
97
|
+
if (!light.castsShadow || (light.kind !== "spot" && light.kind !== "point"))
|
|
98
|
+
return light;
|
|
99
|
+
changed = true;
|
|
100
|
+
const slot = localShadows.slots.get(light);
|
|
101
|
+
const out = { ...light, castsShadow: false, ...(slot === undefined ? {} : { localShadowSlot: slot }) };
|
|
102
|
+
return out;
|
|
103
|
+
});
|
|
104
|
+
return changed ? shaded : lights;
|
|
105
|
+
}
|
|
55
106
|
export const MAX_FORWARD_SHADOW_PCF_SAMPLES = 32;
|
|
56
107
|
const INSTANCE_MATRIX_ATTRIBUTE_NAMES = [
|
|
57
108
|
"a_instanceMatrix0",
|
|
@@ -92,14 +143,31 @@ export class ForwardPass extends BaseRenderPass {
|
|
|
92
143
|
super(options.framePass?.name ?? "forward", [...(options.inputColorResource ? [options.inputColorResource] : []), ...(options.framePass?.reads ?? [])], options.framePass?.writes ?? ["color"]);
|
|
93
144
|
this.options = options;
|
|
94
145
|
this.shaderLibrary = options.shaderLibrary ?? createLeanCoreShaderLibrary();
|
|
146
|
+
ensureGu47ForwardFeatures();
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* GU47 E-D: per-execute values the `material.custom` built-ins share (`u_lightCount`/`u_lightData` for
|
|
150
|
+
* `#include <a3d_lights>`, `u_a3dInverseViewProjection` for `a3dFragWorldPosition`), computed once on first use.
|
|
151
|
+
*/
|
|
152
|
+
customFrame = {};
|
|
153
|
+
customFrameCache = {
|
|
154
|
+
lights: () => (this.customFrame.lights ??= LightUniforms.pack(this.shadedLights())),
|
|
155
|
+
inverseViewProjection: () => (this.customFrame.inverseViewProjection ??= customShaderInverseViewProjection(this.options))
|
|
156
|
+
};
|
|
157
|
+
/** GU47 eint (EB-3): `forwardShadedLights` of this pass, computed once per execute (packed per draw). */
|
|
158
|
+
shadedLightsMemo;
|
|
159
|
+
shadedLights() {
|
|
160
|
+
return (this.shadedLightsMemo ??= forwardShadedLights(this.options.lights, this.options.shadowMap?.localShadows));
|
|
95
161
|
}
|
|
96
162
|
execute(context) {
|
|
163
|
+
this.customFrame = {};
|
|
164
|
+
this.shadedLightsMemo = undefined;
|
|
97
165
|
this.skinningPaletteUploads.beginFrame();
|
|
98
166
|
this.frameWidth = context.width;
|
|
99
167
|
this.frameHeight = context.height;
|
|
100
168
|
this.contactMaskScope = { device: context.device, width: context.width, height: context.height, cameraPosition: this.options.cameraPosition };
|
|
101
169
|
this.beginFramePools(context.device);
|
|
102
|
-
this.clusteredLighting = resolveForwardClusteredLighting(this.
|
|
170
|
+
this.clusteredLighting = resolveForwardClusteredLighting(this.shadedLights(), context.width, context.height, this.options.cameraViewProjectionMatrix);
|
|
103
171
|
const flags = rendererQrFlags(context.device);
|
|
104
172
|
if (qrGeneratedProgramsOn(flags)) {
|
|
105
173
|
const auraFrame = rendererAuraFrame(context.device, flags);
|
|
@@ -190,17 +258,20 @@ export class ForwardPass extends BaseRenderPass {
|
|
|
190
258
|
}
|
|
191
259
|
return;
|
|
192
260
|
}
|
|
261
|
+
// GU47 E-D: a `material.custom` vertex shader that reads `instanceMatrix` / `instanceColor` draws every instance in
|
|
262
|
+
// one call from the same per-instance attribute buffer the generated path uses (no split, no per-instance expansion).
|
|
263
|
+
const authorInstancing = item.instanceTransforms !== undefined && !generated && supportsAuthorInstancing(shader);
|
|
193
264
|
// Phase 6: generated programs only know attribute-matrix instancing — the
|
|
194
265
|
// uniform fallback (`u_instanceMatrices[64]`) exists only in the frozen
|
|
195
266
|
// legacy library, so the >64 split and no-support expansion never apply
|
|
196
267
|
// on this path.
|
|
197
|
-
if (item.instanceTransforms && !generated && !supportsInstanceAttributes(shader) && instanceTransformCount(item) > MAX_GPU_INSTANCES) {
|
|
268
|
+
if (item.instanceTransforms && !generated && !authorInstancing && !supportsInstanceAttributes(shader) && instanceTransformCount(item) > MAX_GPU_INSTANCES) {
|
|
198
269
|
for (const batch of splitInstanceTransforms(item.instanceTransforms)) {
|
|
199
270
|
this.drawItem(device, { ...item, instanceTransforms: batch });
|
|
200
271
|
}
|
|
201
272
|
return;
|
|
202
273
|
}
|
|
203
|
-
if (item.instanceTransforms && !generated && !supportsInstanceAttributes(shader) && !supportsInstanceUniforms(shader)) {
|
|
274
|
+
if (item.instanceTransforms && !generated && !authorInstancing && !supportsInstanceAttributes(shader) && !supportsInstanceUniforms(shader)) {
|
|
204
275
|
for (const expanded of expandInstancedRenderItem(item)) {
|
|
205
276
|
this.drawItem(device, expanded);
|
|
206
277
|
}
|
|
@@ -262,6 +333,8 @@ export class ForwardPass extends BaseRenderPass {
|
|
|
262
333
|
if (generated)
|
|
263
334
|
applyGeneratedFogUniforms(itemFog, shader, uniforms);
|
|
264
335
|
applyForwardShadowMapUniforms(selectForwardShadowMap(this.options.shadowMap, item, this.options.cameraViewMatrix, this.options.cameraPosition), item, shader, uniforms, this.contactMaskScope);
|
|
336
|
+
// GU47 eint (EB-3): PRD-02 local-light tiles, bound only to programs that declare them (generated, localShadows > 0).
|
|
337
|
+
applyForwardLocalShadowUniforms(this.options.shadowMap?.localShadows, item, shader, uniforms);
|
|
265
338
|
applyOutputColorSpaceUniform(this.options.outputColorSpace ?? "srgb", item, shader, uniforms);
|
|
266
339
|
applyCameraUniforms(this.options.cameraPosition, item, shader, uniforms);
|
|
267
340
|
applyAlphaCutoffUniform(item, shader, uniforms);
|
|
@@ -271,7 +344,19 @@ export class ForwardPass extends BaseRenderPass {
|
|
|
271
344
|
// may declare (u_time/u_resolution/u_viewMatrix/u_projectionMatrix) — bound
|
|
272
345
|
// only when the program actually reflects them, mirroring applyCameraUniforms.
|
|
273
346
|
applyCustomShaderFrameUniforms(this.options, this.frameWidth, this.frameHeight, shader, uniforms);
|
|
347
|
+
// GU47 E-D: `a3d_lights` / sun / hemisphere / fog built-ins for `material.custom` programs (reflection-guarded).
|
|
348
|
+
if (baseMaterial instanceof PortableShaderMaterial) {
|
|
349
|
+
applyCustomShaderLightingUniforms(this.options, itemFog, shader, uniforms, this.customFrameCache);
|
|
350
|
+
// `instanceColor` reads white unless this instanced draw carries per-instance colours.
|
|
351
|
+
if (shader.reflection.uniforms.has("u_a3dInstanceColors")) {
|
|
352
|
+
uniforms.set("u_a3dInstanceColors", authorInstancing && item.instanceColors !== undefined ? 1 : 0);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
274
355
|
bindVelocityUniforms?.(item, uniforms);
|
|
356
|
+
if (forwardDrawHooks.length > 0) {
|
|
357
|
+
for (const hook of forwardDrawHooks)
|
|
358
|
+
hook.bind(item, shader, (name, value) => uniforms.set(name, value));
|
|
359
|
+
}
|
|
275
360
|
if (generated && this.lastProgramFeatures) {
|
|
276
361
|
// C-02 `ShaderFeature.bindUniforms` for the features this draw selected.
|
|
277
362
|
bindShaderFeatureUniforms(this.lastProgramFeatures.features, rendererQrFlags(device), item, (name, value) => uniforms.set(name, value));
|
|
@@ -293,7 +378,9 @@ export class ForwardPass extends BaseRenderPass {
|
|
|
293
378
|
// a generated draw without it has no skin attributes (featuresForGeometry).
|
|
294
379
|
this.skinningPaletteUploads.bind(item, item.skinning, baseMaterial, shader, uniforms, device);
|
|
295
380
|
}
|
|
296
|
-
const instanceBinding = item.instanceTransforms ? this.applyInstanceBinding(device, item, shader, uniforms, generated) : { count: 1 };
|
|
381
|
+
const instanceBinding = item.instanceTransforms ? this.applyInstanceBinding(device, item, shader, uniforms, generated || authorInstancing) : { count: 1 };
|
|
382
|
+
if (authorInstancing)
|
|
383
|
+
uniforms.set("u_a3dInstancing", 1);
|
|
297
384
|
const gpuMorph = item.morphTargets || item.morphWeights ? applyGpuMorphUniforms(item, shader, uniforms) : false;
|
|
298
385
|
const geometry = gpuMorph ? item.geometry : resolveRenderGeometry(item);
|
|
299
386
|
// Generated programs validate their selected attributes in MaterialBinding.
|
|
@@ -357,6 +444,8 @@ export class ForwardPass extends BaseRenderPass {
|
|
|
357
444
|
}
|
|
358
445
|
const bound = slot.buffer.bind();
|
|
359
446
|
const extra = createExtraInstanceAttributeBindings(device, item, count, false);
|
|
447
|
+
// GU47 E-D: `instanceColorTarget: "emissive"` — the colours feed the emissive term only (prd04.instanceColorTarget).
|
|
448
|
+
const colorAttribute = materialInstanceColorTarget(item.material) === "emissive" ? A3D_INSTANCE_EMISSIVE_ATTRIBUTE : "a_instanceColor";
|
|
360
449
|
return {
|
|
361
450
|
count,
|
|
362
451
|
attributes: [
|
|
@@ -370,7 +459,7 @@ export class ForwardPass extends BaseRenderPass {
|
|
|
370
459
|
})),
|
|
371
460
|
...(bound.colorBuffer ? [{
|
|
372
461
|
buffer: bound.colorBuffer,
|
|
373
|
-
shaderName:
|
|
462
|
+
shaderName: colorAttribute,
|
|
374
463
|
components: 4,
|
|
375
464
|
offset: 0,
|
|
376
465
|
stride: 16,
|
|
@@ -386,7 +475,7 @@ export class ForwardPass extends BaseRenderPass {
|
|
|
386
475
|
if (!baseMaterial.requiredUniforms.includes("u_lightCount") || !baseMaterial.requiredUniforms.includes("u_lightData")) {
|
|
387
476
|
return;
|
|
388
477
|
}
|
|
389
|
-
const packed = LightUniforms.pack(this.
|
|
478
|
+
const packed = LightUniforms.pack(this.shadedLights());
|
|
390
479
|
if (material instanceof MaterialInstance) {
|
|
391
480
|
material.setOverride("u_lightCount", packed.lightCount);
|
|
392
481
|
material.setOverride("u_lightData", packed.data);
|
|
@@ -521,7 +610,8 @@ export class ForwardPass extends BaseRenderPass {
|
|
|
521
610
|
// Phase 6: instancing is item-driven — a material's own feature record
|
|
522
611
|
// only declares it when authored instanced; the draw's program must
|
|
523
612
|
// cover the union (attribute matrices are the only generated path).
|
|
524
|
-
|
|
613
|
+
// GU47 E-D: `instanceColorTarget: "emissive"` keeps the base colour (no USE_INSTANCING_COLOR base multiply).
|
|
614
|
+
...(item?.instanceTransforms ? { instancing: { color: item.instanceColors !== undefined && materialInstanceColorTarget(material) !== "emissive" } } : {}),
|
|
525
615
|
// #1140: a per-item probe cube (PRD-02 S12) is sampled as a cube.
|
|
526
616
|
...(item?.environmentCube?.texture?.dimension === "cube" ? { environment: "pmrem-cube" } : {}),
|
|
527
617
|
backgroundCoverage: this.options.backgroundCoverage === true,
|
|
@@ -742,7 +832,13 @@ export function forwardPassFeatureAxes(options, clustered) {
|
|
|
742
832
|
hemisphere: env?.proceduralMap !== undefined
|
|
743
833
|
},
|
|
744
834
|
shadows: options.shadowMap
|
|
745
|
-
? {
|
|
835
|
+
? {
|
|
836
|
+
cascades: Math.max(1, Math.min(4, options.shadowMap.cascades?.length ?? 1)),
|
|
837
|
+
pcfTaps: 4,
|
|
838
|
+
// GU47 eint (EB-3): one variant for any tile count, so lights entering / leaving do not recompile.
|
|
839
|
+
localShadows: (options.shadowMap.localShadows?.slots.size ?? 0) > 0 ? MAX_FORWARD_LOCAL_SHADOW_TILES : 0,
|
|
840
|
+
contact: false
|
|
841
|
+
}
|
|
746
842
|
: { cascades: 0, pcfTaps: 4, localShadows: 0, contact: false },
|
|
747
843
|
environment:
|
|
748
844
|
// #1140: the generated env chunk samples exactly the texture it was
|
|
@@ -1782,15 +1878,143 @@ function applyCustomShaderFrameUniforms(options, frameWidth, frameHeight, shader
|
|
|
1782
1878
|
uniforms.set("u_viewMatrix", toMat4Uniform(options.customFrameCamera?.viewMatrix ?? options.cameraViewMatrix ?? identityMatrix(), "cameraViewMatrix"));
|
|
1783
1879
|
}
|
|
1784
1880
|
if (reflected.has("u_a3dSunDirection") && !uniforms.has("u_a3dSunDirection")) {
|
|
1785
|
-
// `#include <a3d_shadow
|
|
1786
|
-
|
|
1787
|
-
const d =
|
|
1881
|
+
// `#include <a3d_shadow>` and the GU47 sun built-ins: direction from the surface toward the sun (the shadow-casting
|
|
1882
|
+
// directional light, else the first directional light; straight up when the scene has none).
|
|
1883
|
+
const d = customShaderSun(options.lights)?.direction ?? [0, -1, 0];
|
|
1788
1884
|
const length = Math.hypot(d[0], d[1], d[2]) || 1;
|
|
1789
1885
|
uniforms.set("u_a3dSunDirection", [-d[0] / length, -d[1] / length, -d[2] / length]);
|
|
1790
1886
|
}
|
|
1791
1887
|
if (reflected.has("u_projectionMatrix") && !uniforms.has("u_projectionMatrix")) {
|
|
1792
1888
|
uniforms.set("u_projectionMatrix", toMat4Uniform(options.customFrameCamera?.projectionMatrix ?? options.auraFrameCamera?.projectionMatrix ?? identityMatrix(), "auraFrameCamera.projectionMatrix"));
|
|
1793
1889
|
}
|
|
1890
|
+
// GU47 E-D: `instanceMatrix` / `instanceColor` read identity / white on a non-instanced draw (the instanced path sets 1).
|
|
1891
|
+
if (reflected.has("u_a3dInstancing") && !uniforms.has("u_a3dInstancing"))
|
|
1892
|
+
uniforms.set("u_a3dInstancing", 0);
|
|
1893
|
+
}
|
|
1894
|
+
/** The light the custom-shader sun built-ins describe: the shadow-casting directional light, else the first directional one. */
|
|
1895
|
+
function customShaderSun(lights) {
|
|
1896
|
+
return lights?.find((light) => light.castsShadow && light.kind === "directional") ?? lights?.find((light) => light.kind === "directional");
|
|
1897
|
+
}
|
|
1898
|
+
/** Exp2 density whose fog reaches 98% at `far`, so a linear-fog scene still gives `u_a3dFogDensity` a matching value. */
|
|
1899
|
+
const LINEAR_FOG_EXP2_EQUIVALENT = Math.sqrt(-Math.log(0.02));
|
|
1900
|
+
/**
|
|
1901
|
+
* GU47 E-D (PRD §3.1): lighting built-ins for `material.custom` programs, each bound only when the program reflects it:
|
|
1902
|
+
* - `u_a3dSunColor` (linear rgb) / `u_a3dSunIntensity`: the sun `u_a3dSunDirection` points at (0 when there is none).
|
|
1903
|
+
* - `u_a3dHemiSky` / `u_a3dHemiGround`: the authored hemisphere pair (linear rgb, premultiplied by intensity; 0 when none).
|
|
1904
|
+
* - `u_a3dFogColor` / `u_a3dFogDensity`: the scene fog for this draw (exp2 density; a linear fog gets the density that
|
|
1905
|
+
* reaches 98% at `far`; 0 when the scene has no fog or the material opts out with `fog: false`).
|
|
1906
|
+
* - `u_lightCount` / `u_lightData`: the packed direct lights `#include <a3d_lights>` loops over (same packing as the
|
|
1907
|
+
* built-in lit programs; the clustered textures are bound by `applyClusteredLightingUniforms`).
|
|
1908
|
+
* - `u_a3dInverseViewProjection`: inverse(projection * view) of the camera the other custom built-ins describe, for
|
|
1909
|
+
* `a3dFragWorldPosition()`.
|
|
1910
|
+
* - `#include <a3d_ibl>`: `u_a3dEnvAmbient` (environment colour * intensity), `u_a3dEnvSh` / `u_a3dEnvShEnabled` (the
|
|
1911
|
+
* scene probe's SH9), `u_a3dEnvSky` / `u_a3dEnvHorizon` / `u_a3dEnvGround` (procedural map * intensity) and the
|
|
1912
|
+
* equirect `u_a3dEnvMap` with `u_a3dEnvMapEnabled` / `Intensity` / `Rotation` / `MaxLod` / `Encoding` (same values the
|
|
1913
|
+
* generated programs' `u_environmentMap*` get; the white fallback with enabled 0 when the scene has none).
|
|
1914
|
+
*/
|
|
1915
|
+
export function applyCustomShaderLightingUniforms(options, fog, shader, uniforms, frame) {
|
|
1916
|
+
const reflected = shader.reflection.uniforms;
|
|
1917
|
+
const wants = (name) => reflected.has(name) && !uniforms.has(name);
|
|
1918
|
+
if (wants("u_a3dInverseViewProjection"))
|
|
1919
|
+
uniforms.set("u_a3dInverseViewProjection", frame.inverseViewProjection());
|
|
1920
|
+
applyCustomShaderEnvironmentUniforms(options.environmentLighting, wants, uniforms);
|
|
1921
|
+
if (wants("u_a3dSunColor") || wants("u_a3dSunIntensity")) {
|
|
1922
|
+
const sun = customShaderSun(options.lights);
|
|
1923
|
+
if (wants("u_a3dSunColor"))
|
|
1924
|
+
uniforms.set("u_a3dSunColor", sun ? [sun.color[0], sun.color[1], sun.color[2]] : [0, 0, 0]);
|
|
1925
|
+
if (wants("u_a3dSunIntensity"))
|
|
1926
|
+
uniforms.set("u_a3dSunIntensity", sun && Number.isFinite(sun.intensity) ? Math.max(0, sun.intensity) : 0);
|
|
1927
|
+
}
|
|
1928
|
+
const hemisphere = options.environmentLighting?.hemisphere;
|
|
1929
|
+
if (wants("u_a3dHemiSky"))
|
|
1930
|
+
uniforms.set("u_a3dHemiSky", hemisphere ? [...hemisphere.sky] : [0, 0, 0]);
|
|
1931
|
+
if (wants("u_a3dHemiGround"))
|
|
1932
|
+
uniforms.set("u_a3dHemiGround", hemisphere ? [...hemisphere.ground] : [0, 0, 0]);
|
|
1933
|
+
if (wants("u_a3dFogColor"))
|
|
1934
|
+
uniforms.set("u_a3dFogColor", fog ? Array.from(fog.color) : [0, 0, 0]);
|
|
1935
|
+
if (wants("u_a3dFogDensity")) {
|
|
1936
|
+
const density = !fog ? 0
|
|
1937
|
+
: fog.mode === "linear" ? (Number.isFinite(fog.far) && fog.far > 0 ? LINEAR_FOG_EXP2_EQUIVALENT / fog.far : 0)
|
|
1938
|
+
: Math.max(0, Number.isFinite(fog.density) ? fog.density : 0);
|
|
1939
|
+
uniforms.set("u_a3dFogDensity", density);
|
|
1940
|
+
}
|
|
1941
|
+
if (wants("u_lightCount") || wants("u_lightData")) {
|
|
1942
|
+
const packed = frame.lights();
|
|
1943
|
+
if (wants("u_lightCount"))
|
|
1944
|
+
uniforms.set("u_lightCount", packed.lightCount);
|
|
1945
|
+
if (wants("u_lightData"))
|
|
1946
|
+
uniforms.set("u_lightData", packed.data);
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
/** inverse(projection * view) of the camera `applyCustomShaderFrameUniforms` binds as `u_projectionMatrix` / `u_viewMatrix`. */
|
|
1950
|
+
export function customShaderInverseViewProjection(options) {
|
|
1951
|
+
const view = Array.from(options.customFrameCamera?.viewMatrix ?? options.cameraViewMatrix ?? identityMatrix());
|
|
1952
|
+
const projection = Array.from(options.customFrameCamera?.projectionMatrix ?? options.auraFrameCamera?.projectionMatrix ?? identityMatrix());
|
|
1953
|
+
if (view.length !== 16 || projection.length !== 16 || !isFiniteArrayLike(view) || !isFiniteArrayLike(projection))
|
|
1954
|
+
return new Float32Array(identityMatrix());
|
|
1955
|
+
try {
|
|
1956
|
+
const inverse = invertMat4(multiplyMat4(projection, view));
|
|
1957
|
+
return new Float32Array(isFiniteArrayLike(inverse) ? inverse : identityMatrix());
|
|
1958
|
+
}
|
|
1959
|
+
catch {
|
|
1960
|
+
// Singular camera (degenerate projection): `a3dFragWorldPosition` reads clip space instead of NaN.
|
|
1961
|
+
return new Float32Array(identityMatrix());
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
const ZERO_SH9 = new Float32Array(27);
|
|
1965
|
+
const CUSTOM_ENV_MAP_FALLBACK = new TextureBinding({ name: "u_a3dEnvMap", required: false });
|
|
1966
|
+
/** `#include <a3d_ibl>` uniforms (see `applyCustomShaderLightingUniforms`). */
|
|
1967
|
+
function applyCustomShaderEnvironmentUniforms(environment, wants, uniforms) {
|
|
1968
|
+
if (wants("u_a3dEnvAmbient")) {
|
|
1969
|
+
const k = environment && Number.isFinite(environment.intensity) ? Math.max(0, environment.intensity) : 0;
|
|
1970
|
+
uniforms.set("u_a3dEnvAmbient", environment ? [environment.color[0] * k, environment.color[1] * k, environment.color[2] * k] : [0, 0, 0]);
|
|
1971
|
+
}
|
|
1972
|
+
if (wants("u_a3dEnvSh") || wants("u_a3dEnvShEnabled")) {
|
|
1973
|
+
const sh9 = environment?.environmentProbe?.sh9;
|
|
1974
|
+
const valid = sh9 !== undefined && sh9.length === 27 && isFiniteArrayLike(sh9);
|
|
1975
|
+
if (wants("u_a3dEnvSh"))
|
|
1976
|
+
uniforms.set("u_a3dEnvSh", valid ? sh9 : ZERO_SH9);
|
|
1977
|
+
if (wants("u_a3dEnvShEnabled"))
|
|
1978
|
+
uniforms.set("u_a3dEnvShEnabled", valid ? 1 : 0);
|
|
1979
|
+
}
|
|
1980
|
+
if (wants("u_a3dEnvSky") || wants("u_a3dEnvHorizon") || wants("u_a3dEnvGround")) {
|
|
1981
|
+
const procedural = environment?.proceduralMap;
|
|
1982
|
+
const k = procedural && Number.isFinite(procedural.intensity) ? Math.max(0, procedural.intensity) : 0;
|
|
1983
|
+
const scaled = (color) => color ? [color[0] * k, color[1] * k, color[2] * k] : [0, 0, 0];
|
|
1984
|
+
if (wants("u_a3dEnvSky"))
|
|
1985
|
+
uniforms.set("u_a3dEnvSky", scaled(procedural?.skyColor));
|
|
1986
|
+
if (wants("u_a3dEnvHorizon"))
|
|
1987
|
+
uniforms.set("u_a3dEnvHorizon", scaled(procedural?.horizonColor));
|
|
1988
|
+
if (wants("u_a3dEnvGround"))
|
|
1989
|
+
uniforms.set("u_a3dEnvGround", scaled(procedural?.groundColor));
|
|
1990
|
+
}
|
|
1991
|
+
if (!wants("u_a3dEnvMap") && !wants("u_a3dEnvMapEnabled"))
|
|
1992
|
+
return;
|
|
1993
|
+
const binding = environment?.environmentMapTexture;
|
|
1994
|
+
const texture = binding?.texture;
|
|
1995
|
+
const usable = texture !== null && texture !== undefined && texture.dimension !== "cube";
|
|
1996
|
+
if (wants("u_a3dEnvMap")) {
|
|
1997
|
+
uniforms.set("u_a3dEnvMap", usable && binding
|
|
1998
|
+
? new TextureBinding({ name: "u_a3dEnvMap", texture, sampler: binding.sampler, required: false, ready: binding.ready, expectedColorSpace: binding.expectedColorSpace, expectedDimension: "2d" })
|
|
1999
|
+
: CUSTOM_ENV_MAP_FALLBACK);
|
|
2000
|
+
}
|
|
2001
|
+
if (wants("u_a3dEnvMapEnabled"))
|
|
2002
|
+
uniforms.set("u_a3dEnvMapEnabled", usable ? 1 : 0);
|
|
2003
|
+
const intensity = environment?.environmentMapIntensity ?? 1;
|
|
2004
|
+
const mipCount = environment?.environmentMapMipCount ?? 1;
|
|
2005
|
+
const encoding = environment?.environmentMapEncoding ?? "srgb";
|
|
2006
|
+
if (wants("u_a3dEnvMapIntensity"))
|
|
2007
|
+
uniforms.set("u_a3dEnvMapIntensity", usable && Number.isFinite(intensity) ? Math.max(0, intensity) : 0);
|
|
2008
|
+
if (wants("u_a3dEnvMapRotation"))
|
|
2009
|
+
uniforms.set("u_a3dEnvMapRotation", Number.isFinite(environment?.environmentMapRotation) ? environment.environmentMapRotation : 0);
|
|
2010
|
+
if (wants("u_a3dEnvMapMaxLod"))
|
|
2011
|
+
uniforms.set("u_a3dEnvMapMaxLod", Number.isInteger(mipCount) && mipCount >= 1 ? mipCount - 1 : 0);
|
|
2012
|
+
if (wants("u_a3dEnvMapEncoding"))
|
|
2013
|
+
uniforms.set("u_a3dEnvMapEncoding", encoding === "rgbe" ? 1 : encoding === "linear" ? 2 : 0);
|
|
2014
|
+
}
|
|
2015
|
+
/** GU47 E-D: a `material.custom` vertex shader that reads `instanceMatrix` (the adapter declares these inputs for it). */
|
|
2016
|
+
function supportsAuthorInstancing(shader) {
|
|
2017
|
+
return shader.reflection.uniforms.has("u_a3dInstancing") && INSTANCE_MATRIX_ATTRIBUTE_NAMES.every((name) => shader.reflection.attributes.has(name));
|
|
1794
2018
|
}
|
|
1795
2019
|
export function toMat4Uniform(value, field, label) {
|
|
1796
2020
|
if (value.length !== 16 || !isFiniteArrayLike(value)) {
|