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
|
@@ -66,7 +66,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
66
66
|
* @param gltfModel - The glTF model data
|
|
67
67
|
* @returns A scene graph entity configured as a group
|
|
68
68
|
*/
|
|
69
|
-
static
|
|
69
|
+
static dq(engine, gltfModel) {
|
|
70
70
|
const entity = createGroupEntity(engine);
|
|
71
71
|
this.addTags(entity, gltfModel);
|
|
72
72
|
return entity;
|
|
@@ -92,7 +92,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
92
92
|
* @param gltfModel - The glTF model data
|
|
93
93
|
* @returns A mesh entity with appropriate tags
|
|
94
94
|
*/
|
|
95
|
-
static
|
|
95
|
+
static qq(engine, gltfModel) {
|
|
96
96
|
const entity = createMeshEntity(engine);
|
|
97
97
|
this.addTags(entity, gltfModel);
|
|
98
98
|
return entity;
|
|
@@ -103,7 +103,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
103
103
|
* @param gltfModel - The glTF model data
|
|
104
104
|
* @returns A camera entity with appropriate tags
|
|
105
105
|
*/
|
|
106
|
-
static
|
|
106
|
+
static rq(engine, gltfModel) {
|
|
107
107
|
const entity = createCameraEntity(engine, true);
|
|
108
108
|
this.addTags(entity, gltfModel);
|
|
109
109
|
return entity;
|
|
@@ -114,7 +114,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
114
114
|
* @param gltfModel - The glTF model data
|
|
115
115
|
* @returns A light entity with appropriate tags
|
|
116
116
|
*/
|
|
117
|
-
static
|
|
117
|
+
static sq(engine, gltfModel) {
|
|
118
118
|
const entity = createLightEntity(engine);
|
|
119
119
|
this.addTags(entity, gltfModel);
|
|
120
120
|
return entity;
|
|
@@ -126,11 +126,11 @@ var ModelConverter = class _ModelConverter {
|
|
|
126
126
|
* @param rnSamplers - Array of Rhodonite samplers
|
|
127
127
|
* @returns Array of configured Rhodonite materials
|
|
128
128
|
*/
|
|
129
|
-
static
|
|
129
|
+
static hq(engine, gltfModel, rnTextures, rnSamplers) {
|
|
130
130
|
const rnMaterials = [];
|
|
131
131
|
if (gltfModel.materials != null) {
|
|
132
132
|
for (const material of gltfModel.materials) {
|
|
133
|
-
const rnMaterial = this.
|
|
133
|
+
const rnMaterial = this.wk(engine, gltfModel, rnTextures, rnSamplers, material);
|
|
134
134
|
rnMaterials.push(rnMaterial);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
@@ -143,7 +143,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
143
143
|
* @param gltfModel - The glTF model data to inspect
|
|
144
144
|
* @internal
|
|
145
145
|
*/
|
|
146
|
-
static async
|
|
146
|
+
static async tq(gltfModel) {
|
|
147
147
|
var _a;
|
|
148
148
|
const materials = (_a = gltfModel.materials) != null ? _a : [];
|
|
149
149
|
const needsMToon1 = materials.some((material) => {
|
|
@@ -204,7 +204,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
204
204
|
* @param gltfModel - The glTF model data to inspect
|
|
205
205
|
* @internal
|
|
206
206
|
*/
|
|
207
|
-
static async
|
|
207
|
+
static async uq(engine, gltfModel) {
|
|
208
208
|
var _a;
|
|
209
209
|
const materials = (_a = gltfModel.materials) != null ? _a : [];
|
|
210
210
|
const usesSheen = materials.some((material) => {
|
|
@@ -225,7 +225,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
225
225
|
* @param gltfModel - The glTF model data
|
|
226
226
|
* @returns Promise resolving to array of Rhodonite textures
|
|
227
227
|
*/
|
|
228
|
-
static async
|
|
228
|
+
static async vq(engine, gltfModel) {
|
|
229
229
|
const rnTextures = [];
|
|
230
230
|
if (gltfModel.images != null) {
|
|
231
231
|
for (const image of gltfModel.images) {
|
|
@@ -241,7 +241,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
241
241
|
* @param gltfModel - The glTF model data
|
|
242
242
|
* @returns Array of Rhodonite samplers
|
|
243
243
|
*/
|
|
244
|
-
static
|
|
244
|
+
static wq(engine, gltfModel) {
|
|
245
245
|
const rnSamplers = [];
|
|
246
246
|
if (gltfModel.samplers != null) {
|
|
247
247
|
for (const sampler of gltfModel.samplers) {
|
|
@@ -258,12 +258,12 @@ var ModelConverter = class _ModelConverter {
|
|
|
258
258
|
*/
|
|
259
259
|
static convertToRhodoniteObjectSimple(engine, gltfModel) {
|
|
260
260
|
gltfModel.asset.extras.rnMeshesAtGltMeshIdx = [];
|
|
261
|
-
const rnBuffers = this.
|
|
261
|
+
const rnBuffers = this.iq(gltfModel);
|
|
262
262
|
gltfModel.asset.extras.rnMaterials = {};
|
|
263
263
|
const rnTextures = [];
|
|
264
264
|
const rnSamplers = [];
|
|
265
|
-
const rnMaterials = this
|
|
266
|
-
const { rnEntities, rnEntitiesByNames } = this.
|
|
265
|
+
const rnMaterials = this.hq(engine, gltfModel, rnTextures, rnSamplers);
|
|
266
|
+
const { rnEntities, rnEntitiesByNames } = this.jq(
|
|
267
267
|
engine,
|
|
268
268
|
gltfModel,
|
|
269
269
|
rnBuffers,
|
|
@@ -273,12 +273,12 @@ var ModelConverter = class _ModelConverter {
|
|
|
273
273
|
);
|
|
274
274
|
gltfModel.asset.extras.rnEntities = rnEntities;
|
|
275
275
|
this._setupTransform(gltfModel, rnEntities);
|
|
276
|
-
const rootGroup = this.
|
|
276
|
+
const rootGroup = this.dq(engine, gltfModel);
|
|
277
277
|
this._setupAnimation(engine, gltfModel, rnEntities, rnBuffers, rootGroup, rnMaterials);
|
|
278
278
|
this._setupSkeleton(engine, gltfModel, rnEntities, rnBuffers);
|
|
279
279
|
this._setupHierarchy(gltfModel, rnEntities);
|
|
280
280
|
setupKhrStaticColliders(gltfModel, rnEntities);
|
|
281
|
-
this.
|
|
281
|
+
this.kq(gltfModel, rnEntities);
|
|
282
282
|
if (gltfModel.scenes[0].nodes) {
|
|
283
283
|
for (const nodesIndex of gltfModel.scenes[0].nodes) {
|
|
284
284
|
const sg = rnEntities[nodesIndex].getSceneGraph();
|
|
@@ -300,16 +300,16 @@ var ModelConverter = class _ModelConverter {
|
|
|
300
300
|
static async convertToRhodoniteObject(engine, gltfModel) {
|
|
301
301
|
var _a, _b;
|
|
302
302
|
gltfModel.asset.extras.rnMeshesAtGltMeshIdx = [];
|
|
303
|
-
const rnBuffers = this.
|
|
303
|
+
const rnBuffers = this.iq(gltfModel);
|
|
304
304
|
gltfModel.asset.extras.rnMaterials = {};
|
|
305
|
-
const rnTextures = await this.
|
|
306
|
-
const rnSamplers = this.
|
|
307
|
-
await this.
|
|
305
|
+
const rnTextures = await this.vq(engine, gltfModel);
|
|
306
|
+
const rnSamplers = this.wq(engine, gltfModel);
|
|
307
|
+
await this.tq(gltfModel);
|
|
308
308
|
await RhodoniteImportExtension.preloadNodeBasedMaterialSupport(gltfModel);
|
|
309
309
|
await this.preloadRaymarchingSupport(gltfModel);
|
|
310
|
-
await this.
|
|
311
|
-
const rnMaterials = this
|
|
312
|
-
const { rnEntities, rnEntitiesByNames } = this.
|
|
310
|
+
await this.uq(engine, gltfModel);
|
|
311
|
+
const rnMaterials = this.hq(engine, gltfModel, rnTextures, rnSamplers);
|
|
312
|
+
const { rnEntities, rnEntitiesByNames } = this.jq(
|
|
313
313
|
engine,
|
|
314
314
|
gltfModel,
|
|
315
315
|
rnBuffers,
|
|
@@ -319,13 +319,13 @@ var ModelConverter = class _ModelConverter {
|
|
|
319
319
|
);
|
|
320
320
|
gltfModel.asset.extras.rnEntities = rnEntities;
|
|
321
321
|
this._setupTransform(gltfModel, rnEntities);
|
|
322
|
-
const rootGroup = this.
|
|
322
|
+
const rootGroup = this.dq(engine, gltfModel);
|
|
323
323
|
this._setupAnimation(engine, gltfModel, rnEntities, rnBuffers, rootGroup, rnMaterials);
|
|
324
324
|
this._setupSkeleton(engine, gltfModel, rnEntities, rnBuffers);
|
|
325
325
|
this._setupHierarchy(gltfModel, rnEntities);
|
|
326
326
|
await preloadKhrPhysicsSupport(gltfModel);
|
|
327
327
|
setupKhrStaticColliders(gltfModel, rnEntities);
|
|
328
|
-
this.
|
|
328
|
+
this.kq(gltfModel, rnEntities);
|
|
329
329
|
rootGroup.tryToSetUniqueName("FileRoot", true);
|
|
330
330
|
rootGroup.tryToSetTag({ tag: "ObjectType", value: "top" });
|
|
331
331
|
if (gltfModel.scenes[0].nodes) {
|
|
@@ -367,7 +367,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
367
367
|
* @param gltfModel - The glTF model containing buffer data
|
|
368
368
|
* @returns Array of Rhodonite Buffer objects
|
|
369
369
|
*/
|
|
370
|
-
static
|
|
370
|
+
static iq(gltfModel) {
|
|
371
371
|
var _a;
|
|
372
372
|
const rnBuffers = [];
|
|
373
373
|
for (const buffer of (_a = gltfModel.buffers) != null ? _a : []) {
|
|
@@ -437,21 +437,21 @@ var ModelConverter = class _ModelConverter {
|
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
static
|
|
440
|
+
static kq(gltfModel, rnEntities) {
|
|
441
441
|
var _a, _b, _c;
|
|
442
442
|
const visitedNodeIndices = /* @__PURE__ */ new Set();
|
|
443
443
|
const sceneRootNodeIndices = (_c = (_b = (_a = gltfModel.scenes) == null ? void 0 : _a[0]) == null ? void 0 : _b.nodes) != null ? _c : [];
|
|
444
444
|
for (const nodeIndex of sceneRootNodeIndices) {
|
|
445
|
-
this.
|
|
445
|
+
this.eq(gltfModel, rnEntities, nodeIndex, true, visitedNodeIndices);
|
|
446
446
|
}
|
|
447
447
|
for (const nodeIndexString in gltfModel.nodes) {
|
|
448
448
|
const nodeIndex = Number.parseInt(nodeIndexString, 10);
|
|
449
449
|
if (!visitedNodeIndices.has(nodeIndex)) {
|
|
450
|
-
this.
|
|
450
|
+
this.eq(gltfModel, rnEntities, nodeIndex, true, visitedNodeIndices);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
static
|
|
454
|
+
static eq(gltfModel, rnEntities, nodeIndex, parentVisible, visitedNodeIndices) {
|
|
455
455
|
var _a, _b;
|
|
456
456
|
if (visitedNodeIndices.has(nodeIndex)) {
|
|
457
457
|
return;
|
|
@@ -462,14 +462,14 @@ var ModelConverter = class _ModelConverter {
|
|
|
462
462
|
if (Is.not.exist(node) || Is.not.exist(entity)) {
|
|
463
463
|
return;
|
|
464
464
|
}
|
|
465
|
-
const localVisible = this.
|
|
465
|
+
const localVisible = this.xq(node);
|
|
466
466
|
entity.tryToSetTag({ tag: TagKhrNodeVisibilityVisible, value: localVisible });
|
|
467
467
|
if (Is.exist((_a = node.extensions) == null ? void 0 : _a.KHR_node_visibility)) {
|
|
468
468
|
entity.tryToSetTag({ tag: TagKhrNodeVisibilityEnabled, value: true });
|
|
469
469
|
}
|
|
470
470
|
entity.getSceneGraph().isVisible = parentVisible && localVisible;
|
|
471
471
|
for (const childNodeIndex of (_b = node.children) != null ? _b : []) {
|
|
472
|
-
this.
|
|
472
|
+
this.eq(
|
|
473
473
|
gltfModel,
|
|
474
474
|
rnEntities,
|
|
475
475
|
childNodeIndex,
|
|
@@ -478,7 +478,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
478
478
|
);
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
-
static
|
|
481
|
+
static xq(node) {
|
|
482
482
|
var _a, _b;
|
|
483
483
|
const extension = (_a = node.extensions) == null ? void 0 : _a.KHR_node_visibility;
|
|
484
484
|
return (_b = extension == null ? void 0 : extension.visible) != null ? _b : true;
|
|
@@ -522,7 +522,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
522
522
|
animationAttributeType = channel.target.path;
|
|
523
523
|
}
|
|
524
524
|
if (channel.target.path === "pointer") {
|
|
525
|
-
_ModelConverter.
|
|
525
|
+
_ModelConverter.yq(
|
|
526
526
|
rnEntities,
|
|
527
527
|
channel,
|
|
528
528
|
samplerObject,
|
|
@@ -535,7 +535,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
535
535
|
gltfModel
|
|
536
536
|
);
|
|
537
537
|
} else {
|
|
538
|
-
_ModelConverter.
|
|
538
|
+
_ModelConverter.zq(
|
|
539
539
|
rnEntities,
|
|
540
540
|
channel,
|
|
541
541
|
samplerObject,
|
|
@@ -563,14 +563,14 @@ var ModelConverter = class _ModelConverter {
|
|
|
563
563
|
* @param rnMaterials - Array of Rhodonite materials
|
|
564
564
|
* @param gltfModel - The glTF model data
|
|
565
565
|
*/
|
|
566
|
-
static
|
|
566
|
+
static yq(rnEntities, channel, samplerObject, animation, animInputArray, animOutputArray, interpolation, animationAttributeType, rnMaterials, gltfModel) {
|
|
567
567
|
const pointer = channel.target.extensions.KHR_animation_pointer.pointer;
|
|
568
568
|
const matchNodes = pointer.match(/^\/nodes\/([0-9]+)\//);
|
|
569
569
|
const matchMaterials = pointer.match(/^\/materials\/([0-9]+)\//);
|
|
570
570
|
const matchLights = pointer.match(/^\/extensions\/KHR_lights_punctual\/lights\/([0-9]+)\//);
|
|
571
571
|
const matchCameras = pointer.match(/^\/cameras\/([0-9]+)\//);
|
|
572
572
|
if (matchMaterials) {
|
|
573
|
-
_ModelConverter.
|
|
573
|
+
_ModelConverter.Aq(
|
|
574
574
|
matchMaterials,
|
|
575
575
|
rnMaterials,
|
|
576
576
|
pointer,
|
|
@@ -582,7 +582,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
582
582
|
animationAttributeType
|
|
583
583
|
);
|
|
584
584
|
} else if (matchNodes) {
|
|
585
|
-
_ModelConverter.
|
|
585
|
+
_ModelConverter.Bq(
|
|
586
586
|
matchNodes,
|
|
587
587
|
rnEntities,
|
|
588
588
|
pointer,
|
|
@@ -594,7 +594,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
594
594
|
animationAttributeType
|
|
595
595
|
);
|
|
596
596
|
} else if (matchLights) {
|
|
597
|
-
_ModelConverter.
|
|
597
|
+
_ModelConverter.Cq(
|
|
598
598
|
matchLights,
|
|
599
599
|
rnEntities,
|
|
600
600
|
pointer,
|
|
@@ -607,7 +607,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
607
607
|
gltfModel
|
|
608
608
|
);
|
|
609
609
|
} else if (matchCameras) {
|
|
610
|
-
_ModelConverter.
|
|
610
|
+
_ModelConverter.Dq(
|
|
611
611
|
matchCameras,
|
|
612
612
|
rnEntities,
|
|
613
613
|
pointer,
|
|
@@ -636,7 +636,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
636
636
|
* @param animationAttributeType - Type of animation attribute
|
|
637
637
|
* @param gltfModel - The glTF model data
|
|
638
638
|
*/
|
|
639
|
-
static
|
|
639
|
+
static Dq(match, rnEntities, pointer, samplerObject, animation, animInputArray, animOutputArray, interpolation, _animationAttributeType, gltfModel) {
|
|
640
640
|
const cameraIndex = Number.parseInt(match[1], 10);
|
|
641
641
|
const nodes = gltfModel.nodes;
|
|
642
642
|
for (let i = 0; i < nodes.length; i++) {
|
|
@@ -701,7 +701,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
701
701
|
* @param animationAttributeType - Type of animation attribute
|
|
702
702
|
* @param gltfModel - The glTF model data
|
|
703
703
|
*/
|
|
704
|
-
static
|
|
704
|
+
static Cq(match, rnEntities, pointer, samplerObject, animation, animInputArray, animOutputArray, interpolation, _animationAttributeType, gltfModel) {
|
|
705
705
|
var _a;
|
|
706
706
|
const lightIndex = Number.parseInt(match[1], 10);
|
|
707
707
|
const nodes = gltfModel.nodes;
|
|
@@ -769,7 +769,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
769
769
|
* @param interpolation - Interpolation method
|
|
770
770
|
* @param animationAttributeType - Type of animation attribute
|
|
771
771
|
*/
|
|
772
|
-
static
|
|
772
|
+
static Bq(match, rnEntities, pointer, samplerObject, animation, animInputArray, animOutputArray, interpolation, _animationAttributeType) {
|
|
773
773
|
const nodeIndex = Number.parseInt(match[1], 10);
|
|
774
774
|
const rnEntity = rnEntities[nodeIndex];
|
|
775
775
|
if (Is.not.exist(rnEntity)) {
|
|
@@ -837,7 +837,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
837
837
|
* @param interpolation - Interpolation method
|
|
838
838
|
* @param animationAttributeType - Type of animation attribute
|
|
839
839
|
*/
|
|
840
|
-
static
|
|
840
|
+
static Aq(match, rnMaterials, pointer, samplerObject, animation, animInputArray, animOutputArray, interpolation, _animationAttributeType) {
|
|
841
841
|
const materialIndex = Number.parseInt(match[1], 10);
|
|
842
842
|
const material = rnMaterials[materialIndex];
|
|
843
843
|
if (Is.not.exist(material)) {
|
|
@@ -907,7 +907,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
907
907
|
* @param interpolation - Interpolation method
|
|
908
908
|
* @param animationAttributeType - Type of animation attribute
|
|
909
909
|
*/
|
|
910
|
-
static
|
|
910
|
+
static zq(rnEntities, channel, samplerObject, animation, animInputArray, animOutputArray, interpolation, animationAttributeType) {
|
|
911
911
|
const rnEntity = rnEntities[channel.target.node];
|
|
912
912
|
if (Is.exist(rnEntity)) {
|
|
913
913
|
let animationComponent = rnEntity.tryToGetAnimation();
|
|
@@ -963,7 +963,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
963
963
|
const newRnEntity = engine.entityRepository.addComponentToEntity(SkeletalComponent, rnEntity);
|
|
964
964
|
skeletalComponent = newRnEntity.getSkeletal();
|
|
965
965
|
const inverseBindMatAccessor = node.skinObject.inverseBindMatricesObject;
|
|
966
|
-
const rnAccessorOfInverseBindMat = Is.exist(inverseBindMatAccessor) ? this.
|
|
966
|
+
const rnAccessorOfInverseBindMat = Is.exist(inverseBindMatAccessor) ? this.aq(engine, inverseBindMatAccessor, rnBuffers) : void 0;
|
|
967
967
|
if (forcedBoneDataType != null) {
|
|
968
968
|
skeletalComponent.setBoneDataType(forcedBoneDataType);
|
|
969
969
|
} else {
|
|
@@ -987,7 +987,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
987
987
|
}
|
|
988
988
|
const joints = node.skinObject.joints.map((i) => rnEntities[i].getSceneGraph());
|
|
989
989
|
skeletalComponent.setJoints(joints);
|
|
990
|
-
const skeletonRoot = Is.exist(node.skinObject.skeleton) ? rnEntities[node.skinObject.skeleton].getSceneGraph() : this.
|
|
990
|
+
const skeletonRoot = Is.exist(node.skinObject.skeleton) ? rnEntities[node.skinObject.skeleton].getSceneGraph() : this.Eq(joints);
|
|
991
991
|
skeletalComponent.topOfJointsHierarchy = skeletonRoot != null ? skeletonRoot : joints[0];
|
|
992
992
|
if (skeletonRoot != null) {
|
|
993
993
|
skeletonRoot.isRootJoint = true;
|
|
@@ -1003,7 +1003,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1003
1003
|
* glTF's `skin.skeleton` is optional; when it is omitted, the common root of the
|
|
1004
1004
|
* joints is the root of the skin's joint hierarchy.
|
|
1005
1005
|
*/
|
|
1006
|
-
static
|
|
1006
|
+
static Eq(joints) {
|
|
1007
1007
|
if (joints.length === 0) {
|
|
1008
1008
|
return void 0;
|
|
1009
1009
|
}
|
|
@@ -1039,7 +1039,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1039
1039
|
* glTF requires implementations to calculate normals when they are absent; without
|
|
1040
1040
|
* them lit materials receive a zero normal and shade incorrectly (black or NaN).
|
|
1041
1041
|
*/
|
|
1042
|
-
static
|
|
1042
|
+
static Fq(engine, primitive, indicesAccessor) {
|
|
1043
1043
|
if (Is.exist(primitive.getAttribute(VertexAttribute.Normal.XYZ))) {
|
|
1044
1044
|
return;
|
|
1045
1045
|
}
|
|
@@ -1129,7 +1129,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1129
1129
|
* @param rnSamplers - Array of Rhodonite samplers
|
|
1130
1130
|
* @returns Object containing arrays of entities and entities by name
|
|
1131
1131
|
*/
|
|
1132
|
-
static
|
|
1132
|
+
static jq(engine, gltfModel, rnBuffers, rnMaterials, rnTextures, rnSamplers) {
|
|
1133
1133
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
1134
1134
|
const rnEntities = [];
|
|
1135
1135
|
const rnEntitiesByNames = /* @__PURE__ */ new Map();
|
|
@@ -1138,7 +1138,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1138
1138
|
let entity;
|
|
1139
1139
|
if (node.mesh != null) {
|
|
1140
1140
|
const meshIdx = node.mesh;
|
|
1141
|
-
const meshEntity = this.
|
|
1141
|
+
const meshEntity = this.Gq(
|
|
1142
1142
|
engine,
|
|
1143
1143
|
node.meshObject,
|
|
1144
1144
|
meshIdx,
|
|
@@ -1157,14 +1157,14 @@ var ModelConverter = class _ModelConverter {
|
|
|
1157
1157
|
}
|
|
1158
1158
|
entity = meshEntity;
|
|
1159
1159
|
} else if (node.cameraObject != null) {
|
|
1160
|
-
const cameraEntity = this.
|
|
1160
|
+
const cameraEntity = this.Hq(engine, node.cameraObject, gltfModel);
|
|
1161
1161
|
let entityWithOptionalLight = cameraEntity;
|
|
1162
1162
|
if (((_b = node.extensions) == null ? void 0 : _b.KHR_lights_punctual) != null) {
|
|
1163
1163
|
const lightEntity = engine.entityRepository.addComponentToEntity(
|
|
1164
1164
|
LightComponent,
|
|
1165
1165
|
cameraEntity
|
|
1166
1166
|
);
|
|
1167
|
-
this.
|
|
1167
|
+
this.lq(lightEntity.getLight(), node.extensions.KHR_lights_punctual.light);
|
|
1168
1168
|
lightEntity.getCamera().isSyncToLight = true;
|
|
1169
1169
|
entityWithOptionalLight = lightEntity;
|
|
1170
1170
|
}
|
|
@@ -1173,10 +1173,10 @@ var ModelConverter = class _ModelConverter {
|
|
|
1173
1173
|
}
|
|
1174
1174
|
entity = entityWithOptionalLight;
|
|
1175
1175
|
} else if ((_c = node.extensions) == null ? void 0 : _c.KHR_lights_punctual) {
|
|
1176
|
-
const lightEntity = this.
|
|
1176
|
+
const lightEntity = this.Iq(engine, node.extensions.KHR_lights_punctual.light, gltfModel);
|
|
1177
1177
|
entity = lightEntity;
|
|
1178
1178
|
} else {
|
|
1179
|
-
const group = this.
|
|
1179
|
+
const group = this.dq(engine, gltfModel);
|
|
1180
1180
|
if (node.name) {
|
|
1181
1181
|
group.tryToSetUniqueName(node.name, true);
|
|
1182
1182
|
}
|
|
@@ -1209,7 +1209,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1209
1209
|
entity = raymarchingEntity;
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
|
-
if (this.
|
|
1212
|
+
if (this.Jq(node, gltfModel)) {
|
|
1213
1213
|
let weights = [];
|
|
1214
1214
|
if (node.weights) {
|
|
1215
1215
|
weights = node.weights;
|
|
@@ -1245,7 +1245,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1245
1245
|
* @param gltfModel - The glTF model data
|
|
1246
1246
|
* @returns True if the node supports morphing
|
|
1247
1247
|
*/
|
|
1248
|
-
static
|
|
1248
|
+
static Jq(node, gltfModel) {
|
|
1249
1249
|
var _a, _b, _c;
|
|
1250
1250
|
const argument = (_b = (_a = gltfModel.asset.extras) == null ? void 0 : _a.rnLoaderOptions) == null ? void 0 : _b.defaultMaterialHelperArgumentArray[0];
|
|
1251
1251
|
if ((argument == null ? void 0 : argument.isMorphing) === false) {
|
|
@@ -1259,10 +1259,10 @@ var ModelConverter = class _ModelConverter {
|
|
|
1259
1259
|
* @param gltfModel - The glTF model data
|
|
1260
1260
|
* @returns Configured light entity
|
|
1261
1261
|
*/
|
|
1262
|
-
static
|
|
1263
|
-
const lightEntity = this.
|
|
1262
|
+
static Iq(engine, light, gltfModel) {
|
|
1263
|
+
const lightEntity = this.sq(engine, gltfModel);
|
|
1264
1264
|
const lightComponent = lightEntity.getComponent(LightComponent);
|
|
1265
|
-
this.
|
|
1265
|
+
this.lq(lightComponent, light);
|
|
1266
1266
|
if (lightComponent.castShadow) {
|
|
1267
1267
|
attachLightShadowCamera(engine, lightEntity);
|
|
1268
1268
|
}
|
|
@@ -1274,7 +1274,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1274
1274
|
* @param lightComponent - The component to configure
|
|
1275
1275
|
* @param light - The glTF light data
|
|
1276
1276
|
*/
|
|
1277
|
-
static
|
|
1277
|
+
static lq(lightComponent, light) {
|
|
1278
1278
|
var _a, _b, _c;
|
|
1279
1279
|
if (light.name != null) {
|
|
1280
1280
|
lightComponent.tryToSetUniqueName(light.name, true);
|
|
@@ -1320,8 +1320,8 @@ var ModelConverter = class _ModelConverter {
|
|
|
1320
1320
|
* @param gltfModel - The glTF model data
|
|
1321
1321
|
* @returns Configured camera entity
|
|
1322
1322
|
*/
|
|
1323
|
-
static
|
|
1324
|
-
const cameraEntity = this.
|
|
1323
|
+
static Hq(engine, camera, gltfModel) {
|
|
1324
|
+
const cameraEntity = this.rq(engine, gltfModel);
|
|
1325
1325
|
const cameraComponent = cameraEntity.getCamera();
|
|
1326
1326
|
cameraComponent.direction = Vector3.fromCopyArray([0, 0, -1]);
|
|
1327
1327
|
if (gltfModel.asset && gltfModel.asset.LastSaved_ApplicationVendor) {
|
|
@@ -1371,9 +1371,9 @@ var ModelConverter = class _ModelConverter {
|
|
|
1371
1371
|
* @param rnSamplers - Array of Rhodonite samplers
|
|
1372
1372
|
* @returns Configured mesh entity
|
|
1373
1373
|
*/
|
|
1374
|
-
static
|
|
1374
|
+
static Gq(engine, mesh, meshIndex, rnBuffers, gltfModel, rnMaterials, rnTextures, rnSamplers) {
|
|
1375
1375
|
var _a, _b, _c, _d, _e;
|
|
1376
|
-
const meshEntity = this.
|
|
1376
|
+
const meshEntity = this.qq(engine, gltfModel);
|
|
1377
1377
|
const existingRnMesh = (_a = gltfModel.asset.extras.rnMeshesAtGltMeshIdx[meshIndex]) == null ? void 0 : _a.deref();
|
|
1378
1378
|
let rnPrimitiveMode = PrimitiveMode.Triangles;
|
|
1379
1379
|
const meshComponent = meshEntity.getMesh();
|
|
@@ -1403,7 +1403,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1403
1403
|
rnPrimitiveMode = PrimitiveMode.from(primitive.mode);
|
|
1404
1404
|
}
|
|
1405
1405
|
const rnPrimitive = new Primitive(engine);
|
|
1406
|
-
const rnMaterial = primitive.material != null ? rnMaterials[primitive.material] : this.
|
|
1406
|
+
const rnMaterial = primitive.material != null ? rnMaterials[primitive.material] : this.wk(engine, gltfModel, rnTextures, rnSamplers);
|
|
1407
1407
|
setupMaterialVariants(rnPrimitive, primitive);
|
|
1408
1408
|
if (rnMaterial.materialTypeName.indexOf("MToon") !== -1) {
|
|
1409
1409
|
const VRMProperties = gltfModel.extensions.VRM;
|
|
@@ -1420,13 +1420,13 @@ var ModelConverter = class _ModelConverter {
|
|
|
1420
1420
|
let indicesRnAccessor;
|
|
1421
1421
|
const map = /* @__PURE__ */ new Map();
|
|
1422
1422
|
if ((_e = primitive.extensions) == null ? void 0 : _e.KHR_draco_mesh_compression) {
|
|
1423
|
-
indicesRnAccessor = this.
|
|
1423
|
+
indicesRnAccessor = this.yp(engine, primitive, rnBuffers, gltfModel, map);
|
|
1424
1424
|
if (Is.not.exist(indicesRnAccessor)) {
|
|
1425
1425
|
break;
|
|
1426
1426
|
}
|
|
1427
1427
|
} else {
|
|
1428
1428
|
if (Is.exist(primitive.indices)) {
|
|
1429
|
-
indicesRnAccessor = this.
|
|
1429
|
+
indicesRnAccessor = this.aq(engine, primitive.indicesObject, rnBuffers);
|
|
1430
1430
|
}
|
|
1431
1431
|
const rnBufferViewMap = /* @__PURE__ */ new Map();
|
|
1432
1432
|
for (const attributeName in primitive.attributesObjects) {
|
|
@@ -1436,7 +1436,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1436
1436
|
if (Is.exist(rnm2attribute.bufferView)) {
|
|
1437
1437
|
rnBufferView = rnBufferViewMap.get(rnm2attribute.bufferView);
|
|
1438
1438
|
if (Is.not.exist(rnBufferView)) {
|
|
1439
|
-
rnBufferView = this.
|
|
1439
|
+
rnBufferView = this.bq(rnm2attribute.bufferViewObject, rnBuffer);
|
|
1440
1440
|
rnBufferViewMap.set(rnm2attribute.bufferView, rnBufferView);
|
|
1441
1441
|
}
|
|
1442
1442
|
} else {
|
|
@@ -1445,7 +1445,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1445
1445
|
byteStride: 0
|
|
1446
1446
|
}).unwrapForce();
|
|
1447
1447
|
}
|
|
1448
|
-
const attributeRnAccessor = this.
|
|
1448
|
+
const attributeRnAccessor = this.cq(engine, rnm2attribute, rnBufferView);
|
|
1449
1449
|
const joinedString = VertexAttribute.toVertexAttributeSemanticJoinedStringAsGltfStyle(
|
|
1450
1450
|
VertexAttribute.fromString(attributeName)
|
|
1451
1451
|
);
|
|
@@ -1453,7 +1453,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1453
1453
|
}
|
|
1454
1454
|
}
|
|
1455
1455
|
rnPrimitive.setData(map, rnPrimitiveMode, rnMaterial, indicesRnAccessor);
|
|
1456
|
-
this.
|
|
1456
|
+
this.Fq(engine, rnPrimitive, indicesRnAccessor);
|
|
1457
1457
|
if (primitive.targets != null) {
|
|
1458
1458
|
const targets = [];
|
|
1459
1459
|
for (let i2 = 0; i2 < primitive.targetsObjects.length; i2++) {
|
|
@@ -1461,8 +1461,8 @@ var ModelConverter = class _ModelConverter {
|
|
|
1461
1461
|
const targetMap = /* @__PURE__ */ new Map();
|
|
1462
1462
|
for (const attributeName in target) {
|
|
1463
1463
|
const attributeAccessor = target[attributeName];
|
|
1464
|
-
const attributeRnAccessor = this.
|
|
1465
|
-
const attributeRnAccessorInGPUVertexData = this.
|
|
1464
|
+
const attributeRnAccessor = this.aq(engine, attributeAccessor, rnBuffers);
|
|
1465
|
+
const attributeRnAccessorInGPUVertexData = this.Kq(
|
|
1466
1466
|
engine,
|
|
1467
1467
|
attributeRnAccessor
|
|
1468
1468
|
);
|
|
@@ -1535,7 +1535,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1535
1535
|
* @param rnLoaderOptions - Loader options
|
|
1536
1536
|
* @returns Configured material or undefined if not VRM 1.0
|
|
1537
1537
|
*/
|
|
1538
|
-
static
|
|
1538
|
+
static Lq(engine, gltfModel, materialJson, rnLoaderOptions) {
|
|
1539
1539
|
var _a;
|
|
1540
1540
|
const VRMProperties = gltfModel.extensions.VRM;
|
|
1541
1541
|
const VRMC_materials_mtoon = (_a = materialJson.extensions) == null ? void 0 : _a.VRMC_materials_mtoon;
|
|
@@ -1551,13 +1551,13 @@ var ModelConverter = class _ModelConverter {
|
|
|
1551
1551
|
const additionalName = defaultMaterialHelperArgument.additionalName;
|
|
1552
1552
|
const isMorphing = true;
|
|
1553
1553
|
const isSkinning = true;
|
|
1554
|
-
const isLighting = this.
|
|
1554
|
+
const isLighting = this.fq(gltfModel, materialJson);
|
|
1555
1555
|
const useTangentAttribute = true;
|
|
1556
1556
|
const textures = defaultMaterialHelperArgument.textures;
|
|
1557
1557
|
const samplers = defaultMaterialHelperArgument.samplers;
|
|
1558
1558
|
const debugMode = defaultMaterialHelperArgument.debugMode;
|
|
1559
1559
|
const maxInstancesNumber = defaultMaterialHelperArgument.maxInstancesNumber;
|
|
1560
|
-
const makeOutputSrgb = this.
|
|
1560
|
+
const makeOutputSrgb = this.gq(gltfModel);
|
|
1561
1561
|
let renderPassOutline;
|
|
1562
1562
|
if (Is.exist(VRMProperties == null ? void 0 : VRMProperties.rnExtension)) {
|
|
1563
1563
|
const rnExtension = VRMProperties.rnExtension;
|
|
@@ -1703,7 +1703,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1703
1703
|
* @param rnLoaderOptions - Loader options
|
|
1704
1704
|
* @returns Configured material or undefined if not VRM 0.x
|
|
1705
1705
|
*/
|
|
1706
|
-
static
|
|
1706
|
+
static Mq(engine, gltfModel, materialJson, rnLoaderOptions) {
|
|
1707
1707
|
const VRMProperties = gltfModel.extensions.VRM;
|
|
1708
1708
|
const materialProperties = materialJson.extras.vrm0xMaterialProperty;
|
|
1709
1709
|
const shaderName = materialProperties.shader;
|
|
@@ -1719,13 +1719,13 @@ var ModelConverter = class _ModelConverter {
|
|
|
1719
1719
|
const additionalName = defaultMaterialHelperArgument.additionalName;
|
|
1720
1720
|
const isMorphing = true;
|
|
1721
1721
|
const isSkinning = true;
|
|
1722
|
-
const isLighting = this.
|
|
1722
|
+
const isLighting = this.fq(gltfModel, materialJson);
|
|
1723
1723
|
const useTangentAttribute = true;
|
|
1724
1724
|
const textures = defaultMaterialHelperArgument.textures;
|
|
1725
1725
|
const samplers = defaultMaterialHelperArgument.samplers;
|
|
1726
1726
|
const debugMode = defaultMaterialHelperArgument.debugMode;
|
|
1727
1727
|
const maxInstancesNumber = defaultMaterialHelperArgument.maxInstancesNumber;
|
|
1728
|
-
const makeOutputSrgb = this.
|
|
1728
|
+
const makeOutputSrgb = this.gq(gltfModel);
|
|
1729
1729
|
let renderPassOutline;
|
|
1730
1730
|
if (Is.exist(VRMProperties == null ? void 0 : VRMProperties.rnExtension)) {
|
|
1731
1731
|
const rnExtension = VRMProperties.rnExtension;
|
|
@@ -1784,7 +1784,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1784
1784
|
* @param materialJson - The material JSON data (optional)
|
|
1785
1785
|
* @returns Generated material
|
|
1786
1786
|
*/
|
|
1787
|
-
static
|
|
1787
|
+
static Nq(engine, gltfModel, rnTextures, rnSamplers, materialJson) {
|
|
1788
1788
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
1789
1789
|
const isTranslucent = Is.exist((_a = materialJson == null ? void 0 : materialJson.extensions) == null ? void 0 : _a.KHR_materials_transmission);
|
|
1790
1790
|
if (((_b = gltfModel.asset.extras) == null ? void 0 : _b.rnLoaderOptions) != null) {
|
|
@@ -1795,8 +1795,8 @@ var ModelConverter = class _ModelConverter {
|
|
|
1795
1795
|
return loaderExtension.generateMaterial(materialJson);
|
|
1796
1796
|
}
|
|
1797
1797
|
}
|
|
1798
|
-
if (rnLoaderOptions2.
|
|
1799
|
-
const material2 = this.
|
|
1798
|
+
if (rnLoaderOptions2.Qp) {
|
|
1799
|
+
const material2 = this.Mq(engine, gltfModel, materialJson, rnLoaderOptions2);
|
|
1800
1800
|
if (Is.exist(material2)) {
|
|
1801
1801
|
material2.isTranslucent = isTranslucent;
|
|
1802
1802
|
return material2;
|
|
@@ -1814,7 +1814,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1814
1814
|
}
|
|
1815
1815
|
const isMorphing = true;
|
|
1816
1816
|
const isSkinning = true;
|
|
1817
|
-
const isLighting = this.
|
|
1817
|
+
const isLighting = this.fq(gltfModel, materialJson);
|
|
1818
1818
|
const additionalName = "";
|
|
1819
1819
|
const rnLoaderOptions = (_i = (_h = gltfModel.asset.extras) == null ? void 0 : _h.rnLoaderOptions) != null ? _i : {};
|
|
1820
1820
|
const useNormalTexture = (materialJson == null ? void 0 : materialJson.normalTexture) != null;
|
|
@@ -1843,7 +1843,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1843
1843
|
if (Is.exist(materialJson)) {
|
|
1844
1844
|
if (((_t = materialJson.extensions) == null ? void 0 : _t.VRMC_materials_mtoon) != null) {
|
|
1845
1845
|
const rnLoaderOptions2 = gltfModel.asset.extras.rnLoaderOptions;
|
|
1846
|
-
const material2 = this.
|
|
1846
|
+
const material2 = this.Lq(engine, gltfModel, materialJson, rnLoaderOptions2);
|
|
1847
1847
|
if (Is.exist(material2)) {
|
|
1848
1848
|
material2.isTranslucent = isTranslucent;
|
|
1849
1849
|
return material2;
|
|
@@ -1869,7 +1869,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1869
1869
|
}
|
|
1870
1870
|
if (Number.parseFloat((_u = gltfModel.asset) == null ? void 0 : _u.version) >= 2) {
|
|
1871
1871
|
const material2 = createPbrUberMaterial(engine, pbrUberMaterialOptions);
|
|
1872
|
-
const makeOutputSrgb = this.
|
|
1872
|
+
const makeOutputSrgb = this.gq(gltfModel);
|
|
1873
1873
|
if (Is.exist(makeOutputSrgb)) {
|
|
1874
1874
|
material2.setParameter("makeOutputSrgb", makeOutputSrgb);
|
|
1875
1875
|
}
|
|
@@ -1891,7 +1891,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1891
1891
|
* @param materialJson - The material JSON data (optional)
|
|
1892
1892
|
* @returns True if lighting should be enabled
|
|
1893
1893
|
*/
|
|
1894
|
-
static
|
|
1894
|
+
static fq(gltfModel, materialJson) {
|
|
1895
1895
|
var _a, _b, _c, _d;
|
|
1896
1896
|
const argument = (_c = (_b = (_a = gltfModel == null ? void 0 : gltfModel.asset) == null ? void 0 : _a.extras) == null ? void 0 : _b.rnLoaderOptions) == null ? void 0 : _c.defaultMaterialHelperArgumentArray[0];
|
|
1897
1897
|
if ((argument == null ? void 0 : argument.isLighting) != null) {
|
|
@@ -1905,7 +1905,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1905
1905
|
* @param primitive - The glTF primitive data
|
|
1906
1906
|
* @returns True if tangent attributes should be used
|
|
1907
1907
|
*/
|
|
1908
|
-
static
|
|
1908
|
+
static Qq(gltfModel, primitive) {
|
|
1909
1909
|
var _a, _b, _c;
|
|
1910
1910
|
const tangentCalculationMode = (_c = (_b = (_a = gltfModel == null ? void 0 : gltfModel.asset) == null ? void 0 : _a.extras) == null ? void 0 : _b.rnLoaderOptions) == null ? void 0 : _c.tangentCalculationMode;
|
|
1911
1911
|
switch (tangentCalculationMode) {
|
|
@@ -1928,7 +1928,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
1928
1928
|
}
|
|
1929
1929
|
return false;
|
|
1930
1930
|
}
|
|
1931
|
-
static
|
|
1931
|
+
static Rq(gltfModel) {
|
|
1932
1932
|
var _a, _b, _c, _d, _e, _f;
|
|
1933
1933
|
const argument = (_c = (_b = (_a = gltfModel == null ? void 0 : gltfModel.asset) == null ? void 0 : _a.extras) == null ? void 0 : _b.rnLoaderOptions) == null ? void 0 : _c.defaultMaterialHelperArgumentArray[0];
|
|
1934
1934
|
if ((argument == null ? void 0 : argument.useNormalTexture) === false) {
|
|
@@ -1936,14 +1936,14 @@ var ModelConverter = class _ModelConverter {
|
|
|
1936
1936
|
}
|
|
1937
1937
|
return ((_f = (_e = (_d = gltfModel == null ? void 0 : gltfModel.asset) == null ? void 0 : _d.extras) == null ? void 0 : _e.rnLoaderOptions) == null ? void 0 : _f.tangentCalculationMode) !== 0;
|
|
1938
1938
|
}
|
|
1939
|
-
static
|
|
1939
|
+
static gq(gltfModel) {
|
|
1940
1940
|
var _a, _b, _c;
|
|
1941
1941
|
const argument = (_c = (_b = (_a = gltfModel == null ? void 0 : gltfModel.asset) == null ? void 0 : _a.extras) == null ? void 0 : _b.rnLoaderOptions) == null ? void 0 : _c.defaultMaterialHelperArgumentArray[0];
|
|
1942
1942
|
return argument == null ? void 0 : argument.makeOutputSrgb;
|
|
1943
1943
|
}
|
|
1944
|
-
static
|
|
1944
|
+
static wk(engine, gltfModel, rnTextures, rnSamplers, materialJson) {
|
|
1945
1945
|
var _a;
|
|
1946
|
-
const material = this.
|
|
1946
|
+
const material = this.Nq(
|
|
1947
1947
|
engine,
|
|
1948
1948
|
gltfModel,
|
|
1949
1949
|
rnTextures,
|
|
@@ -2025,7 +2025,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2025
2025
|
}
|
|
2026
2026
|
if (alphaMode != null) {
|
|
2027
2027
|
material.alphaMode = AlphaMode.fromGlTFString(alphaMode);
|
|
2028
|
-
if (material.alphaMode === AlphaMode.Mask && !((_e = (_d = gltfModel.asset.extras) == null ? void 0 : _d.rnLoaderOptions) == null ? void 0 : _e.
|
|
2028
|
+
if (material.alphaMode === AlphaMode.Mask && !((_e = (_d = gltfModel.asset.extras) == null ? void 0 : _d.rnLoaderOptions) == null ? void 0 : _e.Qp)) {
|
|
2029
2029
|
material.setParameter("alphaCutoff", Scalar.fromCopyNumber((_f = materialJson.alphaCutoff) != null ? _f : 0.5));
|
|
2030
2030
|
}
|
|
2031
2031
|
}
|
|
@@ -2112,7 +2112,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2112
2112
|
static getRaymarchingMaterialTextureAssignments(gltfModel) {
|
|
2113
2113
|
var _a;
|
|
2114
2114
|
const extension = (_a = gltfModel.extensions) == null ? void 0 : _a.RHODONITE_raymarching_materials;
|
|
2115
|
-
return this.
|
|
2115
|
+
return this.mq(gltfModel, extension == null ? void 0 : extension.textures);
|
|
2116
2116
|
}
|
|
2117
2117
|
/**
|
|
2118
2118
|
* Parses the per-component texture assignments stored in the `RHODONITE_raymarching` node
|
|
@@ -2131,7 +2131,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2131
2131
|
const nodes = (_a = gltfModel.nodes) != null ? _a : [];
|
|
2132
2132
|
for (let nodeIndex = 0; nodeIndex < nodes.length; nodeIndex++) {
|
|
2133
2133
|
const extension = (_b = nodes[nodeIndex].extensions) == null ? void 0 : _b.RHODONITE_raymarching;
|
|
2134
|
-
for (const assignment of this.
|
|
2134
|
+
for (const assignment of this.mq(gltfModel, extension == null ? void 0 : extension.textures)) {
|
|
2135
2135
|
result.push({ nodeIndex, ...assignment });
|
|
2136
2136
|
}
|
|
2137
2137
|
}
|
|
@@ -2143,7 +2143,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2143
2143
|
* @param gltfModel - The imported glTF model
|
|
2144
2144
|
* @param textures - The extension's texture map
|
|
2145
2145
|
*/
|
|
2146
|
-
static
|
|
2146
|
+
static mq(gltfModel, textures) {
|
|
2147
2147
|
var _a, _b, _c;
|
|
2148
2148
|
if (textures == null || typeof textures !== "object") {
|
|
2149
2149
|
return [];
|
|
@@ -2182,7 +2182,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2182
2182
|
const result = /* @__PURE__ */ new Map();
|
|
2183
2183
|
const assignments = this.getRaymarchingMaterialTextureAssignments(gltfModel);
|
|
2184
2184
|
for (const { semantic, textureIndex, samplerIndex } of assignments) {
|
|
2185
|
-
const created = await this.
|
|
2185
|
+
const created = await this.nq(engine, gltfModel, textureIndex, samplerIndex);
|
|
2186
2186
|
if (created != null) {
|
|
2187
2187
|
result.set(semantic, created);
|
|
2188
2188
|
}
|
|
@@ -2205,7 +2205,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2205
2205
|
const result = /* @__PURE__ */ new Map();
|
|
2206
2206
|
const assignments = this.getRaymarchingComponentTextureAssignments(gltfModel);
|
|
2207
2207
|
for (const { nodeIndex, semantic, textureIndex, samplerIndex } of assignments) {
|
|
2208
|
-
const created = await this.
|
|
2208
|
+
const created = await this.nq(engine, gltfModel, textureIndex, samplerIndex);
|
|
2209
2209
|
if (created == null) {
|
|
2210
2210
|
continue;
|
|
2211
2211
|
}
|
|
@@ -2227,7 +2227,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2227
2227
|
* @param samplerIndex - The glTF sampler index of the texture
|
|
2228
2228
|
* @returns The created texture and sampler, or null when creation fails
|
|
2229
2229
|
*/
|
|
2230
|
-
static async
|
|
2230
|
+
static async nq(engine, gltfModel, textureIndex, samplerIndex) {
|
|
2231
2231
|
var _a;
|
|
2232
2232
|
try {
|
|
2233
2233
|
const gltfTexture = gltfModel.textures[textureIndex];
|
|
@@ -2245,13 +2245,13 @@ var ModelConverter = class _ModelConverter {
|
|
|
2245
2245
|
return null;
|
|
2246
2246
|
}
|
|
2247
2247
|
}
|
|
2248
|
-
static
|
|
2248
|
+
static Sq(textureOption) {
|
|
2249
2249
|
if (textureOption.wrapS !== TextureParameter.ClampToEdge || textureOption.wrapT !== TextureParameter.ClampToEdge || textureOption.minFilter !== TextureParameter.Linear && textureOption.minFilter !== TextureParameter.Nearest) {
|
|
2250
2250
|
return true;
|
|
2251
2251
|
}
|
|
2252
2252
|
return false;
|
|
2253
2253
|
}
|
|
2254
|
-
static
|
|
2254
|
+
static Tq(image) {
|
|
2255
2255
|
const width = image.width;
|
|
2256
2256
|
const height = image.height;
|
|
2257
2257
|
if ((width & width - 1) === 0 && (height & height - 1) === 0) {
|
|
@@ -2259,7 +2259,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2259
2259
|
}
|
|
2260
2260
|
return false;
|
|
2261
2261
|
}
|
|
2262
|
-
static
|
|
2262
|
+
static Uq(materialJson, _materialTypeName) {
|
|
2263
2263
|
if (materialJson == null) return false;
|
|
2264
2264
|
return true;
|
|
2265
2265
|
}
|
|
@@ -2270,7 +2270,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2270
2270
|
}
|
|
2271
2271
|
return false;
|
|
2272
2272
|
}
|
|
2273
|
-
static
|
|
2273
|
+
static $p(typedArrayClass, uint8Array, byteOffset, length) {
|
|
2274
2274
|
return new typedArrayClass(uint8Array.buffer, byteOffset + uint8Array.byteOffset, length);
|
|
2275
2275
|
}
|
|
2276
2276
|
static _checkBytesPerComponent(accessor) {
|
|
@@ -2378,8 +2378,8 @@ var ModelConverter = class _ModelConverter {
|
|
|
2378
2378
|
const byteLength = componentBytes * componentN * accessor.count;
|
|
2379
2379
|
if (Is.exist(rnBuffers)) {
|
|
2380
2380
|
const rnBuffer = rnBuffers[accessor.bufferViewObject.buffer];
|
|
2381
|
-
const rnBufferView = this.
|
|
2382
|
-
const rnAccessor = this.
|
|
2381
|
+
const rnBufferView = this.bq(bufferView, rnBuffer);
|
|
2382
|
+
const rnAccessor = this.cq(engine, accessor, rnBufferView);
|
|
2383
2383
|
uint8Array = rnAccessor.getUint8Array();
|
|
2384
2384
|
byteOffsetFromBuffer = 0;
|
|
2385
2385
|
}
|
|
@@ -2388,7 +2388,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2388
2388
|
if (_ModelConverter._isSystemLittleEndian()) {
|
|
2389
2389
|
let typedDataArray = new Float32Array();
|
|
2390
2390
|
if (dataViewMethod === "getFloat32") {
|
|
2391
|
-
typedDataArray = this
|
|
2391
|
+
typedDataArray = this.$p(
|
|
2392
2392
|
Float32Array,
|
|
2393
2393
|
uint8Array,
|
|
2394
2394
|
byteOffsetFromBuffer,
|
|
@@ -2407,35 +2407,35 @@ var ModelConverter = class _ModelConverter {
|
|
|
2407
2407
|
byteLength / componentBytes
|
|
2408
2408
|
);
|
|
2409
2409
|
} else if (dataViewMethod === "getInt16") {
|
|
2410
|
-
typedDataArray = this
|
|
2410
|
+
typedDataArray = this.$p(
|
|
2411
2411
|
Int16Array,
|
|
2412
2412
|
uint8Array,
|
|
2413
2413
|
byteOffsetFromBuffer,
|
|
2414
2414
|
byteLength / componentBytes
|
|
2415
2415
|
);
|
|
2416
2416
|
} else if (dataViewMethod === "getUint16") {
|
|
2417
|
-
typedDataArray = this
|
|
2417
|
+
typedDataArray = this.$p(
|
|
2418
2418
|
Uint16Array,
|
|
2419
2419
|
uint8Array,
|
|
2420
2420
|
byteOffsetFromBuffer,
|
|
2421
2421
|
byteLength / componentBytes
|
|
2422
2422
|
);
|
|
2423
2423
|
} else if (dataViewMethod === "getInt32") {
|
|
2424
|
-
typedDataArray = this
|
|
2424
|
+
typedDataArray = this.$p(
|
|
2425
2425
|
Int32Array,
|
|
2426
2426
|
uint8Array,
|
|
2427
2427
|
byteOffsetFromBuffer,
|
|
2428
2428
|
byteLength / componentBytes
|
|
2429
2429
|
);
|
|
2430
2430
|
} else if (dataViewMethod === "getUint32") {
|
|
2431
|
-
typedDataArray = this
|
|
2431
|
+
typedDataArray = this.$p(
|
|
2432
2432
|
Uint32Array,
|
|
2433
2433
|
uint8Array,
|
|
2434
2434
|
byteOffsetFromBuffer,
|
|
2435
2435
|
byteLength / componentBytes
|
|
2436
2436
|
);
|
|
2437
2437
|
}
|
|
2438
|
-
float32Array = this.
|
|
2438
|
+
float32Array = this.oq(dataViewMethod, typedDataArray);
|
|
2439
2439
|
} else {
|
|
2440
2440
|
const dataView = new DataView(uint8Array.buffer, byteOffsetFromBuffer + uint8Array.byteOffset, byteLength);
|
|
2441
2441
|
const byteDelta = componentBytes * componentN;
|
|
@@ -2466,7 +2466,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2466
2466
|
break;
|
|
2467
2467
|
}
|
|
2468
2468
|
}
|
|
2469
|
-
float32Array = this.
|
|
2469
|
+
float32Array = this.oq(dataViewMethod, numberArray);
|
|
2470
2470
|
}
|
|
2471
2471
|
accessor.extras.typedDataArray = float32Array;
|
|
2472
2472
|
return float32Array;
|
|
@@ -2478,7 +2478,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2478
2478
|
* @param numberArray
|
|
2479
2479
|
* @returns
|
|
2480
2480
|
*/
|
|
2481
|
-
static
|
|
2481
|
+
static oq(dataViewMethod, numberArray) {
|
|
2482
2482
|
if (dataViewMethod === "getInt8") {
|
|
2483
2483
|
return DataUtil.normalizedInt8ArrayToFloat32Array(numberArray);
|
|
2484
2484
|
}
|
|
@@ -2505,7 +2505,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2505
2505
|
Logger.default.error("Not considered");
|
|
2506
2506
|
return new Float32Array();
|
|
2507
2507
|
}
|
|
2508
|
-
static
|
|
2508
|
+
static Vq(meshComponent) {
|
|
2509
2509
|
const primitiveNumber = meshComponent.mesh.getPrimitiveNumber();
|
|
2510
2510
|
let offsetSum = 0;
|
|
2511
2511
|
for (let i = 0; i < primitiveNumber; i++) {
|
|
@@ -2528,7 +2528,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2528
2528
|
* @param rnBuffer
|
|
2529
2529
|
* @returns
|
|
2530
2530
|
*/
|
|
2531
|
-
static
|
|
2531
|
+
static cq(engine, accessor, rnBufferView) {
|
|
2532
2532
|
var _a;
|
|
2533
2533
|
let rnAccessor;
|
|
2534
2534
|
if (rnBufferView != null) {
|
|
@@ -2572,17 +2572,17 @@ var ModelConverter = class _ModelConverter {
|
|
|
2572
2572
|
* @param rnBuffer
|
|
2573
2573
|
* @returns
|
|
2574
2574
|
*/
|
|
2575
|
-
static
|
|
2575
|
+
static aq(engine, accessor, rnBuffers) {
|
|
2576
2576
|
const gltfBufferView = accessor.bufferViewObject;
|
|
2577
2577
|
let rnBufferView;
|
|
2578
2578
|
if (gltfBufferView != null) {
|
|
2579
2579
|
const rnBuffer = rnBuffers[gltfBufferView.buffer];
|
|
2580
|
-
rnBufferView = this.
|
|
2580
|
+
rnBufferView = this.bq(gltfBufferView, rnBuffer);
|
|
2581
2581
|
}
|
|
2582
|
-
const rnAccessor = this.
|
|
2582
|
+
const rnAccessor = this.cq(engine, accessor, rnBufferView);
|
|
2583
2583
|
return rnAccessor;
|
|
2584
2584
|
}
|
|
2585
|
-
static
|
|
2585
|
+
static Kq(engine, srcRnAccessor) {
|
|
2586
2586
|
const byteSize = srcRnAccessor.elementCount * 3 * 4;
|
|
2587
2587
|
const dstRnBuffer = engine.memoryManager.createBufferOnDemand(BufferUse.GPUVertexData, byteSize, 16);
|
|
2588
2588
|
const dstRnBufferView = dstRnBuffer.takeBufferView({
|
|
@@ -2600,15 +2600,15 @@ var ModelConverter = class _ModelConverter {
|
|
|
2600
2600
|
dstRnAccessor.copyBuffer(srcRnAccessor);
|
|
2601
2601
|
return dstRnAccessor;
|
|
2602
2602
|
}
|
|
2603
|
-
static
|
|
2603
|
+
static pq(engine, accessor, compositionNum, rnBuffer) {
|
|
2604
2604
|
const rnBufferView = rnBuffer.takeBufferView({
|
|
2605
2605
|
byteLengthToNeed: accessor.count * compositionNum * 4,
|
|
2606
2606
|
byteStride: 0
|
|
2607
2607
|
}).unwrapForce();
|
|
2608
|
-
const rnAccessor = this.
|
|
2608
|
+
const rnAccessor = this.cq(engine, accessor, rnBufferView);
|
|
2609
2609
|
return rnAccessor;
|
|
2610
2610
|
}
|
|
2611
|
-
static
|
|
2611
|
+
static bq(rnm2bufferView, rnBuffer) {
|
|
2612
2612
|
var _a, _b;
|
|
2613
2613
|
const rnBufferView = rnBuffer.takeBufferViewWithByteOffset({
|
|
2614
2614
|
byteLengthToNeed: rnm2bufferView.byteLength,
|
|
@@ -2617,7 +2617,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2617
2617
|
}).unwrapForce();
|
|
2618
2618
|
return rnBufferView;
|
|
2619
2619
|
}
|
|
2620
|
-
static
|
|
2620
|
+
static zp(draco, decoder, arrayBuffer) {
|
|
2621
2621
|
const buffer = new draco.DecoderBuffer();
|
|
2622
2622
|
buffer.Init(new Int8Array(arrayBuffer), arrayBuffer.byteLength);
|
|
2623
2623
|
const geometryType = decoder.GetEncodedGeometryType(buffer);
|
|
@@ -2645,7 +2645,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2645
2645
|
draco.destroy(buffer);
|
|
2646
2646
|
return dracoGeometry;
|
|
2647
2647
|
}
|
|
2648
|
-
static
|
|
2648
|
+
static Oq(draco, decoder, dracoGeometry, triangleStripDrawMode) {
|
|
2649
2649
|
const geometryType = dracoGeometry.geometryType;
|
|
2650
2650
|
if (geometryType !== draco.TRIANGULAR_MESH) {
|
|
2651
2651
|
return void 0;
|
|
@@ -2675,28 +2675,28 @@ var ModelConverter = class _ModelConverter {
|
|
|
2675
2675
|
}
|
|
2676
2676
|
return indices;
|
|
2677
2677
|
}
|
|
2678
|
-
static
|
|
2678
|
+
static yp(engine, primitive, rnBuffers, gltfModel, map) {
|
|
2679
2679
|
var _a, _b;
|
|
2680
2680
|
const bufferView = gltfModel.bufferViews[(_a = primitive.extensions) == null ? void 0 : _a.KHR_draco_mesh_compression.bufferView];
|
|
2681
|
-
const rnBufferView = this.
|
|
2681
|
+
const rnBufferView = this.bq(bufferView, rnBuffers[bufferView.buffer]);
|
|
2682
2682
|
const arraybufferOfBufferView = new Uint8Array(rnBufferView.getUint8Array()).buffer;
|
|
2683
2683
|
const draco = new DracoDecoderModule();
|
|
2684
2684
|
const decoder = new draco.Decoder();
|
|
2685
|
-
const dracoGeometry = this.
|
|
2685
|
+
const dracoGeometry = this.zp(draco, decoder, arraybufferOfBufferView);
|
|
2686
2686
|
if (dracoGeometry == null) {
|
|
2687
2687
|
draco.destroy(dracoGeometry);
|
|
2688
2688
|
draco.destroy(decoder);
|
|
2689
2689
|
return void 0;
|
|
2690
2690
|
}
|
|
2691
2691
|
const numPoints = dracoGeometry.num_points();
|
|
2692
|
-
const rnBufferForDraco = this.
|
|
2692
|
+
const rnBufferForDraco = this.Pq(primitive, numPoints);
|
|
2693
2693
|
const primitiveMode = PrimitiveMode.from(primitive.mode);
|
|
2694
2694
|
let isTriangleStrip = false;
|
|
2695
2695
|
if (primitiveMode === PrimitiveMode.TriangleStrip) {
|
|
2696
2696
|
isTriangleStrip = true;
|
|
2697
2697
|
}
|
|
2698
|
-
const indices = this.
|
|
2699
|
-
const indicesRnAccessor = this.
|
|
2698
|
+
const indices = this.Oq(draco, decoder, dracoGeometry, isTriangleStrip);
|
|
2699
|
+
const indicesRnAccessor = this.pq(
|
|
2700
2700
|
engine,
|
|
2701
2701
|
primitive.indicesObject,
|
|
2702
2702
|
1,
|
|
@@ -2710,10 +2710,10 @@ var ModelConverter = class _ModelConverter {
|
|
|
2710
2710
|
const attributeGltf2Accessor = primitive.attributesObjects[attributeName];
|
|
2711
2711
|
let attributeRnAccessor;
|
|
2712
2712
|
if (Is.not.exist(dracoAttributeId)) {
|
|
2713
|
-
attributeRnAccessor = this.
|
|
2713
|
+
attributeRnAccessor = this.aq(engine, attributeGltf2Accessor, rnBuffers);
|
|
2714
2714
|
} else {
|
|
2715
2715
|
const compositionNum = CompositionType.fromString(attributeGltf2Accessor.type).getNumberOfComponents();
|
|
2716
|
-
attributeRnAccessor = this.
|
|
2716
|
+
attributeRnAccessor = this.pq(
|
|
2717
2717
|
engine,
|
|
2718
2718
|
attributeGltf2Accessor,
|
|
2719
2719
|
compositionNum,
|
|
@@ -2788,7 +2788,7 @@ var ModelConverter = class _ModelConverter {
|
|
|
2788
2788
|
rnMaterial.setParameter(textureTransformRotationShaderSemantic, rotation);
|
|
2789
2789
|
}
|
|
2790
2790
|
}
|
|
2791
|
-
static
|
|
2791
|
+
static Pq(primitive, numPoints) {
|
|
2792
2792
|
var _a;
|
|
2793
2793
|
let byteLengthOfBufferForDraco = 0;
|
|
2794
2794
|
if (Is.exist(primitive.indices)) {
|