@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
|
@@ -34,7 +34,35 @@ import type { RenderItem } from "../ForwardPass.js";
|
|
|
34
34
|
import type { Texture } from "../Texture.js";
|
|
35
35
|
import type { TemporalGpuBindings } from "../TemporalHistory.js";
|
|
36
36
|
import { vignetteColorRgb } from "./vignetteColor.js";
|
|
37
|
+
import { type HdrGradeUniforms } from "./shaders/hdrGrade.glsl.js";
|
|
38
|
+
import { type DofOptions, type LutTexture3D } from "./PostGraph.js";
|
|
37
39
|
export { vignetteColorRgb };
|
|
40
|
+
/**
|
|
41
|
+
* GU47 E-C (EC-2): the `pipeline.lut` bag. The engine bridge emits it once the
|
|
42
|
+
* `.cube` text has loaded (`source` = the served URL); hosts may pass parsed
|
|
43
|
+
* `data` instead of `cube`. `intensity` (0..1, default 1) blends the LUT over
|
|
44
|
+
* the ungraded colour in the shader, so animating it never re-uploads.
|
|
45
|
+
*/
|
|
46
|
+
export interface PostLutBag {
|
|
47
|
+
readonly source: string;
|
|
48
|
+
readonly cube?: string;
|
|
49
|
+
readonly data?: LutTexture3D;
|
|
50
|
+
readonly intensity?: number;
|
|
51
|
+
/** Set by the bridge while the `.cube` is loading or after it failed (no `cube` then). */
|
|
52
|
+
readonly status?: "pending" | "failed";
|
|
53
|
+
}
|
|
54
|
+
/** A resolved S10b LUT: the TEXTURE_3D and the `u_lutBypass` (1 − intensity) value. */
|
|
55
|
+
export interface PostLutBinding {
|
|
56
|
+
readonly texture: WebGLTexture;
|
|
57
|
+
readonly bypass: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Uploads a user `.cube` (lattice domain, sampled with `u_lutLattice = 1`) as
|
|
61
|
+
* an RGBA8 TEXTURE_3D, red-fastest like the file. WebGL2 rejects 3-D uploads
|
|
62
|
+
* from an ArrayBufferView while the FLIP_Y / PREMULTIPLY unpack flags are set,
|
|
63
|
+
* so both are cleared first.
|
|
64
|
+
*/
|
|
65
|
+
export declare function uploadCubeLutTexture(gl: WebGL2RenderingContext, lut: LutTexture3D): WebGLTexture;
|
|
38
66
|
/**
|
|
39
67
|
* God-ray tint as an RGB triple. The engine bridge compiles
|
|
40
68
|
* `effects.volumetricFog({ color })` to a `{ r, g, b }` object, while direct
|
|
@@ -45,6 +73,29 @@ export { vignetteColorRgb };
|
|
|
45
73
|
* the default warm tint.
|
|
46
74
|
*/
|
|
47
75
|
export declare function godRayColor(color: unknown): [number, number, number];
|
|
76
|
+
/**
|
|
77
|
+
* GU47 E-C (EC-6): S3 options from `pipeline.ssr`: `intensity` (default
|
|
78
|
+
* 0.9, [0, 2]), `maxDistance` metres (18, [0.5, 200]), `roughness` hint
|
|
79
|
+
* (0; the trace fades out between 0.35 and the 0.5 cutoff), `thickness`
|
|
80
|
+
* metres (0.25) and march `steps` snapped to 16 | 24 | 32 (24).
|
|
81
|
+
*/
|
|
82
|
+
export declare function resolveSsrOptions(ssr: unknown): {
|
|
83
|
+
readonly intensity: number;
|
|
84
|
+
readonly maxDistance: number;
|
|
85
|
+
readonly roughness: number;
|
|
86
|
+
readonly thickness: number;
|
|
87
|
+
readonly steps: 16 | 24 | 32;
|
|
88
|
+
};
|
|
89
|
+
/** GU47 E-C (EC-8): S4 `u_density` — the authored god-ray density clamped to [0.05, 1]; omitted or invalid = 1 (full march). */
|
|
90
|
+
export declare function godRayDensity(density: unknown): number;
|
|
91
|
+
/** GU47 phase 2: S4 `u_medium` — the shaft medium per metre clamped to [0, 1]; omitted or invalid = 0 (no depth scaling). */
|
|
92
|
+
export declare function godRayMedium(medium: unknown): number;
|
|
93
|
+
/**
|
|
94
|
+
* GU47 E-C (EC-8): S6 `u_tiltShift` = [bandCenter, bandWidth, angle (rad), 1]
|
|
95
|
+
* for a valid band (centre and width clamped to [0, 1]), else all zeros
|
|
96
|
+
* (the thin-lens CoC).
|
|
97
|
+
*/
|
|
98
|
+
export declare function dofTiltShiftUniform(tilt: DofOptions["tiltShift"] | undefined): [number, number, number, number];
|
|
48
99
|
/**
|
|
49
100
|
* Inserts `#define` lines after the `#version` directive. GLSL ES 3.00
|
|
50
101
|
* requires `#version 300 es` to be the first line, so prepending defines (as
|
|
@@ -54,6 +105,8 @@ export declare function godRayColor(color: unknown): [number, number, number];
|
|
|
54
105
|
* post-quality 38138763970).
|
|
55
106
|
*/
|
|
56
107
|
export declare function withDefines(source: string, defines: Readonly<Record<string, string | number>>): string;
|
|
108
|
+
/** The S10 grade uniform writer (`u_whiteBalance` … `u_highlights`). Exported for the mock-GL unit gate. */
|
|
109
|
+
export declare function writeHdrGradeUniforms(g: WebGL2RenderingContext, prog: WebGLProgram, grade: HdrGradeUniforms): void;
|
|
57
110
|
/**
|
|
58
111
|
* §6.12: a custom pass's `fragment.glsl` is appended after the engine
|
|
59
112
|
* prelude (version, precision, the `v_uv` input, `outColor`, and the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2Stages.d.ts","sourceRoot":"","sources":["../../../../../packages/rendering/src/post/v2Stages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGvE,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAA2B,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAgB9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"v2Stages.d.ts","sourceRoot":"","sources":["../../../../../packages/rendering/src/post/v2Stages.ts"],"names":[],"mappings":"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"}
|
|
@@ -31,7 +31,7 @@ import { reportShaderFailure } from "../ShaderFailures.js";
|
|
|
31
31
|
import { invertMat4, multiplyMat4 } from "../../scene/index.js";
|
|
32
32
|
import { registeredPostPasses, validatePostPassSpace } from "../contracts/post.js";
|
|
33
33
|
import { rendererQrFlags } from "../renderer/FrameGraph.js";
|
|
34
|
-
import { beginPostStageTrace, markTaaHistoryWritten, recordPostSkipped, recordPostStage } from "../renderer/postSkipped.js";
|
|
34
|
+
import { beginPostStageTrace, clearPostSkipped, markTaaHistoryWritten, recordPostSkipped, recordPostStage } from "../renderer/postSkipped.js";
|
|
35
35
|
import { PostResources } from "./PostResources.js";
|
|
36
36
|
import { QUALITY_TIERS } from "../contracts/quality.js";
|
|
37
37
|
import { CAMERA_VELOCITY_GLSL, DEPTH_LINEARIZE_GLSL, DEPTH_MINMAX_HALF_GLSL } from "./shaders/depthDownsample.glsl.js";
|
|
@@ -47,9 +47,13 @@ import { TAA_RESOLVE_GLSL, TAA_UPSCALE_GLSL } from "./shaders/taa.glsl.js";
|
|
|
47
47
|
import { DOF_COMPOSITE_GLSL, DOF_GATHER_GLSL, DOF_NEAR_TILE_GLSL, DOF_PREFILTER_GLSL } from "./shaders/dof.glsl.js";
|
|
48
48
|
import { MB_NEIGHBOR_GLSL, MB_RECONSTRUCT_GLSL, MB_TILE_MAX_GLSL } from "./shaders/motionBlur.glsl.js";
|
|
49
49
|
import { EXPOSURE_ADAPT_GLSL, EXPOSURE_LUMA_LOG_GLSL, EXPOSURE_MUL_GLSL, EXPOSURE_REDUCE_GLSL } from "./shaders/exposure.glsl.js";
|
|
50
|
+
import { HDR_GRADE_GLSL, resolveHdrGradeUniforms } from "./shaders/hdrGrade.glsl.js";
|
|
51
|
+
import { SSR_COMPOSITE_GLSL, SSR_DEFAULT_STEPS, SSR_DEFAULT_THICKNESS, SSR_TRACE_GLSL } from "./shaders/ssr.glsl.js";
|
|
50
52
|
import { SMAA_BLEND_GLSL, SMAA_EDGES_GLSL, SMAA_WEIGHTS_GLSL } from "./shaders/smaa.glsl.js";
|
|
51
53
|
import { FXAA_185_FRAGMENT_GLSL } from "./shaders/fxaa.glsl.js";
|
|
52
54
|
import { POST_INSERT_ANCHORS } from "./PostGraph.js";
|
|
55
|
+
import { DisplayLutCache } from "./DisplayLutCache.js";
|
|
56
|
+
import { parseCubeLut } from "./CubeLut.js";
|
|
53
57
|
export { vignetteColorRgb };
|
|
54
58
|
/** Identity for the folded camera-velocity reprojection (S1-C). */
|
|
55
59
|
const IDENTITY_MAT4_F32 = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
|
|
@@ -68,6 +72,78 @@ function asGlTarget(target) {
|
|
|
68
72
|
}
|
|
69
73
|
return t;
|
|
70
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Uploads a user `.cube` (lattice domain, sampled with `u_lutLattice = 1`) as
|
|
77
|
+
* an RGBA8 TEXTURE_3D, red-fastest like the file. WebGL2 rejects 3-D uploads
|
|
78
|
+
* from an ArrayBufferView while the FLIP_Y / PREMULTIPLY unpack flags are set,
|
|
79
|
+
* so both are cleared first.
|
|
80
|
+
*/
|
|
81
|
+
export function uploadCubeLutTexture(gl, lut) {
|
|
82
|
+
const texture = gl.createTexture();
|
|
83
|
+
if (!texture)
|
|
84
|
+
throw new RenderDeviceError("LUT texture allocation failed.", "POST_GRAPH_V2_UNSUPPORTED");
|
|
85
|
+
const n = lut.size;
|
|
86
|
+
const bytes = new Uint8Array(n * n * n * 4);
|
|
87
|
+
for (let i = 0; i < bytes.length; i += 1) {
|
|
88
|
+
const v = lut.data[i] ?? 1;
|
|
89
|
+
bytes[i] = Math.round(Math.min(1, Math.max(0, Number.isFinite(v) ? v : 0)) * 255);
|
|
90
|
+
}
|
|
91
|
+
gl.bindTexture(gl.TEXTURE_3D, texture);
|
|
92
|
+
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
|
|
93
|
+
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
|
94
|
+
gl.pixelStorei(gl.UNPACK_ALIGNMENT, 4);
|
|
95
|
+
gl.texImage3D(gl.TEXTURE_3D, 0, gl.RGBA8, n, n, n, 0, gl.RGBA, gl.UNSIGNED_BYTE, bytes);
|
|
96
|
+
gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
|
97
|
+
gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
|
98
|
+
gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
99
|
+
gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
100
|
+
gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_WRAP_R, gl.CLAMP_TO_EDGE);
|
|
101
|
+
gl.bindTexture(gl.TEXTURE_3D, null);
|
|
102
|
+
return texture;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* GU47 E-C (EC-2): resolves `pipeline.lut` to a bound TEXTURE_3D through the
|
|
106
|
+
* per-host `DisplayLutCache` (one parse + upload per source; the key holds the
|
|
107
|
+
* source with contrast/saturation/vibrance/intensity at identity because those
|
|
108
|
+
* run in the fused present and the shader). A bag without text/data records
|
|
109
|
+
* `LUT_PENDING`; a `.cube` the parser rejects records `LUT_INVALID` once and
|
|
110
|
+
* renders the identity grade.
|
|
111
|
+
*/
|
|
112
|
+
function displayLutBinding(host, state, lut) {
|
|
113
|
+
if (!lut || typeof lut !== "object")
|
|
114
|
+
return null;
|
|
115
|
+
const bag = lut;
|
|
116
|
+
if (typeof bag.source !== "string" || (typeof bag.cube !== "string" && !bag.data)) {
|
|
117
|
+
if (bag.status === "failed")
|
|
118
|
+
clearPostSkipped(`LUT_PENDING:${String(bag.source)}`);
|
|
119
|
+
recordPostSkipped(`${bag.status === "failed" ? "LUT_UNAVAILABLE" : "LUT_PENDING"}:${String(bag.source)}`);
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
// The load settled: the first frames' `LUT_PENDING` no longer describes it.
|
|
123
|
+
clearPostSkipped(`LUT_PENDING:${bag.source}`);
|
|
124
|
+
if (state.lutFailed.has(bag.source))
|
|
125
|
+
return null;
|
|
126
|
+
const gl = host.gl;
|
|
127
|
+
state.lutCache ??= new DisplayLutCache(() => {
|
|
128
|
+
const baking = state.lutBaking;
|
|
129
|
+
return uploadCubeLutTexture(gl, baking.data ?? parseCubeLut(baking.cube));
|
|
130
|
+
}, (texture) => gl.deleteTexture(texture), { maxEntries: 4 });
|
|
131
|
+
state.lutBaking = bag;
|
|
132
|
+
try {
|
|
133
|
+
const texture = state.lutCache.acquire({ contrast: 1, saturation: 1, vibrance: 0, lutIntensity: 1, userLut: bag.source });
|
|
134
|
+
const intensity = typeof bag.intensity === "number" && Number.isFinite(bag.intensity) ? Math.min(1, Math.max(0, bag.intensity)) : 1;
|
|
135
|
+
return { texture, bypass: 1 - intensity };
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
state.lutFailed.add(bag.source);
|
|
139
|
+
const code = error instanceof Error ? /^[A-Z0-9_]+/.exec(error.message)?.[0] ?? "LUT_UPLOAD_FAILED" : "LUT_UPLOAD_FAILED";
|
|
140
|
+
recordPostSkipped(`LUT_INVALID:${bag.source}:${code}`);
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
finally {
|
|
144
|
+
state.lutBaking = undefined;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
71
147
|
const states = new WeakMap();
|
|
72
148
|
function v2State(host) {
|
|
73
149
|
const gl = host.gl;
|
|
@@ -117,7 +193,8 @@ function v2State(host) {
|
|
|
117
193
|
evTargets: [undefined, undefined],
|
|
118
194
|
evIndex: 0,
|
|
119
195
|
evValid: false,
|
|
120
|
-
smaa: { area: null, search: null, requested: false }
|
|
196
|
+
smaa: { area: null, search: null, requested: false },
|
|
197
|
+
lutFailed: new Set()
|
|
121
198
|
};
|
|
122
199
|
states.set(host, state);
|
|
123
200
|
}
|
|
@@ -145,6 +222,46 @@ export function godRayColor(color) {
|
|
|
145
222
|
return fallback;
|
|
146
223
|
return [0, 1, 2].map((i) => (typeof rgb[i] === "number" && Number.isFinite(rgb[i]) ? rgb[i] : fallback[i]));
|
|
147
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* GU47 E-C (EC-6): S3 options from `pipeline.ssr`: `intensity` (default
|
|
227
|
+
* 0.9, [0, 2]), `maxDistance` metres (18, [0.5, 200]), `roughness` hint
|
|
228
|
+
* (0; the trace fades out between 0.35 and the 0.5 cutoff), `thickness`
|
|
229
|
+
* metres (0.25) and march `steps` snapped to 16 | 24 | 32 (24).
|
|
230
|
+
*/
|
|
231
|
+
export function resolveSsrOptions(ssr) {
|
|
232
|
+
const bag = (ssr && typeof ssr === "object" ? ssr : {});
|
|
233
|
+
const num = (key, fallback, min, max) => {
|
|
234
|
+
const value = bag[key];
|
|
235
|
+
return typeof value === "number" && Number.isFinite(value) ? Math.min(max, Math.max(min, value)) : fallback;
|
|
236
|
+
};
|
|
237
|
+
const steps = num("steps", SSR_DEFAULT_STEPS, 1, 64);
|
|
238
|
+
return {
|
|
239
|
+
intensity: num("intensity", 0.9, 0, 2),
|
|
240
|
+
maxDistance: num("maxDistance", 18, 0.5, 200),
|
|
241
|
+
roughness: num("roughness", 0, 0, 1),
|
|
242
|
+
thickness: num("thickness", SSR_DEFAULT_THICKNESS, 0.01, 10),
|
|
243
|
+
steps: steps <= 16 ? 16 : steps <= 24 ? 24 : 32
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
/** GU47 E-C (EC-8): S4 `u_density` — the authored god-ray density clamped to [0.05, 1]; omitted or invalid = 1 (full march). */
|
|
247
|
+
export function godRayDensity(density) {
|
|
248
|
+
return typeof density === "number" && Number.isFinite(density) ? Math.min(1, Math.max(0.05, density)) : 1;
|
|
249
|
+
}
|
|
250
|
+
/** GU47 phase 2: S4 `u_medium` — the shaft medium per metre clamped to [0, 1]; omitted or invalid = 0 (no depth scaling). */
|
|
251
|
+
export function godRayMedium(medium) {
|
|
252
|
+
return typeof medium === "number" && Number.isFinite(medium) ? Math.min(1, Math.max(0, medium)) : 0;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* GU47 E-C (EC-8): S6 `u_tiltShift` = [bandCenter, bandWidth, angle (rad), 1]
|
|
256
|
+
* for a valid band (centre and width clamped to [0, 1]), else all zeros
|
|
257
|
+
* (the thin-lens CoC).
|
|
258
|
+
*/
|
|
259
|
+
export function dofTiltShiftUniform(tilt) {
|
|
260
|
+
if (!tilt || !Number.isFinite(tilt.bandCenter) || !Number.isFinite(tilt.bandWidth))
|
|
261
|
+
return [0, 0, 0, 0];
|
|
262
|
+
const angle = typeof tilt.angleDeg === "number" && Number.isFinite(tilt.angleDeg) ? tilt.angleDeg : 0;
|
|
263
|
+
return [Math.min(1, Math.max(0, tilt.bandCenter)), Math.min(1, Math.max(0, tilt.bandWidth)), angle * Math.PI / 180, 1];
|
|
264
|
+
}
|
|
148
265
|
/**
|
|
149
266
|
* Inserts `#define` lines after the `#version` directive. GLSL ES 3.00
|
|
150
267
|
* requires `#version 300 es` to be the first line, so prepending defines (as
|
|
@@ -234,6 +351,51 @@ function draw(host, state, prog, target, textures, uniforms) {
|
|
|
234
351
|
}
|
|
235
352
|
/** §6.3 multi-bounce ρ and AO metadata shared by the apply draw. */
|
|
236
353
|
const AO_RHO = 0.5;
|
|
354
|
+
/**
|
|
355
|
+
* GU47 E-C: one fullscreen draw for S8's `exp2(ev)` multiply and/or the S10
|
|
356
|
+
* linear grade. AE-only frames keep the original `EXPOSURE_MUL_GLSL` program
|
|
357
|
+
* (byte-identical); a non-identity grade runs `HDR_GRADE_GLSL`, with the EV
|
|
358
|
+
* multiply folded in when S8 is active (`ev` non-null).
|
|
359
|
+
*/
|
|
360
|
+
function runHdrGradeDraw(host, state, target, input, ev, grade) {
|
|
361
|
+
const gl = host.gl;
|
|
362
|
+
if (!grade) {
|
|
363
|
+
if (!ev)
|
|
364
|
+
return;
|
|
365
|
+
const mulProg = program(state, gl, "exposure-mul", EXPOSURE_MUL_GLSL);
|
|
366
|
+
draw(host, state, mulProg, asGlTarget(target), [asGlTarget(input).colorHandle, asGlTarget(ev).colorHandle], (g) => {
|
|
367
|
+
g.uniform1i(g.getUniformLocation(mulProg, "u_hdr"), 0);
|
|
368
|
+
g.uniform1i(g.getUniformLocation(mulProg, "u_ev"), 1);
|
|
369
|
+
});
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
const prog = program(state, gl, "hdr-grade", HDR_GRADE_GLSL);
|
|
373
|
+
draw(host, state, prog, asGlTarget(target), [asGlTarget(input).colorHandle, ev ? asGlTarget(ev).colorHandle : state.blankTex], (g) => {
|
|
374
|
+
g.uniform1i(g.getUniformLocation(prog, "u_hdr"), 0);
|
|
375
|
+
g.uniform1i(g.getUniformLocation(prog, "u_ev"), 1);
|
|
376
|
+
g.uniform1i(g.getUniformLocation(prog, "u_hasEv"), ev ? 1 : 0);
|
|
377
|
+
g.uniform1i(g.getUniformLocation(prog, "u_hasGrade"), 1);
|
|
378
|
+
writeHdrGradeUniforms(g, prog, grade);
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
/** The S10 grade uniform writer (`u_whiteBalance` … `u_highlights`). Exported for the mock-GL unit gate. */
|
|
382
|
+
export function writeHdrGradeUniforms(g, prog, grade) {
|
|
383
|
+
const v3 = (name, value) => {
|
|
384
|
+
g.uniform3f(g.getUniformLocation(prog, name), value[0], value[1], value[2]);
|
|
385
|
+
};
|
|
386
|
+
v3("u_whiteBalance", grade.whiteBalance);
|
|
387
|
+
v3("u_lift", grade.lift);
|
|
388
|
+
v3("u_gamma", grade.gamma);
|
|
389
|
+
v3("u_gain", grade.gain);
|
|
390
|
+
v3("u_shadows", grade.shadows);
|
|
391
|
+
v3("u_midtones", grade.midtones);
|
|
392
|
+
v3("u_highlights", grade.highlights);
|
|
393
|
+
}
|
|
394
|
+
/** Stage-trace suffix for S9: the authored mip count when the bag carries one. */
|
|
395
|
+
function bloomMipsTag(bloom) {
|
|
396
|
+
const mips = bloom && typeof bloom === "object" ? bloom.mips : undefined;
|
|
397
|
+
return typeof mips === "number" && Number.isFinite(mips) ? `-${mips}mips` : "";
|
|
398
|
+
}
|
|
237
399
|
/* ------------------------------------------------------------------------ */
|
|
238
400
|
/* Phase 6 — C-13 custom passes, S8 auto-exposure, S11 SMAA */
|
|
239
401
|
/* ------------------------------------------------------------------------ */
|
|
@@ -458,10 +620,16 @@ frameContext, options) {
|
|
|
458
620
|
const wantsTaa = pipeline.antiAliasing === "taa" || Boolean(pipeline.taa);
|
|
459
621
|
const wantsDof = Boolean(pipeline.dof);
|
|
460
622
|
const wantsMb = Boolean(pipeline.motionBlur);
|
|
623
|
+
// GU47 E-C (EC-6): S3 SSR runs only for an authored screenSpaceReflections node.
|
|
624
|
+
const wantsSsr = Boolean(pipeline.ssr);
|
|
461
625
|
// Phase 6: S8 auto-exposure + C-13 HDR-domain custom passes at their §6.1
|
|
462
626
|
// insertion anchors (`after-tonemap` runs in the LDR tail instead).
|
|
463
627
|
const autoExposure = pipeline.autoExposure;
|
|
464
628
|
const wantsAutoExposure = autoExposure !== undefined && autoExposure !== false;
|
|
629
|
+
// GU47 E-C: the linear grade (white balance, lift/gamma/gain, shadows/
|
|
630
|
+
// midtones/highlights). Identity → null → no draw (byte-identical frames).
|
|
631
|
+
const gradeUniforms = resolveHdrGradeUniforms(pipeline.grade);
|
|
632
|
+
const wantsGrade = gradeUniforms !== null;
|
|
465
633
|
const customs = mergedCustomPasses(pipeline);
|
|
466
634
|
const customsAt = (anchor) => sortCustomPassesAtAnchor(customs, anchor);
|
|
467
635
|
const hdrCustoms = customs.filter((pass) => pass.insertAt !== "after-tonemap");
|
|
@@ -473,6 +641,12 @@ frameContext, options) {
|
|
|
473
641
|
const mbActive = wantsMb && temporalOk;
|
|
474
642
|
beginPostStageTrace();
|
|
475
643
|
recordPostStage(`enter:taa=${String(wantsTaa)}:mb=${String(wantsMb)}:temporal=${String(temporalOk)}`);
|
|
644
|
+
// GU47 E-C stage trace: S9 bloom executes inside the fused present right
|
|
645
|
+
// after this driver returns. The executor sets `deferBeforeTonemap` exactly
|
|
646
|
+
// when its pass list carries an HDR bloom pass (LegacyPost
|
|
647
|
+
// `executePostGraphWebGL2`), so that flag — not the authored bag — records it.
|
|
648
|
+
if (options?.deferBeforeTonemap)
|
|
649
|
+
recordPostStage(`S9:bloom${bloomMipsTag(pipeline.bloom)}`);
|
|
476
650
|
if (wantsTaa && !temporalOk) {
|
|
477
651
|
skipped.push("TAA_VELOCITY_COVERAGE");
|
|
478
652
|
recordPostSkipped("TAA_VELOCITY_COVERAGE:v2-hdr-stages");
|
|
@@ -481,11 +655,11 @@ frameContext, options) {
|
|
|
481
655
|
skipped.push("S7_VELOCITY_UNAVAILABLE");
|
|
482
656
|
recordPostSkipped("S7_VELOCITY_UNAVAILABLE:v2-hdr-stages");
|
|
483
657
|
}
|
|
484
|
-
const needsLinZ = wantsAo || wantsGodRays || wantsDof || taaActive || mbActive
|
|
658
|
+
const needsLinZ = wantsAo || wantsGodRays || wantsDof || taaActive || mbActive || wantsSsr
|
|
485
659
|
|| hdrCustoms.some((pass) => pass.inputs.includes("depth"));
|
|
486
660
|
const needsVelocity = ((taaActive || mbActive) && temporalOk)
|
|
487
661
|
|| (hdrCustoms.some((pass) => pass.inputs.includes("velocity")) && temporalOk);
|
|
488
|
-
if (!wantsAo && !wantsGodRays && !wantsCa && !taaActive && !wantsDof && !mbActive && !wantsAutoExposure && hdrCustoms.length === 0)
|
|
662
|
+
if (!wantsAo && !wantsGodRays && !wantsCa && !taaActive && !wantsDof && !mbActive && !wantsSsr && !wantsAutoExposure && !wantsGrade && hdrCustoms.length === 0)
|
|
489
663
|
return { target: source, aoPending: false, skipped };
|
|
490
664
|
// T0-15: the forward HDR target is multisampled by default (`sampleCount` 4
|
|
491
665
|
// in `Renderer`), so its `colorHandle`/`depthTextureHandle` only contain
|
|
@@ -502,7 +676,7 @@ frameContext, options) {
|
|
|
502
676
|
recordPostSkipped("WEBGL_LDR_POSTPROCESS_DEPTH_REQUIRED:v2-hdr-stages");
|
|
503
677
|
return { target: source, aoPending: false, skipped: [...skipped, "V2_DEPTH_UNAVAILABLE"] };
|
|
504
678
|
}
|
|
505
|
-
if ((wantsAo || wantsGodRays || needsVelocity) && !camera) {
|
|
679
|
+
if ((wantsAo || wantsGodRays || wantsSsr || needsVelocity) && !camera) {
|
|
506
680
|
recordPostSkipped("POST_GRAPH_V2_CAMERA_REQUIRED:v2-hdr-stages");
|
|
507
681
|
return { target: source, aoPending: false, skipped: [...skipped, "V2_CAMERA_UNAVAILABLE"] };
|
|
508
682
|
}
|
|
@@ -518,6 +692,7 @@ frameContext, options) {
|
|
|
518
692
|
let minmaxHalf = null;
|
|
519
693
|
let linZOwnedByPool = false;
|
|
520
694
|
if (needsLinZ) {
|
|
695
|
+
recordPostStage("S1:depth-prep");
|
|
521
696
|
// Temporal frames write this frame's linear Z into the history ping-pong's
|
|
522
697
|
// `linZOutput` slot so commit() promotes it for next frame's disocclusion.
|
|
523
698
|
linZFull = temporal?.v2?.linZOutput
|
|
@@ -648,6 +823,43 @@ frameContext, options) {
|
|
|
648
823
|
state.pool.release(aoHalf);
|
|
649
824
|
void AO_RHO;
|
|
650
825
|
}
|
|
826
|
+
// ── S3: GU47 E-C screen-space reflections (half-res trace + composite) ───
|
|
827
|
+
if (wantsSsr && camera && linZFull) {
|
|
828
|
+
const ssr = resolveSsrOptions(pipeline.ssr);
|
|
829
|
+
// Reprojected previous colour: the TAA history (last frame's resolved
|
|
830
|
+
// HDR) through prevViewProj · inv(view); without TAA history the trace
|
|
831
|
+
// samples this frame's HDR at the hit.
|
|
832
|
+
const history = taaActive && temporal?.historyValid && temporal.v2 ? temporal : undefined;
|
|
833
|
+
const viewToPrevClip = history
|
|
834
|
+
? Float32Array.from(multiplyMat4(Array.from(history.v2.previous), invertMat4(Array.from(camera.viewMatrix))))
|
|
835
|
+
: IDENTITY_MAT4_F32;
|
|
836
|
+
const trace = state.pool.acquire({ width: hw, height: hh, format: "rgba16f", samples: 1, depth: false });
|
|
837
|
+
const traceProg = program(state, gl, `ssr-trace-${ssr.steps}`, withDefines(SSR_TRACE_GLSL, { AURA_SSR_STEPS: ssr.steps }));
|
|
838
|
+
recordPostStage(`S3:ssr-${ssr.steps}${history ? ":history" : ""}`);
|
|
839
|
+
draw(host, state, traceProg, asGlTarget(trace), [asGlTarget(history ? history.history : hdr).colorHandle, asGlTarget(linZFull).colorHandle], (g) => {
|
|
840
|
+
g.uniform1i(g.getUniformLocation(traceProg, "u_color"), 0);
|
|
841
|
+
g.uniform1i(g.getUniformLocation(traceProg, "u_linearDepth"), 1);
|
|
842
|
+
g.uniformMatrix4fv(g.getUniformLocation(traceProg, "u_projection"), false, camera.projectionMatrix);
|
|
843
|
+
g.uniformMatrix4fv(g.getUniformLocation(traceProg, "u_viewToPrevClip"), false, viewToPrevClip);
|
|
844
|
+
g.uniform1i(g.getUniformLocation(traceProg, "u_reproject"), history ? 1 : 0);
|
|
845
|
+
g.uniform1i(g.getUniformLocation(traceProg, "u_ortho"), ortho ? 1 : 0);
|
|
846
|
+
g.uniform1f(g.getUniformLocation(traceProg, "u_far"), far);
|
|
847
|
+
g.uniform1f(g.getUniformLocation(traceProg, "u_maxDistance"), ssr.maxDistance);
|
|
848
|
+
g.uniform1f(g.getUniformLocation(traceProg, "u_thickness"), ssr.thickness);
|
|
849
|
+
g.uniform1f(g.getUniformLocation(traceProg, "u_roughness"), ssr.roughness);
|
|
850
|
+
});
|
|
851
|
+
const composited = state.pool.acquire({ width: w, height: h, format: "rgba16f", samples: 1, depth: false });
|
|
852
|
+
const ssrCompProg = program(state, gl, "ssr-composite", SSR_COMPOSITE_GLSL);
|
|
853
|
+
draw(host, state, ssrCompProg, asGlTarget(composited), [asGlTarget(hdr).colorHandle, asGlTarget(trace).colorHandle], (g) => {
|
|
854
|
+
g.uniform1i(g.getUniformLocation(ssrCompProg, "u_color"), 0);
|
|
855
|
+
g.uniform1i(g.getUniformLocation(ssrCompProg, "u_reflection"), 1);
|
|
856
|
+
g.uniform1f(g.getUniformLocation(ssrCompProg, "u_intensity"), ssr.intensity);
|
|
857
|
+
});
|
|
858
|
+
state.pool.release(trace);
|
|
859
|
+
if (hdr !== source)
|
|
860
|
+
state.pool.release(hdr);
|
|
861
|
+
hdr = composited;
|
|
862
|
+
}
|
|
651
863
|
// ── S4: god rays, half-res radial march → additive onto HDR ─────────────
|
|
652
864
|
if (wantsGodRays && camera && minmaxHalf) {
|
|
653
865
|
const god = pipeline.godRays;
|
|
@@ -674,6 +886,7 @@ frameContext, options) {
|
|
|
674
886
|
: [0.5, 0.5];
|
|
675
887
|
const godSrc = withDefines(GODRAYS_GLSL, { AURA_GODRAY_SAMPLES: samples });
|
|
676
888
|
const godProg = program(state, gl, `godrays-${samples}`, godSrc);
|
|
889
|
+
recordPostStage(`S4:god-rays-${samples}`);
|
|
677
890
|
draw(host, state, godProg, asGlTarget(godTarget), [asGlTarget(hdr).colorHandle, asGlTarget(minmaxHalf).colorHandle], (g) => {
|
|
678
891
|
g.uniform1i(g.getUniformLocation(godProg, "u_hdr"), 0);
|
|
679
892
|
g.uniform1i(g.getUniformLocation(godProg, "u_depthHalf"), 1);
|
|
@@ -687,6 +900,10 @@ frameContext, options) {
|
|
|
687
900
|
g.uniform1f(g.getUniformLocation(godProg, "u_weight"), god.weight ?? god.intensity ?? 0.7);
|
|
688
901
|
g.uniform1f(g.getUniformLocation(godProg, "u_diskOuter"), 0.08);
|
|
689
902
|
g.uniform1f(g.getUniformLocation(godProg, "u_diskInner"), 0.02);
|
|
903
|
+
// GU47 E-C (EC-8): `godRayDensity`; omitted keeps the full march (1).
|
|
904
|
+
g.uniform1f(g.getUniformLocation(godProg, "u_density"), godRayDensity(god.density));
|
|
905
|
+
// GU47 phase 2: distance-scaled shaft medium; omitted (0) keeps the unscaled shaft.
|
|
906
|
+
g.uniform1f(g.getUniformLocation(godProg, "u_medium"), godRayMedium(god.medium));
|
|
690
907
|
});
|
|
691
908
|
// Additive blend onto the working HDR target.
|
|
692
909
|
const blended = state.pool.acquire({ width: w, height: h, format: "rgba16f", samples: 1, depth: false });
|
|
@@ -721,6 +938,7 @@ frameContext, options) {
|
|
|
721
938
|
const ca = pipeline.chromaticAberration;
|
|
722
939
|
const caTarget = state.pool.acquire({ width: w, height: h, format: "rgba16f", samples: 1, depth: false });
|
|
723
940
|
const caProg = program(state, gl, "ca-pass", CA_PASS_GLSL);
|
|
941
|
+
recordPostStage("CA:chromatic-aberration");
|
|
724
942
|
draw(host, state, caProg, asGlTarget(caTarget), [asGlTarget(hdr).colorHandle], (g) => {
|
|
725
943
|
g.uniform1i(g.getUniformLocation(caProg, "u_hdr"), 0);
|
|
726
944
|
g.uniform1f(g.getUniformLocation(caProg, "u_caIntensity"), ca.intensity ?? 0.0015);
|
|
@@ -808,6 +1026,9 @@ frameContext, options) {
|
|
|
808
1026
|
const dw = Math.max(1, Math.round(w / 2)), dh = Math.max(1, Math.round(h / 2));
|
|
809
1027
|
const prefilter = state.pool.acquire({ width: dw, height: dh, format: "rgba16f", samples: 1, depth: false });
|
|
810
1028
|
const prefilterProg = program(state, gl, "dof-prefilter", DOF_PREFILTER_GLSL);
|
|
1029
|
+
// GU47 E-C (EC-8): the tilt-shift band replaces the thin-lens CoC.
|
|
1030
|
+
const tilt = dofTiltShiftUniform(dof.tiltShift);
|
|
1031
|
+
recordPostStage(tilt[3] > 0 ? `S6:dof-tilt-shift-rings${rings}` : `S6:dof-rings${rings}`);
|
|
811
1032
|
draw(host, state, prefilterProg, asGlTarget(prefilter), [asGlTarget(hdr).colorHandle, asGlTarget(linZFull).colorHandle], (g) => {
|
|
812
1033
|
g.uniform1i(g.getUniformLocation(prefilterProg, "u_color"), 0);
|
|
813
1034
|
g.uniform1i(g.getUniformLocation(prefilterProg, "u_linearDepth"), 1);
|
|
@@ -817,6 +1038,7 @@ frameContext, options) {
|
|
|
817
1038
|
g.uniform1f(g.getUniformLocation(prefilterProg, "u_sensorHeightMm"), dof.sensorHeightMm ?? 24);
|
|
818
1039
|
g.uniform1f(g.getUniformLocation(prefilterProg, "u_frameHeightPx"), h);
|
|
819
1040
|
g.uniform1f(g.getUniformLocation(prefilterProg, "u_maxBlurPx"), maxBlur);
|
|
1041
|
+
g.uniform4f(g.getUniformLocation(prefilterProg, "u_tiltShift"), tilt[0], tilt[1], tilt[2], tilt[3]);
|
|
820
1042
|
});
|
|
821
1043
|
const tileW = Math.max(1, Math.ceil(dw / 8)), tileH = Math.max(1, Math.ceil(dh / 8));
|
|
822
1044
|
const nearTile = state.pool.acquire({ width: tileW, height: tileH, format: "rgba16f", samples: 1, depth: false });
|
|
@@ -851,6 +1073,7 @@ frameContext, options) {
|
|
|
851
1073
|
const tile = mb.tileSize ?? 16;
|
|
852
1074
|
const samples = mb.samples ?? 12;
|
|
853
1075
|
const tw = Math.max(1, Math.ceil(w / tile)), th = Math.max(1, Math.ceil(h / tile));
|
|
1076
|
+
recordPostStage(`S7:motion-blur-${samples}x${tile}`);
|
|
854
1077
|
const tileMax = state.pool.acquire({ width: tw, height: th, format: "rgba16f", samples: 1, depth: false });
|
|
855
1078
|
const tileProg = program(state, gl, `mb-tile-${tile}`, withDefines(MB_TILE_MAX_GLSL, { MB_TILE_SIZE: tile }));
|
|
856
1079
|
draw(host, state, tileProg, asGlTarget(tileMax), [asGlTarget(dilatedVelocity).colorHandle], (g) => {
|
|
@@ -944,18 +1167,28 @@ frameContext, options) {
|
|
|
944
1167
|
state.pool.release(luma);
|
|
945
1168
|
if (reduceTmp)
|
|
946
1169
|
state.pool.release(reduceTmp);
|
|
1170
|
+
recordPostStage("S8:auto-exposure");
|
|
947
1171
|
// Apply: hdr *= exp2(ev) — the composite's autoExp factor, ahead of the
|
|
948
|
-
// fused present's own §6.4 exposure (linear multipliers commute).
|
|
1172
|
+
// fused present's own §6.4 exposure (linear multipliers commute). GU47
|
|
1173
|
+
// E-C: the S10 linear grade folds into this same draw (one fullscreen
|
|
1174
|
+
// pass for AE + grade).
|
|
949
1175
|
const multiplied = state.pool.acquire({ width: w, height: h, format: "rgba16f", samples: 1, depth: false });
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
g.uniform1i(g.getUniformLocation(mulProg, "u_ev"), 1);
|
|
954
|
-
});
|
|
1176
|
+
runHdrGradeDraw(host, state, multiplied, hdr, evWrite, gradeUniforms);
|
|
1177
|
+
if (gradeUniforms)
|
|
1178
|
+
recordPostStage("S10:hdr-grade:folded-s8");
|
|
955
1179
|
if (hdr !== source)
|
|
956
1180
|
state.pool.release(hdr);
|
|
957
1181
|
hdr = multiplied;
|
|
958
1182
|
}
|
|
1183
|
+
else if (gradeUniforms) {
|
|
1184
|
+
// ── S10 linear grade (no S8 this frame): one fullscreen draw ─────────────
|
|
1185
|
+
const graded = state.pool.acquire({ width: w, height: h, format: "rgba16f", samples: 1, depth: false });
|
|
1186
|
+
runHdrGradeDraw(host, state, graded, hdr, null, gradeUniforms);
|
|
1187
|
+
recordPostStage("S10:hdr-grade");
|
|
1188
|
+
if (hdr !== source)
|
|
1189
|
+
state.pool.release(hdr);
|
|
1190
|
+
hdr = graded;
|
|
1191
|
+
}
|
|
959
1192
|
// ── §6.1 insertion "before-tonemap" (linear HDR, exposure applied) ────────
|
|
960
1193
|
const beforeTonemapPasses = customsAt("before-tonemap");
|
|
961
1194
|
let afterBloom;
|
|
@@ -1073,10 +1306,37 @@ frameContext) {
|
|
|
1073
1306
|
const aaSmaa = pipeline.antiAliasing === "smaa";
|
|
1074
1307
|
const displayCustoms = sortCustomPassesAtAnchor(mergedCustomPasses(pipeline), "after-tonemap");
|
|
1075
1308
|
const rcas = (pipeline.renderScale ?? 1) < 1 ? 0.2 : 0;
|
|
1309
|
+
// GU47 E-C (EC-2): the user `.cube` LUT, uploaded once per source.
|
|
1310
|
+
const lut = displayLutBinding(host, state, pipeline.lut);
|
|
1311
|
+
const bindLut = (g, prog) => {
|
|
1312
|
+
g.activeTexture(g.TEXTURE1);
|
|
1313
|
+
g.bindTexture(g.TEXTURE_3D, lut?.texture ?? state.identityLut);
|
|
1314
|
+
// GU47 phase 2 (receipt effects-lut, LUT frame all black): the forward pass
|
|
1315
|
+
// leaves material sampler objects bound on low units (webgl2/Samplers.ts);
|
|
1316
|
+
// a mipmapped one overrides the LUT's LINEAR filter, the mip-less
|
|
1317
|
+
// TEXTURE_3D is then incomplete and every fetch returns black. The
|
|
1318
|
+
// identity LUT is never fetched (u_hasLut 0), so only LUT frames change.
|
|
1319
|
+
g.bindSampler(1, null);
|
|
1320
|
+
g.uniform1i(g.getUniformLocation(prog, "u_lut3d"), 1);
|
|
1321
|
+
g.uniform1i(g.getUniformLocation(prog, "u_hasLut"), lut ? 1 : 0);
|
|
1322
|
+
g.uniform1i(g.getUniformLocation(prog, "u_lutLattice"), lut ? 1 : 0);
|
|
1323
|
+
g.uniform1f(g.getUniformLocation(prog, "u_lutBypass"), lut?.bypass ?? 0);
|
|
1324
|
+
};
|
|
1325
|
+
// GU47 E-C stage trace: the display stages that draw this frame.
|
|
1326
|
+
const vignetteOn = (vignette?.intensity ?? 0) > 0;
|
|
1327
|
+
const grainOn = (grain?.intensity ?? 0) > 0;
|
|
1328
|
+
const traceDisplayStages = (fused) => {
|
|
1329
|
+
if (vignetteOn || lut)
|
|
1330
|
+
recordPostStage(`S10b:display-grade${vignetteOn ? ":vignette" : ""}${lut ? ":lut" : ""}${fused ? ":fused-fxaa" : ""}`);
|
|
1331
|
+
if (grainOn)
|
|
1332
|
+
recordPostStage(`S12:film-grain${fused ? ":fused-fxaa" : ""}`);
|
|
1333
|
+
};
|
|
1076
1334
|
// §6.1 fuse: FXAA + S10b + S12 in a single draw — only when nothing sits
|
|
1077
1335
|
// between the stages (an after-tonemap custom pass splices S10b→S11).
|
|
1078
1336
|
if (aaFxaa && displayCustoms.length === 0) {
|
|
1079
1337
|
const prog = program(state, gl, "finalize-fxaa-fused", FINALIZE_FXAA_FUSED_GLSL);
|
|
1338
|
+
traceDisplayStages(true);
|
|
1339
|
+
recordPostStage("S11:fxaa:fused");
|
|
1080
1340
|
bindOut(host, outTarget, w, h);
|
|
1081
1341
|
gl.useProgram(prog);
|
|
1082
1342
|
gl.bindVertexArray(state.vao);
|
|
@@ -1085,11 +1345,8 @@ frameContext) {
|
|
|
1085
1345
|
gl.disable(gl.BLEND);
|
|
1086
1346
|
gl.activeTexture(gl.TEXTURE0);
|
|
1087
1347
|
gl.bindTexture(gl.TEXTURE_2D, ldrGl.colorHandle);
|
|
1088
|
-
|
|
1089
|
-
gl.bindTexture(gl.TEXTURE_3D, state.identityLut);
|
|
1348
|
+
bindLut(gl, prog);
|
|
1090
1349
|
gl.uniform1i(gl.getUniformLocation(prog, "u_source"), 0);
|
|
1091
|
-
gl.uniform1i(gl.getUniformLocation(prog, "u_lut3d"), 1);
|
|
1092
|
-
gl.uniform1i(gl.getUniformLocation(prog, "u_hasLut"), 0);
|
|
1093
1350
|
gl.uniform2f(gl.getUniformLocation(prog, "u_texelSize"), 1 / w, 1 / h);
|
|
1094
1351
|
gl.uniform2f(gl.getUniformLocation(prog, "u_outputTexel"), 1 / w, 1 / h);
|
|
1095
1352
|
gl.uniform1f(gl.getUniformLocation(prog, "u_frame"), state.frameIndex);
|
|
@@ -1110,17 +1367,15 @@ frameContext) {
|
|
|
1110
1367
|
return;
|
|
1111
1368
|
}
|
|
1112
1369
|
let current = ldr;
|
|
1113
|
-
|
|
1114
|
-
//
|
|
1370
|
+
traceDisplayStages(false);
|
|
1371
|
+
// S10b — display grade: vignette plus the user `.cube` (GU47 E-C, EC-2;
|
|
1372
|
+
// the identity 3-D texture binds with u_hasLut 0 while no LUT resolved).
|
|
1115
1373
|
if (vignette || pipeline.lut) {
|
|
1116
1374
|
const graded = state.pool.acquire({ width: w, height: h, format: "rgba8", samples: 1, depth: false });
|
|
1117
1375
|
const prog = program(state, gl, "display-grade", DISPLAY_GRADE_GLSL);
|
|
1118
1376
|
draw(host, state, prog, asGlTarget(graded), [ldrGl.colorHandle], (g) => {
|
|
1119
1377
|
g.uniform1i(g.getUniformLocation(prog, "u_source"), 0);
|
|
1120
|
-
|
|
1121
|
-
gl.bindTexture(gl.TEXTURE_3D, state.identityLut);
|
|
1122
|
-
g.uniform1i(g.getUniformLocation(prog, "u_lut3d"), 1);
|
|
1123
|
-
g.uniform1i(g.getUniformLocation(prog, "u_hasLut"), 0);
|
|
1378
|
+
bindLut(g, prog);
|
|
1124
1379
|
g.uniform1f(g.getUniformLocation(prog, "u_vignetteIntensity"), vignette?.intensity ?? 0);
|
|
1125
1380
|
g.uniform1f(g.getUniformLocation(prog, "u_vignetteSmoothness"), vignette?.smoothness ?? 1);
|
|
1126
1381
|
g.uniform1f(g.getUniformLocation(prog, "u_vignetteRoundness"), vignette?.roundness ?? 1);
|
|
@@ -1130,19 +1385,25 @@ frameContext) {
|
|
|
1130
1385
|
});
|
|
1131
1386
|
current = graded;
|
|
1132
1387
|
}
|
|
1133
|
-
// §6.1 insertion "after-tonemap" (display-referred RGBA8 customs).
|
|
1388
|
+
// §6.1 insertion "after-tonemap" (display-referred RGBA8 customs). GU47 E-E
|
|
1389
|
+
// handoff H2: a display custom declaring `inputs` "depth" reads the frame's
|
|
1390
|
+
// scene depth, linearised once per tail (the HDR stages' linZ is gone by now).
|
|
1391
|
+
const tailLinZ = displayCustomLinearDepth(host, state, displayCustoms, frameContext, w, h);
|
|
1134
1392
|
for (const pass of displayCustoms) {
|
|
1135
|
-
const out = runCustomPass(host, state, pass, current, {}, null, frameContext);
|
|
1393
|
+
const out = runCustomPass(host, state, pass, current, tailLinZ ? { linZ: tailLinZ } : {}, null, frameContext);
|
|
1136
1394
|
if (out !== current) {
|
|
1137
1395
|
if (current !== ldr)
|
|
1138
1396
|
state.pool.release(current);
|
|
1139
1397
|
current = out;
|
|
1140
1398
|
}
|
|
1141
1399
|
}
|
|
1400
|
+
if (tailLinZ)
|
|
1401
|
+
state.pool.release(tailLinZ);
|
|
1142
1402
|
// S11 — SMAA 1x three-pass (§8.14). The lazy textures warm on first use;
|
|
1143
1403
|
// until both land, the stage skips (same first-frames window as three's
|
|
1144
1404
|
// async Image load — never a silent FXAA substitution).
|
|
1145
1405
|
if (aaSmaa && smaaTexturesReady(host, state)) {
|
|
1406
|
+
recordPostStage("S11:smaa");
|
|
1146
1407
|
const edges = state.pool.acquire({ width: w, height: h, format: "rgba8", samples: 1, depth: false });
|
|
1147
1408
|
const edgesProg = program(state, gl, "smaa-edges", SMAA_EDGES_GLSL);
|
|
1148
1409
|
draw(host, state, edgesProg, asGlTarget(edges), [asGlTarget(current).colorHandle], (g) => {
|
|
@@ -1176,6 +1437,7 @@ frameContext) {
|
|
|
1176
1437
|
}
|
|
1177
1438
|
else if (aaFxaa && displayCustoms.length > 0) {
|
|
1178
1439
|
// FXAA unfused: an after-tonemap custom already consumed the fused slot.
|
|
1440
|
+
recordPostStage("S11:fxaa");
|
|
1179
1441
|
const aa = state.pool.acquire({ width: w, height: h, format: "rgba8", samples: 1, depth: false });
|
|
1180
1442
|
const fxaaProg = program(state, gl, "fxaa-standalone-nodither", FXAA_185_FRAGMENT_GLSL.replace("#version 300 es", "#version 300 es\n#define AURA_FXAA_NO_DITHER"));
|
|
1181
1443
|
draw(host, state, fxaaProg, asGlTarget(aa), [asGlTarget(current).colorHandle], (g) => {
|
|
@@ -1212,6 +1474,35 @@ frameContext) {
|
|
|
1212
1474
|
if (current !== ldr)
|
|
1213
1475
|
state.pool.release(current);
|
|
1214
1476
|
}
|
|
1477
|
+
/**
|
|
1478
|
+
* GU47 E-E handoff H2: linear depth (RGBA32F `.r` = view-space metres, the S1
|
|
1479
|
+
* pass A program) for the LDR tail's `after-tonemap` customs that declare
|
|
1480
|
+
* `inputs` "depth", from the C-13 `sceneDepth` (the forward target's depth
|
|
1481
|
+
* texture; the present already resolved it). `null` — the pass keeps the 1×1
|
|
1482
|
+
* blank, as before — when no display custom reads depth or the frame has no
|
|
1483
|
+
* scene depth. The caller releases the target after the custom loop.
|
|
1484
|
+
*/
|
|
1485
|
+
function displayCustomLinearDepth(host, state, passes, frameContext, width, height) {
|
|
1486
|
+
if (!passes.some((pass) => pass.inputs.includes("depth")))
|
|
1487
|
+
return null;
|
|
1488
|
+
const sceneDepth = frameContext?.sceneDepth;
|
|
1489
|
+
if (!sceneDepth?.available || !sceneDepth.texture)
|
|
1490
|
+
return null;
|
|
1491
|
+
const depthHandle = host.textureRegistry?.textures.get(sceneDepth.texture);
|
|
1492
|
+
if (!depthHandle)
|
|
1493
|
+
return null;
|
|
1494
|
+
const gl = host.gl;
|
|
1495
|
+
recordPostStage("S1:depth-prep:after-tonemap");
|
|
1496
|
+
const linZ = state.pool.acquire({ width, height, format: "rgba32f", samples: 1, depth: false });
|
|
1497
|
+
const linProg = program(state, gl, "depth-linearize", DEPTH_LINEARIZE_GLSL);
|
|
1498
|
+
draw(host, state, linProg, asGlTarget(linZ), [depthHandle], (g) => {
|
|
1499
|
+
g.uniform1i(g.getUniformLocation(linProg, "u_depth"), 0);
|
|
1500
|
+
g.uniform1f(g.getUniformLocation(linProg, "u_near"), sceneDepth.linearize.near);
|
|
1501
|
+
g.uniform1f(g.getUniformLocation(linProg, "u_far"), sceneDepth.linearize.far);
|
|
1502
|
+
g.uniform1i(g.getUniformLocation(linProg, "u_ortho"), sceneDepth.linearize.orthographic ? 1 : 0);
|
|
1503
|
+
});
|
|
1504
|
+
return linZ;
|
|
1505
|
+
}
|
|
1215
1506
|
function bindOut(host, outTarget, w, h) {
|
|
1216
1507
|
const gl = host.gl;
|
|
1217
1508
|
if (outTarget) {
|