@aura3d/engine 1.4.4 → 1.5.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/README.md +65 -30
- package/dist/animation/Retargeting.d.ts +12 -0
- package/dist/animation/Retargeting.d.ts.map +1 -0
- package/dist/animation/Retargeting.js +19 -0
- package/dist/animation/Retargeting.js.map +1 -0
- package/dist/assets/GLTFLoader.d.ts +4 -0
- package/dist/assets/GLTFLoader.d.ts.map +1 -1
- package/dist/assets/GLTFLoader.js +39 -4
- package/dist/assets/GLTFLoader.js.map +1 -1
- package/dist/assets/GLTFRenderResources.d.ts +16 -0
- package/dist/assets/GLTFRenderResources.d.ts.map +1 -1
- package/dist/assets/GLTFRenderResources.js +42 -2
- package/dist/assets/GLTFRenderResources.js.map +1 -1
- package/dist/assets/asset-corpus/ProductionGLTFRenderPipeline.d.ts +6 -0
- package/dist/assets/asset-corpus/ProductionGLTFRenderPipeline.d.ts.map +1 -1
- package/dist/assets/asset-corpus/ProductionGLTFRenderPipeline.js +2 -1
- package/dist/assets/asset-corpus/ProductionGLTFRenderPipeline.js.map +1 -1
- package/dist/assets/index.d.ts +0 -1
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js +0 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/loaders/index.d.ts +0 -1
- package/dist/assets/loaders/index.d.ts.map +1 -1
- package/dist/assets/loaders/index.js +0 -1
- package/dist/assets/loaders/index.js.map +1 -1
- package/dist/aura3d-cli/asset-intent.d.ts +148 -0
- package/dist/aura3d-cli/asset-intent.d.ts.map +1 -0
- package/dist/aura3d-cli/asset-intent.js +145 -0
- package/dist/aura3d-cli/asset-intent.js.map +1 -0
- package/dist/aura3d-cli/asset-role-admission.d.ts +174 -0
- package/dist/aura3d-cli/asset-role-admission.d.ts.map +1 -0
- package/dist/aura3d-cli/asset-role-admission.js +381 -0
- package/dist/aura3d-cli/asset-role-admission.js.map +1 -0
- package/dist/aura3d-cli/asset-screening-effects.d.ts +95 -0
- package/dist/aura3d-cli/asset-screening-effects.d.ts.map +1 -0
- package/dist/aura3d-cli/asset-screening-effects.js +321 -0
- package/dist/aura3d-cli/asset-screening-effects.js.map +1 -0
- package/dist/aura3d-cli/asset-screening-pipeline.d.ts +132 -0
- package/dist/aura3d-cli/asset-screening-pipeline.d.ts.map +1 -0
- package/dist/aura3d-cli/asset-screening-pipeline.js +277 -0
- package/dist/aura3d-cli/asset-screening-pipeline.js.map +1 -0
- package/dist/aura3d-cli/cartoon-asset-profiles.d.ts +15 -0
- package/dist/aura3d-cli/cartoon-asset-profiles.d.ts.map +1 -0
- package/dist/aura3d-cli/cartoon-asset-profiles.js +46 -0
- package/dist/aura3d-cli/cartoon-asset-profiles.js.map +1 -0
- package/dist/aura3d-cli/cli-help.js +1 -1
- package/dist/aura3d-cli/cli.js +16 -2
- package/dist/aura3d-cli/cli.js.map +1 -1
- package/dist/aura3d-cli/index.d.ts +8 -0
- package/dist/aura3d-cli/index.d.ts.map +1 -1
- package/dist/aura3d-cli/index.js +390 -17
- package/dist/aura3d-cli/index.js.map +1 -1
- package/dist/aura3d-cli/pull-bridge/search.d.ts +4 -0
- package/dist/aura3d-cli/pull-bridge/search.d.ts.map +1 -1
- package/dist/aura3d-cli/pull-bridge/search.js +22 -0
- package/dist/aura3d-cli/pull-bridge/search.js.map +1 -1
- package/dist/aura3d-cli/pull-bridge.d.ts +20 -5
- package/dist/aura3d-cli/pull-bridge.d.ts.map +1 -1
- package/dist/aura3d-cli/pull-bridge.js +38 -1
- package/dist/aura3d-cli/pull-bridge.js.map +1 -1
- package/dist/controls/ControlState.d.ts +1 -1
- package/dist/controls/ControlState.d.ts.map +1 -1
- package/dist/controls/DragControls.d.ts +21 -1
- package/dist/controls/DragControls.d.ts.map +1 -1
- package/dist/controls/DragControls.js +24 -2
- package/dist/controls/DragControls.js.map +1 -1
- package/dist/controls/FirstPersonControls.d.ts +10 -1
- package/dist/controls/FirstPersonControls.d.ts.map +1 -1
- package/dist/controls/FirstPersonControls.js +18 -2
- package/dist/controls/FirstPersonControls.js.map +1 -1
- package/dist/controls/FlyControls.d.ts +42 -0
- package/dist/controls/FlyControls.d.ts.map +1 -1
- package/dist/controls/FlyControls.js +106 -3
- package/dist/controls/FlyControls.js.map +1 -1
- package/dist/controls/MapControls.d.ts +13 -0
- package/dist/controls/MapControls.d.ts.map +1 -1
- package/dist/controls/MapControls.js +40 -2
- package/dist/controls/MapControls.js.map +1 -1
- package/dist/controls/OrbitControls.d.ts +54 -0
- package/dist/controls/OrbitControls.d.ts.map +1 -1
- package/dist/controls/OrbitControls.js +133 -0
- package/dist/controls/OrbitControls.js.map +1 -1
- package/dist/controls/PointerLockControls.d.ts +12 -5
- package/dist/controls/PointerLockControls.d.ts.map +1 -1
- package/dist/controls/PointerLockControls.js +30 -11
- package/dist/controls/PointerLockControls.js.map +1 -1
- package/dist/controls/SelectionManager.d.ts +22 -1
- package/dist/controls/SelectionManager.d.ts.map +1 -1
- package/dist/controls/SelectionManager.js +64 -6
- package/dist/controls/SelectionManager.js.map +1 -1
- package/dist/controls/TransformControls.d.ts +135 -1
- package/dist/controls/TransformControls.d.ts.map +1 -1
- package/dist/controls/TransformControls.js +534 -10
- package/dist/controls/TransformControls.js.map +1 -1
- package/dist/controls/index.d.ts +7 -2
- package/dist/controls/index.d.ts.map +1 -1
- package/dist/controls/index.js +1 -1
- package/dist/controls/index.js.map +1 -1
- package/dist/create-aura3d/index.js +1 -1
- package/dist/create-aura3d/showcase-spec-game-geometry-extractor.d.ts +2 -0
- package/dist/create-aura3d/showcase-spec-game-geometry-extractor.d.ts.map +1 -1
- package/dist/create-aura3d/showcase-spec-game-geometry-extractor.js +781 -46
- package/dist/create-aura3d/showcase-spec-game-geometry-extractor.js.map +1 -1
- package/dist/create-aura3d/showcase-spec-game-template-evidence.d.ts.map +1 -1
- package/dist/create-aura3d/showcase-spec-game-template-evidence.js +24 -4
- package/dist/create-aura3d/showcase-spec-game-template-evidence.js.map +1 -1
- package/dist/create-aura3d/showcase-spec-platformer-artifacts.d.ts.map +1 -1
- package/dist/create-aura3d/showcase-spec-platformer-artifacts.js +28 -17
- package/dist/create-aura3d/showcase-spec-platformer-artifacts.js.map +1 -1
- package/dist/create-aura3d/showcase-spec-racing-artifacts.d.ts.map +1 -1
- package/dist/create-aura3d/showcase-spec-racing-artifacts.js +10 -5
- package/dist/create-aura3d/showcase-spec-racing-artifacts.js.map +1 -1
- package/dist/create-aura3d/showcase-spec-replacement-candidates.js +26 -0
- package/dist/create-aura3d/showcase-spec-replacement-candidates.js.map +1 -1
- package/dist/ecs/components/MeshComponent.d.ts +5 -2
- package/dist/ecs/components/MeshComponent.d.ts.map +1 -1
- package/dist/ecs/components/MeshComponent.js.map +1 -1
- package/dist/editor-runtime/CartoonSceneEditor.d.ts +111 -0
- package/dist/editor-runtime/CartoonSceneEditor.d.ts.map +1 -0
- package/dist/editor-runtime/CartoonSceneEditor.js +285 -0
- package/dist/editor-runtime/CartoonSceneEditor.js.map +1 -0
- package/dist/editor-runtime/InteractiveTransformGizmo.d.ts +142 -0
- package/dist/editor-runtime/InteractiveTransformGizmo.d.ts.map +1 -0
- package/dist/editor-runtime/InteractiveTransformGizmo.js +468 -0
- package/dist/editor-runtime/InteractiveTransformGizmo.js.map +1 -0
- package/dist/editor-runtime/index.d.ts +2 -0
- package/dist/editor-runtime/index.d.ts.map +1 -1
- package/dist/editor-runtime/index.js +1 -0
- package/dist/editor-runtime/index.js.map +1 -1
- package/dist/engine/agent-api/CartoonAssetManifest.d.ts +50 -0
- package/dist/engine/agent-api/CartoonAssetManifest.d.ts.map +1 -0
- package/dist/engine/agent-api/CartoonAssetManifest.js +65 -0
- package/dist/engine/agent-api/CartoonAssetManifest.js.map +1 -0
- package/dist/engine/agent-api/CartoonDirector.d.ts +120 -0
- package/dist/engine/agent-api/CartoonDirector.d.ts.map +1 -0
- package/dist/engine/agent-api/CartoonDirector.js +432 -0
- package/dist/engine/agent-api/CartoonDirector.js.map +1 -0
- package/dist/engine/agent-api/CartoonEpisodePackage.d.ts +51 -0
- package/dist/engine/agent-api/CartoonEpisodePackage.d.ts.map +1 -0
- package/dist/engine/agent-api/CartoonEpisodePackage.js +79 -0
- package/dist/engine/agent-api/CartoonEpisodePackage.js.map +1 -0
- package/dist/engine/agent-api/CartoonMotionQuality.d.ts +83 -0
- package/dist/engine/agent-api/CartoonMotionQuality.d.ts.map +1 -0
- package/dist/engine/agent-api/CartoonMotionQuality.js +128 -0
- package/dist/engine/agent-api/CartoonMotionQuality.js.map +1 -0
- package/dist/engine/agent-api/CartoonPerformance.d.ts +150 -0
- package/dist/engine/agent-api/CartoonPerformance.d.ts.map +1 -0
- package/dist/engine/agent-api/CartoonPerformance.js +345 -0
- package/dist/engine/agent-api/CartoonPerformance.js.map +1 -0
- package/dist/engine/agent-api/CartoonRenderQueue.d.ts +143 -0
- package/dist/engine/agent-api/CartoonRenderQueue.d.ts.map +1 -0
- package/dist/engine/agent-api/CartoonRenderQueue.js +410 -0
- package/dist/engine/agent-api/CartoonRenderQueue.js.map +1 -0
- package/dist/engine/agent-api/CartoonRouteProof.d.ts +112 -0
- package/dist/engine/agent-api/CartoonRouteProof.d.ts.map +1 -0
- package/dist/engine/agent-api/CartoonRouteProof.js +127 -0
- package/dist/engine/agent-api/CartoonRouteProof.js.map +1 -0
- package/dist/engine/agent-api/GameEvidence.d.ts +1 -0
- package/dist/engine/agent-api/GameEvidence.d.ts.map +1 -1
- package/dist/engine/agent-api/GameEvidence.js +1 -0
- package/dist/engine/agent-api/GameEvidence.js.map +1 -1
- package/dist/engine/agent-api/GameGenreKits.d.ts +13 -0
- package/dist/engine/agent-api/GameGenreKits.d.ts.map +1 -1
- package/dist/engine/agent-api/GameGenreKits.js +57 -11
- package/dist/engine/agent-api/GameGenreKits.js.map +1 -1
- package/dist/engine/agent-api/GameRuntime.d.ts +1 -0
- package/dist/engine/agent-api/GameRuntime.d.ts.map +1 -1
- package/dist/engine/agent-api/GameRuntime.js +1 -0
- package/dist/engine/agent-api/GameRuntime.js.map +1 -1
- package/dist/engine/agent-api/GameSceneGeometryBindings.d.ts +12 -0
- package/dist/engine/agent-api/GameSceneGeometryBindings.d.ts.map +1 -1
- package/dist/engine/agent-api/GameSceneGeometryBindings.js +2 -0
- package/dist/engine/agent-api/GameSceneGeometryBindings.js.map +1 -1
- package/dist/engine/agent-api/LayeredSceneComposition.d.ts +295 -0
- package/dist/engine/agent-api/LayeredSceneComposition.d.ts.map +1 -0
- package/dist/engine/agent-api/LayeredSceneComposition.js +387 -0
- package/dist/engine/agent-api/LayeredSceneComposition.js.map +1 -0
- package/dist/engine/agent-api/SceneGroundingUtils.d.ts +62 -0
- package/dist/engine/agent-api/SceneGroundingUtils.d.ts.map +1 -1
- package/dist/engine/agent-api/SceneGroundingUtils.js +37 -0
- package/dist/engine/agent-api/SceneGroundingUtils.js.map +1 -1
- package/dist/engine/agent-api/SubjectFramingUtils.d.ts +127 -0
- package/dist/engine/agent-api/SubjectFramingUtils.d.ts.map +1 -0
- package/dist/engine/agent-api/SubjectFramingUtils.js +126 -0
- package/dist/engine/agent-api/SubjectFramingUtils.js.map +1 -0
- package/dist/engine/agent-api/TouchControlBinding.d.ts +81 -0
- package/dist/engine/agent-api/TouchControlBinding.d.ts.map +1 -0
- package/dist/engine/agent-api/TouchControlBinding.js +116 -0
- package/dist/engine/agent-api/TouchControlBinding.js.map +1 -0
- package/dist/engine/agent-api/index.d.ts +39 -0
- package/dist/engine/agent-api/index.d.ts.map +1 -1
- package/dist/engine/agent-api/index.js +546 -74
- package/dist/engine/agent-api/index.js.map +1 -1
- package/dist/engine/agent-api/product-viewer-runtime.d.ts.map +1 -1
- package/dist/engine/production-runtime/GameRenderPreset.d.ts +32 -0
- package/dist/engine/production-runtime/GameRenderPreset.d.ts.map +1 -1
- package/dist/engine/production-runtime/GameRenderPreset.js +37 -2
- package/dist/engine/production-runtime/GameRenderPreset.js.map +1 -1
- package/dist/engine/production-runtime/TypedGLBActor.d.ts +8 -0
- package/dist/engine/production-runtime/TypedGLBActor.d.ts.map +1 -1
- package/dist/engine/production-runtime/TypedGLBActor.js +2 -1
- package/dist/engine/production-runtime/TypedGLBActor.js.map +1 -1
- package/dist/input/controls/PointerLockControls.d.ts +1 -1
- package/dist/input/controls/PointerLockControls.d.ts.map +1 -1
- package/dist/input/controls/PointerLockControls.js +12 -0
- package/dist/input/controls/PointerLockControls.js.map +1 -1
- package/dist/physics/Collider.d.ts +1 -1
- package/dist/physics/Collider.d.ts.map +1 -1
- package/dist/physics/Collider.js +2 -2
- package/dist/physics/Collider.js.map +1 -1
- package/dist/physics/CollisionEvents.d.ts +1 -0
- package/dist/physics/CollisionEvents.d.ts.map +1 -1
- package/dist/physics/CollisionEvents.js.map +1 -1
- package/dist/physics/NarrowPhase.d.ts +11 -0
- package/dist/physics/NarrowPhase.d.ts.map +1 -0
- package/dist/physics/NarrowPhase.js +565 -0
- package/dist/physics/NarrowPhase.js.map +1 -0
- package/dist/physics/PhysicsDebugDraw.js +19 -1
- package/dist/physics/PhysicsDebugDraw.js.map +1 -1
- package/dist/physics/PhysicsWorld.d.ts +43 -0
- package/dist/physics/PhysicsWorld.d.ts.map +1 -1
- package/dist/physics/PhysicsWorld.js +305 -30
- package/dist/physics/PhysicsWorld.js.map +1 -1
- package/dist/physics/RigidBody.d.ts +8 -1
- package/dist/physics/RigidBody.d.ts.map +1 -1
- package/dist/physics/RigidBody.js +32 -5
- package/dist/physics/RigidBody.js.map +1 -1
- package/dist/physics/Shape.d.ts +16 -2
- package/dist/physics/Shape.d.ts.map +1 -1
- package/dist/physics/Shape.js +93 -31
- package/dist/physics/Shape.js.map +1 -1
- package/dist/physics/TimeOfImpact.d.ts +15 -0
- package/dist/physics/TimeOfImpact.d.ts.map +1 -0
- package/dist/physics/TimeOfImpact.js +81 -0
- package/dist/physics/TimeOfImpact.js.map +1 -0
- package/dist/physics/index.d.ts +2 -0
- package/dist/physics/index.d.ts.map +1 -1
- package/dist/physics/index.js +2 -0
- package/dist/physics/index.js.map +1 -1
- package/dist/rendering/CascadedShadowMaps.d.ts +9 -1
- package/dist/rendering/CascadedShadowMaps.d.ts.map +1 -1
- package/dist/rendering/CascadedShadowMaps.js +68 -0
- package/dist/rendering/CascadedShadowMaps.js.map +1 -1
- package/dist/rendering/ClusteredForwardLighting.d.ts +28 -0
- package/dist/rendering/ClusteredForwardLighting.d.ts.map +1 -0
- package/dist/rendering/ClusteredForwardLighting.js +156 -0
- package/dist/rendering/ClusteredForwardLighting.js.map +1 -0
- package/dist/rendering/DepthPass.d.ts +14 -1
- package/dist/rendering/DepthPass.d.ts.map +1 -1
- package/dist/rendering/DepthPass.js +19 -4
- package/dist/rendering/DepthPass.js.map +1 -1
- package/dist/rendering/EnvironmentMapResources.d.ts +59 -1
- package/dist/rendering/EnvironmentMapResources.d.ts.map +1 -1
- package/dist/rendering/EnvironmentMapResources.js +140 -100
- package/dist/rendering/EnvironmentMapResources.js.map +1 -1
- package/dist/rendering/EnvironmentPlatform.d.ts +3 -2
- package/dist/rendering/EnvironmentPlatform.d.ts.map +1 -1
- package/dist/rendering/EnvironmentPlatform.js +99 -44
- package/dist/rendering/EnvironmentPlatform.js.map +1 -1
- package/dist/rendering/ForwardPass.d.ts +37 -0
- package/dist/rendering/ForwardPass.d.ts.map +1 -1
- package/dist/rendering/ForwardPass.js +234 -7
- package/dist/rendering/ForwardPass.js.map +1 -1
- package/dist/rendering/Geometry.d.ts +19 -0
- package/dist/rendering/Geometry.d.ts.map +1 -1
- package/dist/rendering/Geometry.js +64 -0
- package/dist/rendering/Geometry.js.map +1 -1
- package/dist/rendering/IBL.d.ts.map +1 -1
- package/dist/rendering/IBL.js +0 -1
- package/dist/rendering/IBL.js.map +1 -1
- package/dist/rendering/LightCollector.d.ts +5 -1
- package/dist/rendering/LightCollector.d.ts.map +1 -1
- package/dist/rendering/LightCollector.js +16 -3
- package/dist/rendering/LightCollector.js.map +1 -1
- package/dist/rendering/LightUniforms.d.ts +26 -1
- package/dist/rendering/LightUniforms.d.ts.map +1 -1
- package/dist/rendering/LightUniforms.js +140 -8
- package/dist/rendering/LightUniforms.js.map +1 -1
- package/dist/rendering/LightingRig.d.ts +77 -0
- package/dist/rendering/LightingRig.d.ts.map +1 -1
- package/dist/rendering/LightingRig.js +100 -11
- package/dist/rendering/LightingRig.js.map +1 -1
- package/dist/rendering/MeshConsolidation.d.ts +63 -0
- package/dist/rendering/MeshConsolidation.d.ts.map +1 -0
- package/dist/rendering/MeshConsolidation.js +251 -0
- package/dist/rendering/MeshConsolidation.js.map +1 -0
- package/dist/rendering/PMREM.d.ts +13 -1
- package/dist/rendering/PMREM.d.ts.map +1 -1
- package/dist/rendering/PMREM.js +18 -4
- package/dist/rendering/PMREM.js.map +1 -1
- package/dist/rendering/PostProcessPass.d.ts +24 -2
- package/dist/rendering/PostProcessPass.d.ts.map +1 -1
- package/dist/rendering/PostProcessPass.js +136 -18
- package/dist/rendering/PostProcessPass.js.map +1 -1
- package/dist/rendering/PrimitiveSubmissionAudit.d.ts +195 -0
- package/dist/rendering/PrimitiveSubmissionAudit.d.ts.map +1 -0
- package/dist/rendering/PrimitiveSubmissionAudit.js +280 -0
- package/dist/rendering/PrimitiveSubmissionAudit.js.map +1 -0
- package/dist/rendering/ProductTurntableFixtures.d.ts.map +1 -1
- package/dist/rendering/ProductTurntableFixtures.js +93 -13
- package/dist/rendering/ProductTurntableFixtures.js.map +1 -1
- package/dist/rendering/ReflectionProbe.d.ts +59 -0
- package/dist/rendering/ReflectionProbe.d.ts.map +1 -1
- package/dist/rendering/ReflectionProbe.js +224 -0
- package/dist/rendering/ReflectionProbe.js.map +1 -1
- package/dist/rendering/ReflectionSurfaces.d.ts +4 -2
- package/dist/rendering/ReflectionSurfaces.d.ts.map +1 -1
- package/dist/rendering/ReflectionSurfaces.js +13 -8
- package/dist/rendering/ReflectionSurfaces.js.map +1 -1
- package/dist/rendering/RenderBackend.d.ts +1 -1
- package/dist/rendering/RenderBackend.d.ts.map +1 -1
- package/dist/rendering/RenderBackend.js +5 -1
- package/dist/rendering/RenderBackend.js.map +1 -1
- package/dist/rendering/RenderDevice.d.ts +13 -2
- package/dist/rendering/RenderDevice.d.ts.map +1 -1
- package/dist/rendering/RenderDevice.js +5 -2
- package/dist/rendering/RenderDevice.js.map +1 -1
- package/dist/rendering/Renderer.d.ts +41 -1
- package/dist/rendering/Renderer.d.ts.map +1 -1
- package/dist/rendering/Renderer.js +406 -61
- package/dist/rendering/Renderer.js.map +1 -1
- package/dist/rendering/RendererPostprocessPlan.d.ts +10 -3
- package/dist/rendering/RendererPostprocessPlan.d.ts.map +1 -1
- package/dist/rendering/RendererPostprocessPlan.js +25 -5
- package/dist/rendering/RendererPostprocessPlan.js.map +1 -1
- package/dist/rendering/RendererVisualPipelineReport.d.ts +3 -2
- package/dist/rendering/RendererVisualPipelineReport.d.ts.map +1 -1
- package/dist/rendering/RendererVisualPipelineReport.js +2 -0
- package/dist/rendering/RendererVisualPipelineReport.js.map +1 -1
- package/dist/rendering/ScreenSpaceLineMaterial.d.ts +34 -0
- package/dist/rendering/ScreenSpaceLineMaterial.d.ts.map +1 -0
- package/dist/rendering/ScreenSpaceLineMaterial.js +93 -0
- package/dist/rendering/ScreenSpaceLineMaterial.js.map +1 -0
- package/dist/rendering/ShaderChunks.d.ts +7 -0
- package/dist/rendering/ShaderChunks.d.ts.map +1 -1
- package/dist/rendering/ShaderChunks.js +137 -0
- package/dist/rendering/ShaderChunks.js.map +1 -1
- package/dist/rendering/ShaderLibrary.d.ts +17 -0
- package/dist/rendering/ShaderLibrary.d.ts.map +1 -1
- package/dist/rendering/ShaderLibrary.js +940 -98
- package/dist/rendering/ShaderLibrary.js.map +1 -1
- package/dist/rendering/ShadowPass.d.ts +10 -0
- package/dist/rendering/ShadowPass.d.ts.map +1 -1
- package/dist/rendering/ShadowPass.js +8 -1
- package/dist/rendering/ShadowPass.js.map +1 -1
- package/dist/rendering/SkinnedLitMaterial.d.ts +6 -0
- package/dist/rendering/SkinnedLitMaterial.d.ts.map +1 -1
- package/dist/rendering/SkinnedLitMaterial.js +22 -8
- package/dist/rendering/SkinnedLitMaterial.js.map +1 -1
- package/dist/rendering/SkinnedUnlitMaterial.d.ts +8 -0
- package/dist/rendering/SkinnedUnlitMaterial.d.ts.map +1 -1
- package/dist/rendering/SkinnedUnlitMaterial.js +26 -9
- package/dist/rendering/SkinnedUnlitMaterial.js.map +1 -1
- package/dist/rendering/SpecularPrefilter.d.ts +42 -0
- package/dist/rendering/SpecularPrefilter.d.ts.map +1 -0
- package/dist/rendering/SpecularPrefilter.js +480 -0
- package/dist/rendering/SpecularPrefilter.js.map +1 -0
- package/dist/rendering/TerrainFixtures.d.ts +24 -0
- package/dist/rendering/TerrainFixtures.d.ts.map +1 -1
- package/dist/rendering/TerrainFixtures.js +96 -0
- package/dist/rendering/TerrainFixtures.js.map +1 -1
- package/dist/rendering/Texture.d.ts +7 -0
- package/dist/rendering/Texture.d.ts.map +1 -1
- package/dist/rendering/Texture.js +9 -0
- package/dist/rendering/Texture.js.map +1 -1
- package/dist/rendering/VertexFormat.d.ts +34 -1
- package/dist/rendering/VertexFormat.d.ts.map +1 -1
- package/dist/rendering/VertexFormat.js +61 -0
- package/dist/rendering/VertexFormat.js.map +1 -1
- package/dist/rendering/WebGL2Device.d.ts +48 -0
- package/dist/rendering/WebGL2Device.d.ts.map +1 -1
- package/dist/rendering/WebGL2Device.js +1298 -44
- package/dist/rendering/WebGL2Device.js.map +1 -1
- package/dist/rendering/WebGPUDevice.d.ts +7 -2
- package/dist/rendering/WebGPUDevice.d.ts.map +1 -1
- package/dist/rendering/WebGPUDevice.js +111 -17
- package/dist/rendering/WebGPUDevice.js.map +1 -1
- package/dist/rendering/WebGPUSkinningLimits.d.ts +14 -0
- package/dist/rendering/WebGPUSkinningLimits.d.ts.map +1 -0
- package/dist/rendering/WebGPUSkinningLimits.js +14 -0
- package/dist/rendering/WebGPUSkinningLimits.js.map +1 -0
- package/dist/rendering/cartoon/CartoonMaterialStyle.d.ts +19 -0
- package/dist/rendering/cartoon/CartoonMaterialStyle.d.ts.map +1 -0
- package/dist/rendering/cartoon/CartoonMaterialStyle.js +13 -0
- package/dist/rendering/cartoon/CartoonMaterialStyle.js.map +1 -0
- package/dist/rendering/cartoon/CartoonRenderPreset.d.ts +36 -0
- package/dist/rendering/cartoon/CartoonRenderPreset.d.ts.map +1 -0
- package/dist/rendering/cartoon/CartoonRenderPreset.js +23 -0
- package/dist/rendering/cartoon/CartoonRenderPreset.js.map +1 -0
- package/dist/rendering/cartoon/CartoonToonMaterial.d.ts +130 -0
- package/dist/rendering/cartoon/CartoonToonMaterial.d.ts.map +1 -0
- package/dist/rendering/cartoon/CartoonToonMaterial.js +303 -0
- package/dist/rendering/cartoon/CartoonToonMaterial.js.map +1 -0
- package/dist/rendering/cartoon/CartoonVisualQuality.d.ts +28 -0
- package/dist/rendering/cartoon/CartoonVisualQuality.d.ts.map +1 -0
- package/dist/rendering/cartoon/CartoonVisualQuality.js +39 -0
- package/dist/rendering/cartoon/CartoonVisualQuality.js.map +1 -0
- package/dist/rendering/cartoon/applyCartoonRenderPreset.d.ts +79 -0
- package/dist/rendering/cartoon/applyCartoonRenderPreset.d.ts.map +1 -0
- package/dist/rendering/cartoon/applyCartoonRenderPreset.js +88 -0
- package/dist/rendering/cartoon/applyCartoonRenderPreset.js.map +1 -0
- package/dist/rendering/cartoon/index.d.ts +6 -0
- package/dist/rendering/cartoon/index.d.ts.map +1 -0
- package/dist/rendering/cartoon/index.js +6 -0
- package/dist/rendering/cartoon/index.js.map +1 -0
- package/dist/rendering/index.d.ts +26 -15
- package/dist/rendering/index.d.ts.map +1 -1
- package/dist/rendering/index.js +15 -9
- package/dist/rendering/index.js.map +1 -1
- package/dist/rendering/postprocess/NativeLdrEffectLuts.d.ts +93 -0
- package/dist/rendering/postprocess/NativeLdrEffectLuts.d.ts.map +1 -0
- package/dist/rendering/postprocess/NativeLdrEffectLuts.js +202 -0
- package/dist/rendering/postprocess/NativeLdrEffectLuts.js.map +1 -0
- package/dist/rendering/production-runtime/PBRHDRPipeline.d.ts.map +1 -1
- package/dist/rendering/production-runtime/PBRHDRPipeline.js +3 -0
- package/dist/rendering/production-runtime/PBRHDRPipeline.js.map +1 -1
- package/dist/rendering/production-runtime/ProductionRendererTypes.d.ts +1 -0
- package/dist/rendering/production-runtime/ProductionRendererTypes.d.ts.map +1 -1
- package/dist/rendering/production-runtime/ProductionRendererTypes.js.map +1 -1
- package/dist/rendering/production-runtime/ProductionWebGL2Renderer.d.ts.map +1 -1
- package/dist/rendering/production-runtime/ProductionWebGL2Renderer.js +5 -3
- package/dist/rendering/production-runtime/ProductionWebGL2Renderer.js.map +1 -1
- package/dist/rendering/production-runtime/ProductionWebGPURenderer.d.ts.map +1 -1
- package/dist/rendering/production-runtime/ProductionWebGPURenderer.js +9 -5
- package/dist/rendering/production-runtime/ProductionWebGPURenderer.js.map +1 -1
- package/dist/rendering/production-runtime/TransmissionBackdropCapture.d.ts +5 -0
- package/dist/rendering/production-runtime/TransmissionBackdropCapture.d.ts.map +1 -1
- package/dist/rendering/production-runtime/TransmissionBackdropCapture.js +40 -0
- package/dist/rendering/production-runtime/TransmissionBackdropCapture.js.map +1 -1
- package/dist/rendering/production-runtime/environment/HDRLoader.d.ts +6 -0
- package/dist/rendering/production-runtime/environment/HDRLoader.d.ts.map +1 -1
- package/dist/rendering/production-runtime/environment/HDRLoader.js +19 -0
- package/dist/rendering/production-runtime/environment/HDRLoader.js.map +1 -1
- package/dist/rendering/production-runtime/index.d.ts +3 -1
- package/dist/rendering/production-runtime/index.d.ts.map +1 -1
- package/dist/rendering/production-runtime/index.js +1 -0
- package/dist/rendering/production-runtime/index.js.map +1 -1
- package/dist/scene/Light.d.ts +1 -1
- package/dist/scene/Light.d.ts.map +1 -1
- package/dist/scene/RectAreaLight.d.ts +22 -0
- package/dist/scene/RectAreaLight.d.ts.map +1 -0
- package/dist/scene/RectAreaLight.js +46 -0
- package/dist/scene/RectAreaLight.js.map +1 -0
- package/dist/scene/Scene.d.ts +6 -1
- package/dist/scene/Scene.d.ts.map +1 -1
- package/dist/scene/Scene.js +8 -1
- package/dist/scene/Scene.js.map +1 -1
- package/dist/scene/SceneSerializer.d.ts +3 -1
- package/dist/scene/SceneSerializer.d.ts.map +1 -1
- package/dist/scene/SceneSerializer.js +14 -7
- package/dist/scene/SceneSerializer.js.map +1 -1
- package/dist/scene/index.d.ts +1 -0
- package/dist/scene/index.d.ts.map +1 -1
- package/dist/scene/index.js +1 -0
- package/dist/scene/index.js.map +1 -1
- package/dist/scripting/CartoonNodeCategories.d.ts +3 -0
- package/dist/scripting/CartoonNodeCategories.d.ts.map +1 -0
- package/dist/scripting/CartoonNodeCategories.js +9 -0
- package/dist/scripting/CartoonNodeCategories.js.map +1 -0
- package/dist/scripting/CartoonVisualNodes.d.ts +3 -0
- package/dist/scripting/CartoonVisualNodes.d.ts.map +1 -0
- package/dist/scripting/CartoonVisualNodes.js +41 -0
- package/dist/scripting/CartoonVisualNodes.js.map +1 -0
- package/package.json +124 -113
- package/templates/cinematic-scene/package.json +1 -1
- package/templates/mini-game/package.json +1 -1
- package/templates/product-viewer/package.json +1 -1
- package/templates/production-asset-inspector/README.md +5 -0
- package/templates/production-asset-inspector/asset-manifest.json +9 -0
- package/templates/production-asset-inspector/index.html +2 -0
- package/templates/production-asset-inspector/package.json +17 -0
- package/templates/production-asset-inspector/src/main.ts +16 -0
- package/templates/production-material-studio/README.md +5 -0
- package/templates/production-material-studio/asset-manifest.json +9 -0
- package/templates/production-material-studio/index.html +2 -0
- package/templates/production-material-studio/package.json +17 -0
- package/templates/production-material-studio/src/main.ts +16 -0
- package/templates/production-product-configurator/README.md +5 -0
- package/templates/production-product-configurator/asset-manifest.json +9 -0
- package/templates/production-product-configurator/index.html +2 -0
- package/templates/production-product-configurator/package.json +17 -0
- package/templates/production-product-configurator/src/main.ts +16 -0
- package/templates/production-product-viewer/README.md +7 -0
- package/templates/production-product-viewer/asset-manifest.json +8 -0
- package/templates/production-product-viewer/index.html +26 -0
- package/templates/production-product-viewer/package.json +17 -0
- package/templates/production-product-viewer/src/main.ts +70 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PhysicsDebugDraw, PhysicsStepper, PhysicsWorld, ScenePhysicsBridge, Shape as PhysicsShapeFactory } from "../../physics/index.js";
|
|
2
2
|
import { createExternalParityEnvironmentLighting, Geometry, IndexBuffer, PBRMaterial, ProductionRuntimeRenderer, VertexBuffer, VertexFormat } from "../../rendering/index.js";
|
|
3
|
-
import { DirectionalLight } from "../../scene/index.js";
|
|
3
|
+
import { DirectionalLight, PointLight, SpotLight } from "../../scene/index.js";
|
|
4
4
|
import { createTypedGLBActor } from "../production-runtime/TypedGLBActor.js";
|
|
5
5
|
import { AURA_NORMALIZED_MODEL_MAX_DIMENSION, boundsFromAsset, boundsHeight, boundsMaxDimension, boundsSize } from "./SceneGroundingUtils.js";
|
|
6
6
|
export * from "./FrameEncoder.js";
|
|
@@ -35,6 +35,9 @@ export * from "./CloudRenderAdapter.js";
|
|
|
35
35
|
export * from "./BatchEpisodeRenderer.js";
|
|
36
36
|
export * from "./AnimationAssetManifest.js";
|
|
37
37
|
export * from "./SceneGroundingUtils.js";
|
|
38
|
+
export * from "./SubjectFramingUtils.js";
|
|
39
|
+
export * from "./LayeredSceneComposition.js";
|
|
40
|
+
export * from "./TouchControlBinding.js";
|
|
38
41
|
export * from "./AssetLibraryBrowser.js";
|
|
39
42
|
export * from "./DialogueAlignment.js";
|
|
40
43
|
export * from "./PerformancePoseEditor.js";
|
|
@@ -98,6 +101,9 @@ export * from "./AnimationPerformance.js";
|
|
|
98
101
|
export * from "./AnimationRenderQueue.js";
|
|
99
102
|
export * from "./AnimationAssetManifest.js";
|
|
100
103
|
export * from "./SceneGroundingUtils.js";
|
|
104
|
+
export * from "./SubjectFramingUtils.js";
|
|
105
|
+
export * from "./LayeredSceneComposition.js";
|
|
106
|
+
export * from "./TouchControlBinding.js";
|
|
101
107
|
export * from "./AssetLibraryBrowser.js";
|
|
102
108
|
const auraAssetRefBrand = Symbol("AuraAssetRef");
|
|
103
109
|
export function defineAuraAssets(definitions) {
|
|
@@ -1735,7 +1741,17 @@ function createRendererDiagnosticReport(snapshot, runtime, rendererOptions) {
|
|
|
1735
1741
|
antiBlowout: bloom?.antiBlowout ?? true
|
|
1736
1742
|
},
|
|
1737
1743
|
shadows: {
|
|
1738
|
-
|
|
1744
|
+
// Never a source-authored `true`. When the runtime is mounted this is the
|
|
1745
|
+
// device-observed shadow-map state; when it is not mounted the scene has
|
|
1746
|
+
// only requested shadows and nothing has been proven yet.
|
|
1747
|
+
enabled: runtime?.mounted ? Boolean(runtime.shadow?.mapSampled) : false,
|
|
1748
|
+
requested: runtime?.shadow?.requested ?? false,
|
|
1749
|
+
mapRendered: runtime?.shadow?.mapRendered ?? false,
|
|
1750
|
+
mapSampled: runtime?.shadow?.mapSampled ?? false,
|
|
1751
|
+
mapSize: runtime?.shadow?.mapSize,
|
|
1752
|
+
label: runtime?.shadow?.label,
|
|
1753
|
+
nativeShadowMapBindings: runtime?.shadow?.nativeShadowMapBindings ?? 0,
|
|
1754
|
+
shadowRenderTargetsAllocated: runtime?.shadow?.shadowRenderTargetsAllocated ?? 0,
|
|
1739
1755
|
contactShadows,
|
|
1740
1756
|
mapType: "pcf-soft"
|
|
1741
1757
|
},
|
|
@@ -4325,7 +4341,12 @@ export function createGamePlatformerPresentationSurfaceNodes(options) {
|
|
|
4325
4341
|
const point = options.sceneBinding.toScenePoint(checkpoint, 0.02);
|
|
4326
4342
|
nodes.push(primitives.box({
|
|
4327
4343
|
name: `scene-bound platformer checkpoint ${checkpoint.id}`,
|
|
4328
|
-
material: material.emissive({
|
|
4344
|
+
material: material.emissive({
|
|
4345
|
+
color: options.checkpointColor ?? "#d7f9ff",
|
|
4346
|
+
emissive: options.checkpointColor ?? "#a6f4ff",
|
|
4347
|
+
emissiveIntensity: 0.48,
|
|
4348
|
+
roughness: 0.4
|
|
4349
|
+
})
|
|
4329
4350
|
})
|
|
4330
4351
|
.position(point[0], point[1], point[2] + (isGameLevel ? 0.29 : 0.19))
|
|
4331
4352
|
.scale([0.026, 0.22, 0.034])
|
|
@@ -7131,38 +7152,7 @@ async function createProductionSceneRenderer(canvas, snapshot, rendererOptions,
|
|
|
7131
7152
|
], runtimeNodes);
|
|
7132
7153
|
}
|
|
7133
7154
|
}
|
|
7134
|
-
|
|
7135
|
-
targetFormat: "rgba8",
|
|
7136
|
-
toneMapping: {
|
|
7137
|
-
exposure: 1.14,
|
|
7138
|
-
whitePoint: 1.18,
|
|
7139
|
-
operator: "filmic",
|
|
7140
|
-
inputColorSpace: "linear",
|
|
7141
|
-
outputColorSpace: "srgb"
|
|
7142
|
-
},
|
|
7143
|
-
colorGrade: {
|
|
7144
|
-
contrast: 1.1,
|
|
7145
|
-
saturation: 1.06,
|
|
7146
|
-
vibrance: 0.12,
|
|
7147
|
-
vignette: 0.08,
|
|
7148
|
-
sharpening: 0.24
|
|
7149
|
-
},
|
|
7150
|
-
fxaa: {
|
|
7151
|
-
edgeThreshold: 0.08,
|
|
7152
|
-
subpixelBlend: 0.55
|
|
7153
|
-
}
|
|
7154
|
-
};
|
|
7155
|
-
const PRODUCTION_RUNTIME_SHADOWS = {
|
|
7156
|
-
enabled: true,
|
|
7157
|
-
size: 1024,
|
|
7158
|
-
bias: 0.0014,
|
|
7159
|
-
strength: 0.28,
|
|
7160
|
-
pcfRadius: 1.2,
|
|
7161
|
-
pcfSamples: 9,
|
|
7162
|
-
filter: "pcf",
|
|
7163
|
-
label: "aura3d-root-production-shadow-map"
|
|
7164
|
-
};
|
|
7165
|
-
let cachedProductionRuntimeLights;
|
|
7155
|
+
let cachedProductionRuntimeFallbackLights;
|
|
7166
7156
|
function createProductionRuntimeEnvironment(snapshot) {
|
|
7167
7157
|
const names = groups.flatten(snapshot.nodes).map((node) => "name" in node ? node.name?.toLowerCase() ?? "" : "");
|
|
7168
7158
|
const category = resolveRendererSceneCategory(snapshot, names);
|
|
@@ -7179,11 +7169,149 @@ function createProductionRuntimeEnvironment(snapshot) {
|
|
|
7179
7169
|
lighting: bundle.lighting
|
|
7180
7170
|
};
|
|
7181
7171
|
}
|
|
7182
|
-
|
|
7183
|
-
|
|
7172
|
+
/**
|
|
7173
|
+
* Translates a public `effects.fog(...)` node into renderer forward-pass fog.
|
|
7174
|
+
*
|
|
7175
|
+
* Without this the root bridge never set `environmentFog`, so `effects.fog()` was
|
|
7176
|
+
* accepted by the scene builder, reported as `fog.enabled` in diagnostics, and
|
|
7177
|
+
* changed exactly zero pixels through `createAuraApp`. Returning `false` when no
|
|
7178
|
+
* fog node is authored keeps the unfogged path unchanged.
|
|
7179
|
+
*/
|
|
7180
|
+
function createProductionRuntimeEnvironmentFog(snapshot) {
|
|
7181
|
+
const fog = groups.flatten(snapshot.nodes).find((node) => node.kind === "effect" && node.effect === "fog");
|
|
7182
|
+
if (!fog)
|
|
7183
|
+
return false;
|
|
7184
|
+
const density = clampNumber(fog.density ?? 0.12, 0, 1);
|
|
7185
|
+
const intensity = clampNumber(fog.intensity ?? 0.5, 0, 1);
|
|
7186
|
+
const color = colorToRgb(fog.color ?? "#9fb7d9");
|
|
7187
|
+
return {
|
|
7188
|
+
// Exponential-squared reads as depth haze rather than a hard linear band, which
|
|
7189
|
+
// matches what the public helper documents.
|
|
7190
|
+
mode: "exponential-squared",
|
|
7191
|
+
color: [color[0], color[1], color[2]],
|
|
7192
|
+
near: 1,
|
|
7193
|
+
far: 60,
|
|
7194
|
+
density,
|
|
7195
|
+
maxOpacity: clampNumber(0.25 + intensity * 0.55, 0, 0.92)
|
|
7196
|
+
};
|
|
7197
|
+
}
|
|
7198
|
+
function createProductionRuntimePostprocess(snapshot) {
|
|
7199
|
+
const nodes = groups.flatten(snapshot.nodes);
|
|
7200
|
+
const names = nodes.map((node) => "name" in node ? node.name?.toLowerCase() ?? "" : "");
|
|
7201
|
+
const category = resolveRendererSceneCategory(snapshot, names);
|
|
7202
|
+
const authoredBloom = nodes.find((node) => node.kind === "effect" && node.effect === "bloom");
|
|
7203
|
+
const emissiveSubjects = nodes.filter((node) => {
|
|
7204
|
+
if (!("material" in node) || !node.material)
|
|
7205
|
+
return false;
|
|
7206
|
+
return Boolean(node.material.emissive) && (node.material.emissiveIntensity ?? 1) > 0;
|
|
7207
|
+
}).length;
|
|
7208
|
+
const darkScene = ["neon", "city-night", "space", "game"].includes(category);
|
|
7209
|
+
const bloomRequested = Boolean(authoredBloom) || (darkScene && emissiveSubjects > 0);
|
|
7210
|
+
// Root previously advertised `ssao` in `requestedPasses` whenever a scene added
|
|
7211
|
+
// effects.ambientOcclusion() or effects.contactOcclusion(), but never submitted
|
|
7212
|
+
// an `ssao` option to the renderer. The advertised pass could therefore never
|
|
7213
|
+
// run, and `ambientOcclusionPass` was permanently false. Submit the real option
|
|
7214
|
+
// so the request and the rendered pass agree.
|
|
7215
|
+
const authoredAmbientOcclusion = nodes.find((node) => node.kind === "effect" && node.effect === "ambient-occlusion");
|
|
7216
|
+
const authoredContactOcclusion = nodes.find((node) => node.kind === "effect" && node.effect === "contact-occlusion");
|
|
7217
|
+
const authoredOcclusion = authoredAmbientOcclusion ?? authoredContactOcclusion;
|
|
7218
|
+
const exposure = category === "city-day" ? 1.02
|
|
7219
|
+
: category === "material" || category === "product" ? 1.08
|
|
7220
|
+
: category === "space" ? 1.18
|
|
7221
|
+
: 1.12;
|
|
7222
|
+
const saturation = category === "material" || category === "product" ? 1.01
|
|
7223
|
+
: category === "city-day" ? 1.04
|
|
7224
|
+
: 1.1;
|
|
7225
|
+
return {
|
|
7226
|
+
targetFormat: "rgba8",
|
|
7227
|
+
...(bloomRequested ? {
|
|
7228
|
+
bloom: {
|
|
7229
|
+
threshold: clampNumber(authoredBloom?.threshold ?? (darkScene ? 0.68 : 0.78), 0, 1),
|
|
7230
|
+
intensity: clampNumber(authoredBloom?.intensity ?? Math.min(0.5, 0.24 + emissiveSubjects * 0.035), 0, 2),
|
|
7231
|
+
radius: Math.max(1, Math.min(4, Math.round(authoredBloom?.radius ?? (category === "space" ? 3 : 2))))
|
|
7232
|
+
}
|
|
7233
|
+
} : {}),
|
|
7234
|
+
...(authoredOcclusion ? {
|
|
7235
|
+
ssao: {
|
|
7236
|
+
// The renderer's SSAO radius is an integer sample-kernel size in pixels
|
|
7237
|
+
// (1-8), while the public effect `radius` is a world-space extent whose
|
|
7238
|
+
// default is 0.42. Passing the authored value straight through threw
|
|
7239
|
+
// "SSAO radius must be an integer in [1, 8]" and left the route with zero
|
|
7240
|
+
// draw calls, so it is mapped onto the kernel range instead.
|
|
7241
|
+
radius: Math.max(1, Math.min(8, Math.round((authoredOcclusion.radius ?? 0.42) * 8))),
|
|
7242
|
+
intensity: clampNumber(authoredOcclusion.intensity ?? 0.32, 0, 1),
|
|
7243
|
+
bias: 0.025
|
|
7244
|
+
}
|
|
7245
|
+
} : {}),
|
|
7246
|
+
toneMapping: {
|
|
7247
|
+
exposure,
|
|
7248
|
+
whitePoint: category === "city-day" ? 1.28 : 1.18,
|
|
7249
|
+
operator: "filmic",
|
|
7250
|
+
inputColorSpace: "linear",
|
|
7251
|
+
outputColorSpace: "srgb"
|
|
7252
|
+
},
|
|
7253
|
+
colorGrade: {
|
|
7254
|
+
contrast: category === "material" || category === "product" ? 1.06 : 1.1,
|
|
7255
|
+
saturation,
|
|
7256
|
+
vibrance: darkScene ? 0.14 : 0.06,
|
|
7257
|
+
vignette: category === "game" || category === "neon" ? 0.1 : 0.04,
|
|
7258
|
+
sharpening: category === "material" || category === "product" ? 0.28 : 0.2
|
|
7259
|
+
},
|
|
7260
|
+
fxaa: {
|
|
7261
|
+
edgeThreshold: category === "game" ? 0.07 : 0.09,
|
|
7262
|
+
subpixelBlend: category === "material" || category === "product" ? 0.48 : 0.58
|
|
7263
|
+
}
|
|
7264
|
+
};
|
|
7265
|
+
}
|
|
7266
|
+
function createProductionRuntimeShadowOptions(snapshot, collectedLights) {
|
|
7267
|
+
const nodes = groups.flatten(snapshot.nodes);
|
|
7268
|
+
const names = nodes.map((node) => "name" in node ? node.name?.toLowerCase() ?? "" : "");
|
|
7269
|
+
const category = resolveRendererSceneCategory(snapshot, names);
|
|
7270
|
+
const sceneRadius = nodes.reduce((radius, node) => {
|
|
7271
|
+
const position = "position" in node && Array.isArray(node.position)
|
|
7272
|
+
? node.position
|
|
7273
|
+
: [0, 0, 0];
|
|
7274
|
+
const nodeScale = "scale" in node ? node.scale : undefined;
|
|
7275
|
+
const scale = typeof nodeScale === "number"
|
|
7276
|
+
? Math.abs(nodeScale)
|
|
7277
|
+
: Array.isArray(nodeScale) ? Math.max(...nodeScale.map(Math.abs)) : 1;
|
|
7278
|
+
return Math.max(radius, Math.hypot(...position) + scale);
|
|
7279
|
+
}, 1);
|
|
7280
|
+
const shadowCaster = collectedLights.find((light) => light.castsShadow);
|
|
7281
|
+
const size = sceneRadius > 30 ? 4096 : sceneRadius > 10 ? 2048 : 1024;
|
|
7282
|
+
const texelWorldSize = (sceneRadius * 2) / size;
|
|
7283
|
+
return {
|
|
7284
|
+
enabled: Boolean(shadowCaster),
|
|
7285
|
+
size,
|
|
7286
|
+
bias: clampNumber(texelWorldSize * 0.55, 0.00035, 0.004),
|
|
7287
|
+
strength: category === "city-day" ? 0.38
|
|
7288
|
+
: category === "material" || category === "product" ? 0.24
|
|
7289
|
+
: 0.32,
|
|
7290
|
+
pcfRadius: size >= 2048 ? 1.5 : 1.2,
|
|
7291
|
+
pcfSamples: size >= 2048 ? 16 : 9,
|
|
7292
|
+
filter: "pcf",
|
|
7293
|
+
label: `aura3d-root-production-${category}-${size}px-shadow-map`
|
|
7294
|
+
};
|
|
7184
7295
|
}
|
|
7185
|
-
|
|
7186
|
-
|
|
7296
|
+
/**
|
|
7297
|
+
* Device-observed shadow state. `requested` comes from the submitted shadow
|
|
7298
|
+
* options, but `mapRendered`/`mapSampled` come only from what the device
|
|
7299
|
+
* actually did: a shadow depth target has to exist and a shader has to bind and
|
|
7300
|
+
* sample it. This is what stops the root report from publishing an unconditional
|
|
7301
|
+
* `shadows.enabled: true`.
|
|
7302
|
+
*/
|
|
7303
|
+
function createProductionRuntimeShadowObservation(shadowOptions, diagnostics) {
|
|
7304
|
+
const nativeShadowMapBindings = diagnostics.nativeShadowMapBindings ?? 0;
|
|
7305
|
+
const mapRendered = Boolean(shadowOptions.enabled) && (diagnostics.shadowRenderTargetsAllocated ?? 0) > 0;
|
|
7306
|
+
return {
|
|
7307
|
+
requested: Boolean(shadowOptions.enabled),
|
|
7308
|
+
mapRendered,
|
|
7309
|
+
mapSampled: mapRendered && nativeShadowMapBindings > 0,
|
|
7310
|
+
mapSize: shadowOptions.size,
|
|
7311
|
+
label: shadowOptions.label,
|
|
7312
|
+
nativeShadowMapBindings,
|
|
7313
|
+
shadowRenderTargetsAllocated: diagnostics.shadowRenderTargetsAllocated ?? 0
|
|
7314
|
+
};
|
|
7187
7315
|
}
|
|
7188
7316
|
function createProductionRuntimePostprocessObservation(diagnostics) {
|
|
7189
7317
|
const actualPasses = diagnostics.postprocessPassNames ?? [];
|
|
@@ -7199,22 +7327,150 @@ function createProductionRuntimePostprocessObservation(diagnostics) {
|
|
|
7199
7327
|
fallbackPasses: pixelBacked ? [] : ["direct-render"]
|
|
7200
7328
|
};
|
|
7201
7329
|
}
|
|
7202
|
-
function createProductionRuntimeCollectedLights() {
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
const
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7330
|
+
function createProductionRuntimeCollectedLights(snapshot) {
|
|
7331
|
+
const authoredLights = groups.flatten(snapshot.nodes).filter((node) => node.kind === "light");
|
|
7332
|
+
const descriptors = authoredLights.flatMap((node, index) => createProductionRuntimeLightDescriptors(node, index));
|
|
7333
|
+
if (descriptors.length === 0)
|
|
7334
|
+
return createProductionRuntimeFallbackLights();
|
|
7335
|
+
const shadowCasterIndex = descriptors.reduce((selected, descriptor, index) => {
|
|
7336
|
+
if (selected < 0)
|
|
7337
|
+
return index;
|
|
7338
|
+
const current = descriptors[selected];
|
|
7339
|
+
if (descriptor.shadowPriority !== current.shadowPriority) {
|
|
7340
|
+
return descriptor.shadowPriority > current.shadowPriority ? index : selected;
|
|
7341
|
+
}
|
|
7342
|
+
return descriptor.intensity > current.intensity ? index : selected;
|
|
7343
|
+
}, -1);
|
|
7344
|
+
return descriptors.map((descriptor, index) => createProductionRuntimeCollectedLight(descriptor, index === shadowCasterIndex));
|
|
7345
|
+
}
|
|
7346
|
+
function createProductionRuntimeLightDescriptors(node, authoredIndex) {
|
|
7347
|
+
const name = node.name?.trim() || `aura-authored-${node.light}-${authoredIndex + 1}`;
|
|
7348
|
+
const color = colorToRgb(node.color ?? "#ffffff");
|
|
7349
|
+
const intensity = nonNegativeFinite(node.intensity);
|
|
7350
|
+
const position = productionRuntimeLightPosition(node);
|
|
7351
|
+
const direction = productionRuntimeLightDirection(node, position);
|
|
7352
|
+
if (node.light === "ambient") {
|
|
7353
|
+
// CollectedLight intentionally represents direct lights only. Ambient light remains
|
|
7354
|
+
// environment-lighting intent and does not masquerade as a directional light.
|
|
7355
|
+
return [];
|
|
7356
|
+
}
|
|
7357
|
+
if (node.light === "directional") {
|
|
7358
|
+
return [{
|
|
7359
|
+
kind: "directional",
|
|
7360
|
+
name,
|
|
7361
|
+
color,
|
|
7362
|
+
intensity,
|
|
7363
|
+
position,
|
|
7364
|
+
direction,
|
|
7365
|
+
range: 0,
|
|
7366
|
+
spotAngle: 0,
|
|
7367
|
+
penumbra: 0,
|
|
7368
|
+
shadowPriority: 3,
|
|
7369
|
+
authoredLight: node.light
|
|
7370
|
+
}];
|
|
7371
|
+
}
|
|
7372
|
+
if (node.light === "point") {
|
|
7373
|
+
return [{
|
|
7374
|
+
kind: "point",
|
|
7375
|
+
name,
|
|
7376
|
+
color,
|
|
7377
|
+
intensity,
|
|
7378
|
+
position,
|
|
7379
|
+
direction,
|
|
7380
|
+
range: 10 * productionRuntimeLightMaxScale(node.scale),
|
|
7381
|
+
spotAngle: 0,
|
|
7382
|
+
penumbra: 0,
|
|
7383
|
+
shadowPriority: 1,
|
|
7384
|
+
authoredLight: node.light
|
|
7385
|
+
}];
|
|
7386
|
+
}
|
|
7387
|
+
if (node.light === "studio") {
|
|
7388
|
+
return createProductionRuntimeStudioLightDescriptors(node, name, color, intensity, position);
|
|
7389
|
+
}
|
|
7390
|
+
const width = positiveFinite(node.width, node.light === "softbox" ? 2.4 : 2.2)
|
|
7391
|
+
* productionRuntimeLightAxisScale(node.scale, 0);
|
|
7392
|
+
const height = positiveFinite(node.height, node.light === "softbox" ? 1.6 : 1.2)
|
|
7393
|
+
* productionRuntimeLightAxisScale(node.scale, 1);
|
|
7394
|
+
const target = node.lookAt ?? [0, 0.75, 0];
|
|
7395
|
+
const targetDistance = Math.max(0.001, distance3(position, target));
|
|
7396
|
+
const halfDiagonal = Math.hypot(width, height) / 2;
|
|
7397
|
+
return [{
|
|
7398
|
+
kind: "spot",
|
|
7399
|
+
name: `${name}-${node.light}-spot-proxy`,
|
|
7400
|
+
color,
|
|
7401
|
+
intensity,
|
|
7402
|
+
position,
|
|
7403
|
+
direction,
|
|
7404
|
+
range: Math.max(1, targetDistance + halfDiagonal * 2),
|
|
7405
|
+
spotAngle: clampNumber(Math.atan2(halfDiagonal, targetDistance), 0.08, Math.PI / 2 - 0.01),
|
|
7406
|
+
penumbra: node.light === "softbox" ? 0.78 : 0.42,
|
|
7407
|
+
shadowPriority: 2,
|
|
7408
|
+
authoredLight: node.light,
|
|
7409
|
+
authoredWidth: width,
|
|
7410
|
+
authoredHeight: height
|
|
7411
|
+
}];
|
|
7412
|
+
}
|
|
7413
|
+
function createProductionRuntimeStudioLightDescriptors(node, name, color, intensity, position) {
|
|
7414
|
+
const target = node.lookAt ?? [0, 0.75, 0];
|
|
7415
|
+
const fillPosition = [
|
|
7416
|
+
position[0] === 0 ? 3.2 : -position[0],
|
|
7417
|
+
Math.max(1, position[1] * 0.72),
|
|
7418
|
+
position[2] * 0.58
|
|
7419
|
+
];
|
|
7420
|
+
const rimPosition = [
|
|
7421
|
+
position[0] * 0.2,
|
|
7422
|
+
Math.max(1, position[1] * 0.88),
|
|
7423
|
+
position[2] === 0 ? -3.6 : -Math.abs(position[2])
|
|
7424
|
+
];
|
|
7425
|
+
return [
|
|
7426
|
+
{
|
|
7427
|
+
kind: "directional",
|
|
7428
|
+
name: `${name}-key`,
|
|
7429
|
+
color,
|
|
7430
|
+
intensity,
|
|
7431
|
+
position,
|
|
7432
|
+
direction: productionRuntimeLightDirection(node, position),
|
|
7433
|
+
range: 0,
|
|
7434
|
+
spotAngle: 0,
|
|
7435
|
+
penumbra: 0,
|
|
7436
|
+
shadowPriority: 3,
|
|
7437
|
+
authoredLight: node.light
|
|
7438
|
+
},
|
|
7439
|
+
{
|
|
7440
|
+
kind: "directional",
|
|
7441
|
+
name: `${name}-fill`,
|
|
7442
|
+
color: multiplyRgb(color, [0.62, 0.72, 1]),
|
|
7443
|
+
intensity: intensity * 0.32,
|
|
7444
|
+
position: fillPosition,
|
|
7445
|
+
direction: normalizedDirection(fillPosition, target),
|
|
7446
|
+
range: 0,
|
|
7447
|
+
spotAngle: 0,
|
|
7448
|
+
penumbra: 0,
|
|
7449
|
+
shadowPriority: 0,
|
|
7450
|
+
authoredLight: node.light
|
|
7451
|
+
},
|
|
7452
|
+
{
|
|
7453
|
+
kind: "directional",
|
|
7454
|
+
name: `${name}-rim`,
|
|
7455
|
+
color: multiplyRgb(color, [0.84, 0.92, 1]),
|
|
7456
|
+
intensity: intensity * 0.54,
|
|
7457
|
+
position: rimPosition,
|
|
7458
|
+
direction: normalizedDirection(rimPosition, target),
|
|
7459
|
+
range: 0,
|
|
7460
|
+
spotAngle: 0,
|
|
7461
|
+
penumbra: 0,
|
|
7462
|
+
shadowPriority: 0,
|
|
7463
|
+
authoredLight: node.light
|
|
7464
|
+
}
|
|
7465
|
+
];
|
|
7466
|
+
}
|
|
7467
|
+
function createProductionRuntimeFallbackLights() {
|
|
7468
|
+
if (cachedProductionRuntimeFallbackLights)
|
|
7469
|
+
return cachedProductionRuntimeFallbackLights;
|
|
7470
|
+
const descriptors = [
|
|
7216
7471
|
{
|
|
7217
7472
|
kind: "directional",
|
|
7473
|
+
name: "aura3d-root-production-fallback-key-shadow",
|
|
7218
7474
|
color: [1, 0.94, 0.82],
|
|
7219
7475
|
intensity: 2.6,
|
|
7220
7476
|
position: [0, 0, 0],
|
|
@@ -7222,12 +7478,12 @@ function createProductionRuntimeCollectedLights() {
|
|
|
7222
7478
|
range: 0,
|
|
7223
7479
|
spotAngle: 0,
|
|
7224
7480
|
penumbra: 0,
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
source: key
|
|
7481
|
+
shadowPriority: 3,
|
|
7482
|
+
authoredLight: "fallback"
|
|
7228
7483
|
},
|
|
7229
7484
|
{
|
|
7230
7485
|
kind: "directional",
|
|
7486
|
+
name: "aura3d-root-production-fallback-fill",
|
|
7231
7487
|
color: [0.52, 0.64, 0.9],
|
|
7232
7488
|
intensity: 0.64,
|
|
7233
7489
|
position: [0, 0, 0],
|
|
@@ -7235,12 +7491,12 @@ function createProductionRuntimeCollectedLights() {
|
|
|
7235
7491
|
range: 0,
|
|
7236
7492
|
spotAngle: 0,
|
|
7237
7493
|
penumbra: 0,
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
source: fill
|
|
7494
|
+
shadowPriority: 0,
|
|
7495
|
+
authoredLight: "fallback"
|
|
7241
7496
|
},
|
|
7242
7497
|
{
|
|
7243
7498
|
kind: "directional",
|
|
7499
|
+
name: "aura3d-root-production-fallback-rim",
|
|
7244
7500
|
color: [0.88, 0.94, 1],
|
|
7245
7501
|
intensity: 0.88,
|
|
7246
7502
|
position: [0, 0, 0],
|
|
@@ -7248,12 +7504,120 @@ function createProductionRuntimeCollectedLights() {
|
|
|
7248
7504
|
range: 0,
|
|
7249
7505
|
spotAngle: 0,
|
|
7250
7506
|
penumbra: 0,
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
source: rim
|
|
7507
|
+
shadowPriority: 0,
|
|
7508
|
+
authoredLight: "fallback"
|
|
7254
7509
|
}
|
|
7255
7510
|
];
|
|
7256
|
-
|
|
7511
|
+
cachedProductionRuntimeFallbackLights = descriptors.map((descriptor, index) => createProductionRuntimeCollectedLight(descriptor, index === 0));
|
|
7512
|
+
return cachedProductionRuntimeFallbackLights;
|
|
7513
|
+
}
|
|
7514
|
+
function createProductionRuntimeCollectedLight(descriptor, castsShadow) {
|
|
7515
|
+
const source = descriptor.kind === "directional"
|
|
7516
|
+
? new DirectionalLight(descriptor.name)
|
|
7517
|
+
: descriptor.kind === "point"
|
|
7518
|
+
? new PointLight(descriptor.name)
|
|
7519
|
+
: new SpotLight(descriptor.name);
|
|
7520
|
+
source.color = [...descriptor.color];
|
|
7521
|
+
source.intensity = descriptor.intensity;
|
|
7522
|
+
source.castsShadow = castsShadow;
|
|
7523
|
+
source.layerMask = 0xffffffff;
|
|
7524
|
+
source.userData.aura3dAuthoredLight = descriptor.authoredLight;
|
|
7525
|
+
if (descriptor.authoredWidth !== undefined)
|
|
7526
|
+
source.userData.aura3dAuthoredWidth = descriptor.authoredWidth;
|
|
7527
|
+
if (descriptor.authoredHeight !== undefined)
|
|
7528
|
+
source.userData.aura3dAuthoredHeight = descriptor.authoredHeight;
|
|
7529
|
+
source.transform.setPosition(...descriptor.position);
|
|
7530
|
+
if (source instanceof PointLight || source instanceof SpotLight) {
|
|
7531
|
+
source.range = Math.max(0.001, descriptor.range);
|
|
7532
|
+
}
|
|
7533
|
+
if (source instanceof SpotLight) {
|
|
7534
|
+
source.angle = clampNumber(descriptor.spotAngle, 0.001, Math.PI / 2 - 0.001);
|
|
7535
|
+
source.penumbra = clampNumber(descriptor.penumbra, 0, 1);
|
|
7536
|
+
}
|
|
7537
|
+
if (!(source instanceof PointLight)) {
|
|
7538
|
+
const rotation = quaternionFromForwardDirection(descriptor.direction);
|
|
7539
|
+
source.transform.setRotation(...rotation);
|
|
7540
|
+
}
|
|
7541
|
+
source.updateWorldTransform(true);
|
|
7542
|
+
return {
|
|
7543
|
+
kind: descriptor.kind,
|
|
7544
|
+
color: descriptor.color,
|
|
7545
|
+
intensity: descriptor.intensity,
|
|
7546
|
+
position: descriptor.position,
|
|
7547
|
+
direction: normalize3(descriptor.direction),
|
|
7548
|
+
range: descriptor.range,
|
|
7549
|
+
spotAngle: descriptor.spotAngle,
|
|
7550
|
+
penumbra: descriptor.penumbra,
|
|
7551
|
+
castsShadow,
|
|
7552
|
+
layerMask: 0xffffffff,
|
|
7553
|
+
source
|
|
7554
|
+
};
|
|
7555
|
+
}
|
|
7556
|
+
function productionRuntimeLightPosition(node) {
|
|
7557
|
+
const fallback = node.light === "directional" ? [3, 4, 3]
|
|
7558
|
+
: node.light === "point" ? [2, 2.5, 1.5]
|
|
7559
|
+
: node.light === "studio" ? [0, 3, 4]
|
|
7560
|
+
: node.light === "softbox" ? [-2.2, 2.4, 2.2]
|
|
7561
|
+
: node.light === "rect" ? [0, 2.6, 1.8]
|
|
7562
|
+
: [0, 0, 0];
|
|
7563
|
+
const position = node.position ?? fallback;
|
|
7564
|
+
return position.map((component, index) => Number.isFinite(component) ? component : fallback[index]);
|
|
7565
|
+
}
|
|
7566
|
+
function productionRuntimeLightDirection(node, position) {
|
|
7567
|
+
if (node.lookAt) {
|
|
7568
|
+
const direction = normalizedDirection(position, node.lookAt);
|
|
7569
|
+
if (length3(direction) > 0)
|
|
7570
|
+
return direction;
|
|
7571
|
+
}
|
|
7572
|
+
if (node.rotation) {
|
|
7573
|
+
const matrix = rotationXYZ(node.rotation);
|
|
7574
|
+
return normalize3([-matrix[8], -matrix[9], -matrix[10]]);
|
|
7575
|
+
}
|
|
7576
|
+
if (length3(position) > 0.000001)
|
|
7577
|
+
return normalize3([-position[0], -position[1], -position[2]]);
|
|
7578
|
+
return [0, -1, 0];
|
|
7579
|
+
}
|
|
7580
|
+
function quaternionFromForwardDirection(direction) {
|
|
7581
|
+
const target = normalize3(direction);
|
|
7582
|
+
const dot = clampNumber(-target[2], -1, 1);
|
|
7583
|
+
if (dot > 0.999999)
|
|
7584
|
+
return [0, 0, 0, 1];
|
|
7585
|
+
if (dot < -0.999999)
|
|
7586
|
+
return [0, 1, 0, 0];
|
|
7587
|
+
const quaternion = [target[1], -target[0], 0, 1 + dot];
|
|
7588
|
+
const length = Math.hypot(...quaternion) || 1;
|
|
7589
|
+
return [
|
|
7590
|
+
quaternion[0] / length,
|
|
7591
|
+
quaternion[1] / length,
|
|
7592
|
+
quaternion[2] / length,
|
|
7593
|
+
quaternion[3] / length
|
|
7594
|
+
];
|
|
7595
|
+
}
|
|
7596
|
+
function normalizedDirection(from, to) {
|
|
7597
|
+
const direction = [to[0] - from[0], to[1] - from[1], to[2] - from[2]];
|
|
7598
|
+
return length3(direction) > 0.000001 ? normalize3(direction) : [0, -1, 0];
|
|
7599
|
+
}
|
|
7600
|
+
function length3(value) {
|
|
7601
|
+
return Math.hypot(value[0], value[1], value[2]);
|
|
7602
|
+
}
|
|
7603
|
+
function productionRuntimeLightMaxScale(scale) {
|
|
7604
|
+
return Math.max(productionRuntimeLightAxisScale(scale, 0), productionRuntimeLightAxisScale(scale, 1), productionRuntimeLightAxisScale(scale, 2));
|
|
7605
|
+
}
|
|
7606
|
+
function productionRuntimeLightAxisScale(scale, axis) {
|
|
7607
|
+
const value = typeof scale === "number" ? scale : scale?.[axis] ?? 1;
|
|
7608
|
+
return positiveFinite(Math.abs(value), 1);
|
|
7609
|
+
}
|
|
7610
|
+
function nonNegativeFinite(value) {
|
|
7611
|
+
return Number.isFinite(value) ? Math.max(0, value) : 0;
|
|
7612
|
+
}
|
|
7613
|
+
function positiveFinite(value, fallback) {
|
|
7614
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : fallback;
|
|
7615
|
+
}
|
|
7616
|
+
function clampNumber(value, min, max) {
|
|
7617
|
+
return Math.max(min, Math.min(max, Number.isFinite(value) ? value : min));
|
|
7618
|
+
}
|
|
7619
|
+
function multiplyRgb(color, tint) {
|
|
7620
|
+
return [color[0] * tint[0], color[1] * tint[1], color[2] * tint[2]];
|
|
7257
7621
|
}
|
|
7258
7622
|
async function createProductionRuntimeSceneRenderer(canvas, snapshot, rendererOptions, runtimeNodes) {
|
|
7259
7623
|
const flattened = groups.flatten(snapshot.nodes);
|
|
@@ -7283,10 +7647,16 @@ async function createProductionRuntimeSceneRenderer(canvas, snapshot, rendererOp
|
|
|
7283
7647
|
let latestFeatures = productionRenderer.getFeatures();
|
|
7284
7648
|
const runtimeWarnings = new Set();
|
|
7285
7649
|
const productionEnvironment = createProductionRuntimeEnvironment(snapshot);
|
|
7650
|
+
const productionRuntimeLights = createProductionRuntimeCollectedLights(snapshot);
|
|
7651
|
+
const authoredLightNodes = flattened.filter((node) => node.kind === "light");
|
|
7652
|
+
const authoredDirectLightNodes = authoredLightNodes.filter((node) => node.light !== "ambient");
|
|
7653
|
+
const authoredAmbientLightCount = authoredLightNodes.length - authoredDirectLightNodes.length;
|
|
7654
|
+
const authoredAreaProxyCount = authoredDirectLightNodes.filter((node) => node.light === "rect" || node.light === "softbox").length;
|
|
7286
7655
|
const buildDiagnostics = () => createRendererDiagnosticReport(snapshot, {
|
|
7287
7656
|
mounted: true,
|
|
7288
7657
|
backend: "production-runtime",
|
|
7289
7658
|
postprocess: createProductionRuntimePostprocessObservation(latestDeviceDiagnostics),
|
|
7659
|
+
shadow: createProductionRuntimeShadowObservation(createProductionRuntimeShadowOptions(snapshot, productionRuntimeLights), latestDeviceDiagnostics),
|
|
7290
7660
|
environment: {
|
|
7291
7661
|
enabled: true,
|
|
7292
7662
|
preset: productionEnvironment.preset,
|
|
@@ -7295,6 +7665,15 @@ async function createProductionRuntimeSceneRenderer(canvas, snapshot, rendererOp
|
|
|
7295
7665
|
},
|
|
7296
7666
|
warnings: [
|
|
7297
7667
|
`Production runtime bridge active with ${actorEntries.length} typed GLB actor${actorEntries.length === 1 ? "" : "s"} and ${primitiveEntries.length} Aura primitive${primitiveEntries.length === 1 ? "" : "s"} on ${productionRenderer.backend}.`,
|
|
7668
|
+
...(authoredDirectLightNodes.length === 0
|
|
7669
|
+
? ["Production runtime direct-light fallback active: the scene has no authored directional, point, studio, rect, or softbox light."]
|
|
7670
|
+
: [`Production runtime derived ${productionRuntimeLights.length} collected direct light${productionRuntimeLights.length === 1 ? "" : "s"} from ${authoredDirectLightNodes.length} authored scene light${authoredDirectLightNodes.length === 1 ? "" : "s"}.`]),
|
|
7671
|
+
...(authoredAmbientLightCount > 0
|
|
7672
|
+
? [`${authoredAmbientLightCount} authored ambient light${authoredAmbientLightCount === 1 ? "" : "s"} remain environment-lighting intent and are not mislabeled as direct CollectedLight entries.`]
|
|
7673
|
+
: []),
|
|
7674
|
+
...(authoredAreaProxyCount > 0
|
|
7675
|
+
? [`${authoredAreaProxyCount} authored rect/softbox light${authoredAreaProxyCount === 1 ? "" : "s"} use bounded spot-light proxies whose cone and range derive from authored width and height; this does not claim physical area-light shading.`]
|
|
7676
|
+
: []),
|
|
7298
7677
|
...(flattened.some((node) => node.kind === "effect")
|
|
7299
7678
|
? ["Effect nodes are requested in the scene graph; production bridge diagnostics report them, but unsupported postprocess/effect passes remain non-pixel-backed until the runtime feature reports support."]
|
|
7300
7679
|
: []),
|
|
@@ -7314,7 +7693,7 @@ async function createProductionRuntimeSceneRenderer(canvas, snapshot, rendererOp
|
|
|
7314
7693
|
},
|
|
7315
7694
|
render(time) {
|
|
7316
7695
|
runtimeWarnings.clear();
|
|
7317
|
-
const input = createProductionRuntimeRendererInput(snapshot, canvas, actorEntries, primitiveEntries, time, runtimeNodes, runtimeWarnings, productionEnvironment.lighting);
|
|
7696
|
+
const input = createProductionRuntimeRendererInput(snapshot, canvas, actorEntries, primitiveEntries, time, runtimeNodes, runtimeWarnings, productionEnvironment.lighting, productionRuntimeLights);
|
|
7318
7697
|
const result = productionRenderer.renderInteractiveFrame(input);
|
|
7319
7698
|
latestDeviceDiagnostics = result.diagnostics;
|
|
7320
7699
|
latestFeatures = result.features;
|
|
@@ -7331,7 +7710,7 @@ async function createProductionRuntimeSceneRenderer(canvas, snapshot, rendererOp
|
|
|
7331
7710
|
}
|
|
7332
7711
|
};
|
|
7333
7712
|
}
|
|
7334
|
-
function createProductionRuntimeRendererInput(snapshot, canvas, actorEntries, primitiveEntries, time, runtimeNodes, runtimeWarnings, environmentLighting) {
|
|
7713
|
+
function createProductionRuntimeRendererInput(snapshot, canvas, actorEntries, primitiveEntries, time, runtimeNodes, runtimeWarnings, environmentLighting, collectedLights) {
|
|
7335
7714
|
const items = [];
|
|
7336
7715
|
for (const entry of actorEntries) {
|
|
7337
7716
|
const currentState = resolveProductionActorRuntimeState(entry, runtimeNodes);
|
|
@@ -7340,7 +7719,7 @@ function createProductionRuntimeRendererInput(snapshot, canvas, actorEntries, pr
|
|
|
7340
7719
|
continue;
|
|
7341
7720
|
applyProductionActorAnimation(entry, currentNode, currentState.animationBinding, time, runtimeWarnings);
|
|
7342
7721
|
applyProductionActorMorphTargets(entry, currentState.morphTargets, runtimeWarnings);
|
|
7343
|
-
const modelMatrix = [...createModelMatrix(currentNode,
|
|
7722
|
+
const modelMatrix = [...createModelMatrix(currentNode, productionActorModelBounds(currentNode.asset, entry.actor), shouldNormalizeModelNode(currentNode), time)];
|
|
7344
7723
|
const actorItems = entry.actor.collectRenderItems({ modelMatrix });
|
|
7345
7724
|
items.push(...actorItems);
|
|
7346
7725
|
attachProductionActorEvidence(currentNode, entry.actor, actorItems, runtimeNodes);
|
|
@@ -7362,12 +7741,13 @@ function createProductionRuntimeRendererInput(snapshot, canvas, actorEntries, pr
|
|
|
7362
7741
|
const source = {
|
|
7363
7742
|
collectRenderItems: () => items,
|
|
7364
7743
|
cameraPolicy: "require",
|
|
7365
|
-
staticBatching:
|
|
7366
|
-
frustumCulling:
|
|
7367
|
-
collectedLights
|
|
7744
|
+
staticBatching: true,
|
|
7745
|
+
frustumCulling: true,
|
|
7746
|
+
collectedLights,
|
|
7368
7747
|
environmentLighting,
|
|
7369
|
-
postprocess: createProductionRuntimePostprocess(),
|
|
7370
|
-
shadow: createProductionRuntimeShadowOptions(),
|
|
7748
|
+
postprocess: createProductionRuntimePostprocess(snapshot),
|
|
7749
|
+
shadow: createProductionRuntimeShadowOptions(snapshot, collectedLights),
|
|
7750
|
+
environmentFog: createProductionRuntimeEnvironmentFog(snapshot),
|
|
7371
7751
|
cameraPosition
|
|
7372
7752
|
};
|
|
7373
7753
|
const cameraLike = { viewProjectionMatrix };
|
|
@@ -7564,6 +7944,74 @@ function createProductionRuntimeMetadata(actorEntries) {
|
|
|
7564
7944
|
function sumProductionMetadata(metadata, key) {
|
|
7565
7945
|
return metadata.reduce((total, item) => total + item[key], 0);
|
|
7566
7946
|
}
|
|
7947
|
+
/**
|
|
7948
|
+
* Bounds used to size a typed model in the production bridge.
|
|
7949
|
+
*
|
|
7950
|
+
* Order matters and is deliberate:
|
|
7951
|
+
*
|
|
7952
|
+
* 1. The actor's actually-loaded GLB bounds. These are what the geometry really
|
|
7953
|
+
* occupies, so the bridge stays correct even if a manifest is stale or was written
|
|
7954
|
+
* by an older CLI. Preferring metadata here once caused whole levels to disappear:
|
|
7955
|
+
* a world recorded with an ~8x-too-small X extent was sized far too large and
|
|
7956
|
+
* frustum-culled out of frame.
|
|
7957
|
+
* 2. Manifest `boundsMetadata` min/max, when loaded bounds are unavailable.
|
|
7958
|
+
* 3. The flat `bounds` size triple, only if neither is available. This assumes a
|
|
7959
|
+
* min-Y-at-zero box that the mesh may not match, so it is a last resort.
|
|
7960
|
+
*
|
|
7961
|
+
* `camera.frameAsset` is synchronous and can only read manifest metadata, so framing
|
|
7962
|
+
* and rendering agree only while the manifest matches the geometry. Both are correct
|
|
7963
|
+
* as of the scene-space bounds fix and manifest regeneration;
|
|
7964
|
+
* `auraProductionBoundsProbes()` records any per-asset disagreement at runtime so a
|
|
7965
|
+
* future divergence is observable rather than silent.
|
|
7966
|
+
*/
|
|
7967
|
+
function productionActorModelBounds(asset, actor) {
|
|
7968
|
+
const loaded = typedGLBActorLoadedBounds(actor);
|
|
7969
|
+
const metadataBounds = asset.metadata?.boundsMetadata;
|
|
7970
|
+
const metadataMin = vec3FromReadonly(metadataBounds?.min);
|
|
7971
|
+
const metadataMax = vec3FromReadonly(metadataBounds?.max);
|
|
7972
|
+
if (loaded) {
|
|
7973
|
+
if (metadataMin && metadataMax) {
|
|
7974
|
+
productionBoundsProbes.set(asset.id, {
|
|
7975
|
+
assetId: asset.id,
|
|
7976
|
+
metadata: { min: metadataMin, max: metadataMax },
|
|
7977
|
+
loaded: { min: [...loaded.min], max: [...loaded.max] }
|
|
7978
|
+
});
|
|
7979
|
+
}
|
|
7980
|
+
return loaded;
|
|
7981
|
+
}
|
|
7982
|
+
if (metadataMin && metadataMax)
|
|
7983
|
+
return { min: metadataMin, max: metadataMax };
|
|
7984
|
+
return boundsFromAuraAsset(asset);
|
|
7985
|
+
}
|
|
7986
|
+
const productionBoundsProbes = new Map();
|
|
7987
|
+
/**
|
|
7988
|
+
* Diagnostic: manifest `boundsMetadata` versus the bounds actually computed from the
|
|
7989
|
+
* loaded GLB, per typed asset routed through the production bridge.
|
|
7990
|
+
*
|
|
7991
|
+
* The bridge sizes models from loaded bounds because those are what the geometry
|
|
7992
|
+
* really occupies. This accessor exists so a disagreement with manifest metadata —
|
|
7993
|
+
* which `camera.frameAsset` must use, being synchronous — is observable instead of
|
|
7994
|
+
* silently producing mismatched framing.
|
|
7995
|
+
*/
|
|
7996
|
+
export function auraProductionBoundsProbes() {
|
|
7997
|
+
return [...productionBoundsProbes.values()];
|
|
7998
|
+
}
|
|
7999
|
+
/**
|
|
8000
|
+
* Real bounds of the loaded GLB scene, as computed from its geometry. Returns
|
|
8001
|
+
* undefined when the actor cannot supply them, so callers fall back to manifest
|
|
8002
|
+
* metadata rather than silently using a zeroed box.
|
|
8003
|
+
*/
|
|
8004
|
+
function typedGLBActorLoadedBounds(actor) {
|
|
8005
|
+
const bounds = actor.pipeline?.resources?.bounds;
|
|
8006
|
+
const min = vec3FromReadonly(bounds?.min);
|
|
8007
|
+
const max = vec3FromReadonly(bounds?.max);
|
|
8008
|
+
if (!min || !max)
|
|
8009
|
+
return undefined;
|
|
8010
|
+
// A degenerate box would produce a divide-by-near-zero fit scale.
|
|
8011
|
+
if (max[0] - min[0] <= 0 && max[1] - min[1] <= 0 && max[2] - min[2] <= 0)
|
|
8012
|
+
return undefined;
|
|
8013
|
+
return { min, max };
|
|
8014
|
+
}
|
|
7567
8015
|
function boundsFromAuraAsset(asset) {
|
|
7568
8016
|
const metadataBounds = asset.metadata?.boundsMetadata;
|
|
7569
8017
|
const metadataMin = vec3FromReadonly(metadataBounds?.min);
|
|
@@ -8858,7 +9306,13 @@ function createPlaneGeometry() {
|
|
|
8858
9306
|
0, 1, 0,
|
|
8859
9307
|
0, 1, 0
|
|
8860
9308
|
]),
|
|
8861
|
-
|
|
9309
|
+
// Counter-clockwise when viewed from +Y, so the triangle winding agrees with
|
|
9310
|
+
// the [0, 1, 0] vertex normals. The previous [0, 1, 2, 0, 2, 3] order wound
|
|
9311
|
+
// the opposite way: its geometric normal was [0, -1, 0], so `gl_FrontFacing`
|
|
9312
|
+
// was false for a camera above the plane and the two-sided shader flipped the
|
|
9313
|
+
// up-normal downward. The plane then faced away from every overhead light and
|
|
9314
|
+
// received no direct lighting or visible cast shadows.
|
|
9315
|
+
indices: new Uint16Array([0, 2, 1, 0, 3, 2]),
|
|
8862
9316
|
bounds: { min: [-0.5, 0, -0.5], max: [0.5, 0, 0.5] }
|
|
8863
9317
|
};
|
|
8864
9318
|
}
|
|
@@ -9542,6 +9996,23 @@ function appendCanvas(target) {
|
|
|
9542
9996
|
target.append(canvas);
|
|
9543
9997
|
return canvas;
|
|
9544
9998
|
}
|
|
9999
|
+
/**
|
|
10000
|
+
* `resize: false` means "do not take over sizing", not "render at the HTML
|
|
10001
|
+
* default backing store". A canvas element always reports `width === 300` and
|
|
10002
|
+
* `height === 150` until something assigns them, so a truthiness check on those
|
|
10003
|
+
* properties can never tell an author-chosen size from the spec default. Only an
|
|
10004
|
+
* explicit `width`/`height` attribute, or a backing store that was already
|
|
10005
|
+
* assigned to something other than the default pair, counts as author intent.
|
|
10006
|
+
*/
|
|
10007
|
+
function hasAuthoredBackingStore(canvas) {
|
|
10008
|
+
if (canvas.dataset.aura3dCanvas === "true")
|
|
10009
|
+
return false;
|
|
10010
|
+
if (canvas.hasAttribute("width") || canvas.hasAttribute("height"))
|
|
10011
|
+
return true;
|
|
10012
|
+
return canvas.width !== DEFAULT_CANVAS_BACKING_WIDTH || canvas.height !== DEFAULT_CANVAS_BACKING_HEIGHT;
|
|
10013
|
+
}
|
|
10014
|
+
const DEFAULT_CANVAS_BACKING_WIDTH = 300;
|
|
10015
|
+
const DEFAULT_CANVAS_BACKING_HEIGHT = 150;
|
|
9545
10016
|
function applyDefaultCanvasMountLayout(target) {
|
|
9546
10017
|
if (typeof window === "undefined")
|
|
9547
10018
|
return;
|
|
@@ -9571,8 +10042,9 @@ function configureCanvas(canvas, pixelRatio, resize) {
|
|
|
9571
10042
|
canvas.style.height = `${cssHeight}px`;
|
|
9572
10043
|
const width = Math.max(320, Math.round(cssWidth * pixelRatio));
|
|
9573
10044
|
const height = Math.max(220, Math.round(cssHeight * pixelRatio));
|
|
9574
|
-
|
|
9575
|
-
canvas.
|
|
10045
|
+
const keepAuthoredSize = !resize && hasAuthoredBackingStore(canvas);
|
|
10046
|
+
canvas.width = keepAuthoredSize ? canvas.width : width;
|
|
10047
|
+
canvas.height = keepAuthoredSize ? canvas.height : height;
|
|
9576
10048
|
}
|
|
9577
10049
|
function validateSceneAssets(snapshot, assets) {
|
|
9578
10050
|
for (const node of snapshot.nodes) {
|