@relu-interactives/spatial-ecs 0.5.3 → 0.8.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/{System-V_mv07le.d.cts → System-8D-XBDKZ.d.cts} +734 -8
- package/dist/{System-V_mv07le.d.ts → System-DPMAW30g.d.ts} +734 -8
- package/dist/{XRHandPose-CU3vNFuS.d.ts → XRHandPose-G0Dl-F0w.d.ts} +93 -3
- package/dist/{XRHandPose-CQTLGxFC.d.cts → XRHandPose-VQMT1WXj.d.cts} +93 -3
- package/dist/animation/index.cjs +252 -0
- package/dist/animation/index.cjs.map +1 -0
- package/dist/animation/index.d.cts +100 -0
- package/dist/animation/index.d.ts +100 -0
- package/dist/animation/index.js +4 -0
- package/dist/animation/index.js.map +1 -0
- package/dist/chunk-CKTHDXPS.js +11 -0
- package/dist/chunk-CKTHDXPS.js.map +1 -0
- package/dist/chunk-G4XJ53LS.js +1237 -0
- package/dist/chunk-G4XJ53LS.js.map +1 -0
- package/dist/chunk-GSWC6LLD.js +241 -0
- package/dist/chunk-GSWC6LLD.js.map +1 -0
- package/dist/{chunk-DF5SSRN6.js → chunk-JIJQFW6P.js} +1216 -2920
- package/dist/chunk-JIJQFW6P.js.map +1 -0
- package/dist/{chunk-BUEKOSR5.js → chunk-NNDUOQ7O.js} +188 -14
- package/dist/chunk-NNDUOQ7O.js.map +1 -0
- package/dist/chunk-OHCNPPMX.js +334 -0
- package/dist/chunk-OHCNPPMX.js.map +1 -0
- package/dist/{chunk-RXBLOO5B.js → chunk-SGF73YTF.js} +105 -715
- package/dist/chunk-SGF73YTF.js.map +1 -0
- package/dist/chunk-U727NTWQ.js +2856 -0
- package/dist/chunk-U727NTWQ.js.map +1 -0
- package/dist/{chunk-OY7ZODZP.js → chunk-XE4OXN2W.js} +3 -9
- package/dist/chunk-XE4OXN2W.js.map +1 -0
- package/dist/{chunk-OWQSESTO.js → chunk-XU2DVWCP.js} +4 -3
- package/dist/chunk-XU2DVWCP.js.map +1 -0
- package/dist/components/index.cjs +183 -10
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +5 -3
- package/dist/components/index.d.ts +5 -3
- package/dist/components/index.js +3 -2
- package/dist/docs/api/Behaviour/classes/Behaviour.md +366 -79
- package/dist/docs/api/Behaviour/index.md +7 -3
- package/dist/docs/api/Behaviour/type-aliases/UiInteractionEvent.md +35 -0
- package/dist/docs/api/Component/classes/Component.md +14 -1
- package/dist/docs/api/components/classes/AnimationComponent.md +26 -26
- package/dist/docs/api/components/classes/AudioComponent.md +19 -19
- package/dist/docs/api/components/classes/CameraComponent.md +14 -14
- package/dist/docs/api/components/classes/EntityType.md +4 -4
- package/dist/docs/api/components/classes/Environment.md +5 -4
- package/dist/docs/api/components/classes/ImageComponent.md +7 -7
- package/dist/docs/api/components/classes/ImageTarget.md +8 -8
- package/dist/docs/api/components/classes/ImageTargetAnchor.md +4 -4
- package/dist/docs/api/components/classes/InstanceSlotComponent.md +4 -4
- package/dist/docs/api/components/classes/InstancedMeshComponent.md +10 -10
- package/dist/docs/api/components/classes/LightComponent.md +6 -6
- package/dist/docs/api/components/classes/MaterialComponent.md +16 -16
- package/dist/docs/api/components/classes/MeshComponent.md +3 -3
- package/dist/docs/api/components/classes/MeshGeometryComponent.md +9 -9
- package/dist/docs/api/components/classes/ModelComponent.md +8 -5
- package/dist/docs/api/components/classes/Name.md +3 -3
- package/dist/docs/api/components/classes/Object3DRef.md +4 -4
- package/dist/docs/api/components/classes/ParentId.md +3 -3
- package/dist/docs/api/components/classes/PhysicsComponent.md +7 -6
- package/dist/docs/api/components/classes/Postprocessing.md +3 -3
- package/dist/docs/api/components/classes/PrefabInstance.md +5 -5
- package/dist/docs/api/components/classes/PrefabNode.md +3 -3
- package/dist/docs/api/components/classes/ScriptComponent.md +5 -5
- package/dist/docs/api/components/classes/ScriptObjectComponent.md +9 -9
- package/dist/docs/api/components/classes/Selectable.md +3 -3
- package/dist/docs/api/components/classes/SelectionTransformState.md +5 -5
- package/dist/docs/api/components/classes/SpriteComponent.md +7 -7
- package/dist/docs/api/components/classes/TransformComponent.md +12 -12
- package/dist/docs/api/components/classes/UIButtonComponent.md +63 -0
- package/dist/docs/api/components/classes/UIPanelComponent.md +62 -0
- package/dist/docs/api/components/classes/UISliderComponent.md +59 -0
- package/dist/docs/api/components/classes/UITextComponent.md +59 -0
- package/dist/docs/api/components/classes/UIToggleComponent.md +56 -0
- package/dist/docs/api/components/classes/VRTeleportAreaComponent.md +53 -0
- package/dist/docs/api/components/classes/VideoComponent.md +28 -28
- package/dist/docs/api/components/classes/XRAnchorComponent.md +64 -0
- package/dist/docs/api/components/classes/XREnvironmentComponent.md +64 -0
- package/dist/docs/api/components/classes/XRHandPoseComponent.md +50 -0
- package/dist/docs/api/components/classes/XRInteractableComponent.md +74 -0
- package/dist/docs/api/components/classes/XRInteractorComponent.md +57 -0
- package/dist/docs/api/components/classes/XRInteractorSideComponent.md +50 -0
- package/dist/docs/api/components/classes/XRRigComponent.md +68 -0
- package/dist/docs/api/components/functions/createAttachPoint.md +25 -0
- package/dist/docs/api/components/functions/createHandPoseEntry.md +25 -0
- package/dist/docs/api/components/functions/defaultMaterialValue.md +1 -1
- package/dist/docs/api/components/functions/handPoseDefinitionFor.md +33 -0
- package/dist/docs/api/components/functions/normalizeEnvironmentLighting.md +30 -0
- package/dist/docs/api/components/functions/normalizePhysicsState.md +1 -1
- package/dist/docs/api/components/functions/setModelLoadState.md +33 -0
- package/dist/docs/api/components/functions/setPhysicsLiveRef.md +3 -9
- package/dist/docs/api/components/index.md +61 -4
- package/dist/docs/api/components/type-aliases/AnimationComponentOptions.md +9 -9
- package/dist/docs/api/components/type-aliases/CameraComponentOptions.md +13 -13
- package/dist/docs/api/components/type-aliases/CameraProjection.md +1 -1
- package/dist/docs/api/components/type-aliases/CameraRuntimeType.md +5 -3
- package/dist/docs/api/components/type-aliases/ColliderShape.md +1 -1
- package/dist/docs/api/components/type-aliases/ColliderState.md +20 -20
- package/dist/docs/api/components/type-aliases/CubeMeshParameters.md +4 -4
- package/dist/docs/api/components/type-aliases/EditableMeshObjectKind.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentFogState.md +8 -8
- package/dist/docs/api/components/type-aliases/EnvironmentFogType.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentGradientEffect.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentLightingState.md +40 -0
- package/dist/docs/api/components/type-aliases/EnvironmentSkyboxImageProjection.md +22 -0
- package/dist/docs/api/components/type-aliases/EnvironmentSkyboxState.md +9 -7
- package/dist/docs/api/components/type-aliases/EnvironmentSkyboxType.md +1 -1
- package/dist/docs/api/components/type-aliases/EnvironmentState.md +7 -5
- package/dist/docs/api/components/type-aliases/EnvironmentToneMapping.md +16 -0
- package/dist/docs/api/components/type-aliases/ImageTargetAnchorOptions.md +3 -3
- package/dist/docs/api/components/type-aliases/ImageTargetReference.md +7 -7
- package/dist/docs/api/components/type-aliases/InstanceTransform.md +13 -13
- package/dist/docs/api/components/type-aliases/InstancedMeshKind.md +1 -1
- package/dist/docs/api/components/type-aliases/LightShadowState.md +37 -0
- package/dist/docs/api/components/type-aliases/LightValueState.md +13 -11
- package/dist/docs/api/components/type-aliases/MaterialTypeValue.md +1 -1
- package/dist/docs/api/components/type-aliases/MaterialValueState.md +28 -28
- package/dist/docs/api/components/type-aliases/MeshGeometryParameters.md +1 -1
- package/dist/docs/api/components/type-aliases/MeshGeometryParametersByKind.md +7 -7
- package/dist/docs/api/components/type-aliases/ModelLoadState.md +15 -0
- package/dist/docs/api/components/type-aliases/PhysicsState.md +3 -3
- package/dist/docs/api/components/type-aliases/PlaneMeshParameters.md +3 -3
- package/dist/docs/api/components/type-aliases/PostprocessingState.md +62 -62
- package/dist/docs/api/components/type-aliases/RadiusHeightMeshParameters.md +3 -3
- package/dist/docs/api/components/type-aliases/RadiusMeshParameters.md +2 -2
- package/dist/docs/api/components/type-aliases/RigidbodyState.md +17 -17
- package/dist/docs/api/components/type-aliases/RigidbodyType.md +1 -1
- package/dist/docs/api/components/type-aliases/ScriptEntry.md +8 -8
- package/dist/docs/api/components/type-aliases/ScriptObjectComponentInput.md +1 -1
- package/dist/docs/api/components/type-aliases/ScriptObjectRuntimeState.md +1 -1
- package/dist/docs/api/components/type-aliases/TextureFilteringValue.md +1 -1
- package/dist/docs/api/components/type-aliases/TransformData.md +4 -4
- package/dist/docs/api/components/type-aliases/TransformModeValue.md +1 -1
- package/dist/docs/api/components/type-aliases/TransformSpaceValue.md +1 -1
- package/dist/docs/api/components/type-aliases/UIButtonOptions.md +45 -0
- package/dist/docs/api/components/type-aliases/UIPanelOptions.md +39 -0
- package/dist/docs/api/components/type-aliases/UISliderOptions.md +39 -0
- package/dist/docs/api/components/type-aliases/UITextOptions.md +41 -0
- package/dist/docs/api/components/type-aliases/UIToggleOptions.md +35 -0
- package/dist/docs/api/components/type-aliases/UiFollowMode.md +15 -0
- package/dist/docs/api/components/type-aliases/UiTextAlign.md +13 -0
- package/dist/docs/api/components/type-aliases/UiTextVAlign.md +13 -0
- package/dist/docs/api/components/type-aliases/VRTeleportAreaOptions.md +29 -0
- package/dist/docs/api/components/type-aliases/Vec3.md +4 -4
- package/dist/docs/api/components/type-aliases/VrTeleportShape.md +15 -0
- package/dist/docs/api/components/type-aliases/XRAnchorOptions.md +23 -0
- package/dist/docs/api/components/type-aliases/XRHandPoseOptions.md +23 -0
- package/dist/docs/api/components/type-aliases/XRInteractableOptions.md +75 -0
- package/dist/docs/api/components/type-aliases/XRInteractorOptions.md +37 -0
- package/dist/docs/api/components/type-aliases/XRRigOptions.md +51 -0
- package/dist/docs/api/components/type-aliases/XrAttachPoint.md +53 -0
- package/dist/docs/api/components/type-aliases/XrDistanceGrabBehavior.md +19 -0
- package/dist/docs/api/components/type-aliases/XrEnvironmentKind.md +15 -0
- package/dist/docs/api/components/type-aliases/XrEnvironmentOrientation.md +15 -0
- package/dist/docs/api/components/type-aliases/XrEnvironmentPhysics.md +25 -0
- package/dist/docs/api/components/type-aliases/XrGrabGesture.md +19 -0
- package/dist/docs/api/components/type-aliases/XrGrabHands.md +20 -0
- package/dist/docs/api/components/type-aliases/XrGrabReach.md +20 -0
- package/dist/docs/api/components/type-aliases/XrHandPoseEntry.md +49 -0
- package/dist/docs/api/components/type-aliases/XrHandPreset.md +19 -0
- package/dist/docs/api/components/type-aliases/XrInteractorSide.md +15 -0
- package/dist/docs/api/components/type-aliases/XrInteractorType.md +13 -0
- package/dist/docs/api/components/type-aliases/XrLocomotionMode.md +15 -0
- package/dist/docs/api/components/type-aliases/XrTrackingOrigin.md +24 -0
- package/dist/docs/api/components/type-aliases/XrTwoHandRotation.md +15 -0
- package/dist/docs/api/components/variables/DEFAULT_COLLIDER_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_ENVIRONMENT_LIGHTING.md +15 -0
- package/dist/docs/api/components/variables/DEFAULT_ENVIRONMENT_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_INSTANCED_MESH_PARAMETERS.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_INSTANCE_TRANSFORM.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_MESH_GEOMETRY_PARAMETERS.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_PHYSICS_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_POSE_CURLS.md +13 -0
- package/dist/docs/api/components/variables/DEFAULT_POSE_DIRECTIONS.md +13 -0
- package/dist/docs/api/components/variables/DEFAULT_POSTPROCESSING_STATE.md +1 -1
- package/dist/docs/api/components/variables/DEFAULT_RIGIDBODY_STATE.md +1 -1
- package/dist/docs/api/components/variables/MODEL_NO_PATH_MESSAGE.md +15 -0
- package/dist/docs/api/index/classes/AnimationStateMachine.md +16 -16
- package/dist/docs/api/index/classes/AnimationStateManager.md +13 -13
- package/dist/docs/api/index/classes/AnimationSystem.md +3 -3
- package/dist/docs/api/index/classes/AudioSystem.md +4 -4
- package/dist/docs/api/index/classes/CameraSyncSystem.md +2 -2
- package/dist/docs/api/index/classes/EnvironmentSyncSystem.md +19 -4
- package/dist/docs/api/index/classes/HandPoseTracker.md +114 -0
- package/dist/docs/api/index/classes/InputSystem.md +33 -33
- package/dist/docs/api/index/classes/InstancedMeshSystem.md +2 -2
- package/dist/docs/api/index/classes/LightSyncSystem.md +2 -2
- package/dist/docs/api/index/classes/MaterialSyncSystem.md +3 -3
- package/dist/docs/api/index/classes/MeshGeometrySystem.md +2 -2
- package/dist/docs/api/index/classes/ObjectManagementSystem.md +14 -14
- package/dist/docs/api/index/classes/ObjectVisibilitySystem.md +2 -2
- package/dist/docs/api/index/classes/PhysicsSyncSystem.md +4 -4
- package/dist/docs/api/index/classes/PostprocessingSyncSystem.md +34 -10
- package/dist/docs/api/index/classes/RenderSystem.md +13 -4
- package/dist/docs/api/index/classes/ScriptBehaviourSystem.md +9 -5
- package/dist/docs/api/index/classes/ScriptObject.md +10 -10
- package/dist/docs/api/index/classes/ScriptObjectSystem.md +6 -6
- package/dist/docs/api/index/classes/TeleportAimGate.md +114 -0
- package/dist/docs/api/index/classes/ThrowVelocityTracker.md +89 -0
- package/dist/docs/api/index/classes/TransformSyncSystem.md +2 -2
- package/dist/docs/api/index/classes/UIInteractionSystem.md +60 -0
- package/dist/docs/api/index/classes/UIPanelSystem.md +79 -0
- package/dist/docs/api/index/classes/VRTeleportAreaSystem.md +49 -0
- package/dist/docs/api/index/classes/VideoSystem.md +8 -6
- package/dist/docs/api/index/classes/World.md +282 -100
- package/dist/docs/api/index/classes/XRAnchorSystem.md +90 -0
- package/dist/docs/api/index/classes/XRControllerVisualSystem.md +77 -0
- package/dist/docs/api/index/classes/XREnvironmentSystem.md +137 -0
- package/dist/docs/api/index/classes/XRHandPoseSystem.md +107 -0
- package/dist/docs/api/index/classes/XRHitTestSystem.md +93 -0
- package/dist/docs/api/index/classes/XRHoverVisualSystem.md +76 -0
- package/dist/docs/api/index/classes/XRInputSystem.md +189 -0
- package/dist/docs/api/index/classes/XRInteractionSystem.md +323 -0
- package/dist/docs/api/index/classes/XRLocomotionSystem.md +128 -0
- package/dist/docs/api/index/classes/XRSessionSystem.md +116 -0
- package/dist/docs/api/index/classes/XRTeleportVisualSystem.md +75 -0
- package/dist/docs/api/index/functions/angularVelocityFrom.md +33 -0
- package/dist/docs/api/index/functions/applyHandMaterial.md +26 -0
- package/dist/docs/api/index/functions/applyPrefabToSnapshotInstances.md +1 -1
- package/dist/docs/api/index/functions/arcGroundCrossing.md +30 -0
- package/dist/docs/api/index/functions/buildComponentValueMaps.md +1 -1
- package/dist/docs/api/index/functions/buildNodeKeyMapsFromSnapshot.md +1 -1
- package/dist/docs/api/index/functions/buildNodeMapsFromSnapshot.md +1 -1
- package/dist/docs/api/index/functions/canonicalizeComponentValue.md +1 -1
- package/dist/docs/api/index/functions/clearModelCache.md +1 -1
- package/dist/docs/api/index/functions/clearPrefabCache.md +1 -1
- package/dist/docs/api/index/functions/cloneHandPose.md +23 -0
- package/dist/docs/api/index/functions/collectDiffPaths.md +1 -1
- package/dist/docs/api/index/functions/collectDirectPrefabDependencies.md +1 -1
- package/dist/docs/api/index/functions/collectEntitySubtree.md +1 -1
- package/dist/docs/api/index/functions/collectSnapshotSubtreeIds.md +1 -1
- package/dist/docs/api/index/functions/computeFingerCurl.md +29 -0
- package/dist/docs/api/index/functions/computeHandShape.md +29 -0
- package/dist/docs/api/index/functions/computeInstanceOverrides.md +1 -1
- package/dist/docs/api/index/functions/computePalmPose.md +30 -0
- package/dist/docs/api/index/functions/computePalmWidth.md +25 -0
- package/dist/docs/api/index/functions/computePinch.md +29 -0
- package/dist/docs/api/index/functions/computeSpread.md +33 -0
- package/dist/docs/api/index/functions/createAnimationComponent.md +1 -1
- package/dist/docs/api/index/functions/createAudioComponent.md +1 -1
- package/dist/docs/api/index/functions/createCameraComponent.md +1 -1
- package/dist/docs/api/index/functions/createEntityTypeComponent.md +2 -2
- package/dist/docs/api/index/functions/createEnvironmentComponent.md +1 -1
- package/dist/docs/api/index/functions/createHandMaterial.md +30 -0
- package/dist/docs/api/index/functions/createImageComponent.md +1 -1
- package/dist/docs/api/index/functions/createImageTargetAnchorComponent.md +1 -1
- package/dist/docs/api/index/functions/createImageTargetComponent.md +2 -2
- package/dist/docs/api/index/functions/createInstanceSlotComponent.md +1 -1
- package/dist/docs/api/index/functions/createInstancedMeshComponent.md +1 -1
- package/dist/docs/api/index/functions/createLightComponent.md +2 -2
- package/dist/docs/api/index/functions/createMaterialComponent.md +2 -2
- package/dist/docs/api/index/functions/createMeshComponent.md +1 -1
- package/dist/docs/api/index/functions/createMeshGeometryComponent.md +1 -1
- package/dist/docs/api/index/functions/createModelComponent.md +1 -1
- package/dist/docs/api/index/functions/createNameComponent.md +1 -1
- package/dist/docs/api/index/functions/createObject3DRefComponent.md +1 -1
- package/dist/docs/api/index/functions/createParentIdComponent.md +1 -1
- package/dist/docs/api/index/functions/createPhysicsComponent.md +1 -1
- package/dist/docs/api/index/functions/createPostprocessingComponent.md +1 -1
- package/dist/docs/api/index/functions/createScriptComponent.md +1 -1
- package/dist/docs/api/index/functions/createScriptObjectComponent.md +1 -1
- package/dist/docs/api/index/functions/createSelectableComponent.md +1 -1
- package/dist/docs/api/index/functions/createSelectionTransformStateComponent.md +1 -1
- package/dist/docs/api/index/functions/createSpriteComponent.md +1 -1
- package/dist/docs/api/index/functions/createTransformComponent.md +1 -1
- package/dist/docs/api/index/functions/createUIButtonComponent.md +28 -0
- package/dist/docs/api/index/functions/createUIPanelComponent.md +28 -0
- package/dist/docs/api/index/functions/createUISliderComponent.md +28 -0
- package/dist/docs/api/index/functions/createUITextComponent.md +28 -0
- package/dist/docs/api/index/functions/createUIToggleComponent.md +28 -0
- package/dist/docs/api/index/functions/createVRTeleportAreaComponent.md +28 -0
- package/dist/docs/api/index/functions/createVideoComponent.md +1 -1
- package/dist/docs/api/index/functions/createXRAnchorComponent.md +28 -0
- package/dist/docs/api/index/functions/createXRHandPoseComponent.md +28 -0
- package/dist/docs/api/index/functions/createXRInteractableComponent.md +28 -0
- package/dist/docs/api/index/functions/createXRInteractorComponent.md +28 -0
- package/dist/docs/api/index/functions/createXRInteractorSideComponent.md +28 -0
- package/dist/docs/api/index/functions/createXRRigComponent.md +28 -0
- package/dist/docs/api/index/functions/decanonicalizeComponentValue.md +1 -1
- package/dist/docs/api/index/functions/despawnPrefab.md +1 -1
- package/dist/docs/api/index/functions/encodeOverride.md +1 -1
- package/dist/docs/api/index/functions/estimateHandScale.md +28 -0
- package/dist/docs/api/index/functions/findSnapshotRootEntityIds.md +1 -1
- package/dist/docs/api/index/functions/findTopLevelNestedRegions.md +1 -1
- package/dist/docs/api/index/functions/getHandPosePreset.md +31 -0
- package/dist/docs/api/index/functions/groupOverridePaths.md +1 -1
- package/dist/docs/api/index/functions/handPoseFromCurls.md +42 -0
- package/dist/docs/api/index/functions/hydrateWorldFromSnapshot.md +1 -1
- package/dist/docs/api/index/functions/hydrateWorldFromSnapshotDetailed.md +1 -1
- package/dist/docs/api/index/functions/indexSnapshotByEntity.md +1 -1
- package/dist/docs/api/index/functions/instantiateSubtree.md +1 -1
- package/dist/docs/api/index/functions/loadPrefab.md +1 -1
- package/dist/docs/api/index/functions/loadSharedGltf.md +1 -1
- package/dist/docs/api/index/functions/matchHandPose.md +34 -0
- package/dist/docs/api/index/functions/mergeComponentValue.md +1 -1
- package/dist/docs/api/index/functions/parseOverride.md +1 -1
- package/dist/docs/api/index/functions/parsePrefabAsset.md +1 -1
- package/dist/docs/api/index/functions/prefabFileVersionFor.md +1 -1
- package/dist/docs/api/index/functions/readXrCapabilities.md +30 -0
- package/dist/docs/api/index/functions/registerDefaultComponentFactories.md +1 -1
- package/dist/docs/api/index/functions/registerDefaultFactories.md +1 -1
- package/dist/docs/api/index/functions/remapSnapshotEntityIds.md +3 -3
- package/dist/docs/api/index/functions/resolveDracoDecoderPath.md +1 -1
- package/dist/docs/api/index/functions/restoreComponentState.md +1 -1
- package/dist/docs/api/index/functions/restorePostCreateComponents.md +1 -1
- package/dist/docs/api/index/functions/sampleTeleportArc.md +40 -0
- package/dist/docs/api/index/functions/serializeEntitySubtree.md +1 -1
- package/dist/docs/api/index/functions/setDracoDecoderPath.md +1 -1
- package/dist/docs/api/index/functions/setPrefabAssetUrlResolver.md +1 -1
- package/dist/docs/api/index/functions/spawnPrefab.md +1 -1
- package/dist/docs/api/index/index.md +116 -4
- package/dist/docs/api/index/interfaces/ChromaKeyOptions.md +20 -0
- package/dist/docs/api/index/interfaces/EcsSystem.md +3 -3
- package/dist/docs/api/index/interfaces/PostprocessingBuildContext.md +21 -0
- package/dist/docs/api/index/interfaces/PostprocessingPipeline.md +84 -0
- package/dist/docs/api/index/interfaces/RenderBackend.md +168 -0
- package/dist/docs/api/index/interfaces/StateMachine.md +13 -13
- package/dist/docs/api/index/type-aliases/AnimationStateCallbacks.md +4 -4
- package/dist/docs/api/index/type-aliases/ApplyPrefabToSnapshotResult.md +3 -3
- package/dist/docs/api/index/type-aliases/ComponentFactory.md +1 -1
- package/dist/docs/api/index/type-aliases/ComponentValueMaps.md +50 -26
- package/dist/docs/api/index/type-aliases/EcsComponentFactoryKind.md +14 -2
- package/dist/docs/api/index/type-aliases/EcsRenderer.md +17 -0
- package/dist/docs/api/index/type-aliases/EcsWorldComponentSnapshot.md +3 -3
- package/dist/docs/api/index/type-aliases/EcsWorldStateSnapshotLike.md +4 -4
- package/dist/docs/api/index/type-aliases/ExternalRefWarning.md +5 -5
- package/dist/docs/api/index/type-aliases/HandMaterialOptions.md +32 -0
- package/dist/docs/api/index/type-aliases/HandPoseTrackerOptions.md +27 -0
- package/dist/docs/api/index/type-aliases/HydrateOptions.md +3 -3
- package/dist/docs/api/index/type-aliases/HydrateWorldFromSnapshotResult.md +4 -4
- package/dist/docs/api/index/type-aliases/InstantiateSubtreeResult.md +3 -3
- package/dist/docs/api/index/type-aliases/KeyboardKey.md +1 -1
- package/dist/docs/api/index/type-aliases/ModuleLoader.md +1 -1
- package/dist/docs/api/index/type-aliases/MouseButton.md +1 -1
- package/dist/docs/api/index/type-aliases/NestedRegion.md +5 -5
- package/dist/docs/api/index/type-aliases/NodeKeyMaps.md +5 -5
- package/dist/docs/api/index/type-aliases/NodeMaps.md +4 -4
- package/dist/docs/api/index/type-aliases/PrefabAsset.md +5 -5
- package/dist/docs/api/index/type-aliases/RemapSnapshotOptions.md +2 -2
- package/dist/docs/api/index/type-aliases/RendererKind.md +15 -0
- package/dist/docs/api/index/type-aliases/ScriptBehaviourSystemOptions.md +23 -0
- package/dist/docs/api/index/type-aliases/ScriptErrorEvent.md +39 -0
- package/dist/docs/api/index/type-aliases/ScriptErrorListener.md +25 -0
- package/dist/docs/api/index/type-aliases/ScriptErrorPhase.md +28 -0
- package/dist/docs/api/index/type-aliases/ScriptErrorReport.md +31 -0
- package/dist/docs/api/index/type-aliases/ScriptErrorSource.md +15 -0
- package/dist/docs/api/index/type-aliases/SelectionContext.md +4 -4
- package/dist/docs/api/index/type-aliases/SerializeEntitySubtreeResult.md +4 -4
- package/dist/docs/api/index/type-aliases/SpawnPrefabOptions.md +5 -5
- package/dist/docs/api/index/type-aliases/SpawnPrefabSource.md +1 -1
- package/dist/docs/api/index/type-aliases/SubtreeSnapshot.md +3 -3
- package/dist/docs/api/index/type-aliases/UiCanvasLike.md +46 -0
- package/dist/docs/api/index/type-aliases/VelocitySample.md +23 -0
- package/dist/docs/api/index/type-aliases/XrCapabilities.md +41 -0
- package/dist/docs/api/index/type-aliases/XrFinger.md +13 -0
- package/dist/docs/api/index/type-aliases/XrFingerCurl.md +27 -0
- package/dist/docs/api/index/type-aliases/XrFingerTarget.md +31 -0
- package/dist/docs/api/index/type-aliases/XrHandJointName.md +40 -0
- package/dist/docs/api/index/type-aliases/XrHandJoints.md +18 -0
- package/dist/docs/api/index/type-aliases/XrHandPoseAxis.md +15 -0
- package/dist/docs/api/index/type-aliases/XrHandPoseContext.md +23 -0
- package/dist/docs/api/index/type-aliases/XrHandPoseDefinition.md +47 -0
- package/dist/docs/api/index/type-aliases/XrHandPoseDirection.md +21 -0
- package/dist/docs/api/index/type-aliases/XrHandPoseEvent.md +13 -0
- package/dist/docs/api/index/type-aliases/XrHandPoseEventDetail.md +27 -0
- package/dist/docs/api/index/type-aliases/XrHandPoseMatch.md +25 -0
- package/dist/docs/api/index/type-aliases/XrHandPoseOrientation.md +25 -0
- package/dist/docs/api/index/type-aliases/XrHandShape.md +46 -0
- package/dist/docs/api/index/type-aliases/XrHandedness.md +15 -0
- package/dist/docs/api/index/type-aliases/XrHitResult.md +25 -0
- package/dist/docs/api/index/type-aliases/XrInputKind.md +19 -0
- package/dist/docs/api/index/type-aliases/XrInputState.md +60 -0
- package/dist/docs/api/index/type-aliases/XrPalmPose.md +31 -0
- package/dist/docs/api/index/variables/ADDED_NODE_MARKER_COMPONENT.md +2 -2
- package/dist/docs/api/index/variables/ARC_GRAVITY.md +15 -0
- package/dist/docs/api/index/variables/ARC_MAX_TIME.md +15 -0
- package/dist/docs/api/index/variables/ARC_SPEED.md +15 -0
- package/dist/docs/api/index/variables/ARC_STEPS.md +15 -0
- package/dist/docs/api/index/variables/CURLED_COS.md +13 -0
- package/dist/docs/api/index/variables/DEFAULT_DIRECTION_TOLERANCE.md +15 -0
- package/dist/docs/api/index/variables/DEFAULT_ENTER_CONFIDENCE.md +13 -0
- package/dist/docs/api/index/variables/DEFAULT_EXIT_CONFIDENCE.md +13 -0
- package/dist/docs/api/index/variables/DEFAULT_LOST_GRACE_SECONDS.md +13 -0
- package/dist/docs/api/index/variables/DEFAULT_MIN_HOLD_SECONDS.md +13 -0
- package/dist/docs/api/index/variables/DEFAULT_SCRIPT_ERROR_RETRY_DELAY.md +17 -0
- package/dist/docs/api/index/variables/FALLBACK_HAND_SCALE.md +15 -0
- package/dist/docs/api/index/variables/HAND_POSE_PRESETS.md +19 -0
- package/dist/docs/api/index/variables/HAND_POSE_PRESET_IDS.md +15 -0
- package/dist/docs/api/index/variables/HYDRATABLE_ENTITY_KINDS.md +1 -1
- package/dist/docs/api/index/variables/KeyboardKeys.md +89 -89
- package/dist/docs/api/index/variables/MATCH_FALLOFF.md +15 -0
- package/dist/docs/api/index/variables/MAX_PLAUSIBLE_SPEED.md +25 -0
- package/dist/docs/api/index/variables/MAX_SAMPLE_AGE_SECONDS.md +18 -0
- package/dist/docs/api/index/variables/NODE_KEY_SEPARATOR.md +1 -1
- package/dist/docs/api/index/variables/NO_XR_CAPABILITIES.md +15 -0
- package/dist/docs/api/index/variables/OVERRIDE_DIFF_EXCLUDED_COMPONENTS.md +1 -1
- package/dist/docs/api/index/variables/OVERRIDE_ROOT_EXCLUDED_COMPONENTS.md +1 -1
- package/dist/docs/api/index/variables/PINCH_FINGERS.md +15 -0
- package/dist/docs/api/index/variables/PREFAB_FILE_VERSION.md +1 -1
- package/dist/docs/api/index/variables/PREFAB_FILE_VERSION_NESTED.md +1 -1
- package/dist/docs/api/index/variables/SCRIPT_OBJECT_ROOT_FLAG.md +1 -1
- package/dist/docs/api/index/variables/SHARED_MODEL_RESOURCE_FLAG.md +1 -1
- package/dist/docs/api/index/variables/STRAIGHT_COS.md +19 -0
- package/dist/docs/api/index/variables/VELOCITY_SAMPLES.md +15 -0
- package/dist/docs/api/index/variables/XR_FINGERS.md +13 -0
- package/dist/docs/api/index/variables/XR_HOVER_SHELL_FLAG.md +15 -0
- package/dist/docs/api/index/variables/webglBackend.md +16 -0
- package/dist/docs/api/typedoc-sidebar.json +1 -1
- package/dist/docs/api/types/type-aliases/AssetInput.md +3 -3
- package/dist/docs/api/types/type-aliases/CheckboxInput.md +3 -3
- package/dist/docs/api/types/type-aliases/ColorInput.md +1 -1
- package/dist/docs/api/types/type-aliases/ComponentInput.md +4 -4
- package/dist/docs/api/types/type-aliases/ComponentKind.md +1 -1
- package/dist/docs/api/types/type-aliases/DropdownInput.md +3 -3
- package/dist/docs/api/types/type-aliases/DropdownOption.md +3 -3
- package/dist/docs/api/types/type-aliases/EcsEntityEditorKind.md +1 -1
- package/dist/docs/api/types/type-aliases/EcsEntityKind.md +10 -2
- package/dist/docs/api/types/type-aliases/EntityId.md +1 -1
- package/dist/docs/api/types/type-aliases/EntityInput.md +3 -3
- package/dist/docs/api/types/type-aliases/FloatInput.md +1 -1
- package/dist/docs/api/types/type-aliases/IntersectionResult.md +3 -3
- package/dist/docs/api/types/type-aliases/ParentLookup.md +3 -3
- package/dist/docs/api/types/type-aliases/SelectionListener.md +1 -1
- package/dist/docs/api/types/type-aliases/SliderInput.md +5 -5
- package/dist/docs/api/types/type-aliases/TextInput.md +1 -1
- package/dist/docs/api/types/type-aliases/ToggleInput.md +1 -1
- package/dist/docs/api/types/type-aliases/Vec3.md +1 -1
- package/dist/docs/api/types/type-aliases/Vector2Input.md +3 -3
- package/dist/docs/api/types/type-aliases/Vector3Input.md +4 -4
- package/dist/docs/api/types/type-aliases/WorldEntityView.md +1 -1
- package/dist/docs/guide/audio-mixing-and-sound-banks.md +71 -0
- package/dist/docs/guide/authoring-a-behaviour.md +3 -3
- package/dist/docs/guide/authoring-a-script-object.md +12 -9
- package/dist/docs/guide/behaviour-data-binding/index.md +11 -11
- package/dist/docs/guide/behaviour-lifecycle.md +9 -0
- package/dist/docs/guide/bone-attachments-and-ik.md +128 -0
- package/dist/docs/guide/component-catalog.md +10 -2
- package/dist/docs/guide/components/light.md +42 -0
- package/dist/docs/guide/components/model.md +32 -3
- package/dist/docs/guide/concepts.md +2 -2
- package/dist/docs/guide/getting-started/creating-objects.md +2 -2
- package/dist/docs/guide/getting-started/editing-objects.md +2 -2
- package/dist/docs/guide/getting-started/editor/ai-agent.md +227 -0
- package/dist/docs/guide/getting-started/editor/hierarchy.md +2 -2
- package/dist/docs/guide/getting-started/editor/index.md +3 -2
- package/dist/docs/guide/getting-started/editor/inspector.md +2 -2
- package/dist/docs/guide/getting-started/editor/scene-inspector.md +3 -3
- package/dist/docs/guide/getting-started/editor/toolbar.md +11 -11
- package/dist/docs/guide/getting-started/editor/viewport.md +17 -9
- package/dist/docs/guide/getting-started/index.md +1 -1
- package/dist/docs/guide/getting-started/installation.md +1 -1
- package/dist/docs/guide/getting-started/preview-and-test.md +7 -7
- package/dist/docs/guide/getting-started/project-types/image-tracking.md +23 -11
- package/dist/docs/guide/getting-started/project-types/index.md +4 -4
- package/dist/docs/guide/getting-started/project-types/vr.md +270 -2
- package/dist/docs/guide/getting-started/projects.md +4 -5
- package/dist/docs/guide/getting-started/shortcuts.md +5 -4
- package/dist/docs/guide/multiplayer.md +92 -0
- package/dist/docs/guide/scene/environment.md +101 -4
- package/dist/docs/guide/scene/index.md +4 -4
- package/dist/docs/guide/scene/postprocessing.md +67 -5
- package/dist/docs/guide/spawning/area-light.md +2 -0
- package/dist/docs/guide/systems/environment-sync-system.md +11 -6
- package/dist/docs/guide/systems/light-sync-system.md +5 -3
- package/dist/docs/guide/systems/postprocessing-sync-system.md +16 -6
- package/dist/docs/guide/systems/render-system.md +7 -6
- package/dist/docs/guide/systems/script-behaviour-system.md +7 -5
- package/dist/docs/guide/systems/script-object-system.md +3 -1
- package/dist/docs/guide/systems/video-system.md +1 -1
- package/dist/docs/guide/webgpu-and-tsl.md +415 -0
- package/dist/docs/guide/world-api.md +52 -2
- package/dist/factories/index.cjs +770 -283
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +14 -3
- package/dist/factories/index.d.ts +14 -3
- package/dist/factories/index.js +7 -4
- package/dist/{index-D2Jt_JzH.d.ts → index-C61n65PE.d.ts} +135 -42
- package/dist/{index-DaG03vyN.d.cts → index-C70N4BYG.d.cts} +135 -42
- package/dist/{index-C3ik3sA1.d.ts → index-D9DjrUn3.d.cts} +25 -3
- package/dist/{index-Dlr-7-4m.d.cts → index-DppafVu4.d.ts} +25 -3
- package/dist/index.cjs +3642 -1263
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +113 -11
- package/dist/index.d.ts +113 -11
- package/dist/index.js +187 -12
- package/dist/index.js.map +1 -1
- package/dist/network/index.cjs +4896 -0
- package/dist/network/index.cjs.map +1 -0
- package/dist/network/index.d.cts +98 -0
- package/dist/network/index.d.ts +98 -0
- package/dist/network/index.js +493 -0
- package/dist/network/index.js.map +1 -0
- package/dist/systems/index.cjs +3958 -1762
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +4 -2
- package/dist/systems/index.d.ts +4 -2
- package/dist/systems/index.js +8 -4
- package/dist/types.d.cts +3 -1
- package/dist/types.d.ts +3 -1
- package/dist/webgpu/index.d.ts +113 -0
- package/dist/webgpu/index.js +302 -0
- package/dist/webgpu/index.js.map +1 -0
- package/dist/worldSnapshotUtils.d.cts +3 -1
- package/dist/worldSnapshotUtils.d.ts +3 -1
- package/dist/worldSnapshotUtils.js +3 -2
- package/package.json +19 -3
- package/dist/chunk-BUEKOSR5.js.map +0 -1
- package/dist/chunk-DF5SSRN6.js.map +0 -1
- package/dist/chunk-OWQSESTO.js.map +0 -1
- package/dist/chunk-OY7ZODZP.js.map +0 -1
- package/dist/chunk-RXBLOO5B.js.map +0 -1
- package/dist/chunk-WJD2VKEH.js +0 -315
- package/dist/chunk-WJD2VKEH.js.map +0 -1
package/dist/systems/index.d.cts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { A as AnimationSystem,
|
|
1
|
+
export { a0 as AudioSystem, a4 as ComponentFactory, a9 as EcsComponentFactoryKind, ae as IKSystem, af as InputSystem, ah as KeyboardKey, ai as KeyboardKeys, ak as MouseButton, X as ObjectManagementSystem, M as PlaySlotOptions, ar as RenderSystem, aG as TransformSyncSystem } from '../System-8D-XBDKZ.cjs';
|
|
2
|
+
export { A as AnimationSystem, C as CameraSyncSystem, D as DEFAULT_SCRIPT_ERROR_RETRY_DELAY, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, c as MeshGeometrySystem, d as ModuleLoader, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, e as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, f as ScriptBehaviourSystem, g as ScriptBehaviourSystemOptions, h as ScriptObjectSystem, i as SelectionContext, U as UIInteractionSystem, j as UIPanelSystem, k as UiCanvasLike, V as VRTeleportAreaSystem, l as VideoSystem, m as XRAnchorSystem, n as XRControllerVisualSystem, o as XREnvironmentSystem, p as XRHandPoseSystem, q as XRHitTestSystem, r as XRHoverVisualSystem, s as XRInputSystem, t as XRInteractionSystem, u as XRLocomotionSystem, v as XRSessionSystem, w as XRTeleportVisualSystem, x as XR_HOVER_SHELL_FLAG, b as XrHandPoseEventDetail, z as XrHitResult } from '../index-C70N4BYG.cjs';
|
|
3
3
|
import 'three';
|
|
4
4
|
import '@dimforge/rapier3d-compat';
|
|
5
|
+
import '../animation/index.cjs';
|
|
6
|
+
import 'three/webgpu';
|
|
5
7
|
import '../handPose-DlcTtqgx.cjs';
|
package/dist/systems/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { A as AnimationSystem,
|
|
1
|
+
export { a5 as AudioSystem, a8 as ComponentFactory, ad as EcsComponentFactoryKind, ah as IKSystem, ai as InputSystem, ak as KeyboardKey, al as KeyboardKeys, an as MouseButton, a0 as ObjectManagementSystem, Y as PlaySlotOptions, as as RenderSystem, aG as TransformSyncSystem } from '../System-DPMAW30g.js';
|
|
2
|
+
export { A as AnimationSystem, C as CameraSyncSystem, D as DEFAULT_SCRIPT_ERROR_RETRY_DELAY, E as EnvironmentSyncSystem, I as InstancedMeshSystem, L as LightSyncSystem, M as MaterialSyncSystem, c as MeshGeometrySystem, d as ModuleLoader, O as ObjectVisibilitySystem, P as PhysicsSyncSystem, e as PostprocessingSyncSystem, S as SCRIPT_OBJECT_ROOT_FLAG, f as ScriptBehaviourSystem, g as ScriptBehaviourSystemOptions, h as ScriptObjectSystem, i as SelectionContext, U as UIInteractionSystem, j as UIPanelSystem, k as UiCanvasLike, V as VRTeleportAreaSystem, l as VideoSystem, m as XRAnchorSystem, n as XRControllerVisualSystem, o as XREnvironmentSystem, p as XRHandPoseSystem, q as XRHitTestSystem, r as XRHoverVisualSystem, s as XRInputSystem, t as XRInteractionSystem, u as XRLocomotionSystem, v as XRSessionSystem, w as XRTeleportVisualSystem, x as XR_HOVER_SHELL_FLAG, b as XrHandPoseEventDetail, z as XrHitResult } from '../index-C61n65PE.js';
|
|
3
3
|
import 'three';
|
|
4
4
|
import '@dimforge/rapier3d-compat';
|
|
5
|
+
import '../animation/index.js';
|
|
6
|
+
import 'three/webgpu';
|
|
5
7
|
import '../handPose-DlcTtqgx.js';
|
package/dist/systems/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
export { AnimationSystem, AudioSystem, CameraSyncSystem, EnvironmentSyncSystem, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MaterialSyncSystem, MeshGeometrySystem, ObjectVisibilitySystem, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, SCRIPT_OBJECT_ROOT_FLAG, ScriptBehaviourSystem, ScriptObjectSystem, TransformSyncSystem, UIInteractionSystem, UIPanelSystem, VRTeleportAreaSystem, VideoSystem, XRAnchorSystem, XRControllerVisualSystem, XREnvironmentSystem, XRHandPoseSystem, XRHitTestSystem, XRHoverVisualSystem, XRInputSystem, XRInteractionSystem, XRLocomotionSystem, XRSessionSystem, XRTeleportVisualSystem, XR_HOVER_SHELL_FLAG } from '../chunk-
|
|
2
|
-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
|
|
1
|
+
export { AnimationSystem, AudioSystem, CameraSyncSystem, DEFAULT_SCRIPT_ERROR_RETRY_DELAY, EnvironmentSyncSystem, IKSystem, InputSystem, InstancedMeshSystem, KeyboardKeys, LightSyncSystem, MaterialSyncSystem, MeshGeometrySystem, ObjectVisibilitySystem, PhysicsSyncSystem, PostprocessingSyncSystem, RenderSystem, SCRIPT_OBJECT_ROOT_FLAG, ScriptBehaviourSystem, ScriptObjectSystem, TransformSyncSystem, UIInteractionSystem, UIPanelSystem, VRTeleportAreaSystem, VideoSystem, XRAnchorSystem, XRControllerVisualSystem, XREnvironmentSystem, XRHandPoseSystem, XRHitTestSystem, XRHoverVisualSystem, XRInputSystem, XRInteractionSystem, XRLocomotionSystem, XRSessionSystem, XRTeleportVisualSystem, XR_HOVER_SHELL_FLAG } from '../chunk-JIJQFW6P.js';
|
|
2
|
+
import '../chunk-OHCNPPMX.js';
|
|
3
|
+
import '../chunk-U727NTWQ.js';
|
|
4
|
+
export { ObjectManagementSystem } from '../chunk-G4XJ53LS.js';
|
|
5
|
+
import '../chunk-NNDUOQ7O.js';
|
|
6
|
+
import '../chunk-CKTHDXPS.js';
|
|
7
|
+
import '../chunk-GSWC6LLD.js';
|
|
8
|
+
import '../chunk-XE4OXN2W.js';
|
|
5
9
|
//# sourceMappingURL=index.js.map
|
|
6
10
|
//# sourceMappingURL=index.js.map
|
package/dist/types.d.cts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import 'three';
|
|
2
|
-
export {
|
|
2
|
+
export { $ as AssetInput, a1 as CheckboxInput, a3 as ColorInput, a5 as ComponentInput, a6 as ComponentKind, a7 as DropdownInput, a8 as DropdownOption, aa as EcsEntityEditorKind, U as EcsEntityKind, G as EntityId, ac as EntityInput, ad as FloatInput, ag as IntersectionResult, Q as ParentLookup, ay as SelectionListener, az as SliderInput, aE as TextInput, aF as ToggleInput, aH as Vec3, aI as Vector2Input, aJ as Vector3Input, K as WorldEntityView } from './System-8D-XBDKZ.cjs';
|
|
3
3
|
import '@dimforge/rapier3d-compat';
|
|
4
|
+
import './animation/index.cjs';
|
|
5
|
+
import 'three/webgpu';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import 'three';
|
|
2
|
-
export {
|
|
2
|
+
export { a4 as AssetInput, a6 as CheckboxInput, a7 as ColorInput, a9 as ComponentInput, aa as ComponentKind, ab as DropdownInput, ac as DropdownOption, ae as EcsEntityEditorKind, $ as EcsEntityKind, M as EntityId, af as EntityInput, ag as FloatInput, aj as IntersectionResult, _ as ParentLookup, ay as SelectionListener, az as SliderInput, aE as TextInput, aF as ToggleInput, aH as Vec3, aI as Vector2Input, aJ as Vector3Input, S as WorldEntityView } from './System-DPMAW30g.js';
|
|
3
3
|
import '@dimforge/rapier3d-compat';
|
|
4
|
+
import './animation/index.js';
|
|
5
|
+
import 'three/webgpu';
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { C as ChromaKeyOptions, P as PostprocessingPipeline, a as PostprocessingBuildContext, b as PostprocessingState, R as RenderBackend } from '../System-DPMAW30g.js';
|
|
2
|
+
export { E as EcsRenderer, c as RendererKind } from '../System-DPMAW30g.js';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { UniformNode, MeshBasicNodeMaterial, PassNode, Node, RenderPipeline } from 'three/webgpu';
|
|
5
|
+
import BloomNode from 'three/examples/jsm/tsl/display/BloomNode.js';
|
|
6
|
+
import DepthOfFieldNode from 'three/examples/jsm/tsl/display/DepthOfFieldNode.js';
|
|
7
|
+
import DotScreenNode from 'three/examples/jsm/tsl/display/DotScreenNode.js';
|
|
8
|
+
import GTAONode from 'three/examples/jsm/tsl/display/GTAONode.js';
|
|
9
|
+
import RGBShiftNode from 'three/examples/jsm/tsl/display/RGBShiftNode.js';
|
|
10
|
+
import { smaa } from 'three/examples/jsm/tsl/display/SMAANode.js';
|
|
11
|
+
import '@dimforge/rapier3d-compat';
|
|
12
|
+
import '../animation/index.js';
|
|
13
|
+
|
|
14
|
+
/** The live uniforms of a TSL chroma-key material. */
|
|
15
|
+
interface ChromaKeyUniforms {
|
|
16
|
+
keyColor: UniformNode<"color", THREE.Color>;
|
|
17
|
+
similarity: UniformNode<"float", number>;
|
|
18
|
+
smoothness: UniformNode<"float", number>;
|
|
19
|
+
spill: UniformNode<"float", number>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Green-screen material for WebGPU (and `WebGPURenderer`'s WebGL 2 fallback):
|
|
23
|
+
* the same maths as the WebGL GLSL version, written in TSL.
|
|
24
|
+
*
|
|
25
|
+
* - alpha = `smoothstep(similarity, similarity + smoothness, distance(rgb, key))`
|
|
26
|
+
* - spill: the colour is desaturated toward its luma
|
|
27
|
+
* (`0.299, 0.587, 0.114`) until `similarity + spill + smoothness`.
|
|
28
|
+
*/
|
|
29
|
+
declare function createTslChromaKeyMaterial(map: THREE.Texture, options: ChromaKeyOptions): MeshBasicNodeMaterial;
|
|
30
|
+
/** Update a material made by {@link createTslChromaKeyMaterial}. */
|
|
31
|
+
declare function updateTslChromaKeyMaterial(material: THREE.Material, options: ChromaKeyOptions): boolean;
|
|
32
|
+
/** The uniforms behind a chroma-key material, or `undefined` for any other material. */
|
|
33
|
+
declare function getChromaKeyUniforms(material: THREE.Material): ChromaKeyUniforms | undefined;
|
|
34
|
+
|
|
35
|
+
/** three's `SMAANode` (its declaration file has no default export). */
|
|
36
|
+
type SMAANode = ReturnType<typeof smaa>;
|
|
37
|
+
/** Uniforms for the effects this module implements itself (or feeds by node). */
|
|
38
|
+
interface WebGpuPostprocessingUniforms {
|
|
39
|
+
dofFocusDistance: UniformNode<"float", number>;
|
|
40
|
+
dofFocalLength: UniformNode<"float", number>;
|
|
41
|
+
dofBokehScale: UniformNode<"float", number>;
|
|
42
|
+
vignetteOffset: UniformNode<"float", number>;
|
|
43
|
+
vignetteDarkness: UniformNode<"float", number>;
|
|
44
|
+
/** Hue rotation in radians (`hueSaturation.hue × π`). */
|
|
45
|
+
hueAngle: UniformNode<"float", number>;
|
|
46
|
+
/** `saturation()` factor derived from `hueSaturation.saturation`. */
|
|
47
|
+
saturationFactor: UniformNode<"float", number>;
|
|
48
|
+
sepiaAmount: UniformNode<"float", number>;
|
|
49
|
+
noiseOpacity: UniformNode<"float", number>;
|
|
50
|
+
/** Block size in CSS pixels; multiplied by the device pixel ratio on the GPU. */
|
|
51
|
+
pixelGranularity: UniformNode<"float", number>;
|
|
52
|
+
}
|
|
53
|
+
/** The TSL nodes a WebGPU chain was built from, by effect. Absent = effect off. */
|
|
54
|
+
interface WebGpuPostprocessingNodes {
|
|
55
|
+
/** The scene render (`pass(scene, camera)`). */
|
|
56
|
+
scenePass: PassNode;
|
|
57
|
+
ssao?: GTAONode;
|
|
58
|
+
dof?: DepthOfFieldNode;
|
|
59
|
+
bloom?: BloomNode;
|
|
60
|
+
vignette?: Node;
|
|
61
|
+
hueSaturation?: Node;
|
|
62
|
+
sepia?: Node;
|
|
63
|
+
noise?: Node;
|
|
64
|
+
dotScreen?: DotScreenNode;
|
|
65
|
+
chromAberration?: RGBShiftNode;
|
|
66
|
+
pixelation?: Node;
|
|
67
|
+
smaa?: SMAANode;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A post-processing chain built by the WebGPU backend: a three
|
|
71
|
+
* `RenderPipeline` plus the nodes and uniforms that feed it, so parameter
|
|
72
|
+
* changes update in place.
|
|
73
|
+
*/
|
|
74
|
+
interface WebGpuPostprocessingPipeline extends PostprocessingPipeline {
|
|
75
|
+
readonly renderPipeline: RenderPipeline;
|
|
76
|
+
readonly nodes: WebGpuPostprocessingNodes;
|
|
77
|
+
readonly uniforms: WebGpuPostprocessingUniforms;
|
|
78
|
+
/** Which effects are on; a different key needs a rebuild. */
|
|
79
|
+
readonly structureKey: string;
|
|
80
|
+
}
|
|
81
|
+
/** The on/off pattern of every effect: equal keys = same node graph. */
|
|
82
|
+
declare function postprocessingStructureKey(values: PostprocessingState): string;
|
|
83
|
+
/**
|
|
84
|
+
* Build the chain. Order mirrors the WebGL composer where it can: scene →
|
|
85
|
+
* ambient occlusion → depth of field → bloom → vignette → hue/saturation →
|
|
86
|
+
* sepia → film noise → dot screen → chromatic aberration → pixelation → SMAA.
|
|
87
|
+
* (On WebGL the SSAO pass sits later but renders the scene again itself;
|
|
88
|
+
* here the occlusion multiplies the scene colour before anything else.)
|
|
89
|
+
*/
|
|
90
|
+
declare function createWebGpuPostprocessing(context: PostprocessingBuildContext): WebGpuPostprocessingPipeline;
|
|
91
|
+
/**
|
|
92
|
+
* Push a parameter-only change into `pipeline`. Returns `false` when an
|
|
93
|
+
* effect was switched on or off (the graph differs, so the caller rebuilds),
|
|
94
|
+
* or when `pipeline` was not built here.
|
|
95
|
+
*/
|
|
96
|
+
declare function updateWebGpuPostprocessing(pipeline: PostprocessingPipeline, _previous: PostprocessingState, next: PostprocessingState): boolean;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Give `RectAreaLight` its lookup tables. Without them the light's node
|
|
100
|
+
* throws while its shader is built, so this runs once, before any frame.
|
|
101
|
+
*/
|
|
102
|
+
declare function installWebGpuAreaLights(): void;
|
|
103
|
+
/**
|
|
104
|
+
* The {@link RenderBackend} for three's `WebGPURenderer`: post-processing as
|
|
105
|
+
* a TSL `RenderPipeline`, a TSL green-screen material, and area-light tables.
|
|
106
|
+
* Pass it as `new World({ ..., backend: webgpuBackend })`.
|
|
107
|
+
*
|
|
108
|
+
* Works on the renderer's WebGL 2 fallback too (`WebGPURenderer` picks it by
|
|
109
|
+
* itself when the browser has no WebGPU).
|
|
110
|
+
*/
|
|
111
|
+
declare const webgpuBackend: RenderBackend;
|
|
112
|
+
|
|
113
|
+
export { ChromaKeyOptions, type ChromaKeyUniforms, PostprocessingBuildContext, PostprocessingPipeline, RenderBackend, type WebGpuPostprocessingNodes, type WebGpuPostprocessingPipeline, type WebGpuPostprocessingUniforms, createTslChromaKeyMaterial, createWebGpuPostprocessing, getChromaKeyUniforms, installWebGpuAreaLights, postprocessingStructureKey, updateTslChromaKeyMaterial, updateWebGpuPostprocessing, webgpuBackend };
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { __name } from '../chunk-XE4OXN2W.js';
|
|
2
|
+
import { MeshBasicNodeMaterial, RenderPipeline, RectAreaLightNode } from 'three/webgpu';
|
|
3
|
+
import { RectAreaLightTexturesLib } from 'three/examples/jsm/lights/RectAreaLightTexturesLib.js';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { uniform, texture, uv, distance, smoothstep, dot, vec3, mix, vec4, float, convertToTexture, max, screenDPR, screenSize, floor, pass, hue, saturation, renderOutput } from 'three/tsl';
|
|
6
|
+
import { bloom } from 'three/examples/jsm/tsl/display/BloomNode.js';
|
|
7
|
+
import { dof } from 'three/examples/jsm/tsl/display/DepthOfFieldNode.js';
|
|
8
|
+
import { dotScreen } from 'three/examples/jsm/tsl/display/DotScreenNode.js';
|
|
9
|
+
import { film } from 'three/examples/jsm/tsl/display/FilmNode.js';
|
|
10
|
+
import { ao } from 'three/examples/jsm/tsl/display/GTAONode.js';
|
|
11
|
+
import { rgbShift } from 'three/examples/jsm/tsl/display/RGBShiftNode.js';
|
|
12
|
+
import { sepia } from 'three/examples/jsm/tsl/display/Sepia.js';
|
|
13
|
+
import { smaa } from 'three/examples/jsm/tsl/display/SMAANode.js';
|
|
14
|
+
|
|
15
|
+
var uniformsByMaterial = /* @__PURE__ */ new WeakMap();
|
|
16
|
+
function createTslChromaKeyMaterial(map, options) {
|
|
17
|
+
const uniforms = {
|
|
18
|
+
keyColor: uniform(new THREE.Color(options.keyColor)),
|
|
19
|
+
similarity: uniform(options.similarity),
|
|
20
|
+
smoothness: uniform(options.smoothness),
|
|
21
|
+
spill: uniform(options.spill)
|
|
22
|
+
};
|
|
23
|
+
const texel = texture(map, uv());
|
|
24
|
+
const chromaDist = distance(texel.rgb, uniforms.keyColor.rgb);
|
|
25
|
+
const alpha = smoothstep(
|
|
26
|
+
uniforms.similarity,
|
|
27
|
+
uniforms.similarity.add(uniforms.smoothness),
|
|
28
|
+
chromaDist
|
|
29
|
+
);
|
|
30
|
+
const spillFactor = smoothstep(
|
|
31
|
+
uniforms.similarity,
|
|
32
|
+
uniforms.similarity.add(uniforms.spill).add(uniforms.smoothness),
|
|
33
|
+
chromaDist
|
|
34
|
+
);
|
|
35
|
+
const luma = dot(texel.rgb, vec3(0.299, 0.587, 0.114));
|
|
36
|
+
const despilled = mix(vec3(luma), texel.rgb, spillFactor);
|
|
37
|
+
const material = new MeshBasicNodeMaterial({
|
|
38
|
+
transparent: true,
|
|
39
|
+
side: THREE.DoubleSide
|
|
40
|
+
});
|
|
41
|
+
material.colorNode = despilled;
|
|
42
|
+
material.opacityNode = texel.a.mul(alpha);
|
|
43
|
+
material.userData.ecsChromaKey = true;
|
|
44
|
+
uniformsByMaterial.set(material, uniforms);
|
|
45
|
+
return material;
|
|
46
|
+
}
|
|
47
|
+
__name(createTslChromaKeyMaterial, "createTslChromaKeyMaterial");
|
|
48
|
+
function updateTslChromaKeyMaterial(material, options) {
|
|
49
|
+
const uniforms = uniformsByMaterial.get(material);
|
|
50
|
+
if (!uniforms) return false;
|
|
51
|
+
uniforms.keyColor.value.set(options.keyColor);
|
|
52
|
+
uniforms.similarity.value = options.similarity;
|
|
53
|
+
uniforms.smoothness.value = options.smoothness;
|
|
54
|
+
uniforms.spill.value = options.spill;
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
__name(updateTslChromaKeyMaterial, "updateTslChromaKeyMaterial");
|
|
58
|
+
function getChromaKeyUniforms(material) {
|
|
59
|
+
return uniformsByMaterial.get(material);
|
|
60
|
+
}
|
|
61
|
+
__name(getChromaKeyUniforms, "getChromaKeyUniforms");
|
|
62
|
+
var STRUCTURAL_EFFECTS = [
|
|
63
|
+
"dof",
|
|
64
|
+
"bloom",
|
|
65
|
+
"vignette",
|
|
66
|
+
"hueSaturation",
|
|
67
|
+
"sepia",
|
|
68
|
+
"noise",
|
|
69
|
+
"dotScreen",
|
|
70
|
+
"ssao",
|
|
71
|
+
"glitch",
|
|
72
|
+
"chromAberration",
|
|
73
|
+
"pixelation",
|
|
74
|
+
"smaa"
|
|
75
|
+
];
|
|
76
|
+
function postprocessingStructureKey(values) {
|
|
77
|
+
return [
|
|
78
|
+
values.postEnabled ? "on" : "off",
|
|
79
|
+
...STRUCTURAL_EFFECTS.map((effect) => values[effect].enabled ? "1" : "0")
|
|
80
|
+
].join("");
|
|
81
|
+
}
|
|
82
|
+
__name(postprocessingStructureKey, "postprocessingStructureKey");
|
|
83
|
+
var glitchWarned = /* @__PURE__ */ new WeakSet();
|
|
84
|
+
function warnGlitchOnce(owner) {
|
|
85
|
+
if (glitchWarned.has(owner)) return;
|
|
86
|
+
glitchWarned.add(owner);
|
|
87
|
+
console.warn(
|
|
88
|
+
"[spatial-ecs] The glitch post effect has no WebGPU version and is skipped. The other effects still apply."
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
__name(warnGlitchOnce, "warnGlitchOnce");
|
|
92
|
+
function saturationFactorFor(value) {
|
|
93
|
+
const s = Math.max(-1, Math.min(1, value));
|
|
94
|
+
return s > 0 ? 1 / (1.001 - s) : 1 + s;
|
|
95
|
+
}
|
|
96
|
+
__name(saturationFactorFor, "saturationFactorFor");
|
|
97
|
+
function createUniforms() {
|
|
98
|
+
return {
|
|
99
|
+
dofFocusDistance: uniform(1),
|
|
100
|
+
dofFocalLength: uniform(1),
|
|
101
|
+
dofBokehScale: uniform(1),
|
|
102
|
+
vignetteOffset: uniform(1),
|
|
103
|
+
vignetteDarkness: uniform(1),
|
|
104
|
+
hueAngle: uniform(0),
|
|
105
|
+
saturationFactor: uniform(1),
|
|
106
|
+
sepiaAmount: uniform(1),
|
|
107
|
+
noiseOpacity: uniform(0),
|
|
108
|
+
pixelGranularity: uniform(6)
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
__name(createUniforms, "createUniforms");
|
|
112
|
+
function applyParameters(nodes, uniforms, values) {
|
|
113
|
+
uniforms.dofFocusDistance.value = Math.max(0, values.dof.focusDistance);
|
|
114
|
+
uniforms.dofFocalLength.value = Math.max(1e-4, values.dof.focalLength);
|
|
115
|
+
uniforms.dofBokehScale.value = Math.max(0, values.dof.bokehScale);
|
|
116
|
+
if (nodes.bloom) {
|
|
117
|
+
nodes.bloom.strength.value = Math.max(0, values.bloom.intensity);
|
|
118
|
+
nodes.bloom.radius.value = values.bloom.radius;
|
|
119
|
+
nodes.bloom.threshold.value = values.bloom.threshold;
|
|
120
|
+
}
|
|
121
|
+
uniforms.vignetteOffset.value = values.vignette.offset;
|
|
122
|
+
uniforms.vignetteDarkness.value = values.vignette.darkness;
|
|
123
|
+
uniforms.hueAngle.value = values.hueSaturation.hue * Math.PI;
|
|
124
|
+
uniforms.saturationFactor.value = saturationFactorFor(values.hueSaturation.saturation);
|
|
125
|
+
uniforms.sepiaAmount.value = values.sepia.intensity;
|
|
126
|
+
uniforms.noiseOpacity.value = values.noise.opacity;
|
|
127
|
+
if (nodes.dotScreen) {
|
|
128
|
+
nodes.dotScreen.angle.value = values.dotScreen.angle ?? values.dotScreen.dotScreenAngle;
|
|
129
|
+
nodes.dotScreen.scale.value = values.dotScreen.scale ?? values.dotScreen.dotScreenScale;
|
|
130
|
+
}
|
|
131
|
+
if (nodes.ssao) {
|
|
132
|
+
nodes.ssao.radius.value = Math.max(1e-3, values.ssao.radius);
|
|
133
|
+
nodes.ssao.scale.value = Math.max(0, values.ssao.intensity);
|
|
134
|
+
}
|
|
135
|
+
if (nodes.chromAberration) {
|
|
136
|
+
const { offsetX, offsetY } = values.chromAberration;
|
|
137
|
+
nodes.chromAberration.amount.value = Math.hypot(offsetX, offsetY);
|
|
138
|
+
nodes.chromAberration.angle.value = Math.atan2(offsetY, offsetX);
|
|
139
|
+
}
|
|
140
|
+
uniforms.pixelGranularity.value = Math.max(1, values.pixelation.granularity);
|
|
141
|
+
}
|
|
142
|
+
__name(applyParameters, "applyParameters");
|
|
143
|
+
function vignetteNode(input, offset, darkness) {
|
|
144
|
+
const centered = uv().sub(0.5).mul(offset);
|
|
145
|
+
return vec4(
|
|
146
|
+
mix(input.rgb, vec3(float(1).sub(darkness)), dot(centered, centered)),
|
|
147
|
+
input.a
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
__name(vignetteNode, "vignetteNode");
|
|
151
|
+
function pixelationNode(input, granularity) {
|
|
152
|
+
const source = convertToTexture(input);
|
|
153
|
+
const block = max(granularity.mul(screenDPR), 1).div(screenSize);
|
|
154
|
+
const coord = block.mul(floor(uv().div(block)).add(0.5));
|
|
155
|
+
return source.sample(coord);
|
|
156
|
+
}
|
|
157
|
+
__name(pixelationNode, "pixelationNode");
|
|
158
|
+
function createWebGpuPostprocessing(context) {
|
|
159
|
+
const { scene, camera, values } = context;
|
|
160
|
+
const renderer = context.renderer;
|
|
161
|
+
const readsDepth = values.ssao.enabled || values.dof.enabled;
|
|
162
|
+
const scenePass = readsDepth ? pass(scene, camera, { samples: 0 }) : pass(scene, camera);
|
|
163
|
+
const nodes = { scenePass };
|
|
164
|
+
const uniforms = createUniforms();
|
|
165
|
+
let color = scenePass.getTextureNode("output");
|
|
166
|
+
if (values.ssao.enabled) {
|
|
167
|
+
const aoNode = ao(
|
|
168
|
+
scenePass.getTextureNode("depth"),
|
|
169
|
+
null,
|
|
170
|
+
camera
|
|
171
|
+
);
|
|
172
|
+
nodes.ssao = aoNode;
|
|
173
|
+
color = vec4(color.rgb.mul(aoNode.getTextureNode().r), color.a);
|
|
174
|
+
}
|
|
175
|
+
if (values.dof.enabled) {
|
|
176
|
+
const dofNode = dof(
|
|
177
|
+
color,
|
|
178
|
+
scenePass.getViewZNode(),
|
|
179
|
+
uniforms.dofFocusDistance,
|
|
180
|
+
uniforms.dofFocalLength,
|
|
181
|
+
uniforms.dofBokehScale
|
|
182
|
+
);
|
|
183
|
+
nodes.dof = dofNode;
|
|
184
|
+
color = dofNode;
|
|
185
|
+
}
|
|
186
|
+
if (values.bloom.enabled) {
|
|
187
|
+
const bloomNode = bloom(color);
|
|
188
|
+
nodes.bloom = bloomNode;
|
|
189
|
+
color = vec4(color.rgb.add(bloomNode.rgb), color.a);
|
|
190
|
+
}
|
|
191
|
+
if (values.vignette.enabled) {
|
|
192
|
+
color = vignetteNode(color, uniforms.vignetteOffset, uniforms.vignetteDarkness);
|
|
193
|
+
nodes.vignette = color;
|
|
194
|
+
}
|
|
195
|
+
if (values.hueSaturation.enabled) {
|
|
196
|
+
const rotated = hue(color, uniforms.hueAngle);
|
|
197
|
+
color = vec4(saturation(rotated, uniforms.saturationFactor), color.a);
|
|
198
|
+
nodes.hueSaturation = color;
|
|
199
|
+
}
|
|
200
|
+
if (values.sepia.enabled) {
|
|
201
|
+
const toned = sepia(color);
|
|
202
|
+
color = vec4(mix(color.rgb, toned.rgb, uniforms.sepiaAmount), color.a);
|
|
203
|
+
nodes.sepia = color;
|
|
204
|
+
}
|
|
205
|
+
if (values.noise.enabled) {
|
|
206
|
+
color = film(color, uniforms.noiseOpacity);
|
|
207
|
+
nodes.noise = color;
|
|
208
|
+
}
|
|
209
|
+
if (values.dotScreen.enabled) {
|
|
210
|
+
const dotNode = dotScreen(color);
|
|
211
|
+
nodes.dotScreen = dotNode;
|
|
212
|
+
color = dotNode;
|
|
213
|
+
}
|
|
214
|
+
if (values.glitch.enabled) {
|
|
215
|
+
warnGlitchOnce(context.world ?? scene);
|
|
216
|
+
}
|
|
217
|
+
if (values.chromAberration.enabled) {
|
|
218
|
+
const shiftNode = rgbShift(color);
|
|
219
|
+
nodes.chromAberration = shiftNode;
|
|
220
|
+
color = shiftNode;
|
|
221
|
+
}
|
|
222
|
+
if (values.pixelation.enabled) {
|
|
223
|
+
color = pixelationNode(color, uniforms.pixelGranularity);
|
|
224
|
+
nodes.pixelation = color;
|
|
225
|
+
}
|
|
226
|
+
let outputColorTransform = true;
|
|
227
|
+
if (values.smaa.enabled) {
|
|
228
|
+
const smaaNode = smaa(renderOutput(color));
|
|
229
|
+
nodes.smaa = smaaNode;
|
|
230
|
+
color = smaaNode;
|
|
231
|
+
outputColorTransform = false;
|
|
232
|
+
}
|
|
233
|
+
applyParameters(nodes, uniforms, values);
|
|
234
|
+
const renderPipeline = new RenderPipeline(renderer, color);
|
|
235
|
+
renderPipeline.outputColorTransform = outputColorTransform;
|
|
236
|
+
return {
|
|
237
|
+
renderPipeline,
|
|
238
|
+
nodes,
|
|
239
|
+
uniforms,
|
|
240
|
+
structureKey: postprocessingStructureKey(values),
|
|
241
|
+
render: /* @__PURE__ */ __name(() => {
|
|
242
|
+
renderPipeline.render();
|
|
243
|
+
}, "render"),
|
|
244
|
+
dispose: /* @__PURE__ */ __name(() => {
|
|
245
|
+
renderPipeline.dispose();
|
|
246
|
+
disposeNodes(nodes);
|
|
247
|
+
}, "dispose")
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
__name(createWebGpuPostprocessing, "createWebGpuPostprocessing");
|
|
251
|
+
function updateWebGpuPostprocessing(pipeline, _previous, next) {
|
|
252
|
+
const candidate = pipeline;
|
|
253
|
+
if (!candidate.renderPipeline || !candidate.nodes || !candidate.uniforms || typeof candidate.structureKey !== "string") {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
if (candidate.structureKey !== postprocessingStructureKey(next)) {
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
applyParameters(candidate.nodes, candidate.uniforms, next);
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
__name(updateWebGpuPostprocessing, "updateWebGpuPostprocessing");
|
|
263
|
+
function disposeNodes(nodes) {
|
|
264
|
+
const seen = /* @__PURE__ */ new Set();
|
|
265
|
+
const free = /* @__PURE__ */ __name((node) => {
|
|
266
|
+
if (!node || seen.has(node)) return;
|
|
267
|
+
seen.add(node);
|
|
268
|
+
if (node.isRTTNode) node.renderTarget?.dispose?.();
|
|
269
|
+
node.dispose?.();
|
|
270
|
+
free(node.textureNode);
|
|
271
|
+
}, "free");
|
|
272
|
+
for (const node of Object.values(nodes)) {
|
|
273
|
+
free(node);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
__name(disposeNodes, "disposeNodes");
|
|
277
|
+
|
|
278
|
+
// core/webgpu/index.ts
|
|
279
|
+
var areaLightTablesInstalled = false;
|
|
280
|
+
function installWebGpuAreaLights() {
|
|
281
|
+
if (areaLightTablesInstalled) return;
|
|
282
|
+
areaLightTablesInstalled = true;
|
|
283
|
+
RectAreaLightNode.setLTC(RectAreaLightTexturesLib.init());
|
|
284
|
+
}
|
|
285
|
+
__name(installWebGpuAreaLights, "installWebGpuAreaLights");
|
|
286
|
+
var webgpuBackend = {
|
|
287
|
+
kind: "webgpu",
|
|
288
|
+
install: /* @__PURE__ */ __name(() => {
|
|
289
|
+
installWebGpuAreaLights();
|
|
290
|
+
}, "install"),
|
|
291
|
+
prepareAreaLights: /* @__PURE__ */ __name(() => {
|
|
292
|
+
installWebGpuAreaLights();
|
|
293
|
+
}, "prepareAreaLights"),
|
|
294
|
+
createPostprocessing: createWebGpuPostprocessing,
|
|
295
|
+
updatePostprocessing: updateWebGpuPostprocessing,
|
|
296
|
+
createChromaKeyMaterial: createTslChromaKeyMaterial,
|
|
297
|
+
updateChromaKeyMaterial: updateTslChromaKeyMaterial
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
export { createTslChromaKeyMaterial, createWebGpuPostprocessing, getChromaKeyUniforms, installWebGpuAreaLights, postprocessingStructureKey, updateTslChromaKeyMaterial, updateWebGpuPostprocessing, webgpuBackend };
|
|
301
|
+
//# sourceMappingURL=index.js.map
|
|
302
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../core/webgpu/chromaKey.ts","../../core/webgpu/postprocessing.ts","../../core/webgpu/index.ts"],"names":["uniform","uv","mix","vec3","dot"],"mappings":";;;;;;;;;;;;;;AAcA,IAAM,kBAAA,uBAAyB,OAAA,EAA2C;AAUnE,SAAS,0BAAA,CACd,KACA,OAAA,EACuB;AACvB,EAAA,MAAM,QAAA,GAA8B;AAAA,IAClC,UAAU,OAAA,CAAQ,IAAU,KAAA,CAAA,KAAA,CAAM,OAAA,CAAQ,QAAQ,CAAC,CAAA;AAAA,IACnD,UAAA,EAAY,OAAA,CAAQ,OAAA,CAAQ,UAAU,CAAA;AAAA,IACtC,UAAA,EAAY,OAAA,CAAQ,OAAA,CAAQ,UAAU,CAAA;AAAA,IACtC,KAAA,EAAO,OAAA,CAAQ,OAAA,CAAQ,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BAAA,EAAsB,0BAAA;AAAA,EACtB,oBAAA,EAAsB,0BAAA;AAAA,EACtB,uBAAA,EAAyB,0BAAA;AAAA,EACzB,uBAAA,EAAyB;AAC3B","file":"index.js","sourcesContent":["import * as THREE from \"three\";\nimport { MeshBasicNodeMaterial, type UniformNode } from \"three/webgpu\";\nimport { distance, dot, mix, smoothstep, texture, uniform, uv, vec3 } from \"three/tsl\";\n\nimport type { ChromaKeyOptions } from \"../render/RenderBackend\";\n\n/** The live uniforms of a TSL chroma-key material. */\nexport interface ChromaKeyUniforms {\n keyColor: UniformNode<\"color\", THREE.Color>;\n similarity: UniformNode<\"float\", number>;\n smoothness: UniformNode<\"float\", number>;\n spill: UniformNode<\"float\", number>;\n}\n\nconst uniformsByMaterial = new WeakMap<THREE.Material, ChromaKeyUniforms>();\n\n/**\n * Green-screen material for WebGPU (and `WebGPURenderer`'s WebGL 2 fallback):\n * the same maths as the WebGL GLSL version, written in TSL.\n *\n * - alpha = `smoothstep(similarity, similarity + smoothness, distance(rgb, key))`\n * - spill: the colour is desaturated toward its luma\n * (`0.299, 0.587, 0.114`) until `similarity + spill + smoothness`.\n */\nexport function createTslChromaKeyMaterial(\n map: THREE.Texture,\n options: ChromaKeyOptions,\n): MeshBasicNodeMaterial {\n const uniforms: ChromaKeyUniforms = {\n keyColor: uniform(new THREE.Color(options.keyColor)),\n similarity: uniform(options.similarity),\n smoothness: uniform(options.smoothness),\n spill: uniform(options.spill),\n };\n\n const texel = texture(map, uv());\n const chromaDist = distance(texel.rgb, uniforms.keyColor.rgb);\n const alpha = smoothstep(\n uniforms.similarity,\n uniforms.similarity.add(uniforms.smoothness),\n chromaDist,\n );\n const spillFactor = smoothstep(\n uniforms.similarity,\n uniforms.similarity.add(uniforms.spill).add(uniforms.smoothness),\n chromaDist,\n );\n const luma = dot(texel.rgb, vec3(0.299, 0.587, 0.114));\n const despilled = mix(vec3(luma), texel.rgb, spillFactor);\n\n const material = new MeshBasicNodeMaterial({\n transparent: true,\n side: THREE.DoubleSide,\n });\n material.colorNode = despilled;\n material.opacityNode = texel.a.mul(alpha);\n material.userData.ecsChromaKey = true;\n uniformsByMaterial.set(material, uniforms);\n return material;\n}\n\n/** Update a material made by {@link createTslChromaKeyMaterial}. */\nexport function updateTslChromaKeyMaterial(\n material: THREE.Material,\n options: ChromaKeyOptions,\n): boolean {\n const uniforms = uniformsByMaterial.get(material);\n if (!uniforms) return false;\n uniforms.keyColor.value.set(options.keyColor);\n uniforms.similarity.value = options.similarity;\n uniforms.smoothness.value = options.smoothness;\n uniforms.spill.value = options.spill;\n return true;\n}\n\n/** The uniforms behind a chroma-key material, or `undefined` for any other material. */\nexport function getChromaKeyUniforms(\n material: THREE.Material,\n): ChromaKeyUniforms | undefined {\n return uniformsByMaterial.get(material);\n}\n","import { RenderPipeline, type Node, type PassNode, type UniformNode } from \"three/webgpu\";\nimport {\n convertToTexture,\n dot,\n float,\n floor,\n hue,\n max,\n mix,\n pass,\n renderOutput,\n saturation,\n screenDPR,\n screenSize,\n uniform,\n uv,\n vec3,\n vec4,\n} from \"three/tsl\";\nimport { bloom, type default as BloomNode } from \"three/examples/jsm/tsl/display/BloomNode.js\";\nimport {\n dof,\n type default as DepthOfFieldNode,\n} from \"three/examples/jsm/tsl/display/DepthOfFieldNode.js\";\nimport {\n dotScreen,\n type default as DotScreenNode,\n} from \"three/examples/jsm/tsl/display/DotScreenNode.js\";\nimport { film } from \"three/examples/jsm/tsl/display/FilmNode.js\";\nimport { ao, type default as GTAONode } from \"three/examples/jsm/tsl/display/GTAONode.js\";\nimport {\n rgbShift,\n type default as RGBShiftNode,\n} from \"three/examples/jsm/tsl/display/RGBShiftNode.js\";\nimport { sepia } from \"three/examples/jsm/tsl/display/Sepia.js\";\nimport { smaa } from \"three/examples/jsm/tsl/display/SMAANode.js\";\n\nimport type { PostprocessingState } from \"../components/Postprocessing\";\nimport type {\n PostprocessingBuildContext,\n PostprocessingPipeline,\n} from \"../render/RenderBackend\";\n\n/** three's `SMAANode` (its declaration file has no default export). */\ntype SMAANode = ReturnType<typeof smaa>;\n\n/** Uniforms for the effects this module implements itself (or feeds by node). */\nexport interface WebGpuPostprocessingUniforms {\n dofFocusDistance: UniformNode<\"float\", number>;\n dofFocalLength: UniformNode<\"float\", number>;\n dofBokehScale: UniformNode<\"float\", number>;\n vignetteOffset: UniformNode<\"float\", number>;\n vignetteDarkness: UniformNode<\"float\", number>;\n /** Hue rotation in radians (`hueSaturation.hue × π`). */\n hueAngle: UniformNode<\"float\", number>;\n /** `saturation()` factor derived from `hueSaturation.saturation`. */\n saturationFactor: UniformNode<\"float\", number>;\n sepiaAmount: UniformNode<\"float\", number>;\n noiseOpacity: UniformNode<\"float\", number>;\n /** Block size in CSS pixels; multiplied by the device pixel ratio on the GPU. */\n pixelGranularity: UniformNode<\"float\", number>;\n}\n\n/** The TSL nodes a WebGPU chain was built from, by effect. Absent = effect off. */\nexport interface WebGpuPostprocessingNodes {\n /** The scene render (`pass(scene, camera)`). */\n scenePass: PassNode;\n ssao?: GTAONode;\n dof?: DepthOfFieldNode;\n bloom?: BloomNode;\n vignette?: Node;\n hueSaturation?: Node;\n sepia?: Node;\n noise?: Node;\n dotScreen?: DotScreenNode;\n chromAberration?: RGBShiftNode;\n pixelation?: Node;\n smaa?: SMAANode;\n}\n\n/**\n * A post-processing chain built by the WebGPU backend: a three\n * `RenderPipeline` plus the nodes and uniforms that feed it, so parameter\n * changes update in place.\n */\nexport interface WebGpuPostprocessingPipeline extends PostprocessingPipeline {\n readonly renderPipeline: RenderPipeline;\n readonly nodes: WebGpuPostprocessingNodes;\n readonly uniforms: WebGpuPostprocessingUniforms;\n /** Which effects are on; a different key needs a rebuild. */\n readonly structureKey: string;\n}\n\n/** Effects whose on/off state changes the node graph. */\nconst STRUCTURAL_EFFECTS = [\n \"dof\",\n \"bloom\",\n \"vignette\",\n \"hueSaturation\",\n \"sepia\",\n \"noise\",\n \"dotScreen\",\n \"ssao\",\n \"glitch\",\n \"chromAberration\",\n \"pixelation\",\n \"smaa\",\n] as const;\n\n/** The on/off pattern of every effect: equal keys = same node graph. */\nexport function postprocessingStructureKey(values: PostprocessingState): string {\n return [\n values.postEnabled ? \"on\" : \"off\",\n ...STRUCTURAL_EFFECTS.map((effect) => (values[effect].enabled ? \"1\" : \"0\")),\n ].join(\"\");\n}\n\n/** Owners (worlds, or scenes when no world is known) already warned about glitch. */\nconst glitchWarned = new WeakSet<object>();\n\nfunction warnGlitchOnce(owner: object): void {\n if (glitchWarned.has(owner)) return;\n glitchWarned.add(owner);\n console.warn(\n \"[spatial-ecs] The glitch post effect has no WebGPU version and is skipped. \" +\n \"The other effects still apply.\",\n );\n}\n\n/** `HueSaturationShader`'s saturation curve, as a `saturation()` factor. */\nfunction saturationFactorFor(value: number): number {\n const s = Math.max(-1, Math.min(1, value));\n // WebGL: rgb += (avg - rgb) * (1 - 1 / (1.001 - s)) for s > 0, else (-s).\n return s > 0 ? 1 / (1.001 - s) : 1 + s;\n}\n\nfunction createUniforms(): WebGpuPostprocessingUniforms {\n return {\n dofFocusDistance: uniform(1),\n dofFocalLength: uniform(1),\n dofBokehScale: uniform(1),\n vignetteOffset: uniform(1),\n vignetteDarkness: uniform(1),\n hueAngle: uniform(0),\n saturationFactor: uniform(1),\n sepiaAmount: uniform(1),\n noiseOpacity: uniform(0),\n pixelGranularity: uniform(6),\n };\n}\n\n/** Write every parameter of `values` into the chain's uniforms (idempotent). */\nfunction applyParameters(\n nodes: WebGpuPostprocessingNodes,\n uniforms: WebGpuPostprocessingUniforms,\n values: PostprocessingState,\n): void {\n uniforms.dofFocusDistance.value = Math.max(0, values.dof.focusDistance);\n uniforms.dofFocalLength.value = Math.max(1e-4, values.dof.focalLength);\n uniforms.dofBokehScale.value = Math.max(0, values.dof.bokehScale);\n\n if (nodes.bloom) {\n nodes.bloom.strength.value = Math.max(0, values.bloom.intensity);\n nodes.bloom.radius.value = values.bloom.radius;\n nodes.bloom.threshold.value = values.bloom.threshold;\n }\n\n uniforms.vignetteOffset.value = values.vignette.offset;\n uniforms.vignetteDarkness.value = values.vignette.darkness;\n\n uniforms.hueAngle.value = values.hueSaturation.hue * Math.PI;\n uniforms.saturationFactor.value = saturationFactorFor(values.hueSaturation.saturation);\n\n uniforms.sepiaAmount.value = values.sepia.intensity;\n uniforms.noiseOpacity.value = values.noise.opacity;\n\n if (nodes.dotScreen) {\n nodes.dotScreen.angle.value =\n values.dotScreen.angle ?? values.dotScreen.dotScreenAngle;\n nodes.dotScreen.scale.value =\n values.dotScreen.scale ?? values.dotScreen.dotScreenScale;\n }\n\n if (nodes.ssao) {\n nodes.ssao.radius.value = Math.max(0.001, values.ssao.radius);\n // GTAO raises the occlusion term to `scale`: 0 = no AO, >1 = darker.\n nodes.ssao.scale.value = Math.max(0, values.ssao.intensity);\n }\n\n if (nodes.chromAberration) {\n const { offsetX, offsetY } = values.chromAberration;\n nodes.chromAberration.amount.value = Math.hypot(offsetX, offsetY);\n nodes.chromAberration.angle.value = Math.atan2(offsetY, offsetX);\n }\n\n uniforms.pixelGranularity.value = Math.max(1, values.pixelation.granularity);\n}\n\n/** Loosely-typed TSL node: the chain mixes vec3/vec4/texture nodes. */\n// biome-ignore lint/suspicious/noExplicitAny: TSL node types are structural.\ntype AnyNode = any;\n\n/** Eskil's vignette, as `VignetteShader` computes it. */\nfunction vignetteNode(input: AnyNode, offset: AnyNode, darkness: AnyNode): Node {\n const centered = uv().sub(0.5).mul(offset);\n return vec4(\n mix(input.rgb, vec3(float(1).sub(darkness)), dot(centered, centered)),\n input.a,\n );\n}\n\n/** Sample the input at the centre of each `granularity × DPR` pixel block. */\nfunction pixelationNode(input: AnyNode, granularity: AnyNode): Node {\n const source: AnyNode = convertToTexture(input);\n const block = max(granularity.mul(screenDPR), 1).div(screenSize);\n const coord = block.mul(floor(uv().div(block)).add(0.5));\n return source.sample(coord);\n}\n\n/**\n * Build the chain. Order mirrors the WebGL composer where it can: scene →\n * ambient occlusion → depth of field → bloom → vignette → hue/saturation →\n * sepia → film noise → dot screen → chromatic aberration → pixelation → SMAA.\n * (On WebGL the SSAO pass sits later but renders the scene again itself;\n * here the occlusion multiplies the scene colour before anything else.)\n */\nexport function createWebGpuPostprocessing(\n context: PostprocessingBuildContext,\n): WebGpuPostprocessingPipeline {\n const { scene, camera, values } = context;\n const renderer = context.renderer as unknown as ConstructorParameters<\n typeof RenderPipeline\n >[0];\n\n // Depth-reading effects need a single-sampled depth texture: with the\n // renderer's MSAA (`antialias: true`) the pass's depth is\n // `texture_depth_multisampled_2d`, and GTAO's `textureDimensions(depth, 0)`\n // is invalid WGSL for it (the whole pipeline then fails to build). Those\n // scenes lose MSAA on the scene pass; SMAA smooths the edges instead.\n const readsDepth = values.ssao.enabled || values.dof.enabled;\n const scenePass = readsDepth\n ? pass(scene, camera, { samples: 0 })\n : pass(scene, camera);\n const nodes: WebGpuPostprocessingNodes = { scenePass };\n const uniforms = createUniforms();\n\n let color: AnyNode = scenePass.getTextureNode(\"output\");\n\n if (values.ssao.enabled) {\n // Normals are reconstructed from depth (no extra MRT target).\n const aoNode = ao(\n scenePass.getTextureNode(\"depth\"),\n null as unknown as Node,\n camera,\n );\n nodes.ssao = aoNode;\n color = vec4(color.rgb.mul(aoNode.getTextureNode().r), color.a);\n }\n\n if (values.dof.enabled) {\n const dofNode = dof(\n color,\n scenePass.getViewZNode(),\n uniforms.dofFocusDistance,\n uniforms.dofFocalLength,\n uniforms.dofBokehScale,\n );\n nodes.dof = dofNode;\n color = dofNode;\n }\n\n if (values.bloom.enabled) {\n const bloomNode = bloom(color);\n nodes.bloom = bloomNode;\n // Additive, like UnrealBloomPass; alpha stays the scene's.\n color = vec4(color.rgb.add((bloomNode as AnyNode).rgb), color.a);\n }\n\n if (values.vignette.enabled) {\n color = vignetteNode(color, uniforms.vignetteOffset, uniforms.vignetteDarkness);\n nodes.vignette = color;\n }\n\n if (values.hueSaturation.enabled) {\n const rotated = hue(color, uniforms.hueAngle);\n color = vec4(saturation(rotated, uniforms.saturationFactor), color.a);\n nodes.hueSaturation = color;\n }\n\n if (values.sepia.enabled) {\n const toned: AnyNode = sepia(color);\n color = vec4(mix(color.rgb, toned.rgb, uniforms.sepiaAmount), color.a);\n nodes.sepia = color;\n }\n\n if (values.noise.enabled) {\n color = film(color, uniforms.noiseOpacity);\n nodes.noise = color;\n }\n\n if (values.dotScreen.enabled) {\n const dotNode = dotScreen(color);\n nodes.dotScreen = dotNode;\n color = dotNode;\n }\n\n if (values.glitch.enabled) {\n warnGlitchOnce(context.world ?? scene);\n }\n\n if (values.chromAberration.enabled) {\n const shiftNode = rgbShift(color);\n nodes.chromAberration = shiftNode;\n color = shiftNode;\n }\n\n if (values.pixelation.enabled) {\n color = pixelationNode(color, uniforms.pixelGranularity);\n nodes.pixelation = color;\n }\n\n let outputColorTransform = true;\n if (values.smaa.enabled) {\n // SMAA works on display-referred colour: tone map + encode first, then\n // stop the pipeline from doing it a second time.\n const smaaNode = smaa(renderOutput(color));\n nodes.smaa = smaaNode;\n color = smaaNode;\n outputColorTransform = false;\n }\n\n applyParameters(nodes, uniforms, values);\n\n const renderPipeline = new RenderPipeline(renderer, color);\n renderPipeline.outputColorTransform = outputColorTransform;\n\n return {\n renderPipeline,\n nodes,\n uniforms,\n structureKey: postprocessingStructureKey(values),\n render: () => {\n renderPipeline.render();\n },\n dispose: () => {\n renderPipeline.dispose();\n disposeNodes(nodes);\n },\n };\n}\n\n/**\n * Push a parameter-only change into `pipeline`. Returns `false` when an\n * effect was switched on or off (the graph differs, so the caller rebuilds),\n * or when `pipeline` was not built here.\n */\nexport function updateWebGpuPostprocessing(\n pipeline: PostprocessingPipeline,\n _previous: PostprocessingState,\n next: PostprocessingState,\n): boolean {\n const candidate = pipeline as Partial<WebGpuPostprocessingPipeline>;\n if (\n !candidate.renderPipeline ||\n !candidate.nodes ||\n !candidate.uniforms ||\n typeof candidate.structureKey !== \"string\"\n ) {\n return false;\n }\n if (candidate.structureKey !== postprocessingStructureKey(next)) {\n return false;\n }\n applyParameters(candidate.nodes, candidate.uniforms, next);\n return true;\n}\n\ntype Disposable = {\n dispose?: () => void;\n isRTTNode?: boolean;\n renderTarget?: { dispose?: () => void };\n textureNode?: Disposable;\n};\n\n/** Free the render targets the effect nodes (and their RTT inputs) own. */\nfunction disposeNodes(nodes: WebGpuPostprocessingNodes): void {\n const seen = new Set<unknown>();\n const free = (node: Disposable | undefined) => {\n if (!node || seen.has(node)) return;\n seen.add(node);\n // `convertToTexture` wraps non-texture inputs in an RTT node whose render\n // target `Node.dispose()` does not release.\n if (node.isRTTNode) node.renderTarget?.dispose?.();\n node.dispose?.();\n free(node.textureNode);\n };\n for (const node of Object.values(nodes) as Disposable[]) {\n free(node);\n }\n}\n","/**\n * `@relu-interactives/spatial-ecs/webgpu` — run a `World` on three's\n * `WebGPURenderer`.\n *\n * Kept out of the package root on purpose: importing it loads `three/webgpu`\n * and `three/tsl`, which a WebGL-only app should never pay for.\n *\n * @example\n * ```ts\n * import * as THREE from \"three\";\n * import { WebGPURenderer } from \"three/webgpu\";\n * import { World } from \"@relu-interactives/spatial-ecs\";\n * import { webgpuBackend } from \"@relu-interactives/spatial-ecs/webgpu\";\n *\n * const renderer = new WebGPURenderer({ antialias: true });\n * await renderer.init();\n * const world = new World({\n * scene: new THREE.Scene(),\n * camera: new THREE.PerspectiveCamera(),\n * renderer,\n * backend: webgpuBackend,\n * });\n * ```\n *\n * @module\n */\nimport { RectAreaLightNode } from \"three/webgpu\";\nimport { RectAreaLightTexturesLib } from \"three/examples/jsm/lights/RectAreaLightTexturesLib.js\";\n\nimport type { RenderBackend } from \"../render/RenderBackend\";\nimport { createTslChromaKeyMaterial, updateTslChromaKeyMaterial } from \"./chromaKey\";\nimport {\n createWebGpuPostprocessing,\n updateWebGpuPostprocessing,\n} from \"./postprocessing\";\n\nlet areaLightTablesInstalled = false;\n\n/**\n * Give `RectAreaLight` its lookup tables. Without them the light's node\n * throws while its shader is built, so this runs once, before any frame.\n */\nexport function installWebGpuAreaLights(): void {\n if (areaLightTablesInstalled) return;\n areaLightTablesInstalled = true;\n RectAreaLightNode.setLTC(RectAreaLightTexturesLib.init());\n}\n\n/**\n * The {@link RenderBackend} for three's `WebGPURenderer`: post-processing as\n * a TSL `RenderPipeline`, a TSL green-screen material, and area-light tables.\n * Pass it as `new World({ ..., backend: webgpuBackend })`.\n *\n * Works on the renderer's WebGL 2 fallback too (`WebGPURenderer` picks it by\n * itself when the browser has no WebGPU).\n */\nexport const webgpuBackend: RenderBackend = {\n kind: \"webgpu\",\n install: () => {\n installWebGpuAreaLights();\n },\n prepareAreaLights: () => {\n installWebGpuAreaLights();\n },\n createPostprocessing: createWebGpuPostprocessing,\n updatePostprocessing: updateWebGpuPostprocessing,\n createChromaKeyMaterial: createTslChromaKeyMaterial,\n updateChromaKeyMaterial: updateTslChromaKeyMaterial,\n};\n\nexport {\n createTslChromaKeyMaterial,\n getChromaKeyUniforms,\n updateTslChromaKeyMaterial,\n type ChromaKeyUniforms,\n} from \"./chromaKey\";\nexport {\n createWebGpuPostprocessing,\n postprocessingStructureKey,\n updateWebGpuPostprocessing,\n type WebGpuPostprocessingNodes,\n type WebGpuPostprocessingPipeline,\n type WebGpuPostprocessingUniforms,\n} from \"./postprocessing\";\nexport type {\n ChromaKeyOptions,\n EcsRenderer,\n PostprocessingBuildContext,\n PostprocessingPipeline,\n RenderBackend,\n RendererKind,\n} from \"../render/RenderBackend\";\n"]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { aV as AnyComponent, O as ComponentClass, aW as DEBUG_CHANGE_IGNORED_SYSTEMS, aX as WorldHistorySnapshot, aY as cloneHistoryValue, aZ as normalizeDebugValue } from './System-8D-XBDKZ.cjs';
|
|
2
2
|
import 'three';
|
|
3
3
|
import '@dimforge/rapier3d-compat';
|
|
4
|
+
import './animation/index.cjs';
|
|
5
|
+
import 'three/webgpu';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { aV as AnyComponent, Z as ComponentClass, aW as DEBUG_CHANGE_IGNORED_SYSTEMS, aX as WorldHistorySnapshot, aY as cloneHistoryValue, aZ as normalizeDebugValue } from './System-DPMAW30g.js';
|
|
2
2
|
import 'three';
|
|
3
3
|
import '@dimforge/rapier3d-compat';
|
|
4
|
+
import './animation/index.js';
|
|
5
|
+
import 'three/webgpu';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { DEBUG_CHANGE_IGNORED_SYSTEMS, cloneHistoryValue, normalizeDebugValue } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { DEBUG_CHANGE_IGNORED_SYSTEMS, cloneHistoryValue, normalizeDebugValue } from './chunk-XU2DVWCP.js';
|
|
2
|
+
import './chunk-CKTHDXPS.js';
|
|
3
|
+
import './chunk-XE4OXN2W.js';
|
|
3
4
|
//# sourceMappingURL=worldSnapshotUtils.js.map
|
|
4
5
|
//# sourceMappingURL=worldSnapshotUtils.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@relu-interactives/spatial-ecs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Reusable ECS core engine for Relu Spatial editor and runtime experiences.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -42,6 +42,20 @@
|
|
|
42
42
|
"types": "./dist/worldSnapshotUtils.d.ts",
|
|
43
43
|
"import": "./dist/worldSnapshotUtils.js",
|
|
44
44
|
"require": "./dist/worldSnapshotUtils.cjs"
|
|
45
|
+
},
|
|
46
|
+
"./animation": {
|
|
47
|
+
"types": "./dist/animation/index.d.ts",
|
|
48
|
+
"import": "./dist/animation/index.js",
|
|
49
|
+
"require": "./dist/animation/index.cjs"
|
|
50
|
+
},
|
|
51
|
+
"./network": {
|
|
52
|
+
"types": "./dist/network/index.d.ts",
|
|
53
|
+
"import": "./dist/network/index.js",
|
|
54
|
+
"require": "./dist/network/index.cjs"
|
|
55
|
+
},
|
|
56
|
+
"./webgpu": {
|
|
57
|
+
"types": "./dist/webgpu/index.d.ts",
|
|
58
|
+
"import": "./dist/webgpu/index.js"
|
|
45
59
|
}
|
|
46
60
|
},
|
|
47
61
|
"files": [
|
|
@@ -49,7 +63,7 @@
|
|
|
49
63
|
],
|
|
50
64
|
"sideEffects": false,
|
|
51
65
|
"scripts": {
|
|
52
|
-
"build": "tsup --config tsup.config.ts && node scripts/copy-assets.mjs && node scripts/copy-docs.mjs",
|
|
66
|
+
"build": "node scripts/clean-dist.mjs && tsup --config tsup.config.ts && node scripts/check-dist-entries.mjs && node scripts/copy-assets.mjs && node scripts/copy-docs.mjs",
|
|
53
67
|
"dev": "tsup --config tsup.config.ts --watch",
|
|
54
68
|
"typecheck": "tsc --noEmit",
|
|
55
69
|
"test": "vitest run",
|
|
@@ -62,12 +76,14 @@
|
|
|
62
76
|
"release:minor": "npm version minor",
|
|
63
77
|
"release:major": "npm version major",
|
|
64
78
|
"docs:check": "node scripts/check-doc-examples.mjs --verbose",
|
|
65
|
-
"docs:fix-imports": "node scripts/fix-doc-imports.mjs"
|
|
79
|
+
"docs:fix-imports": "node scripts/fix-doc-imports.mjs",
|
|
80
|
+
"check:entries": "node scripts/check-dist-entries.mjs"
|
|
66
81
|
},
|
|
67
82
|
"peerDependencies": {
|
|
68
83
|
"three": ">=0.184.0 <0.185.0"
|
|
69
84
|
},
|
|
70
85
|
"dependencies": {
|
|
86
|
+
"@colyseus/sdk": "0.18.8",
|
|
71
87
|
"@dimforge/rapier3d-compat": "^0.17.3"
|
|
72
88
|
},
|
|
73
89
|
"devDependencies": {
|