rhodonite 0.26.0 → 0.27.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/VERSION-FILE +1 -1
- package/dist/esm/foundation/core/MemoryManager.d.ts +19 -0
- package/dist/esm/foundation/core/MemoryManager.js +2 -2
- package/dist/esm/foundation/definitions/ShaderSemantics.d.ts +1 -0
- package/dist/esm/foundation/definitions/ShaderSemantics.js +2 -2
- package/dist/esm/foundation/helpers/Shadow/ShadowSystem.js +1 -1
- package/dist/esm/foundation/helpers/materials/createNodeBasedRaymarchingMaterials.js +1 -1
- package/dist/esm/foundation/helpers/materials/nodeBasedMaterialCommon.js +1 -1
- package/dist/esm/foundation/importer/DrcPointCloudImporter.js +1 -1
- package/dist/esm/foundation/importer/Gltf2Importer.d.ts +2 -1
- package/dist/esm/foundation/importer/Gltf2Importer.js +1 -1
- package/dist/esm/foundation/importer/GltfImporter.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 +11 -11
- package/dist/esm/foundation/materials/contents/MToon1MaterialContent.js +6 -6
- package/dist/esm/foundation/materials/core/AbstractMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/core/Material.d.ts +7 -2
- package/dist/esm/foundation/materials/core/Material.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/memory/Accessor.js +6 -6
- package/dist/esm/foundation/memory/BufferView.js +1 -1
- package/dist/esm/foundation/misc/PngDecoder.d.ts +18 -0
- package/dist/esm/foundation/misc/PngDecoder.js +1 -0
- package/dist/esm/foundation/renderer/RenderPass.d.ts +7 -0
- package/dist/esm/foundation/renderer/RenderPass.js +1 -1
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +2 -1
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.js +1 -1
- package/dist/esm/foundation/system/Engine.js +1 -1
- package/dist/esm/foundation/textures/CubeTexture.d.ts +11 -2
- package/dist/esm/foundation/textures/CubeTexture.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTexture2DArray.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTextureCube.d.ts +6 -0
- package/dist/esm/foundation/textures/RenderTargetTextureCube.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/WebGLResourceRepository.d.ts +5 -0
- package/dist/esm/webgl/WebGLResourceRepository.js +3 -3
- package/dist/esm/webgl/WebGLStereoUtil.js +1 -1
- package/dist/esm/webgl/WebGLStrategyWebGL2.d.ts +19 -14
- package/dist/esm/webgl/WebGLStrategyWebGL2.js +67 -67
- package/dist/esm/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.glsl.js +2 -1
- package/dist/esm/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.glsl.js +1 -0
- package/dist/esm/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -0
- package/dist/esm/webgl/shaderity_shaders/common/iblDefinition.glsl.js +11 -5
- package/dist/esm/webgl/shaders/nodes/BlockBeginShader.js +1 -1
- package/dist/esm/webgl/shaders/nodes/BlockEndShader.js +1 -1
- package/dist/esm/webgl/shaders/nodes/ConstantVariableShader.js +5 -5
- package/dist/esm/webgl/shaders/nodes/RaymarchObjectIdUniform.js +3 -3
- package/dist/esm/webgl/shaders/nodes/SdApplyWorldMatrix.js +3 -3
- package/dist/esm/webgl/shaders/nodes/Texture2DShader.js +14 -14
- package/dist/esm/webgl/shaders/nodes/UniformDataShader.js +13 -13
- package/dist/esm/webgpu/GpuCullingRegistry.js +1 -1
- package/dist/esm/webgpu/GpuDeformRegistry.js +1 -1
- package/dist/esm/webgpu/WebGpuGpuTimer.js +1 -1
- package/dist/esm/webgpu/WebGpuResourceRepository.d.ts +6 -0
- package/dist/esm/webgpu/WebGpuResourceRepository.js +5 -5
- package/dist/esm/webgpu/WebGpuStrategyBasic.js +2 -2
- package/dist/esm/webgpu/WebGpuVertexDeformer.js +1 -1
- package/dist/esm/webgpu/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.wgsl.js +1 -0
- package/dist/esm/webgpu/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.wgsl.js +1 -0
- package/dist/esm/webgpu/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +1 -0
- package/dist/esm/webgpu/shaderity_shaders/common/iblDefinition.wgsl.js +10 -4
- package/dist/esmdev/foundation/core/MemoryManager.d.ts +19 -0
- package/dist/esmdev/foundation/core/MemoryManager.js +28 -3
- 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.d.ts +1 -0
- package/dist/esmdev/foundation/definitions/ShaderSemantics.js +12 -7
- 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 +106 -106
- package/dist/esmdev/foundation/geometry/ComplexVertexAttribute.js +18 -18
- package/dist/esmdev/foundation/geometry/Frustum.js +39 -39
- package/dist/esmdev/foundation/geometry/Mesh.js +205 -205
- package/dist/esmdev/foundation/geometry/Primitive.js +124 -124
- 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 +12 -12
- package/dist/esmdev/foundation/gizmos/CapsuleColliderGizmo.js +23 -23
- package/dist/esmdev/foundation/gizmos/Gizmo.js +23 -23
- package/dist/esmdev/foundation/gizmos/JointGizmo.js +35 -35
- package/dist/esmdev/foundation/gizmos/LightGizmo.js +23 -23
- package/dist/esmdev/foundation/gizmos/LocatorGizmo.js +22 -22
- package/dist/esmdev/foundation/gizmos/RotationGizmo.js +197 -197
- package/dist/esmdev/foundation/gizmos/ScaleGizmo.js +129 -129
- package/dist/esmdev/foundation/gizmos/ShapeGizmo.js +43 -43
- package/dist/esmdev/foundation/gizmos/SphereColliderGizmo.js +24 -24
- package/dist/esmdev/foundation/gizmos/TranslationGizmo.js +129 -129
- package/dist/esmdev/foundation/helpers/BloomHelper.js +28 -28
- package/dist/esmdev/foundation/helpers/GaussianBlurHelper.js +18 -18
- package/dist/esmdev/foundation/helpers/Shadow/PointShadowMap.js +11 -11
- package/dist/esmdev/foundation/helpers/Shadow/ShadowMap.js +5 -5
- package/dist/esmdev/foundation/helpers/Shadow/ShadowSystem.js +111 -111
- package/dist/esmdev/foundation/helpers/materials/createNodeBasedRaymarchingMaterials.js +10 -1
- package/dist/esmdev/foundation/helpers/materials/nodeBasedMaterialCommon.js +11 -1
- package/dist/esmdev/foundation/importer/AnimationAssigner.js +44 -44
- package/dist/esmdev/foundation/importer/DrcPointCloudImporter.js +27 -27
- package/dist/esmdev/foundation/importer/Gltf2Importer.d.ts +2 -1
- package/dist/esmdev/foundation/importer/Gltf2Importer.js +21 -17
- 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 +37 -28
- package/dist/esmdev/foundation/materials/contents/DepthEncodeMaterialContent.js +2 -2
- package/dist/esmdev/foundation/materials/contents/MToon0xMaterialContent.js +145 -137
- package/dist/esmdev/foundation/materials/contents/MToon1MaterialContent.js +27 -19
- package/dist/esmdev/foundation/materials/contents/ShadowMapDecodeClassicMaterialContent.js +5 -5
- package/dist/esmdev/foundation/materials/contents/VarianceShadowMapDecodeClassicMaterialContent.js +4 -4
- package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.js +47 -47
- package/dist/esmdev/foundation/materials/core/AbstractShaderNode.js +25 -25
- package/dist/esmdev/foundation/materials/core/DummyTextures.js +3 -3
- package/dist/esmdev/foundation/materials/core/Material.d.ts +7 -2
- package/dist/esmdev/foundation/materials/core/Material.js +113 -99
- package/dist/esmdev/foundation/materials/core/MaterialRepository.js +51 -51
- 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 +14 -14
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGPU.js +15 -15
- 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 +15 -15
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutShadingColorShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutUnionShaderNode.js +15 -15
- 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 +120 -120
- package/dist/esmdev/foundation/math/AnimatedQuaternion.js +53 -53
- package/dist/esmdev/foundation/math/AnimatedScalar.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedValueEvaluationState.js +18 -18
- package/dist/esmdev/foundation/math/AnimatedVector2.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedVector3.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedVector4.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedVectorN.js +54 -54
- 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 +3 -3
- package/dist/esmdev/foundation/math/Quaternion.js +13 -13
- package/dist/esmdev/foundation/math/Transform3D.js +72 -72
- package/dist/esmdev/foundation/math/shapes/MathSphere.js +7 -7
- package/dist/esmdev/foundation/memory/Accessor.js +369 -369
- package/dist/esmdev/foundation/memory/Buffer.js +39 -39
- package/dist/esmdev/foundation/memory/BufferView.js +29 -29
- package/dist/esmdev/foundation/misc/DataUtil.js +2 -2
- package/dist/esmdev/foundation/misc/EnumIO.js +8 -8
- package/dist/esmdev/foundation/misc/Logger.js +14 -14
- package/dist/esmdev/foundation/misc/PngDecoder.d.ts +18 -0
- package/dist/esmdev/foundation/misc/PngDecoder.js +113 -0
- package/dist/esmdev/foundation/misc/RnPromise.js +14 -14
- package/dist/esmdev/foundation/misc/Time.js +23 -23
- 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 +10 -10
- package/dist/esmdev/foundation/physics/Rapier/RapierCharacterControllerStrategy.js +186 -186
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsStrategy.js +221 -221
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsWorldQueryStrategy.js +3 -3
- package/dist/esmdev/foundation/physics/VRMSpring/CapsuleCollider.js +36 -36
- package/dist/esmdev/foundation/physics/VRMSpring/SphereCollider.js +26 -26
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBone.js +6 -6
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBonePhysicsStrategy.js +39 -39
- package/dist/esmdev/foundation/renderer/Expression.js +6 -6
- package/dist/esmdev/foundation/renderer/Frame.js +6 -6
- package/dist/esmdev/foundation/renderer/FrameBuffer.js +25 -25
- package/dist/esmdev/foundation/renderer/RenderPass.d.ts +7 -0
- package/dist/esmdev/foundation/renderer/RenderPass.js +94 -86
- package/dist/esmdev/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +6 -6
- package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.js +75 -75
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystem.js +146 -146
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystemStub.js +3 -3
- package/dist/esmdev/foundation/renderer/pipelines/DeferredRenderPipeline.js +4 -4
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +2 -1
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.js +420 -420
- package/dist/esmdev/foundation/system/Engine.js +209 -209
- 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 +3 -3
- package/dist/esmdev/foundation/textures/AbstractTexture.js +48 -48
- package/dist/esmdev/foundation/textures/CubeTexture.d.ts +11 -2
- package/dist/esmdev/foundation/textures/CubeTexture.js +47 -36
- package/dist/esmdev/foundation/textures/RenderBuffer.js +11 -11
- package/dist/esmdev/foundation/textures/RenderTargetTexture.js +24 -24
- package/dist/esmdev/foundation/textures/RenderTargetTexture2DArray.js +35 -35
- package/dist/esmdev/foundation/textures/RenderTargetTextureCube.d.ts +6 -0
- package/dist/esmdev/foundation/textures/RenderTargetTextureCube.js +25 -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 +146 -146
- package/dist/esmdev/webgl/WebGLGpuTimer.js +30 -30
- package/dist/esmdev/webgl/WebGLResourceRepository.d.ts +5 -0
- package/dist/esmdev/webgl/WebGLResourceRepository.js +368 -307
- package/dist/esmdev/webgl/WebGLStereoUtil.js +39 -39
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.d.ts +19 -14
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.js +294 -280
- package/dist/esmdev/webgl/debug/ShaderParameterDebugger.js +4 -4
- package/dist/esmdev/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/common/iblDefinition.glsl.js +2 -2
- 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/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 +24 -24
- package/dist/esmdev/webgpu/GpuCullingRegistry.js +91 -91
- 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 +51 -51
- package/dist/esmdev/webgpu/WebGpuLightClusterBuilder.js +36 -36
- package/dist/esmdev/webgpu/WebGpuResourceRepository.d.ts +6 -0
- package/dist/esmdev/webgpu/WebGpuResourceRepository.js +655 -593
- package/dist/esmdev/webgpu/WebGpuStrategyBasic.js +123 -123
- package/dist/esmdev/webgpu/WebGpuVertexDeformer.js +128 -128
- package/dist/esmdev/webgpu/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/common/iblDefinition.wgsl.js +2 -2
- package/dist/esmdev/xr/WebARSystem.js +69 -69
- package/dist/esmdev/xr/WebXRSystem.js +151 -151
- package/package.json +2 -1
|
@@ -45,46 +45,46 @@ import { MaterialRepository } from "../materials/core/MaterialRepository.js";
|
|
|
45
45
|
var _Engine = class _Engine extends RnObject {
|
|
46
46
|
constructor(processApproach, cgApiResourceRepository, maxGPUDataStorageSize, config, rnXRModule) {
|
|
47
47
|
super();
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
48
|
+
this.NA = ProcessApproach.None;
|
|
49
|
+
this.RA = new EngineState();
|
|
50
|
+
this.SA = 0;
|
|
51
|
+
this.UA = -1;
|
|
52
|
+
this.gB = [];
|
|
53
|
+
this.WA = new LightClusterSystemStub();
|
|
54
|
+
this.lB = false;
|
|
55
55
|
this.g = false;
|
|
56
|
-
this.YA = -1;
|
|
57
|
-
this.Lc = -1;
|
|
58
56
|
this.ZA = -1;
|
|
57
|
+
this.Lc = -1;
|
|
58
|
+
this._A = -1;
|
|
59
59
|
this.Mc = -1;
|
|
60
|
-
this.
|
|
61
|
-
this.
|
|
60
|
+
this.mB = 0;
|
|
61
|
+
this.nB = false;
|
|
62
62
|
/** Shader program cache map for this engine instance. Maps shader text to program UIDs. */
|
|
63
|
-
this.
|
|
64
|
-
this
|
|
65
|
-
this.
|
|
66
|
-
this.
|
|
67
|
-
this.
|
|
68
|
-
this.
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
72
|
-
this.
|
|
73
|
-
this.
|
|
63
|
+
this.xB = /* @__PURE__ */ new Map();
|
|
64
|
+
this.$A = false;
|
|
65
|
+
this.qB = -1;
|
|
66
|
+
this.XA = config != null ? config : new Config();
|
|
67
|
+
this.kB = new Logger();
|
|
68
|
+
this.kB.logLevel = this.XA.logLevel;
|
|
69
|
+
this.qB = _Engine.pB;
|
|
70
|
+
this.NA = processApproach;
|
|
71
|
+
this.OA = cgApiResourceRepository;
|
|
72
|
+
this.hB = new ComponentMemoryRegistry();
|
|
73
|
+
this.VA = new ComponentRepository(this);
|
|
74
74
|
this.We = new EntityRepository(this);
|
|
75
|
-
this.
|
|
75
|
+
this.iB = new MaterialRepository();
|
|
76
76
|
this.Di = MemoryManager.createInstanceIfNotCreated(this, maxGPUDataStorageSize);
|
|
77
77
|
if (rnXRModule != null) {
|
|
78
|
-
this.
|
|
78
|
+
this.rB(rnXRModule);
|
|
79
79
|
}
|
|
80
|
-
this.
|
|
81
|
-
_Engine.
|
|
80
|
+
this.dB = GlobalDataRepository.init(this);
|
|
81
|
+
_Engine.pB++;
|
|
82
82
|
}
|
|
83
83
|
get engineUid() {
|
|
84
|
-
return this.
|
|
84
|
+
return this.qB;
|
|
85
85
|
}
|
|
86
86
|
static getEngine(objectUid) {
|
|
87
|
-
const engine = _Engine.
|
|
87
|
+
const engine = _Engine.oB.get(objectUid);
|
|
88
88
|
if (Is.not.exist(engine)) {
|
|
89
89
|
return void 0;
|
|
90
90
|
}
|
|
@@ -128,30 +128,30 @@ var _Engine = class _Engine extends RnObject {
|
|
|
128
128
|
*/
|
|
129
129
|
destroy() {
|
|
130
130
|
this.stopRenderLoop();
|
|
131
|
-
this.
|
|
132
|
-
this.
|
|
133
|
-
this.
|
|
131
|
+
this.cB = void 0;
|
|
132
|
+
this.gB = [];
|
|
133
|
+
this.nA();
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
136
136
|
* Internal method that performs the actual resource cleanup.
|
|
137
137
|
* Called after the render loop has fully stopped.
|
|
138
138
|
*/
|
|
139
|
-
|
|
139
|
+
nA() {
|
|
140
140
|
var _a, _b;
|
|
141
141
|
this.g = true;
|
|
142
|
-
this.
|
|
142
|
+
this.iB._makeShaderInvalidateToAllMaterials();
|
|
143
143
|
const entities = this.We._getEntities();
|
|
144
144
|
for (const entity of entities) {
|
|
145
145
|
this.We.deleteEntity(entity.entityUID);
|
|
146
146
|
}
|
|
147
|
-
if (Is.exist(this.
|
|
148
|
-
this.
|
|
149
|
-
this.
|
|
147
|
+
if (Is.exist(this.YA)) {
|
|
148
|
+
this.YA.destroy();
|
|
149
|
+
this.YA = void 0;
|
|
150
150
|
}
|
|
151
|
-
if (Is.exist(this.
|
|
152
|
-
this.
|
|
151
|
+
if (Is.exist(this.PA)) {
|
|
152
|
+
this.PA.clearCache();
|
|
153
153
|
try {
|
|
154
|
-
const deviceWrapper = this.
|
|
154
|
+
const deviceWrapper = this.PA.getWebGpuDeviceWrapper();
|
|
155
155
|
if (deviceWrapper) {
|
|
156
156
|
deviceWrapper.context.unconfigure();
|
|
157
157
|
}
|
|
@@ -162,7 +162,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
162
162
|
this.Di.destroy();
|
|
163
163
|
this.Di = void 0;
|
|
164
164
|
}
|
|
165
|
-
this.
|
|
165
|
+
this.yB();
|
|
166
166
|
TransformComponent._cleanupForEngine(this);
|
|
167
167
|
SceneGraphComponent._cleanupForEngine(this);
|
|
168
168
|
CameraComponent._cleanupForEngine(this);
|
|
@@ -173,16 +173,16 @@ var _Engine = class _Engine extends RnObject {
|
|
|
173
173
|
AbstractMaterialContent._cleanupForEngine(this);
|
|
174
174
|
_cleanupRenderPassHelperForEngine(this);
|
|
175
175
|
_cleanupWebGLStatesCacheForEngine(this);
|
|
176
|
-
(_b = this.
|
|
177
|
-
this.
|
|
178
|
-
this.
|
|
179
|
-
this.$A = void 0;
|
|
176
|
+
(_b = this.TA) == null ? void 0 : _b.destroy();
|
|
177
|
+
this.TA = void 0;
|
|
178
|
+
this.hB.destroy();
|
|
180
179
|
this.aB = void 0;
|
|
181
|
-
this.
|
|
182
|
-
this.
|
|
183
|
-
this.Lc = -1;
|
|
180
|
+
this.bB = void 0;
|
|
181
|
+
this.SA = 0;
|
|
184
182
|
this.ZA = -1;
|
|
185
|
-
|
|
183
|
+
this.Lc = -1;
|
|
184
|
+
this._A = -1;
|
|
185
|
+
_Engine.oB.delete(this.objectUID);
|
|
186
186
|
this.unregister();
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
@@ -199,16 +199,16 @@ var _Engine = class _Engine extends RnObject {
|
|
|
199
199
|
* @param args - arguments you want to be passed to renderLoopFunc
|
|
200
200
|
*/
|
|
201
201
|
startRenderLoop(renderLoopFunc, ...args) {
|
|
202
|
-
this.
|
|
203
|
-
this.
|
|
204
|
-
if (this.
|
|
202
|
+
this.cB = renderLoopFunc;
|
|
203
|
+
this.gB = args;
|
|
204
|
+
if (this.UA !== -1) {
|
|
205
205
|
this.stopRenderLoop();
|
|
206
206
|
}
|
|
207
|
-
const animationFrameObject = this.
|
|
208
|
-
this.
|
|
207
|
+
const animationFrameObject = this.sB();
|
|
208
|
+
this.fB = animationFrameObject;
|
|
209
209
|
const requestAnimationFrame = animationFrameObject.requestAnimationFrame.bind(animationFrameObject);
|
|
210
|
-
const webXRSystem = this.
|
|
211
|
-
const webARSystem = this.
|
|
210
|
+
const webXRSystem = this.MA;
|
|
211
|
+
const webARSystem = this.QA;
|
|
212
212
|
const hasExtraArgs = args.length > 0;
|
|
213
213
|
const callArgs = hasExtraArgs ? [0, ...args] : [];
|
|
214
214
|
const invokeRenderLoopFunc = hasExtraArgs ? (time) => {
|
|
@@ -229,14 +229,14 @@ var _Engine = class _Engine extends RnObject {
|
|
|
229
229
|
} else {
|
|
230
230
|
invokeRenderLoopFunc(_time);
|
|
231
231
|
}
|
|
232
|
-
this.
|
|
232
|
+
this.UA = requestAnimationFrame(__renderLoopFunc);
|
|
233
233
|
});
|
|
234
|
-
this.
|
|
234
|
+
this.UA = requestAnimationFrame(__renderLoopFunc);
|
|
235
235
|
}
|
|
236
|
-
|
|
236
|
+
sB() {
|
|
237
237
|
let animationFrameObject = window;
|
|
238
|
-
const webXRSystem = this.
|
|
239
|
-
const webARSystem = this.
|
|
238
|
+
const webXRSystem = this.MA;
|
|
239
|
+
const webARSystem = this.QA;
|
|
240
240
|
if (webXRSystem == null ? void 0 : webXRSystem.requestedToEnterWebXR) {
|
|
241
241
|
animationFrameObject = webXRSystem.xrSession;
|
|
242
242
|
} else if (webARSystem == null ? void 0 : webARSystem.requestedToEnterWebAR) {
|
|
@@ -252,19 +252,19 @@ var _Engine = class _Engine extends RnObject {
|
|
|
252
252
|
*/
|
|
253
253
|
stopRenderLoop() {
|
|
254
254
|
var _a;
|
|
255
|
-
const animationFrameObject = (_a = this.
|
|
256
|
-
if (this.
|
|
257
|
-
animationFrameObject.cancelAnimationFrame(this.
|
|
255
|
+
const animationFrameObject = (_a = this.fB) != null ? _a : this.sB();
|
|
256
|
+
if (this.UA !== -1) {
|
|
257
|
+
animationFrameObject.cancelAnimationFrame(this.UA);
|
|
258
258
|
}
|
|
259
|
-
this.
|
|
260
|
-
this.
|
|
259
|
+
this.UA = -1;
|
|
260
|
+
this.fB = void 0;
|
|
261
261
|
}
|
|
262
262
|
/**
|
|
263
263
|
* Restart a render loop.
|
|
264
264
|
*/
|
|
265
265
|
restartRenderLoop() {
|
|
266
|
-
if (this.
|
|
267
|
-
this.startRenderLoop(this.
|
|
266
|
+
if (this.cB != null) {
|
|
267
|
+
this.startRenderLoop(this.cB, ...this.gB);
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
/**
|
|
@@ -277,7 +277,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
277
277
|
* @param clearColor - color to clear the canvas
|
|
278
278
|
*/
|
|
279
279
|
processAuto(clearColor = Vector4.fromCopy4(0, 0, 0, 1)) {
|
|
280
|
-
if (Is.not.exist(this
|
|
280
|
+
if (Is.not.exist(this.aB)) {
|
|
281
281
|
const expression = new Expression();
|
|
282
282
|
const renderPassInit = new RenderPass(this);
|
|
283
283
|
renderPassInit.toClearColorBuffer = true;
|
|
@@ -285,22 +285,22 @@ var _Engine = class _Engine extends RnObject {
|
|
|
285
285
|
renderPassInit.clearColor = clearColor;
|
|
286
286
|
const renderPassMain = new RenderPass(this);
|
|
287
287
|
expression.addRenderPasses([renderPassInit, renderPassMain]);
|
|
288
|
-
this
|
|
289
|
-
this.
|
|
288
|
+
this.aB = expression;
|
|
289
|
+
this.bB = renderPassMain;
|
|
290
290
|
}
|
|
291
|
-
this.
|
|
291
|
+
this.bB.clearEntities();
|
|
292
292
|
const entities = this.We._getEntities();
|
|
293
|
-
this.
|
|
294
|
-
this.process([this
|
|
293
|
+
this.bB.addEntities(entities);
|
|
294
|
+
this.process([this.aB]);
|
|
295
295
|
}
|
|
296
296
|
process(value) {
|
|
297
|
-
const gpuTimerEnabled = this
|
|
297
|
+
const gpuTimerEnabled = this.$A;
|
|
298
298
|
if (gpuTimerEnabled) {
|
|
299
|
-
this.
|
|
299
|
+
this.zB();
|
|
300
300
|
}
|
|
301
301
|
Time._processBegin(this);
|
|
302
|
-
this.
|
|
303
|
-
if (!this.
|
|
302
|
+
this.AB();
|
|
303
|
+
if (!this.lB && LightComponent.getUpdateCount(this) > 0) {
|
|
304
304
|
this._requestLightClusterSystem();
|
|
305
305
|
}
|
|
306
306
|
let expressions = value;
|
|
@@ -310,7 +310,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
310
310
|
if (CameraComponent.getCurrent(this) === Component.InvalidObjectUID) {
|
|
311
311
|
_Engine.createCamera(this);
|
|
312
312
|
}
|
|
313
|
-
const time = this.
|
|
313
|
+
const time = this.dB.getValue("time", 0);
|
|
314
314
|
time._v[0] = Time.timeFromSystemStart;
|
|
315
315
|
if (this.processApproach === ProcessApproach.WebGPU) {
|
|
316
316
|
this._processWebGPU(expressions);
|
|
@@ -319,7 +319,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
319
319
|
}
|
|
320
320
|
Time._processEnd();
|
|
321
321
|
if (gpuTimerEnabled) {
|
|
322
|
-
this.
|
|
322
|
+
this.BB();
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
/**
|
|
@@ -330,10 +330,10 @@ var _Engine = class _Engine extends RnObject {
|
|
|
330
330
|
* `timestamp-query` feature in WebGPU), which add a small overhead. See {@link gpuTimeMilliseconds}.
|
|
331
331
|
*/
|
|
332
332
|
get gpuTimerEnabled() {
|
|
333
|
-
return this
|
|
333
|
+
return this.$A;
|
|
334
334
|
}
|
|
335
335
|
set gpuTimerEnabled(flag) {
|
|
336
|
-
this
|
|
336
|
+
this.$A = flag;
|
|
337
337
|
}
|
|
338
338
|
/**
|
|
339
339
|
* Whether the GPU time can be measured in this environment.
|
|
@@ -341,10 +341,10 @@ var _Engine = class _Engine extends RnObject {
|
|
|
341
341
|
*/
|
|
342
342
|
get isGpuTimerSupported() {
|
|
343
343
|
var _a, _b;
|
|
344
|
-
if (this.
|
|
344
|
+
if (this.NA === ProcessApproach.WebGPU) {
|
|
345
345
|
return this.webGpuResourceRepository._getGpuTimer().isSupported;
|
|
346
346
|
}
|
|
347
|
-
return (_b = (_a = this.
|
|
347
|
+
return (_b = (_a = this.tB()) == null ? void 0 : _a.isSupported) != null ? _b : false;
|
|
348
348
|
}
|
|
349
349
|
/**
|
|
350
350
|
* The GPU time spent on the latest measured process() call, in milliseconds.
|
|
@@ -358,13 +358,13 @@ var _Engine = class _Engine extends RnObject {
|
|
|
358
358
|
*/
|
|
359
359
|
get gpuTimeMilliseconds() {
|
|
360
360
|
var _a, _b;
|
|
361
|
-
if (!this
|
|
361
|
+
if (!this.$A) {
|
|
362
362
|
return void 0;
|
|
363
363
|
}
|
|
364
|
-
if (this.
|
|
365
|
-
return (_a = this.
|
|
364
|
+
if (this.NA === ProcessApproach.WebGPU) {
|
|
365
|
+
return (_a = this.PA) == null ? void 0 : _a._getGpuTimer().lastGpuTimeMilliseconds;
|
|
366
366
|
}
|
|
367
|
-
return (_b = this.
|
|
367
|
+
return (_b = this.TA) == null ? void 0 : _b.lastGpuTimeMilliseconds;
|
|
368
368
|
}
|
|
369
369
|
/**
|
|
370
370
|
* The GPU time of each pass of the latest measured process() call, in milliseconds, keyed by the pass label.
|
|
@@ -377,39 +377,39 @@ var _Engine = class _Engine extends RnObject {
|
|
|
377
377
|
*/
|
|
378
378
|
get gpuPassTimesMilliseconds() {
|
|
379
379
|
var _a;
|
|
380
|
-
if (!this
|
|
380
|
+
if (!this.$A || this.NA !== ProcessApproach.WebGPU) {
|
|
381
381
|
return void 0;
|
|
382
382
|
}
|
|
383
|
-
return (_a = this.
|
|
383
|
+
return (_a = this.PA) == null ? void 0 : _a._getGpuTimer().lastPassGpuTimesMilliseconds;
|
|
384
384
|
}
|
|
385
|
-
|
|
385
|
+
tB() {
|
|
386
386
|
var _a;
|
|
387
|
-
if (this.
|
|
388
|
-
const glw = (_a = this.
|
|
387
|
+
if (this.TA == null) {
|
|
388
|
+
const glw = (_a = this.eB) == null ? void 0 : _a.currentWebGLContextWrapper;
|
|
389
389
|
if (glw == null) {
|
|
390
390
|
return void 0;
|
|
391
391
|
}
|
|
392
|
-
this.
|
|
392
|
+
this.TA = new WebGLGpuTimer(glw.getRawContextAsWebGL2());
|
|
393
393
|
}
|
|
394
|
-
return this.
|
|
394
|
+
return this.TA;
|
|
395
395
|
}
|
|
396
|
-
|
|
396
|
+
zB() {
|
|
397
397
|
var _a, _b;
|
|
398
|
-
if (this.
|
|
399
|
-
(_a = this.
|
|
398
|
+
if (this.NA === ProcessApproach.WebGPU) {
|
|
399
|
+
(_a = this.PA) == null ? void 0 : _a._getGpuTimer().beginFrame();
|
|
400
400
|
} else {
|
|
401
|
-
(_b = this.
|
|
401
|
+
(_b = this.tB()) == null ? void 0 : _b.begin();
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
|
|
404
|
+
BB() {
|
|
405
405
|
var _a, _b;
|
|
406
|
-
if (this.
|
|
407
|
-
(_a = this.
|
|
406
|
+
if (this.NA === ProcessApproach.WebGPU) {
|
|
407
|
+
(_a = this.PA) == null ? void 0 : _a._getGpuTimer().endFrame();
|
|
408
408
|
} else {
|
|
409
|
-
(_b = this.
|
|
409
|
+
(_b = this.TA) == null ? void 0 : _b.end();
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
|
-
|
|
412
|
+
CB({
|
|
413
413
|
webGpuResourceRepository,
|
|
414
414
|
renderPass,
|
|
415
415
|
renderPassTickCount,
|
|
@@ -451,7 +451,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
451
451
|
});
|
|
452
452
|
}
|
|
453
453
|
webGpuResourceRepository.clearFrameBuffer(this, renderPass, displayIdx);
|
|
454
|
-
this.
|
|
454
|
+
this.DB({
|
|
455
455
|
webGpuResourceRepository,
|
|
456
456
|
renderPass,
|
|
457
457
|
renderPassTickCount,
|
|
@@ -476,7 +476,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
476
476
|
renderPass.doPostRender();
|
|
477
477
|
return shouldRenderEffekseerEffects;
|
|
478
478
|
}
|
|
479
|
-
|
|
479
|
+
EB({
|
|
480
480
|
webGpuResourceRepository,
|
|
481
481
|
currentRenderPass,
|
|
482
482
|
deferredEffekseerRenderJobs,
|
|
@@ -507,7 +507,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
507
507
|
job.renderPass._copyResolve1ToResolve2WebGpu();
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
|
-
|
|
510
|
+
DB({
|
|
511
511
|
webGpuResourceRepository,
|
|
512
512
|
renderPass,
|
|
513
513
|
renderPassTickCount,
|
|
@@ -529,7 +529,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
529
529
|
} else {
|
|
530
530
|
doRender = !webGpuResourceRepository.renderWithRenderBundle(this, renderPass, displayIdx);
|
|
531
531
|
}
|
|
532
|
-
(_a = this.
|
|
532
|
+
(_a = this.RA).webgpuRenderBundleMode || (_a.webgpuRenderBundleMode = doRender);
|
|
533
533
|
}
|
|
534
534
|
if (!doRender) {
|
|
535
535
|
return renderPassEncoderForEffekseer;
|
|
@@ -554,18 +554,18 @@ var _Engine = class _Engine extends RnObject {
|
|
|
554
554
|
}
|
|
555
555
|
_processWebGPU(expressions) {
|
|
556
556
|
var _a, _b;
|
|
557
|
-
const componentTids = this.
|
|
557
|
+
const componentTids = this.VA.getComponentTIDs();
|
|
558
558
|
const webGpuResourceRepository = this.webGpuResourceRepository;
|
|
559
|
-
const webxrSystem = this.
|
|
559
|
+
const webxrSystem = this.MA;
|
|
560
560
|
for (const stage of Component._processStages) {
|
|
561
561
|
if (stage === ProcessStage.Render) {
|
|
562
|
-
this.
|
|
562
|
+
this.WA.update(expressions);
|
|
563
563
|
MeshRendererComponent.common_$prerender(this);
|
|
564
564
|
const isWebXRMode = (_a = webxrSystem == null ? void 0 : webxrSystem.isWebXRMode) != null ? _a : false;
|
|
565
565
|
const isMultiView = (_b = webxrSystem == null ? void 0 : webxrSystem.isMultiView()) != null ? _b : false;
|
|
566
|
-
const xrPose = this.
|
|
566
|
+
const xrPose = this.RA.xrPoseWebGPU;
|
|
567
567
|
const displayCount = isWebXRMode && !isMultiView && xrPose != null ? xrPose.views.length : 1;
|
|
568
|
-
const hasAnyEffekseerComponents = this.
|
|
568
|
+
const hasAnyEffekseerComponents = this.VA.hasAnyComponent(
|
|
569
569
|
WellKnownComponentTIDs.EffekseerComponentTID
|
|
570
570
|
);
|
|
571
571
|
const isMultiDisplay = displayCount > 1;
|
|
@@ -580,7 +580,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
580
580
|
let renderPassTickCount = renderPassTickCountMap == null ? void 0 : renderPassTickCountMap.get(renderPassUid);
|
|
581
581
|
let primitiveUids;
|
|
582
582
|
if (renderPassTickCount === void 0) {
|
|
583
|
-
renderPassTickCount = this.
|
|
583
|
+
renderPassTickCount = this.SA;
|
|
584
584
|
renderPass._isChangedSortRenderResult = false;
|
|
585
585
|
primitiveUids = MeshRendererComponent.sort_$render(this, renderPass);
|
|
586
586
|
if (renderPassTickCountMap != null) {
|
|
@@ -590,7 +590,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
590
590
|
} else {
|
|
591
591
|
primitiveUids = primitiveUidsMap.get(renderPassUid);
|
|
592
592
|
}
|
|
593
|
-
const renderedEffekseerEffects = this.
|
|
593
|
+
const renderedEffekseerEffects = this.CB({
|
|
594
594
|
webGpuResourceRepository,
|
|
595
595
|
renderPass,
|
|
596
596
|
renderPassTickCount,
|
|
@@ -601,7 +601,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
601
601
|
});
|
|
602
602
|
renderedEffekseerEffectsInDisplay || (renderedEffekseerEffectsInDisplay = renderedEffekseerEffects);
|
|
603
603
|
if (deferredEffekseerRenderJobs != null && deferredEffekseerRenderJobs.length > 0) {
|
|
604
|
-
this.
|
|
604
|
+
this.EB({
|
|
605
605
|
webGpuResourceRepository,
|
|
606
606
|
currentRenderPass: renderPass,
|
|
607
607
|
deferredEffekseerRenderJobs,
|
|
@@ -611,7 +611,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
611
611
|
if (displayIdx === displayCount - 1) {
|
|
612
612
|
renderPassTickCountMap == null ? void 0 : renderPassTickCountMap.delete(renderPassUid);
|
|
613
613
|
primitiveUidsMap == null ? void 0 : primitiveUidsMap.delete(renderPassUid);
|
|
614
|
-
this.
|
|
614
|
+
this.SA++;
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
}
|
|
@@ -621,17 +621,17 @@ var _Engine = class _Engine extends RnObject {
|
|
|
621
621
|
}
|
|
622
622
|
webGpuResourceRepository.flush();
|
|
623
623
|
} else {
|
|
624
|
-
if (!this.
|
|
624
|
+
if (!this.RA.webgpuRenderBundleMode || this.uB() || TransformComponent.getUpdateCount(this) !== this.Lc || CameraComponent.getCurrentCameraUpdateCount(this) !== this.ZA || Primitive.getPrimitiveCount() !== this._A || LightComponent.getUpdateCount(this) !== this.Mc) {
|
|
625
625
|
const commonMethodName = `common_${stage.methodName}`;
|
|
626
626
|
for (const componentTid of componentTids) {
|
|
627
627
|
const componentClass = ComponentRepository.getComponentClass(componentTid);
|
|
628
628
|
const componentClass_commonMethod = componentClass[commonMethodName];
|
|
629
629
|
if (componentClass_commonMethod) {
|
|
630
630
|
componentClass_commonMethod({
|
|
631
|
-
processApproach: this.
|
|
631
|
+
processApproach: this.NA,
|
|
632
632
|
renderPass: void 0,
|
|
633
633
|
processStage: stage,
|
|
634
|
-
renderPassTickCount: this.
|
|
634
|
+
renderPassTickCount: this.SA,
|
|
635
635
|
displayIdx: 0,
|
|
636
636
|
engine: this
|
|
637
637
|
});
|
|
@@ -644,19 +644,19 @@ var _Engine = class _Engine extends RnObject {
|
|
|
644
644
|
SceneGraphComponent._updateTransformGizmosByCameraChange(this);
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
|
-
this.
|
|
648
|
-
this.
|
|
647
|
+
this.ZA = CameraComponent.getCurrentCameraUpdateCount(this);
|
|
648
|
+
this.vB();
|
|
649
649
|
this.Lc = TransformComponent.getUpdateCount(this);
|
|
650
|
-
this.
|
|
650
|
+
this._A = Primitive.getPrimitiveCount();
|
|
651
651
|
this.Mc = LightComponent.getUpdateCount(this);
|
|
652
652
|
}
|
|
653
|
-
|
|
653
|
+
AB() {
|
|
654
654
|
var _a;
|
|
655
655
|
for (const hooks of _getComponentRuntimeHooks()) {
|
|
656
656
|
(_a = hooks.beginFrame) == null ? void 0 : _a.call(hooks, this);
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
|
-
|
|
659
|
+
uB() {
|
|
660
660
|
var _a;
|
|
661
661
|
for (const hooks of _getComponentRuntimeHooks()) {
|
|
662
662
|
if (((_a = hooks.isDirty) == null ? void 0 : _a.call(hooks, this)) === true) {
|
|
@@ -665,13 +665,13 @@ var _Engine = class _Engine extends RnObject {
|
|
|
665
665
|
}
|
|
666
666
|
return false;
|
|
667
667
|
}
|
|
668
|
-
|
|
668
|
+
vB() {
|
|
669
669
|
var _a;
|
|
670
670
|
for (const hooks of _getComponentRuntimeHooks()) {
|
|
671
671
|
(_a = hooks.markUpdated) == null ? void 0 : _a.call(hooks, this);
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
|
-
|
|
674
|
+
yB() {
|
|
675
675
|
var _a;
|
|
676
676
|
for (const hooks of _getComponentRuntimeHooks()) {
|
|
677
677
|
(_a = hooks.cleanup) == null ? void 0 : _a.call(hooks, this);
|
|
@@ -679,14 +679,14 @@ var _Engine = class _Engine extends RnObject {
|
|
|
679
679
|
}
|
|
680
680
|
_processWebGL(expressions) {
|
|
681
681
|
const repo = this.webglResourceRepository;
|
|
682
|
-
const componentTids = this.
|
|
683
|
-
const renderingComponentTids = this.
|
|
682
|
+
const componentTids = this.VA.getComponentTIDs();
|
|
683
|
+
const renderingComponentTids = this.VA.getRenderingComponentTIDs();
|
|
684
684
|
for (const stage of Component._processStages) {
|
|
685
685
|
const methodName = stage.methodName;
|
|
686
686
|
const commonMethodName = `common_${methodName}`;
|
|
687
687
|
if (stage === ProcessStage.Render) {
|
|
688
688
|
repo.getMultiDrawRepository(this).rebuildDirtyGroups();
|
|
689
|
-
this.
|
|
689
|
+
this.WA.update(expressions);
|
|
690
690
|
MeshRendererComponent.common_$prerender(this);
|
|
691
691
|
for (const exp of expressions) {
|
|
692
692
|
for (const componentTid of renderingComponentTids) {
|
|
@@ -701,7 +701,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
701
701
|
this.setViewportForNormalRendering(renderPass);
|
|
702
702
|
this.setScissorForNormalRendering(renderPass);
|
|
703
703
|
if (componentTid === WellKnownComponentTIDs.MeshRendererComponentTID) {
|
|
704
|
-
this.
|
|
704
|
+
this.OA.clearFrameBuffer(this, renderPass);
|
|
705
705
|
}
|
|
706
706
|
renderPass._isChangedSortRenderResult = false;
|
|
707
707
|
const primitiveUids = MeshRendererComponent.sort_$render(this, renderPass);
|
|
@@ -710,10 +710,10 @@ var _Engine = class _Engine extends RnObject {
|
|
|
710
710
|
const componentClass_commonMethod = componentClass[commonMethodName];
|
|
711
711
|
if (componentClass_commonMethod) {
|
|
712
712
|
const renderedSomething = componentClass_commonMethod({
|
|
713
|
-
processApproach: this.
|
|
713
|
+
processApproach: this.NA,
|
|
714
714
|
renderPass,
|
|
715
715
|
processStage: stage,
|
|
716
|
-
renderPassTickCount: this.
|
|
716
|
+
renderPassTickCount: this.SA,
|
|
717
717
|
primitiveUids,
|
|
718
718
|
displayIdx: 0,
|
|
719
719
|
engine: this
|
|
@@ -733,23 +733,23 @@ var _Engine = class _Engine extends RnObject {
|
|
|
733
733
|
}
|
|
734
734
|
webGLResourceRepository.restoreTexture2DBindingsForEffekseer(currentTexture2DBindings);
|
|
735
735
|
}
|
|
736
|
-
this.
|
|
736
|
+
this.SA++;
|
|
737
737
|
renderPass._copyFramebufferToResolveFramebuffersWebGL();
|
|
738
738
|
renderPass.doPostRender();
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
741
|
}
|
|
742
742
|
} else {
|
|
743
|
-
if (this.
|
|
743
|
+
if (this.uB() || TransformComponent.getUpdateCount(this) !== this.Lc || CameraComponent.getCurrentCameraUpdateCount(this) !== this.ZA || Primitive.getPrimitiveCount() !== this._A || LightComponent.getUpdateCount(this) !== this.Mc) {
|
|
744
744
|
for (const componentTid of componentTids) {
|
|
745
745
|
const componentClass = ComponentRepository.getComponentClass(componentTid);
|
|
746
746
|
const componentClass_commonMethod = componentClass[commonMethodName];
|
|
747
747
|
if (componentClass_commonMethod) {
|
|
748
748
|
componentClass_commonMethod({
|
|
749
|
-
processApproach: this.
|
|
749
|
+
processApproach: this.NA,
|
|
750
750
|
renderPass: void 0,
|
|
751
751
|
processStage: stage,
|
|
752
|
-
renderPassTickCount: this.
|
|
752
|
+
renderPassTickCount: this.SA,
|
|
753
753
|
displayIdx: 0,
|
|
754
754
|
engine: this
|
|
755
755
|
});
|
|
@@ -762,10 +762,10 @@ var _Engine = class _Engine extends RnObject {
|
|
|
762
762
|
SceneGraphComponent._updateTransformGizmosByCameraChange(this);
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
|
-
this.
|
|
766
|
-
this.
|
|
765
|
+
this.ZA = CameraComponent.getCurrentCameraUpdateCount(this);
|
|
766
|
+
this.vB();
|
|
767
767
|
this.Lc = TransformComponent.getUpdateCount(this);
|
|
768
|
-
this.
|
|
768
|
+
this._A = Primitive.getPrimitiveCount();
|
|
769
769
|
this.Mc = LightComponent.getUpdateCount(this);
|
|
770
770
|
}
|
|
771
771
|
static get processTime() {
|
|
@@ -789,10 +789,10 @@ var _Engine = class _Engine extends RnObject {
|
|
|
789
789
|
cameraEntity.getCamera().yMag = 1;
|
|
790
790
|
}
|
|
791
791
|
setViewportForNormalRendering(renderPass) {
|
|
792
|
-
const webXRSystem = this.
|
|
793
|
-
const webARSystem = this.
|
|
792
|
+
const webXRSystem = this.MA;
|
|
793
|
+
const webARSystem = this.QA;
|
|
794
794
|
if ((!(webXRSystem == null ? void 0 : webXRSystem.isWebXRMode) || !renderPass.isVrRendering) && !(webARSystem == null ? void 0 : webARSystem.isWebARMode)) {
|
|
795
|
-
this.
|
|
795
|
+
this.OA.setViewport(this, renderPass.getViewport());
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
798
|
/**
|
|
@@ -802,9 +802,9 @@ var _Engine = class _Engine extends RnObject {
|
|
|
802
802
|
* run without one.
|
|
803
803
|
*/
|
|
804
804
|
setScissorForNormalRendering(renderPass) {
|
|
805
|
-
const webXRSystem = this.
|
|
806
|
-
const webARSystem = this.
|
|
807
|
-
const repository = this.
|
|
805
|
+
const webXRSystem = this.MA;
|
|
806
|
+
const webARSystem = this.QA;
|
|
807
|
+
const repository = this.OA;
|
|
808
808
|
if ((!(webXRSystem == null ? void 0 : webXRSystem.isWebXRMode) || !renderPass.isVrRendering) && !(webARSystem == null ? void 0 : webARSystem.isWebARMode)) {
|
|
809
809
|
repository.setScissorRect(renderPass);
|
|
810
810
|
} else {
|
|
@@ -812,24 +812,24 @@ var _Engine = class _Engine extends RnObject {
|
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
814
|
bindFramebufferWebGL(renderPass) {
|
|
815
|
-
const webXRSystem = this.
|
|
816
|
-
const webARSystem = this.
|
|
815
|
+
const webXRSystem = this.MA;
|
|
816
|
+
const webARSystem = this.QA;
|
|
817
817
|
if ((webXRSystem == null ? void 0 : webXRSystem.isWebXRMode) && renderPass.isOutputForVr) {
|
|
818
|
-
const glw = this.
|
|
818
|
+
const glw = this.OA.currentWebGLContextWrapper;
|
|
819
819
|
const gl = glw.getRawContext();
|
|
820
820
|
gl.bindFramebuffer(gl.FRAMEBUFFER, webXRSystem.framebuffer);
|
|
821
821
|
} else if (webARSystem == null ? void 0 : webARSystem.isWebARMode) {
|
|
822
|
-
const glw = this.
|
|
822
|
+
const glw = this.OA.currentWebGLContextWrapper;
|
|
823
823
|
const gl = glw.getRawContext();
|
|
824
824
|
gl.bindFramebuffer(gl.FRAMEBUFFER, webARSystem.framebuffer);
|
|
825
825
|
} else {
|
|
826
|
-
this.
|
|
827
|
-
this.
|
|
826
|
+
this.OA.bindFramebuffer(renderPass.getFramebuffer());
|
|
827
|
+
this.OA.setDrawTargets(renderPass);
|
|
828
828
|
}
|
|
829
829
|
}
|
|
830
|
-
|
|
830
|
+
FB() {
|
|
831
831
|
console.log(
|
|
832
|
-
`%cRhodonite%cWeb3D Library%c %cversion%c${VERSION.version}%c %cbranch%c${VERSION.branch}%c %cmode%c${this.
|
|
832
|
+
`%cRhodonite%cWeb3D Library%c %cversion%c${VERSION.version}%c %cbranch%c${VERSION.branch}%c %cmode%c${this.NA.str}`,
|
|
833
833
|
"font-weight: bold; padding: 4px 8px; border-radius: 6px 0px 0px 6px; background: linear-gradient(to right, #ff0084 0%,#ff0022 100%);",
|
|
834
834
|
"padding: 4px; border-radius: 0px 6px 6px 0px; background: linear-gradient(to right, #8400ff 0%,#4400ff 100%);",
|
|
835
835
|
"",
|
|
@@ -871,7 +871,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
871
871
|
* them by ComponentTID: importing the classes there would create circular imports between the
|
|
872
872
|
* components, the gizmos and the mesh helpers.
|
|
873
873
|
*/
|
|
874
|
-
static
|
|
874
|
+
static GB() {
|
|
875
875
|
ComponentRepository._ensureComponentClassRegistered(TransformComponent);
|
|
876
876
|
ComponentRepository._ensureComponentClassRegistered(SceneGraphComponent);
|
|
877
877
|
ComponentRepository._ensureComponentClassRegistered(MeshComponent);
|
|
@@ -894,7 +894,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
894
894
|
if (desc.approach === ProcessApproach.WebGPU && typeof __RN_WEBGPU__ !== "undefined" && !__RN_WEBGPU__) {
|
|
895
895
|
throw new Error("ProcessApproach.WebGPU is unavailable: this build was bundled with __RN_WEBGPU__ = false.");
|
|
896
896
|
}
|
|
897
|
-
_Engine.
|
|
897
|
+
_Engine.GB();
|
|
898
898
|
const rnXRModule = ((_c = desc.xr) != null ? _c : _Engine._loadXRByDefault) ? await ModuleManager.getInstance().loadModule("xr") : void 0;
|
|
899
899
|
let maxGPUDataStorageSize = 0;
|
|
900
900
|
let cgApiResourceRepository;
|
|
@@ -946,19 +946,19 @@ var _Engine = class _Engine extends RnObject {
|
|
|
946
946
|
maxGPUDataStorageSize = 1024 ** 2 * 4 * 4;
|
|
947
947
|
}
|
|
948
948
|
const engine = new _Engine(desc.approach, cgApiResourceRepository, maxGPUDataStorageSize, desc.config, rnXRModule);
|
|
949
|
-
engine.
|
|
950
|
-
engine.
|
|
949
|
+
engine.RA.currentProcessApproach = desc.approach;
|
|
950
|
+
engine.XA.eventTargetDom = (_e = engine.XA.eventTargetDom) != null ? _e : desc.canvas;
|
|
951
951
|
if (desc.approach === ProcessApproach.WebGPU) {
|
|
952
|
-
engine.
|
|
952
|
+
engine.PA = cgApiResourceRepository;
|
|
953
953
|
}
|
|
954
954
|
if (desc.approach === ProcessApproach.WebGL2) {
|
|
955
|
-
engine.
|
|
955
|
+
engine.eB = cgApiResourceRepository;
|
|
956
956
|
}
|
|
957
|
-
engine.
|
|
957
|
+
engine.OA = cgApiResourceRepository;
|
|
958
958
|
if (desc.notToDisplayRnInfoAtInit !== true) {
|
|
959
|
-
engine.
|
|
959
|
+
engine.FB();
|
|
960
960
|
}
|
|
961
|
-
const globalDataRepository = engine.
|
|
961
|
+
const globalDataRepository = engine.dB;
|
|
962
962
|
globalDataRepository.initialize(desc.approach);
|
|
963
963
|
if (desc.canvas != null && desc.approach === ProcessApproach.WebGL2) {
|
|
964
964
|
desc.canvas.addEventListener(
|
|
@@ -974,57 +974,57 @@ var _Engine = class _Engine extends RnObject {
|
|
|
974
974
|
engine.restartRenderLoop();
|
|
975
975
|
});
|
|
976
976
|
}
|
|
977
|
-
engine.
|
|
978
|
-
engine.
|
|
977
|
+
engine.YA = await DummyTextures.init(engine);
|
|
978
|
+
engine.RA.viewportAspectRatio = desc.canvas != null ? desc.canvas.width / desc.canvas.height : 1;
|
|
979
979
|
return engine;
|
|
980
980
|
}
|
|
981
981
|
get processApproach() {
|
|
982
|
-
return this.
|
|
982
|
+
return this.NA;
|
|
983
983
|
}
|
|
984
984
|
resizeCanvas(width, height) {
|
|
985
985
|
const repo = this.cgApiResourceRepository;
|
|
986
986
|
repo.resizeCanvas(width, height);
|
|
987
|
-
this.
|
|
987
|
+
this.RA.viewportAspectRatio = width / height;
|
|
988
988
|
}
|
|
989
989
|
getCanvasSize() {
|
|
990
990
|
const repo = this.cgApiResourceRepository;
|
|
991
991
|
return repo.getCanvasSize();
|
|
992
992
|
}
|
|
993
993
|
getCurrentWebGLContextWrapper() {
|
|
994
|
-
return this.
|
|
994
|
+
return this.OA.currentWebGLContextWrapper;
|
|
995
995
|
}
|
|
996
996
|
get entityRepository() {
|
|
997
997
|
return this.We;
|
|
998
998
|
}
|
|
999
999
|
get componentRepository() {
|
|
1000
|
-
return this.
|
|
1000
|
+
return this.VA;
|
|
1001
1001
|
}
|
|
1002
1002
|
get componentMemoryRegistry() {
|
|
1003
|
-
return this.
|
|
1003
|
+
return this.hB;
|
|
1004
1004
|
}
|
|
1005
1005
|
/**
|
|
1006
1006
|
* The WebXR (VR) system.
|
|
1007
1007
|
* @throws If the XR support is not enabled (see {@link enableXR} and `EngineInitDescription.xr`)
|
|
1008
1008
|
*/
|
|
1009
1009
|
get webXRSystem() {
|
|
1010
|
-
if (this.
|
|
1011
|
-
throw new Error(_Engine.
|
|
1010
|
+
if (this.MA == null) {
|
|
1011
|
+
throw new Error(_Engine.wB);
|
|
1012
1012
|
}
|
|
1013
|
-
return this.
|
|
1013
|
+
return this.MA;
|
|
1014
1014
|
}
|
|
1015
1015
|
/**
|
|
1016
1016
|
* The WebAR system.
|
|
1017
1017
|
* @throws If the XR support is not enabled (see {@link enableXR} and `EngineInitDescription.xr`)
|
|
1018
1018
|
*/
|
|
1019
1019
|
get webARSystem() {
|
|
1020
|
-
if (this.
|
|
1021
|
-
throw new Error(_Engine.
|
|
1020
|
+
if (this.QA == null) {
|
|
1021
|
+
throw new Error(_Engine.wB);
|
|
1022
1022
|
}
|
|
1023
|
-
return this.
|
|
1023
|
+
return this.QA;
|
|
1024
1024
|
}
|
|
1025
1025
|
/** Whether the XR support (WebXR and WebAR systems) is enabled. */
|
|
1026
1026
|
get isXREnabled() {
|
|
1027
|
-
return this.
|
|
1027
|
+
return this.MA != null;
|
|
1028
1028
|
}
|
|
1029
1029
|
/**
|
|
1030
1030
|
* The WebXR system, or undefined when the XR support is not enabled.
|
|
@@ -1032,14 +1032,14 @@ var _Engine = class _Engine extends RnObject {
|
|
|
1032
1032
|
* @internal
|
|
1033
1033
|
*/
|
|
1034
1034
|
get _webXRSystemIfEnabled() {
|
|
1035
|
-
return this.
|
|
1035
|
+
return this.MA;
|
|
1036
1036
|
}
|
|
1037
1037
|
/**
|
|
1038
1038
|
* The WebAR system, or undefined when the XR support is not enabled.
|
|
1039
1039
|
* @internal
|
|
1040
1040
|
*/
|
|
1041
1041
|
get _webARSystemIfEnabled() {
|
|
1042
|
-
return this.
|
|
1042
|
+
return this.QA;
|
|
1043
1043
|
}
|
|
1044
1044
|
/**
|
|
1045
1045
|
* Enables the WebXR/WebAR support after initialization by loading the XR module.
|
|
@@ -1054,23 +1054,23 @@ var _Engine = class _Engine extends RnObject {
|
|
|
1054
1054
|
* ```
|
|
1055
1055
|
*/
|
|
1056
1056
|
async enableXR() {
|
|
1057
|
-
if (this.
|
|
1057
|
+
if (this.MA == null) {
|
|
1058
1058
|
const rnXRModule = await ModuleManager.getInstance().loadModule("xr");
|
|
1059
|
-
if (this.
|
|
1060
|
-
this.
|
|
1059
|
+
if (this.MA == null) {
|
|
1060
|
+
this.rB(rnXRModule);
|
|
1061
1061
|
}
|
|
1062
1062
|
}
|
|
1063
|
-
return this.
|
|
1063
|
+
return this.MA;
|
|
1064
1064
|
}
|
|
1065
|
-
|
|
1066
|
-
this.
|
|
1067
|
-
this.
|
|
1065
|
+
rB(rnXRModule) {
|
|
1066
|
+
this.MA = rnXRModule.WebXRSystem.init(this);
|
|
1067
|
+
this.QA = rnXRModule.WebARSystem.init(this);
|
|
1068
1068
|
}
|
|
1069
1069
|
get memoryManager() {
|
|
1070
1070
|
return this.Di;
|
|
1071
1071
|
}
|
|
1072
1072
|
get globalDataRepository() {
|
|
1073
|
-
return this.
|
|
1073
|
+
return this.dB;
|
|
1074
1074
|
}
|
|
1075
1075
|
/**
|
|
1076
1076
|
* Starts loading the light cluster system. Called when the first light is added; applications without lights
|
|
@@ -1078,15 +1078,15 @@ var _Engine = class _Engine extends RnObject {
|
|
|
1078
1078
|
* @internal
|
|
1079
1079
|
*/
|
|
1080
1080
|
_requestLightClusterSystem() {
|
|
1081
|
-
if (this.g || this.
|
|
1081
|
+
if (this.g || this.jB != null) {
|
|
1082
1082
|
return;
|
|
1083
1083
|
}
|
|
1084
|
-
this.
|
|
1084
|
+
this.jB = import("../renderer/lightCluster/LightClusterSystem.js").then(({ LightClusterSystem }) => {
|
|
1085
1085
|
if (this.g) {
|
|
1086
1086
|
return;
|
|
1087
1087
|
}
|
|
1088
|
-
this.
|
|
1089
|
-
this.
|
|
1088
|
+
this.WA = new LightClusterSystem(this);
|
|
1089
|
+
this.lB = true;
|
|
1090
1090
|
}).catch((error) => {
|
|
1091
1091
|
Logger.default.warn(`Failed to load the light cluster system: ${error}`);
|
|
1092
1092
|
});
|
|
@@ -1097,35 +1097,35 @@ var _Engine = class _Engine extends RnObject {
|
|
|
1097
1097
|
*/
|
|
1098
1098
|
async _ensureLightClusterSystem() {
|
|
1099
1099
|
this._requestLightClusterSystem();
|
|
1100
|
-
await this.
|
|
1101
|
-
return this.
|
|
1100
|
+
await this.jB;
|
|
1101
|
+
return this.WA;
|
|
1102
1102
|
}
|
|
1103
1103
|
/**
|
|
1104
1104
|
* The system that builds the light lists of Clustered Forward rendering.
|
|
1105
1105
|
*/
|
|
1106
1106
|
get lightClusterSystem() {
|
|
1107
|
-
return this.
|
|
1107
|
+
return this.WA;
|
|
1108
1108
|
}
|
|
1109
1109
|
get materialRepository() {
|
|
1110
|
-
return this.
|
|
1110
|
+
return this.iB;
|
|
1111
1111
|
}
|
|
1112
1112
|
get webglResourceRepository() {
|
|
1113
|
-
return this.
|
|
1113
|
+
return this.eB;
|
|
1114
1114
|
}
|
|
1115
1115
|
get cgApiResourceRepository() {
|
|
1116
|
-
return this.
|
|
1116
|
+
return this.OA;
|
|
1117
1117
|
}
|
|
1118
1118
|
get webGpuResourceRepository() {
|
|
1119
|
-
return this.
|
|
1119
|
+
return this.PA;
|
|
1120
1120
|
}
|
|
1121
1121
|
get dummyTextures() {
|
|
1122
|
-
return this.
|
|
1122
|
+
return this.YA;
|
|
1123
1123
|
}
|
|
1124
1124
|
get engineState() {
|
|
1125
|
-
return this.
|
|
1125
|
+
return this.RA;
|
|
1126
1126
|
}
|
|
1127
1127
|
get config() {
|
|
1128
|
-
return this.
|
|
1128
|
+
return this.XA;
|
|
1129
1129
|
}
|
|
1130
1130
|
/**
|
|
1131
1131
|
* A version that is incremented when the GPU instance data was written outside the component update
|
|
@@ -1135,7 +1135,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
1135
1135
|
* @internal
|
|
1136
1136
|
*/
|
|
1137
1137
|
get _gpuInstanceDataVersion() {
|
|
1138
|
-
return this.
|
|
1138
|
+
return this.mB;
|
|
1139
1139
|
}
|
|
1140
1140
|
/**
|
|
1141
1141
|
* Requests an upload of the GPU instance data in the next prerender stage. Unlike a component update, it does
|
|
@@ -1144,7 +1144,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
1144
1144
|
* @internal
|
|
1145
1145
|
*/
|
|
1146
1146
|
_markGpuInstanceDataDirty() {
|
|
1147
|
-
this.
|
|
1147
|
+
this.mB++;
|
|
1148
1148
|
}
|
|
1149
1149
|
/**
|
|
1150
1150
|
* Whether the morph weights uniform buffer also holds the blend shape weights of the previous frame (for the
|
|
@@ -1153,7 +1153,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
1153
1153
|
* @internal
|
|
1154
1154
|
*/
|
|
1155
1155
|
get _isPreviousMorphWeightsEnabled() {
|
|
1156
|
-
return this.
|
|
1156
|
+
return this.nB;
|
|
1157
1157
|
}
|
|
1158
1158
|
/**
|
|
1159
1159
|
* Makes the morph weights uniform buffer hold the blend shape weights of the previous frame as well.
|
|
@@ -1165,10 +1165,10 @@ var _Engine = class _Engine extends RnObject {
|
|
|
1165
1165
|
* @internal
|
|
1166
1166
|
*/
|
|
1167
1167
|
_enablePreviousMorphWeights() {
|
|
1168
|
-
this.
|
|
1168
|
+
this.nB = true;
|
|
1169
1169
|
}
|
|
1170
1170
|
get logger() {
|
|
1171
|
-
return this.
|
|
1171
|
+
return this.kB;
|
|
1172
1172
|
}
|
|
1173
1173
|
/**
|
|
1174
1174
|
* Gets the shader program cache for this engine instance.
|
|
@@ -1177,7 +1177,7 @@ var _Engine = class _Engine extends RnObject {
|
|
|
1177
1177
|
* @internal
|
|
1178
1178
|
*/
|
|
1179
1179
|
get shaderProgramCache() {
|
|
1180
|
-
return this.
|
|
1180
|
+
return this.xB;
|
|
1181
1181
|
}
|
|
1182
1182
|
};
|
|
1183
1183
|
/**
|
|
@@ -1186,9 +1186,9 @@ var _Engine = class _Engine extends RnObject {
|
|
|
1186
1186
|
* @internal
|
|
1187
1187
|
*/
|
|
1188
1188
|
_Engine._loadXRByDefault = false;
|
|
1189
|
-
_Engine.
|
|
1190
|
-
_Engine.
|
|
1191
|
-
_Engine.
|
|
1189
|
+
_Engine.oB = /* @__PURE__ */ new Map();
|
|
1190
|
+
_Engine.pB = 0;
|
|
1191
|
+
_Engine.wB = "The XR support is not enabled. Initialize the engine with Engine.init({ xr: true }) or call await engine.enableXR() first. The default Rn namespace export enables it automatically.";
|
|
1192
1192
|
var Engine = _Engine;
|
|
1193
1193
|
export {
|
|
1194
1194
|
Engine
|