rhodonite 0.25.0 → 0.26.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 +93 -19
- package/VERSION-FILE +1 -1
- package/dist/esm/foundation/components/BlendShape/BlendShapeComponent.d.ts +54 -0
- package/dist/esm/foundation/components/BlendShape/BlendShapeComponent.js +1 -1
- package/dist/esm/foundation/components/Camera/CameraComponent.d.ts +34 -0
- package/dist/esm/foundation/components/Camera/CameraComponent.js +1 -1
- package/dist/esm/foundation/components/Light/LightComponent.d.ts +3 -1
- package/dist/esm/foundation/components/Light/LightComponent.js +1 -1
- package/dist/esm/foundation/components/Mesh/MeshComponent.js +1 -1
- package/dist/esm/foundation/components/MeshRenderer/MeshRendererComponent.js +1 -1
- package/dist/esm/foundation/components/SceneGraph/SceneGraphComponent.d.ts +16 -0
- package/dist/esm/foundation/components/SceneGraph/SceneGraphComponent.js +1 -1
- package/dist/esm/foundation/components/Shape/ShapeComponent.js +1 -1
- package/dist/esm/foundation/components/Skeletal/AnimationRetarget/AbsoluteAnimation.js +1 -1
- package/dist/esm/foundation/components/Skeletal/AnimationRetarget/GlobalRetarget.js +1 -1
- package/dist/esm/foundation/components/Skeletal/AnimationRetarget/GlobalRetargetReverse.js +1 -1
- package/dist/esm/foundation/components/Skeletal/SkeletalComponent.d.ts +48 -0
- package/dist/esm/foundation/components/Skeletal/SkeletalComponent.js +1 -1
- package/dist/esm/foundation/components/Transform/TransformComponent.js +1 -1
- package/dist/esm/foundation/components/Trigger/TriggerComponent.js +1 -1
- package/dist/esm/foundation/components/Vrm/VrmComponent.js +1 -1
- package/dist/esm/foundation/constraints/VrmAimConstraint.js +1 -1
- package/dist/esm/foundation/constraints/VrmRollConstraint.js +1 -1
- package/dist/esm/foundation/constraints/VrmRotationConstraint.js +1 -1
- package/dist/esm/foundation/core/Component.js +1 -1
- package/dist/esm/foundation/core/ComponentRepository.js +1 -1
- package/dist/esm/foundation/core/Entity.js +1 -1
- package/dist/esm/foundation/core/EntityRepository.js +1 -1
- package/dist/esm/foundation/geometry/ComplexVertexAttribute.js +1 -1
- package/dist/esm/foundation/geometry/Mesh.js +1 -1
- package/dist/esm/foundation/geometry/Primitive.js +1 -1
- package/dist/esm/foundation/gizmos/AABBGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/CapsuleColliderGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/Gizmo.d.ts +13 -0
- package/dist/esm/foundation/gizmos/Gizmo.js +1 -1
- package/dist/esm/foundation/gizmos/JointGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/LightGizmo.d.ts +0 -1
- package/dist/esm/foundation/gizmos/LightGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/LocatorGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/RotationGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/ScaleGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/ShapeGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/SphereColliderGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/TranslationGizmo.js +1 -1
- package/dist/esm/foundation/helpers/BloomHelper.js +1 -1
- package/dist/esm/foundation/helpers/GaussianBlurHelper.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/PointShadowMap.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/ShadowMap.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/ShadowSystem.js +1 -1
- package/dist/esm/foundation/helpers/materials/createMotionVectorMaterial.d.ts +25 -0
- package/dist/esm/foundation/helpers/materials/createMotionVectorMaterial.js +1 -0
- package/dist/esm/foundation/helpers/materials/createTemporalAAResolveMaterial.d.ts +33 -0
- package/dist/esm/foundation/helpers/materials/createTemporalAAResolveMaterial.js +1 -0
- package/dist/esm/foundation/importer/AnimationAssigner.js +1 -1
- package/dist/esm/foundation/importer/DrcPointCloudImporter.js +1 -1
- package/dist/esm/foundation/importer/Gltf2Importer.js +1 -1
- package/dist/esm/foundation/importer/GltfImporter.js +1 -1
- package/dist/esm/foundation/importer/ModelConverter.js +1 -1
- package/dist/esm/foundation/importer/RhodoniteImportExtension.js +1 -1
- package/dist/esm/foundation/importer/Vrm0xImporter.js +1 -1
- package/dist/esm/foundation/importer/VrmImporter.js +1 -1
- package/dist/esm/foundation/materials/contents/CustomMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/MToon0xMaterialContent.js +18 -18
- package/dist/esm/foundation/materials/contents/MToon1MaterialContent.js +6 -6
- package/dist/esm/foundation/materials/core/AbstractMaterialContent.d.ts +11 -0
- package/dist/esm/foundation/materials/core/AbstractMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/core/ShaderityUtilityWebGL.js +2 -2
- package/dist/esm/foundation/materials/core/ShaderityUtilityWebGPU.js +2 -2
- package/dist/esm/foundation/materials/nodes/CastToFloatShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/MergeVectorShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/Random_HashPRNGShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/Random_SinHashShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/SplitVectorShaderNode.js +1 -1
- package/dist/esm/foundation/math/MathClassUtil.js +1 -1
- package/dist/esm/foundation/math/Quaternion.js +1 -1
- package/dist/esm/foundation/math/Transform3D.js +1 -1
- package/dist/esm/foundation/math/shapes/MathSphere.js +1 -1
- package/dist/esm/foundation/memory/Accessor.js +6 -6
- package/dist/esm/foundation/memory/BufferView.js +1 -1
- package/dist/esm/foundation/misc/cache/Cache.js +1 -1
- package/dist/esm/foundation/physics/VRMSpring/CapsuleCollider.js +1 -1
- package/dist/esm/foundation/physics/VRMSpring/SphereCollider.js +1 -1
- package/dist/esm/foundation/physics/VRMSpring/VRMSpringBone.js +1 -1
- package/dist/esm/foundation/renderer/Frame.js +1 -1
- package/dist/esm/foundation/renderer/RenderPass.js +1 -1
- package/dist/esm/foundation/renderer/TemporalAA/PreviousFrameDataTracker.d.ts +33 -0
- package/dist/esm/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +1 -0
- package/dist/esm/foundation/renderer/TemporalAA/TemporalAASystem.d.ts +135 -0
- package/dist/esm/foundation/renderer/TemporalAA/TemporalAASystem.js +1 -0
- package/dist/esm/foundation/renderer/pipelines/DeferredRenderPipeline.js +1 -1
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +62 -16
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.js +1 -1
- package/dist/esm/foundation/system/Engine.d.ts +37 -3
- package/dist/esm/foundation/system/Engine.js +1 -1
- package/dist/esm/foundation/textures/AbstractTexture.js +1 -1
- package/dist/esm/foundation/textures/CubeTexture.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTexture.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTexture2DArray.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTextureCube.js +1 -1
- package/dist/esm/foundation/textures/Texture.js +1 -1
- package/dist/esm/foundation/textures/TextureDataFloat.js +1 -1
- package/dist/esm/foundation/textures/VideoTexture.js +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/webgl/MultiDraw.js +1 -1
- package/dist/esm/webgl/MultiDrawRepository.js +1 -1
- package/dist/esm/webgl/WebGLStereoUtil.js +1 -1
- package/dist/esm/webgl/WebGLStrategyWebGL2.d.ts +8 -0
- package/dist/esm/webgl/WebGLStrategyWebGL2.js +47 -28
- package/dist/esm/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.vert.js +0 -3
- package/dist/esm/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.js +35 -0
- package/dist/esm/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.js +140 -0
- package/dist/esm/webgl/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.js +175 -0
- package/dist/esm/webgl/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.js +18 -0
- package/dist/esm/webgl/shaders/StandardShaderPart.js +3 -3
- package/dist/esm/webgl/shaders/nodes/ConstantVariableShader.js +5 -5
- package/dist/esm/webgl/shaders/nodes/UniformDataShader.js +9 -9
- package/dist/esm/webgpu/GpuCullingRegistry.js +1 -1
- package/dist/esm/webgpu/GpuDeformRegistry.js +1 -1
- package/dist/esm/webgpu/WebGpuGpuCulling.js +1 -1
- package/dist/esm/webgpu/WebGpuGpuTimer.js +1 -1
- package/dist/esm/webgpu/WebGpuLightClusterBuilder.js +1 -1
- package/dist/esm/webgpu/WebGpuResourceRepository.js +3 -3
- package/dist/esm/webgpu/WebGpuStrategyBasic.d.ts +8 -0
- package/dist/esm/webgpu/WebGpuStrategyBasic.js +78 -59
- package/dist/esm/webgpu/WebGpuVertexDeformer.js +1 -1
- package/dist/esm/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.wgsl.js +30 -0
- package/dist/esm/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.wgsl.js +133 -0
- package/dist/esm/webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.wgsl.js +169 -0
- package/dist/esm/webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.wgsl.js +19 -0
- package/dist/esmdev/foundation/components/BlendShape/BlendShapeComponent.d.ts +54 -0
- package/dist/esmdev/foundation/components/BlendShape/BlendShapeComponent.js +107 -1
- package/dist/esmdev/foundation/components/Camera/CameraComponent.d.ts +34 -0
- package/dist/esmdev/foundation/components/Camera/CameraComponent.js +118 -46
- package/dist/esmdev/foundation/components/CameraController/CameraControllerComponent.js +8 -8
- package/dist/esmdev/foundation/components/CharacterController/CharacterAnimationController.js +74 -74
- package/dist/esmdev/foundation/components/CharacterController/CharacterControllerComponent.js +39 -39
- package/dist/esmdev/foundation/components/Constraint/ConstraintComponent.js +4 -4
- package/dist/esmdev/foundation/components/Light/LightComponent.d.ts +3 -1
- package/dist/esmdev/foundation/components/Light/LightComponent.js +126 -121
- package/dist/esmdev/foundation/components/Mesh/MeshComponent.js +50 -50
- package/dist/esmdev/foundation/components/MeshRenderer/MeshRendererComponent.js +96 -92
- package/dist/esmdev/foundation/components/Physics/PhysicsComponent.js +73 -73
- package/dist/esmdev/foundation/components/Raymarching/RaymarchingComponent.js +54 -54
- package/dist/esmdev/foundation/components/Raymarching/RaymarchingSdfEvaluator.js +251 -251
- package/dist/esmdev/foundation/components/SceneGraph/SceneGraphComponent.d.ts +16 -0
- package/dist/esmdev/foundation/components/SceneGraph/SceneGraphComponent.js +375 -343
- package/dist/esmdev/foundation/components/Shape/ShapeComponent.js +31 -31
- package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/AbsoluteAnimation.js +5 -5
- package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/GlobalRetarget.js +5 -5
- package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/GlobalRetargetReverse.js +9 -9
- package/dist/esmdev/foundation/components/Skeletal/SkeletalComponent.d.ts +48 -0
- package/dist/esmdev/foundation/components/Skeletal/SkeletalComponent.js +337 -205
- package/dist/esmdev/foundation/components/Transform/TransformComponent.js +93 -93
- package/dist/esmdev/foundation/components/Trigger/TriggerComponent.js +61 -61
- package/dist/esmdev/foundation/components/Vrm/VrmComponent.js +44 -44
- package/dist/esmdev/foundation/constraints/VrmAimConstraint.js +11 -11
- package/dist/esmdev/foundation/constraints/VrmRollConstraint.js +16 -16
- package/dist/esmdev/foundation/constraints/VrmRotationConstraint.js +10 -10
- package/dist/esmdev/foundation/core/Component.js +32 -32
- package/dist/esmdev/foundation/core/ComponentMemoryRegistry.js +42 -42
- package/dist/esmdev/foundation/core/ComponentRepository.js +37 -37
- package/dist/esmdev/foundation/core/Config.js +9 -9
- package/dist/esmdev/foundation/core/Entity.js +9 -9
- package/dist/esmdev/foundation/core/EntityRepository.js +19 -19
- package/dist/esmdev/foundation/core/GlobalDataRepository.js +17 -17
- package/dist/esmdev/foundation/core/MemoryManager.js +25 -25
- package/dist/esmdev/foundation/core/RnObject.js +37 -37
- package/dist/esmdev/foundation/definitions/Blend.js +3 -3
- package/dist/esmdev/foundation/definitions/ComponentType.js +7 -7
- package/dist/esmdev/foundation/definitions/CompositionType.js +50 -50
- package/dist/esmdev/foundation/definitions/CompressionTextureType.js +6 -6
- package/dist/esmdev/foundation/definitions/ShaderSemantics.js +6 -6
- package/dist/esmdev/foundation/definitions/TextureFormat.js +3 -3
- package/dist/esmdev/foundation/definitions/TextureParameter.js +3 -3
- package/dist/esmdev/foundation/definitions/VertexAttribute.js +30 -30
- package/dist/esmdev/foundation/enhanced_js_objects/Array.js +2 -2
- package/dist/esmdev/foundation/exporter/Gltf2Exporter.js +112 -112
- package/dist/esmdev/foundation/geometry/ComplexVertexAttribute.js +24 -24
- package/dist/esmdev/foundation/geometry/Frustum.js +41 -41
- package/dist/esmdev/foundation/geometry/Mesh.js +218 -218
- package/dist/esmdev/foundation/geometry/Primitive.js +133 -133
- package/dist/esmdev/foundation/geometry/SimpleVertexAttribute.js +7 -7
- package/dist/esmdev/foundation/geometry/shapes/Cylinder.js +3 -3
- package/dist/esmdev/foundation/geometry/shapes/Joint.js +33 -33
- package/dist/esmdev/foundation/gizmos/AABBGizmo.js +17 -20
- package/dist/esmdev/foundation/gizmos/CapsuleColliderGizmo.js +24 -26
- package/dist/esmdev/foundation/gizmos/Gizmo.d.ts +13 -0
- package/dist/esmdev/foundation/gizmos/Gizmo.js +43 -21
- package/dist/esmdev/foundation/gizmos/JointGizmo.js +38 -40
- package/dist/esmdev/foundation/gizmos/LightGizmo.d.ts +0 -1
- package/dist/esmdev/foundation/gizmos/LightGizmo.js +26 -30
- package/dist/esmdev/foundation/gizmos/LocatorGizmo.js +26 -29
- package/dist/esmdev/foundation/gizmos/RotationGizmo.js +217 -219
- package/dist/esmdev/foundation/gizmos/ScaleGizmo.js +135 -137
- package/dist/esmdev/foundation/gizmos/ShapeGizmo.js +44 -47
- package/dist/esmdev/foundation/gizmos/SphereColliderGizmo.js +25 -27
- package/dist/esmdev/foundation/gizmos/TranslationGizmo.js +132 -134
- package/dist/esmdev/foundation/helpers/BloomHelper.js +34 -34
- package/dist/esmdev/foundation/helpers/GaussianBlurHelper.js +18 -18
- package/dist/esmdev/foundation/helpers/Shadow/PointShadowMap.js +12 -12
- package/dist/esmdev/foundation/helpers/Shadow/ShadowMap.js +5 -5
- package/dist/esmdev/foundation/helpers/Shadow/ShadowSystem.js +119 -119
- package/dist/esmdev/foundation/helpers/materials/createMotionVectorMaterial.d.ts +25 -0
- package/dist/esmdev/foundation/helpers/materials/createMotionVectorMaterial.js +61 -0
- package/dist/esmdev/foundation/helpers/materials/createTemporalAAResolveMaterial.d.ts +33 -0
- package/dist/esmdev/foundation/helpers/materials/createTemporalAAResolveMaterial.js +127 -0
- package/dist/esmdev/foundation/importer/AnimationAssigner.js +44 -44
- package/dist/esmdev/foundation/importer/DrcPointCloudImporter.js +33 -33
- package/dist/esmdev/foundation/importer/Gltf2Importer.js +14 -14
- package/dist/esmdev/foundation/importer/GltfImporter.js +22 -22
- package/dist/esmdev/foundation/importer/ModelConverter.js +131 -131
- package/dist/esmdev/foundation/importer/RhodoniteImportExtension.js +6 -6
- package/dist/esmdev/foundation/importer/Vrm0xImporter.js +48 -48
- package/dist/esmdev/foundation/importer/VrmImporter.js +10 -10
- package/dist/esmdev/foundation/materials/contents/CustomMaterialContent.js +27 -27
- package/dist/esmdev/foundation/materials/contents/DepthEncodeMaterialContent.js +2 -2
- package/dist/esmdev/foundation/materials/contents/MToon0xMaterialContent.js +138 -138
- package/dist/esmdev/foundation/materials/contents/MToon1MaterialContent.js +19 -19
- package/dist/esmdev/foundation/materials/contents/ShadowMapDecodeClassicMaterialContent.js +5 -5
- package/dist/esmdev/foundation/materials/contents/VarianceShadowMapDecodeClassicMaterialContent.js +5 -5
- package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.d.ts +11 -0
- package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.js +68 -53
- package/dist/esmdev/foundation/materials/core/AbstractShaderNode.js +26 -26
- package/dist/esmdev/foundation/materials/core/DummyTextures.js +3 -3
- package/dist/esmdev/foundation/materials/core/Material.js +115 -115
- package/dist/esmdev/foundation/materials/core/MaterialRepository.js +65 -65
- package/dist/esmdev/foundation/materials/core/ShaderGraphResolver.js +38 -38
- package/dist/esmdev/foundation/materials/core/ShaderHandler.js +4 -4
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGL.js +16 -17
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGPU.js +17 -18
- package/dist/esmdev/foundation/materials/nodes/AbsShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/AcosShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/AddShaderNode.js +18 -18
- package/dist/esmdev/foundation/materials/nodes/AlphaTestShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/AndShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/Atan2ShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/AttributeColorShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeInstanceIdsShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeJointShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeNormalShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributePositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/AttributeTangentShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeTexcoordShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/AttributeWeightShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/BlockBeginShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/BlockEndShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/BranchShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/CalcBitangentShaderNode.js +7 -7
- package/dist/esmdev/foundation/materials/nodes/CastToFloatShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/ClampShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/ClassicShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/ConstantScalarVariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVariableShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/ConstantVector2VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVector3VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVector4VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/CosShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/DiscardShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/DotProductShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/EqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/FlatShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/GreaterOrEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/GreaterShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/GreaterThanShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/LengthShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/LessOrEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/LessThanShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/MergeVectorShaderNode.js +19 -19
- package/dist/esmdev/foundation/materials/nodes/MinShaderNode.js +18 -18
- package/dist/esmdev/foundation/materials/nodes/MultiplyShaderNode.js +21 -21
- package/dist/esmdev/foundation/materials/nodes/NormalMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/NormalizeShaderNode.js +9 -9
- package/dist/esmdev/foundation/materials/nodes/NotEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/OrShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/OutColorShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/OutPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/PbrAnisotropyPropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrAnisotropyRotationShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/PbrBaseColorPropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrClearcoatPropsShaderNode.js +7 -7
- package/dist/esmdev/foundation/materials/nodes/PbrDiffuseTransmissionPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrEmissivePropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrIridescencePropsShaderNode.js +8 -8
- package/dist/esmdev/foundation/materials/nodes/PbrMetallicRoughnessPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrNormalPropsShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/PbrOcclusionPropsShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/PbrShaderShaderNode.js +21 -21
- package/dist/esmdev/foundation/materials/nodes/PbrSheenPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrSpecularPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrTransmissionPropsShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/PbrVolumePropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PremultipliedAlphaShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/ProcessGeometryShaderNode.js +22 -22
- package/dist/esmdev/foundation/materials/nodes/ProjectionMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/Random_HashPRNGShaderNode.js +12 -12
- package/dist/esmdev/foundation/materials/nodes/Random_SinHashShaderNode.js +12 -12
- package/dist/esmdev/foundation/materials/nodes/RemapShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/SinShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/SmoothStepShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/SplitVectorShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/StepShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/TanShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/Texture2DShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/TimeShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/TransformShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/UniformDataShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/ViewMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/WireframeMaterialNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/WorldMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendXYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendXZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendYXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendYZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendZXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendZYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/InitialPositionShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothIntersectionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothSubtractionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothUnionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSubtractionShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpUnionShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutDistanceShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutShadingColorShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutUnionShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchCameraPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitDistanceShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitNormalShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchObjectIdShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchObjectIdUniformShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchRayDirectionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchTBNShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchViewDirectionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdApplyTransformShaderNode.js +9 -9
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdApplyWorldMatrixShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarXShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarYShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarZShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBoxShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdCapsuleShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatXYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatYZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatZXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRoundBoxShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdSphereShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTorusShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeXShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeYShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeZShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistZShaderNode.js +4 -4
- package/dist/esmdev/foundation/math/AABB.js +132 -132
- package/dist/esmdev/foundation/math/AnimatedQuaternion.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedScalar.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedValueEvaluationState.js +20 -20
- package/dist/esmdev/foundation/math/AnimatedVector2.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedVector3.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedVector4.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedVectorN.js +55 -55
- package/dist/esmdev/foundation/math/IdentityMatrix33.js +2 -2
- package/dist/esmdev/foundation/math/IdentityMatrix44.js +2 -2
- package/dist/esmdev/foundation/math/MathClassUtil.js +4 -4
- package/dist/esmdev/foundation/math/Quaternion.js +20 -20
- package/dist/esmdev/foundation/math/Transform3D.js +83 -83
- package/dist/esmdev/foundation/math/shapes/MathSphere.js +9 -9
- package/dist/esmdev/foundation/memory/Accessor.js +370 -370
- package/dist/esmdev/foundation/memory/Buffer.js +40 -40
- package/dist/esmdev/foundation/memory/BufferView.js +33 -33
- package/dist/esmdev/foundation/misc/DataUtil.js +2 -2
- package/dist/esmdev/foundation/misc/EnumIO.js +10 -10
- package/dist/esmdev/foundation/misc/Logger.js +14 -14
- package/dist/esmdev/foundation/misc/RnPromise.js +14 -14
- package/dist/esmdev/foundation/misc/Time.js +27 -27
- package/dist/esmdev/foundation/misc/WeakOption.js +14 -14
- package/dist/esmdev/foundation/misc/cache/Cache.js +2 -2
- package/dist/esmdev/foundation/misc/cache/SymbolWeakMap.js +8 -8
- package/dist/esmdev/foundation/physics/PhysicsWorldQuery.js +13 -13
- package/dist/esmdev/foundation/physics/Rapier/RapierCharacterControllerStrategy.js +203 -203
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsStrategy.js +241 -241
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsWorldQueryStrategy.js +3 -3
- package/dist/esmdev/foundation/physics/VRMSpring/CapsuleCollider.js +42 -42
- package/dist/esmdev/foundation/physics/VRMSpring/SphereCollider.js +27 -27
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBone.js +10 -10
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBonePhysicsStrategy.js +51 -51
- package/dist/esmdev/foundation/renderer/Expression.js +6 -6
- package/dist/esmdev/foundation/renderer/Frame.js +12 -12
- package/dist/esmdev/foundation/renderer/FrameBuffer.js +25 -25
- package/dist/esmdev/foundation/renderer/RenderPass.js +102 -99
- package/dist/esmdev/foundation/renderer/TemporalAA/PreviousFrameDataTracker.d.ts +33 -0
- package/dist/esmdev/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +66 -0
- package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.d.ts +135 -0
- package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.js +275 -0
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystem.js +153 -153
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystemStub.js +3 -3
- package/dist/esmdev/foundation/renderer/pipelines/DeferredRenderPipeline.js +6 -6
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +62 -16
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.js +535 -428
- package/dist/esmdev/foundation/system/Engine.d.ts +37 -3
- package/dist/esmdev/foundation/system/Engine.js +266 -224
- package/dist/esmdev/foundation/system/EventPubSub.js +8 -8
- package/dist/esmdev/foundation/system/InputManager.js +56 -56
- package/dist/esmdev/foundation/system/ModuleManager.js +6 -6
- package/dist/esmdev/foundation/textures/AbstractTexture.js +50 -50
- package/dist/esmdev/foundation/textures/CubeTexture.js +32 -32
- package/dist/esmdev/foundation/textures/RenderBuffer.js +11 -11
- package/dist/esmdev/foundation/textures/RenderTargetTexture.js +25 -25
- package/dist/esmdev/foundation/textures/RenderTargetTexture2DArray.js +37 -37
- package/dist/esmdev/foundation/textures/RenderTargetTextureCube.js +19 -19
- package/dist/esmdev/foundation/textures/Sampler.js +24 -24
- package/dist/esmdev/foundation/textures/Texture.js +83 -83
- package/dist/esmdev/foundation/textures/TextureArray.js +8 -8
- package/dist/esmdev/foundation/textures/TextureDataFloat.js +26 -26
- package/dist/esmdev/foundation/textures/VideoTexture.js +24 -24
- package/dist/esmdev/version.js +2 -2
- package/dist/esmdev/webgl/InstanceSidTable.js +62 -62
- package/dist/esmdev/webgl/MultiDraw.js +2 -2
- package/dist/esmdev/webgl/MultiDrawRepository.js +30 -30
- package/dist/esmdev/webgl/WebGLContextWrapper.js +164 -164
- package/dist/esmdev/webgl/WebGLGpuTimer.js +32 -32
- package/dist/esmdev/webgl/WebGLResourceRepository.js +306 -306
- package/dist/esmdev/webgl/WebGLStereoUtil.js +42 -42
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.d.ts +8 -0
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.js +296 -261
- package/dist/esmdev/webgl/debug/ShaderParameterDebugger.js +4 -4
- package/dist/esmdev/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.js +12 -0
- package/dist/esmdev/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.js +12 -0
- package/dist/esmdev/webgl/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.js +12 -0
- package/dist/esmdev/webgl/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.js +12 -0
- package/dist/esmdev/webgl/shaders/RaymarchingShaderPart.js +4 -4
- package/dist/esmdev/webgl/shaders/RaymarchingShadowShaderPart.js +14 -14
- package/dist/esmdev/webgl/shaders/StandardShaderPart.js +3 -3
- package/dist/esmdev/webgl/shaders/nodes/BlockBeginShader.js +10 -10
- package/dist/esmdev/webgl/shaders/nodes/BlockEndShader.js +10 -10
- package/dist/esmdev/webgl/shaders/nodes/ConstantVariableShader.js +21 -21
- package/dist/esmdev/webgl/shaders/nodes/DiscardShader.js +3 -3
- package/dist/esmdev/webgl/shaders/nodes/EndShader.js +3 -3
- package/dist/esmdev/webgl/shaders/nodes/OutDistance.js +12 -12
- package/dist/esmdev/webgl/shaders/nodes/OutUnion.js +9 -9
- package/dist/esmdev/webgl/shaders/nodes/RaymarchObjectIdUniform.js +8 -8
- package/dist/esmdev/webgl/shaders/nodes/SdApplyTransform.js +9 -9
- package/dist/esmdev/webgl/shaders/nodes/SdApplyWorldMatrix.js +8 -8
- package/dist/esmdev/webgl/shaders/nodes/Texture2DShader.js +23 -23
- package/dist/esmdev/webgl/shaders/nodes/UniformDataShader.js +23 -23
- package/dist/esmdev/webgl/textureLoader/KTX2TextureLoader.js +27 -27
- package/dist/esmdev/webgpu/GpuCullingRegistry.js +94 -94
- package/dist/esmdev/webgpu/GpuDeformRegistry.js +53 -53
- package/dist/esmdev/webgpu/RangeAllocator.js +16 -16
- package/dist/esmdev/webgpu/WebGpuBufferArena.js +21 -21
- package/dist/esmdev/webgpu/WebGpuDeviceWrapper.js +7 -7
- package/dist/esmdev/webgpu/WebGpuGpuCulling.js +198 -198
- package/dist/esmdev/webgpu/WebGpuGpuTimer.js +52 -52
- package/dist/esmdev/webgpu/WebGpuLightClusterBuilder.js +37 -37
- package/dist/esmdev/webgpu/WebGpuResourceRepository.js +597 -597
- package/dist/esmdev/webgpu/WebGpuStrategyBasic.d.ts +8 -0
- package/dist/esmdev/webgpu/WebGpuStrategyBasic.js +170 -133
- package/dist/esmdev/webgpu/WebGpuVertexDeformer.js +128 -128
- package/dist/esmdev/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.wgsl.js +12 -0
- package/dist/esmdev/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.wgsl.js +12 -0
- package/dist/esmdev/webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.wgsl.js +12 -0
- package/dist/esmdev/webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.wgsl.js +12 -0
- package/dist/esmdev/xr/WebARSystem.js +69 -69
- package/dist/esmdev/xr/WebXRSystem.js +153 -153
- package/package.json +1 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// src/foundation/helpers/materials/createMotionVectorMaterial.ts
|
|
2
|
+
import MotionVectorShaderFragment_ from "../../../webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.js";
|
|
3
|
+
import MotionVectorShaderVertex_ from "../../../webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.js";
|
|
4
|
+
import MotionVectorShaderFragmentWebGpu_ from "../../../webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.wgsl.js";
|
|
5
|
+
import MotionVectorShaderVertexWebGpu_ from "../../../webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.wgsl.js";
|
|
6
|
+
import { ComponentType } from "../../definitions/ComponentType.js";
|
|
7
|
+
import { CompositionType } from "../../definitions/CompositionType.js";
|
|
8
|
+
import { ShaderType } from "../../definitions/ShaderType.js";
|
|
9
|
+
import { CustomMaterialContent } from "../../materials/contents/CustomMaterialContent.js";
|
|
10
|
+
import { Matrix44 } from "../../math/Matrix44.js";
|
|
11
|
+
import { Vector2 } from "../../math/Vector2.js";
|
|
12
|
+
import { createMaterial } from "./createMaterial.js";
|
|
13
|
+
var MotionVectorShaderFragment = typeof __RN_WEBGL__ === "undefined" || __RN_WEBGL__ ? MotionVectorShaderFragment_ : void 0;
|
|
14
|
+
var MotionVectorShaderVertex = typeof __RN_WEBGL__ === "undefined" || __RN_WEBGL__ ? MotionVectorShaderVertex_ : void 0;
|
|
15
|
+
var MotionVectorShaderFragmentWebGpu = typeof __RN_WEBGPU__ === "undefined" || __RN_WEBGPU__ ? MotionVectorShaderFragmentWebGpu_ : void 0;
|
|
16
|
+
var MotionVectorShaderVertexWebGpu = typeof __RN_WEBGPU__ === "undefined" || __RN_WEBGPU__ ? MotionVectorShaderVertexWebGpu_ : void 0;
|
|
17
|
+
function createMotionVectorMaterial(engine, { additionalName = "", maxInstancesNumber = 4 } = {}) {
|
|
18
|
+
const materialName = `MotionVector_${additionalName}_`;
|
|
19
|
+
const additionalShaderSemanticInfo = [
|
|
20
|
+
{
|
|
21
|
+
semantic: "previousViewProjectionMatrix",
|
|
22
|
+
componentType: ComponentType.Float,
|
|
23
|
+
compositionType: CompositionType.Mat4,
|
|
24
|
+
stage: ShaderType.VertexShader,
|
|
25
|
+
initialValue: Matrix44.fromCopy16RowMajor(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
|
|
26
|
+
min: -Number.MAX_VALUE,
|
|
27
|
+
max: Number.MAX_VALUE
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
semantic: "currentJitter",
|
|
31
|
+
componentType: ComponentType.Float,
|
|
32
|
+
compositionType: CompositionType.Vec2,
|
|
33
|
+
stage: ShaderType.VertexShader,
|
|
34
|
+
initialValue: Vector2.fromCopy2(0, 0),
|
|
35
|
+
min: -1,
|
|
36
|
+
max: 1
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
const materialContent = new CustomMaterialContent(engine, {
|
|
40
|
+
name: materialName,
|
|
41
|
+
isSkinning: true,
|
|
42
|
+
isLighting: false,
|
|
43
|
+
// Sets the morph uniforms (u_currentPrimitiveIdx in WebGL2) for primitives with morph targets.
|
|
44
|
+
isMorphing: true,
|
|
45
|
+
vertexShader: MotionVectorShaderVertex,
|
|
46
|
+
pixelShader: MotionVectorShaderFragment,
|
|
47
|
+
vertexShaderWebGpu: MotionVectorShaderVertexWebGpu,
|
|
48
|
+
pixelShaderWebGpu: MotionVectorShaderFragmentWebGpu,
|
|
49
|
+
additionalShaderSemanticInfo,
|
|
50
|
+
// Reflects the uniforms declared for skinning and morphing (as createPbrUberMaterial does).
|
|
51
|
+
definitions: ["RN_IS_SKINNING", "RN_IS_MORPHING"]
|
|
52
|
+
});
|
|
53
|
+
const material = createMaterial(engine, materialContent, maxInstancesNumber);
|
|
54
|
+
material.addShaderDefine("RN_IS_SKINNING");
|
|
55
|
+
material.addShaderDefine("RN_IS_MORPHING");
|
|
56
|
+
return material;
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
createMotionVectorMaterial
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL2ZvdW5kYXRpb24vaGVscGVycy9tYXRlcmlhbHMvY3JlYXRlTW90aW9uVmVjdG9yTWF0ZXJpYWwudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCBNb3Rpb25WZWN0b3JTaGFkZXJGcmFnbWVudF8gZnJvbSAnLi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TtBQUFBLElBQ1osWUFBWTtBQUFBO0FBQUEsSUFFWixZQUFZO0FBQUEsSUFDWixjQUFjO0FBQUEsSUFDZCxhQUFhO0FBQUEsSUFDYixvQkFBb0I7QUFBQSxJQUNwQixtQkFBbUI7QUFBQSxJQUNuQjtBQUFBO0FBQUEsSUFFQSxhQUFhLENBQUMsa0JBQWtCLGdCQUFnQjtBQUFBLEVBQ2xELENBQUM7QUFDRCxRQUFNLFdBQVcsZUFBZSxRQUFRLGlCQUFpQixrQkFBa0I7QUFDM0UsV0FBUyxnQkFBZ0IsZ0JBQWdCO0FBQ3pDLFdBQVMsZ0JBQWdCLGdCQUFnQjtBQUV6QyxTQUFPO0FBQ1Q7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Material } from '../../materials/core/Material';
|
|
2
|
+
import type { Engine } from '../../system/Engine';
|
|
3
|
+
/**
|
|
4
|
+
* Creates the full screen material that resolves temporal anti-aliasing.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Parameters:
|
|
8
|
+
* - `baseColorTexture`: the current (jittered) frame
|
|
9
|
+
* - `historyTexture`: the result of the previous frame
|
|
10
|
+
* - `velocityTexture`: the output of the motion vector material
|
|
11
|
+
* - `framebufferSize`: the size of the textures in pixels
|
|
12
|
+
* - `currentJitter`: the jitter of the current frame in NDC units (see `getTemporalAAJitter`), for the
|
|
13
|
+
* reconstruction filter of the current frame
|
|
14
|
+
* - `currentFrameWeight`: the weight of the current frame in the exponential blend for pixels that move by a pixel
|
|
15
|
+
* per frame or more (default 0.1)
|
|
16
|
+
* - `staticFrameWeight`: the weight of the current frame for pixels that do not move (default 0.04). Slower
|
|
17
|
+
* pixels interpolate between the two weights
|
|
18
|
+
* - `varianceClipGamma`: the size of the variance clipping box in standard deviations (default 1)
|
|
19
|
+
* - `isHistoryValid`: false outputs the current frame (e.g. on the first frame after a reset)
|
|
20
|
+
* - `historyFrameCount`: the number of frames accumulated in the history since the last reset. The weight of the
|
|
21
|
+
* current frame is at least `1 / (historyFrameCount + 1)`, so that the first frames are averaged evenly
|
|
22
|
+
*
|
|
23
|
+
* @param engine - The engine instance
|
|
24
|
+
* @param options - Configuration object for the material
|
|
25
|
+
* @param options.additionalName - Additional name suffix for the material
|
|
26
|
+
* @param options.maxInstancesNumber - Maximum number of material instances
|
|
27
|
+
* @returns The temporal anti-aliasing resolve material
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export declare function createTemporalAAResolveMaterial(engine: Engine, { additionalName, maxInstancesNumber }?: {
|
|
31
|
+
additionalName?: string | undefined;
|
|
32
|
+
maxInstancesNumber?: number | undefined;
|
|
33
|
+
}): Material;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// src/foundation/helpers/materials/createTemporalAAResolveMaterial.ts
|
|
2
|
+
import TemporalAAResolveShaderFragment_ from "../../../webgl/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.js";
|
|
3
|
+
import TemporalAAResolveShaderVertex_ from "../../../webgl/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.js";
|
|
4
|
+
import TemporalAAResolveShaderFragmentWebGpu_ from "../../../webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.wgsl.js";
|
|
5
|
+
import TemporalAAResolveShaderVertexWebGpu_ from "../../../webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.wgsl.js";
|
|
6
|
+
import { ComponentType } from "../../definitions/ComponentType.js";
|
|
7
|
+
import { CompositionType } from "../../definitions/CompositionType.js";
|
|
8
|
+
import { ShaderType } from "../../definitions/ShaderType.js";
|
|
9
|
+
import { CustomMaterialContent } from "../../materials/contents/CustomMaterialContent.js";
|
|
10
|
+
import { Scalar } from "../../math/Scalar.js";
|
|
11
|
+
import { Vector2 } from "../../math/Vector2.js";
|
|
12
|
+
import { createMaterial } from "./createMaterial.js";
|
|
13
|
+
var TemporalAAResolveShaderFragment = typeof __RN_WEBGL__ === "undefined" || __RN_WEBGL__ ? TemporalAAResolveShaderFragment_ : void 0;
|
|
14
|
+
var TemporalAAResolveShaderVertex = typeof __RN_WEBGL__ === "undefined" || __RN_WEBGL__ ? TemporalAAResolveShaderVertex_ : void 0;
|
|
15
|
+
var TemporalAAResolveShaderFragmentWebGpu = typeof __RN_WEBGPU__ === "undefined" || __RN_WEBGPU__ ? TemporalAAResolveShaderFragmentWebGpu_ : void 0;
|
|
16
|
+
var TemporalAAResolveShaderVertexWebGpu = typeof __RN_WEBGPU__ === "undefined" || __RN_WEBGPU__ ? TemporalAAResolveShaderVertexWebGpu_ : void 0;
|
|
17
|
+
function createTemporalAAResolveMaterial(engine, { additionalName = "", maxInstancesNumber = 4 } = {}) {
|
|
18
|
+
const materialName = `TemporalAAResolve_${additionalName}`;
|
|
19
|
+
const additionalShaderSemanticInfo = [
|
|
20
|
+
{
|
|
21
|
+
semantic: "baseColorTexture",
|
|
22
|
+
componentType: ComponentType.Int,
|
|
23
|
+
compositionType: CompositionType.Texture2D,
|
|
24
|
+
stage: ShaderType.PixelShader,
|
|
25
|
+
initialValue: [-1, engine.dummyTextures.dummyBlackTexture],
|
|
26
|
+
min: 0,
|
|
27
|
+
max: Number.MAX_SAFE_INTEGER
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
semantic: "historyTexture",
|
|
31
|
+
componentType: ComponentType.Int,
|
|
32
|
+
compositionType: CompositionType.Texture2D,
|
|
33
|
+
stage: ShaderType.PixelShader,
|
|
34
|
+
initialValue: [-1, engine.dummyTextures.dummyBlackTexture],
|
|
35
|
+
min: 0,
|
|
36
|
+
max: Number.MAX_SAFE_INTEGER
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
semantic: "velocityTexture",
|
|
40
|
+
componentType: ComponentType.Int,
|
|
41
|
+
compositionType: CompositionType.Texture2D,
|
|
42
|
+
stage: ShaderType.PixelShader,
|
|
43
|
+
initialValue: [-1, engine.dummyTextures.dummyBlackTexture],
|
|
44
|
+
min: 0,
|
|
45
|
+
max: Number.MAX_SAFE_INTEGER
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
semantic: "framebufferSize",
|
|
49
|
+
componentType: ComponentType.Float,
|
|
50
|
+
compositionType: CompositionType.Vec2,
|
|
51
|
+
stage: ShaderType.PixelShader,
|
|
52
|
+
initialValue: Vector2.fromCopy2(1, 1),
|
|
53
|
+
min: 0,
|
|
54
|
+
max: Number.MAX_SAFE_INTEGER
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
semantic: "currentJitter",
|
|
58
|
+
componentType: ComponentType.Float,
|
|
59
|
+
compositionType: CompositionType.Vec2,
|
|
60
|
+
stage: ShaderType.PixelShader,
|
|
61
|
+
initialValue: Vector2.fromCopy2(0, 0),
|
|
62
|
+
min: -1,
|
|
63
|
+
max: 1
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
semantic: "currentFrameWeight",
|
|
67
|
+
componentType: ComponentType.Float,
|
|
68
|
+
compositionType: CompositionType.Scalar,
|
|
69
|
+
stage: ShaderType.PixelShader,
|
|
70
|
+
initialValue: Scalar.fromCopyNumber(0.1),
|
|
71
|
+
min: 0,
|
|
72
|
+
max: 1
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
semantic: "staticFrameWeight",
|
|
76
|
+
componentType: ComponentType.Float,
|
|
77
|
+
compositionType: CompositionType.Scalar,
|
|
78
|
+
stage: ShaderType.PixelShader,
|
|
79
|
+
initialValue: Scalar.fromCopyNumber(0.04),
|
|
80
|
+
min: 0,
|
|
81
|
+
max: 1
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
semantic: "historyFrameCount",
|
|
85
|
+
componentType: ComponentType.Float,
|
|
86
|
+
compositionType: CompositionType.Scalar,
|
|
87
|
+
stage: ShaderType.PixelShader,
|
|
88
|
+
initialValue: Scalar.fromCopyNumber(0),
|
|
89
|
+
min: 0,
|
|
90
|
+
max: Number.MAX_SAFE_INTEGER
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
semantic: "varianceClipGamma",
|
|
94
|
+
componentType: ComponentType.Float,
|
|
95
|
+
compositionType: CompositionType.Scalar,
|
|
96
|
+
stage: ShaderType.PixelShader,
|
|
97
|
+
initialValue: Scalar.fromCopyNumber(1),
|
|
98
|
+
min: 0,
|
|
99
|
+
max: Number.MAX_SAFE_INTEGER
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
semantic: "isHistoryValid",
|
|
103
|
+
componentType: ComponentType.Bool,
|
|
104
|
+
compositionType: CompositionType.Scalar,
|
|
105
|
+
stage: ShaderType.PixelShader,
|
|
106
|
+
initialValue: Scalar.fromCopyNumber(0),
|
|
107
|
+
min: 0,
|
|
108
|
+
max: 1
|
|
109
|
+
}
|
|
110
|
+
];
|
|
111
|
+
const materialContent = new CustomMaterialContent(engine, {
|
|
112
|
+
name: materialName,
|
|
113
|
+
isSkinning: false,
|
|
114
|
+
isLighting: false,
|
|
115
|
+
isMorphing: false,
|
|
116
|
+
vertexShader: TemporalAAResolveShaderVertex,
|
|
117
|
+
pixelShader: TemporalAAResolveShaderFragment,
|
|
118
|
+
vertexShaderWebGpu: TemporalAAResolveShaderVertexWebGpu,
|
|
119
|
+
pixelShaderWebGpu: TemporalAAResolveShaderFragmentWebGpu,
|
|
120
|
+
additionalShaderSemanticInfo
|
|
121
|
+
});
|
|
122
|
+
return createMaterial(engine, materialContent, maxInstancesNumber);
|
|
123
|
+
}
|
|
124
|
+
export {
|
|
125
|
+
createTemporalAAResolveMaterial
|
|
126
|
+
};
|
|
127
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vLi4vc3JjL2ZvdW5kYXRpb24vaGVscGVycy9tYXRlcmlhbHMvY3JlYXRlVGVtcG9yYWxBQVJlc29sdmVNYXRlcmlhbC50cyJdLAogICJzb3VyY2VzQ29udGVudCI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TUFDbEIsY0FBYyxPQUFPLGVBQWUsQ0FBQztBQUFBLE1BQ3JDLEtBQUs7QUFBQSxNQUNMLEtBQUssT0FBTztBQUFBLElBQ2Q7QUFBQSxJQUNBO0FBQUEsTUFDRSxVQUFVO0FBQUEsTUFDVixlQUFlLGNBQWM7QUFBQSxNQUM3QixpQkFBaUIsZ0JBQWdCO0FBQUEsTUFDakMsT0FBTyxXQUFXO0FBQUEsTUFDbEIsY0FBYyxPQUFPLGVBQWUsQ0FBRztBQUFBLE1BQ3ZDLEtBQUs7QUFBQSxNQUNMLEtBQUssT0FBTztBQUFBLElBQ2Q7QUFBQSxJQUNBO0FBQUEsTUFDRSxVQUFVO0FBQUEsTUFDVixlQUFlLGNBQWM7QUFBQSxNQUM3QixpQkFBaUIsZ0JBQWdCO0FBQUEsTUFDakMsT0FBTyxXQUFXO0FBQUEsTUFDbEIsY0FBYyxPQUFPLGVBQWUsQ0FBQztBQUFBLE1BQ3JDLEtBQUs7QUFBQSxNQUNMLEtBQUs7QUFBQSxJQUNQO0FBQUEsRUFDRjtBQUVBLFFBQU0sa0JBQWtCLElBQUksc0JBQXNCLFFBQVE7QUFBQSxJQUN4RCxNQUFNO0FBQUEsSUFDTixZQUFZO0FBQUEsSUFDWixZQUFZO0FBQUEsSUFDWixZQUFZO0FBQUEsSUFDWixjQUFjO0FBQUEsSUFDZCxhQUFhO0FBQUEsSUFDYixvQkFBb0I7QUFBQSxJQUNwQixtQkFBbUI7QUFBQSxJQUNuQjtBQUFBLEVBQ0YsQ0FBQztBQUNELFNBQU8sZUFBZSxRQUFRLGlCQUFpQixrQkFBa0I7QUFDbkU7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
|
@@ -53,8 +53,8 @@ var AnimationAssigner = class {
|
|
|
53
53
|
* @returns The root entity with assigned animations
|
|
54
54
|
*/
|
|
55
55
|
assignAnimation(rootEntity, gltfModel, vrmModel, isSameSkeleton, retargetMode) {
|
|
56
|
-
this
|
|
57
|
-
this.
|
|
56
|
+
this.hp(rootEntity);
|
|
57
|
+
this.op(rootEntity, gltfModel, vrmModel, isSameSkeleton, retargetMode);
|
|
58
58
|
return rootEntity;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
@@ -76,9 +76,9 @@ var AnimationAssigner = class {
|
|
|
76
76
|
if (rootVrm._version !== "0.x" && rootVrm._version !== "1.0") {
|
|
77
77
|
throw new Error(`Unsupported VRM version '${rootVrm._version}' for VRMA animation assignment.`);
|
|
78
78
|
}
|
|
79
|
-
const firstActiveAnimationTrackName = postfixToTrackName != null ? this.
|
|
80
|
-
const secondActiveAnimationTrackName = postfixToTrackName != null ? this.
|
|
81
|
-
const activeSamplerBindings = postfixToTrackName != null ? this.
|
|
79
|
+
const firstActiveAnimationTrackName = postfixToTrackName != null ? this.kp(rootEntity) : void 0;
|
|
80
|
+
const secondActiveAnimationTrackName = postfixToTrackName != null ? this.lp(rootEntity) : void 0;
|
|
81
|
+
const activeSamplerBindings = postfixToTrackName != null ? this.pp(rootEntity, postfixToTrackName) : [];
|
|
82
82
|
const entityVrma = ModelConverter.convertToRhodoniteObjectSimple(this.c, vrmaModel);
|
|
83
83
|
const rootMotion = (_a = options.rootMotion) != null ? _a : "preserve";
|
|
84
84
|
const trackNames = /* @__PURE__ */ new Set();
|
|
@@ -100,11 +100,11 @@ var AnimationAssigner = class {
|
|
|
100
100
|
if (nodeIndex == null) {
|
|
101
101
|
continue;
|
|
102
102
|
}
|
|
103
|
-
const humanBones = this.
|
|
103
|
+
const humanBones = this.ip(vrma);
|
|
104
104
|
const humanoidBoneName = humanBones == null ? void 0 : humanBones.get(nodeIndex);
|
|
105
|
-
const expressionNames = (_c = this.
|
|
105
|
+
const expressionNames = (_c = this.qp(vrma)) == null ? void 0 : _c.get(nodeIndex);
|
|
106
106
|
if (channel.target.path === "translation" && expressionNames != null) {
|
|
107
|
-
this.
|
|
107
|
+
this.rp(
|
|
108
108
|
rootEntity,
|
|
109
109
|
animation,
|
|
110
110
|
channel,
|
|
@@ -116,7 +116,7 @@ var AnimationAssigner = class {
|
|
|
116
116
|
if (rootMotion === "ignoreHipsTranslation" && humanoidBoneName === "hips" && ((_d = channel.target) == null ? void 0 : _d.path) === "translation") {
|
|
117
117
|
continue;
|
|
118
118
|
}
|
|
119
|
-
const rnEntity = this.
|
|
119
|
+
const rnEntity = this.sp(rootEntity, vrma, nodeIndex);
|
|
120
120
|
if (rnEntity) {
|
|
121
121
|
const newRnEntity = this.c.entityRepository.addComponentToEntity(AnimationComponent, rnEntity);
|
|
122
122
|
const animationComponent = newRnEntity.getAnimation();
|
|
@@ -141,24 +141,24 @@ var AnimationAssigner = class {
|
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
143
|
try {
|
|
144
|
-
this
|
|
144
|
+
this.hp(rootEntity, postfixToTrackName);
|
|
145
145
|
setRetarget(vrmaModel);
|
|
146
146
|
const firstActiveAnimationTrackWasReset = firstActiveAnimationTrackName != null && postfixToTrackName != null && firstActiveAnimationTrackName.endsWith(postfixToTrackName);
|
|
147
|
-
const firstActiveAnimationTrackStillExists = firstActiveAnimationTrackName != null && this.
|
|
147
|
+
const firstActiveAnimationTrackStillExists = firstActiveAnimationTrackName != null && this.jp(rootEntity, firstActiveAnimationTrackName);
|
|
148
148
|
const requiresFirstActiveAnimationTrackRebind = firstActiveAnimationTrackName != null && (firstActiveAnimationTrackWasReset || !firstActiveAnimationTrackStillExists);
|
|
149
149
|
const secondActiveAnimationTrackWasReset = secondActiveAnimationTrackName != null && postfixToTrackName != null && secondActiveAnimationTrackName.endsWith(postfixToTrackName);
|
|
150
|
-
const secondActiveAnimationTrackStillExists = secondActiveAnimationTrackName != null && this.
|
|
150
|
+
const secondActiveAnimationTrackStillExists = secondActiveAnimationTrackName != null && this.jp(rootEntity, secondActiveAnimationTrackName);
|
|
151
151
|
const requiresSecondActiveAnimationTrackRebind = secondActiveAnimationTrackName != null && (secondActiveAnimationTrackWasReset || !secondActiveAnimationTrackStillExists);
|
|
152
|
-
const fallbackAnimationTrackName = (_b = trackNames.values().next().value) != null ? _b : this.
|
|
152
|
+
const fallbackAnimationTrackName = (_b = trackNames.values().next().value) != null ? _b : this.mp(rootEntity);
|
|
153
153
|
const expressionFirstActiveAnimationTrackName = firstActiveAnimationTrackName != null && firstActiveAnimationTrackStillExists ? firstActiveAnimationTrackName : fallbackAnimationTrackName;
|
|
154
154
|
const replacementSecondActiveAnimationTrackName = secondActiveAnimationTrackName != null && secondActiveAnimationTrackStillExists ? secondActiveAnimationTrackName : fallbackAnimationTrackName;
|
|
155
|
-
this.
|
|
155
|
+
this.tp(
|
|
156
156
|
rootEntity,
|
|
157
157
|
expressionFirstActiveAnimationTrackName,
|
|
158
158
|
secondActiveAnimationTrackName != null ? replacementSecondActiveAnimationTrackName : void 0
|
|
159
159
|
);
|
|
160
160
|
if (postfixToTrackName != null) {
|
|
161
|
-
this.
|
|
161
|
+
this.up(activeSamplerBindings, trackNames, postfixToTrackName);
|
|
162
162
|
}
|
|
163
163
|
const animationState = rootEntity.tryToGetAnimationState();
|
|
164
164
|
if (requiresFirstActiveAnimationTrackRebind && firstActiveAnimationTrackName != null && expressionFirstActiveAnimationTrackName != null) {
|
|
@@ -197,7 +197,7 @@ var AnimationAssigner = class {
|
|
|
197
197
|
if (suppliedSemantics.length === 0) {
|
|
198
198
|
throw new Error("Character VRMA animation assignment requires at least one semantic VRMA animation.");
|
|
199
199
|
}
|
|
200
|
-
this.
|
|
200
|
+
this.vp(rootEntity, vrmaAnimations, suppliedSemantics, rootMotion);
|
|
201
201
|
const mapping = {};
|
|
202
202
|
const trackNames = {};
|
|
203
203
|
const assignedPostfixes = [];
|
|
@@ -216,7 +216,7 @@ var AnimationAssigner = class {
|
|
|
216
216
|
}
|
|
217
217
|
} catch (error) {
|
|
218
218
|
for (const postfix of assignedPostfixes) {
|
|
219
|
-
this
|
|
219
|
+
this.hp(rootEntity, postfix);
|
|
220
220
|
}
|
|
221
221
|
throw error;
|
|
222
222
|
}
|
|
@@ -229,7 +229,7 @@ var AnimationAssigner = class {
|
|
|
229
229
|
* @param rootEntity - The root entity to reset
|
|
230
230
|
* @param postfixToTrackName - Optional postfix to identify specific animation tracks to reset
|
|
231
231
|
*/
|
|
232
|
-
|
|
232
|
+
hp(rootEntity, postfixToTrackName) {
|
|
233
233
|
const vrmComponent = rootEntity.tryToGetVrm();
|
|
234
234
|
const animationComponent = rootEntity.tryToGetAnimation();
|
|
235
235
|
if (vrmComponent != null && animationComponent != null) {
|
|
@@ -278,7 +278,7 @@ var AnimationAssigner = class {
|
|
|
278
278
|
* @param isSameSkeleton - Whether the source and target skeletons are identical
|
|
279
279
|
* @returns The corresponding entity in the target skeleton, or undefined if not found
|
|
280
280
|
*/
|
|
281
|
-
|
|
281
|
+
wp(rootEntity, gltfModel, vrmModel, nodeIndex, nodeName, isSameSkeleton) {
|
|
282
282
|
if (isSameSkeleton) {
|
|
283
283
|
const rnEntities = rootEntity.getTagValue("rnEntitiesByNames");
|
|
284
284
|
const node = gltfModel.nodes[nodeIndex];
|
|
@@ -340,8 +340,8 @@ var AnimationAssigner = class {
|
|
|
340
340
|
* @param nodeIndex - The index of the node in the VRMA model
|
|
341
341
|
* @returns The corresponding entity in the target skeleton, or undefined if not found
|
|
342
342
|
*/
|
|
343
|
-
|
|
344
|
-
const humanBones = this.
|
|
343
|
+
sp(rootEntity, gltfModel, nodeIndex) {
|
|
344
|
+
const humanBones = this.ip(gltfModel);
|
|
345
345
|
const humanoidBoneName = humanBones == null ? void 0 : humanBones.get(nodeIndex);
|
|
346
346
|
if (humanoidBoneName == null) {
|
|
347
347
|
return void 0;
|
|
@@ -360,7 +360,7 @@ var AnimationAssigner = class {
|
|
|
360
360
|
Logger.default.info(`humanoidBoneName: ${humanoidBoneName}, nodeIndex: ${nodeIndex}`);
|
|
361
361
|
return void 0;
|
|
362
362
|
}
|
|
363
|
-
|
|
363
|
+
ip(vrmaModel) {
|
|
364
364
|
var _a, _b;
|
|
365
365
|
const vrmaExtension = (_a = vrmaModel.extensions) == null ? void 0 : _a.VRMC_vrm_animation;
|
|
366
366
|
if (vrmaExtension == null) {
|
|
@@ -381,7 +381,7 @@ var AnimationAssigner = class {
|
|
|
381
381
|
vrmaExtension.humanoidBoneNameMap = humanoidBoneNameMap;
|
|
382
382
|
return humanoidBoneNameMap;
|
|
383
383
|
}
|
|
384
|
-
|
|
384
|
+
qp(vrmaModel) {
|
|
385
385
|
var _a;
|
|
386
386
|
const vrmaExtension = (_a = vrmaModel.extensions) == null ? void 0 : _a.VRMC_vrm_animation;
|
|
387
387
|
if (vrmaExtension == null) {
|
|
@@ -392,7 +392,7 @@ var AnimationAssigner = class {
|
|
|
392
392
|
}
|
|
393
393
|
return vrmaExtension.expressionNamesMap;
|
|
394
394
|
}
|
|
395
|
-
|
|
395
|
+
rp(rootEntity, animation, channel, expressionNames, postfixToTrackName, trackNames) {
|
|
396
396
|
var _a, _b, _c, _d, _e, _f;
|
|
397
397
|
const samplerObject = channel.samplerObject;
|
|
398
398
|
const input = (_b = (_a = samplerObject == null ? void 0 : samplerObject.inputObject) == null ? void 0 : _a.extras) == null ? void 0 : _b.typedDataArray;
|
|
@@ -407,7 +407,7 @@ var AnimationAssigner = class {
|
|
|
407
407
|
const rootVrm = rootEntity.tryToGetVrm();
|
|
408
408
|
const trackName = `${(_e = animation.name) != null ? _e : "Untitled_Animation"}${postfixToTrackName != null ? postfixToTrackName : ""}`;
|
|
409
409
|
let animationComponent = rootEntity.tryToGetAnimation();
|
|
410
|
-
const playbackStateSource = animationComponent == null ? this.
|
|
410
|
+
const playbackStateSource = animationComponent == null ? this.np(rootEntity) : void 0;
|
|
411
411
|
for (const { name: expressionName, isPreset } of expressionNames) {
|
|
412
412
|
const targetExpressionName = rootVrm._version === "0.x" && isPreset && Object.hasOwn(vrmaPresetNameToVrm0xPresetName, expressionName) ? vrmaPresetNameToVrm0xPresetName[expressionName] : expressionName;
|
|
413
413
|
if (rootVrm.getExpressionWeight(targetExpressionName) == null) {
|
|
@@ -448,7 +448,7 @@ var AnimationAssigner = class {
|
|
|
448
448
|
* newly active track, AnimatedScalar keeps its previous sampler and the previous clip's expression
|
|
449
449
|
* can remain active.
|
|
450
450
|
*/
|
|
451
|
-
|
|
451
|
+
tp(rootEntity, firstActiveAnimationTrackName, secondActiveAnimationTrackName) {
|
|
452
452
|
var _a, _b;
|
|
453
453
|
const trackTimeRanges = /* @__PURE__ */ new Map();
|
|
454
454
|
const collectSamplers = (entity) => {
|
|
@@ -561,7 +561,7 @@ var AnimationAssigner = class {
|
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
|
-
|
|
564
|
+
pp(rootEntity, postfixToTrackName) {
|
|
565
565
|
const bindings = [];
|
|
566
566
|
const collectBindings = (entity) => {
|
|
567
567
|
const animationComponent = entity.tryToGetAnimation();
|
|
@@ -590,7 +590,7 @@ var AnimationAssigner = class {
|
|
|
590
590
|
collectBindings(rootEntity);
|
|
591
591
|
return bindings;
|
|
592
592
|
}
|
|
593
|
-
|
|
593
|
+
up(bindings, assignedTrackNames, postfixToTrackName) {
|
|
594
594
|
for (const binding of bindings) {
|
|
595
595
|
const animatedValue = binding.animationComponent.getAnimation(binding.pathName);
|
|
596
596
|
if (animatedValue == null) {
|
|
@@ -617,7 +617,7 @@ var AnimationAssigner = class {
|
|
|
617
617
|
restoreBinding(binding.second, (trackName) => animatedValue.setSecondActiveAnimationTrackName(trackName));
|
|
618
618
|
}
|
|
619
619
|
}
|
|
620
|
-
|
|
620
|
+
kp(rootEntity) {
|
|
621
621
|
const animationComponent = rootEntity.tryToGetAnimation();
|
|
622
622
|
if (animationComponent != null) {
|
|
623
623
|
for (const [, channel] of animationComponent.getAnimationChannelsOfTrack()) {
|
|
@@ -625,27 +625,27 @@ var AnimationAssigner = class {
|
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
627
|
for (const child of rootEntity.children) {
|
|
628
|
-
const firstActiveAnimationTrackName = this.
|
|
628
|
+
const firstActiveAnimationTrackName = this.kp(child.entity);
|
|
629
629
|
if (firstActiveAnimationTrackName != null) {
|
|
630
630
|
return firstActiveAnimationTrackName;
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
return void 0;
|
|
634
634
|
}
|
|
635
|
-
|
|
635
|
+
np(rootEntity) {
|
|
636
636
|
const animationComponent = rootEntity.tryToGetAnimation();
|
|
637
637
|
if (animationComponent != null) {
|
|
638
638
|
return animationComponent;
|
|
639
639
|
}
|
|
640
640
|
for (const child of rootEntity.children) {
|
|
641
|
-
const childAnimationComponent = this.
|
|
641
|
+
const childAnimationComponent = this.np(child.entity);
|
|
642
642
|
if (childAnimationComponent != null) {
|
|
643
643
|
return childAnimationComponent;
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
646
|
return void 0;
|
|
647
647
|
}
|
|
648
|
-
|
|
648
|
+
lp(rootEntity) {
|
|
649
649
|
const animationComponent = rootEntity.tryToGetAnimation();
|
|
650
650
|
if (animationComponent != null) {
|
|
651
651
|
for (const [, channel] of animationComponent.getAnimationChannelsOfTrack()) {
|
|
@@ -656,14 +656,14 @@ var AnimationAssigner = class {
|
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
658
|
for (const child of rootEntity.children) {
|
|
659
|
-
const secondActiveAnimationTrackName = this.
|
|
659
|
+
const secondActiveAnimationTrackName = this.lp(child.entity);
|
|
660
660
|
if (secondActiveAnimationTrackName != null) {
|
|
661
661
|
return secondActiveAnimationTrackName;
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
664
|
return void 0;
|
|
665
665
|
}
|
|
666
|
-
|
|
666
|
+
mp(rootEntity) {
|
|
667
667
|
const animationComponent = rootEntity.tryToGetAnimation();
|
|
668
668
|
if (animationComponent != null) {
|
|
669
669
|
for (const [, channel] of animationComponent.getAnimationChannelsOfTrack()) {
|
|
@@ -674,14 +674,14 @@ var AnimationAssigner = class {
|
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
for (const child of rootEntity.children) {
|
|
677
|
-
const animationTrackName = this.
|
|
677
|
+
const animationTrackName = this.mp(child.entity);
|
|
678
678
|
if (animationTrackName != null) {
|
|
679
679
|
return animationTrackName;
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
682
|
return void 0;
|
|
683
683
|
}
|
|
684
|
-
|
|
684
|
+
jp(rootEntity, trackName) {
|
|
685
685
|
const animationComponent = rootEntity.tryToGetAnimation();
|
|
686
686
|
if (animationComponent != null) {
|
|
687
687
|
for (const [, channel] of animationComponent.getAnimationChannelsOfTrack()) {
|
|
@@ -691,13 +691,13 @@ var AnimationAssigner = class {
|
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
693
|
for (const child of rootEntity.children) {
|
|
694
|
-
if (this.
|
|
694
|
+
if (this.jp(child.entity, trackName)) {
|
|
695
695
|
return true;
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
698
|
return false;
|
|
699
699
|
}
|
|
700
|
-
|
|
700
|
+
vp(rootEntity, vrmaAnimations, suppliedSemantics, rootMotion) {
|
|
701
701
|
const rootVrm = rootEntity.tryToGetVrm();
|
|
702
702
|
if (rootVrm == null) {
|
|
703
703
|
throw new Error("Character VRMA animation assignment requires a VRM root entity.");
|
|
@@ -718,7 +718,7 @@ var AnimationAssigner = class {
|
|
|
718
718
|
if (vrmaModel.animations == null || vrmaModel.animations.length === 0) {
|
|
719
719
|
throw new Error(`Character VRMA animation '${semantic}' does not contain any animations.`);
|
|
720
720
|
}
|
|
721
|
-
const humanoidBoneMap = this.
|
|
721
|
+
const humanoidBoneMap = this.ip(vrmaModel);
|
|
722
722
|
if (humanoidBoneMap == null) {
|
|
723
723
|
throw new Error(`Character VRMA animation '${semantic}' does not define VRMC_vrm_animation humanoid bones.`);
|
|
724
724
|
}
|
|
@@ -757,7 +757,7 @@ var AnimationAssigner = class {
|
|
|
757
757
|
* @param nodeIndex - The index of the node to check
|
|
758
758
|
* @returns True if the node represents the hips bone, false otherwise
|
|
759
759
|
*/
|
|
760
|
-
|
|
760
|
+
xp(_rootEntity, vrmModel, nodeIndex) {
|
|
761
761
|
const srcMapNodeIdName = /* @__PURE__ */ new Map();
|
|
762
762
|
if (Is.exist(vrmModel.extensions.VRM)) {
|
|
763
763
|
const humanBones = vrmModel.extensions.VRM.humanoid.humanBones;
|
|
@@ -787,7 +787,7 @@ var AnimationAssigner = class {
|
|
|
787
787
|
* @param isSameSkeleton - Whether the source and target skeletons are identical
|
|
788
788
|
* @param retargetMode - The retargeting mode to apply
|
|
789
789
|
*/
|
|
790
|
-
|
|
790
|
+
op(rootEntity, gltfModel, vrmModel, isSameSkeleton, retargetMode) {
|
|
791
791
|
var _a, _b, _c, _d;
|
|
792
792
|
if (gltfModel.animations == null || gltfModel.animations.length === 0) {
|
|
793
793
|
return;
|
|
@@ -805,7 +805,7 @@ var AnimationAssigner = class {
|
|
|
805
805
|
const animOutputArray = (_d = (_c = channel.samplerObject) == null ? void 0 : _c.outputObject) == null ? void 0 : _d.extras.typedDataArray;
|
|
806
806
|
const interpolation = channel.samplerObject.interpolation != null ? channel.samplerObject.interpolation : "LINEAR";
|
|
807
807
|
const node = gltfModel.nodes[channel.target.node];
|
|
808
|
-
const rnEntity = this.
|
|
808
|
+
const rnEntity = this.wp(
|
|
809
809
|
rootEntity,
|
|
810
810
|
gltfModel,
|
|
811
811
|
vrmModel,
|
|
@@ -837,7 +837,7 @@ var AnimationAssigner = class {
|
|
|
837
837
|
});
|
|
838
838
|
const newAnimatedValue = new AnimatedQuaternion(animationSamplers, trackName);
|
|
839
839
|
animationComponent.setAnimation(animationAttributeType, newAnimatedValue);
|
|
840
|
-
} else if (animationAttributeType === "translate" && this.
|
|
840
|
+
} else if (animationAttributeType === "translate" && this.xp(rootEntity, vrmModel, channel.target.node)) {
|
|
841
841
|
const animationSamplers = /* @__PURE__ */ new Map();
|
|
842
842
|
const trackName = Is.exist(animation.name) ? animation.name : "Untitled";
|
|
843
843
|
animationSamplers.set(trackName, {
|