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
|
@@ -22,27 +22,27 @@ import { isSkipDrawing } from "../foundation/renderer/RenderingCommonMethods.js"
|
|
|
22
22
|
import { WebGpuLightClusterBuilder } from "./WebGpuLightClusterBuilder.js";
|
|
23
23
|
var WebGpuStrategyBasic = class _WebGpuStrategyBasic {
|
|
24
24
|
constructor(engine) {
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
this.NE = -1;
|
|
30
|
-
this.Mc = -1;
|
|
31
|
-
this.OE = -1;
|
|
32
|
-
this.dK = -1;
|
|
33
|
-
this.Lc = -1;
|
|
25
|
+
this.eK = CGAPIResourceRepository.InvalidCGAPIResourceUid;
|
|
26
|
+
this.fK = CGAPIResourceRepository.InvalidCGAPIResourceUid;
|
|
27
|
+
this.EE = true;
|
|
28
|
+
this.PE = -1;
|
|
34
29
|
this.QE = -1;
|
|
35
|
-
this.
|
|
36
|
-
this.Nc = -1;
|
|
37
|
-
this.KE = -1;
|
|
38
|
-
this.LE = -1;
|
|
30
|
+
this.Mc = -1;
|
|
39
31
|
this.RE = -1;
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
42
|
-
this.iE = -1;
|
|
43
|
-
this.jE = -1;
|
|
44
|
-
this.eK = -1;
|
|
32
|
+
this.hK = -1;
|
|
33
|
+
this.Lc = -1;
|
|
45
34
|
this.TE = -1;
|
|
35
|
+
this.ZA = -1;
|
|
36
|
+
this.Nc = -1;
|
|
37
|
+
this.NE = -1;
|
|
38
|
+
this.OE = -1;
|
|
39
|
+
this.UE = -1;
|
|
40
|
+
this.FE = -1;
|
|
41
|
+
this.VE = -1;
|
|
42
|
+
this.kE = -1;
|
|
43
|
+
this.lE = -1;
|
|
44
|
+
this.iK = -1;
|
|
45
|
+
this.WE = -1;
|
|
46
46
|
this.c = engine;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
@@ -202,7 +202,7 @@ var WebGpuStrategyBasic = class _WebGpuStrategyBasic {
|
|
|
202
202
|
`;
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
static
|
|
205
|
+
static mF(engine) {
|
|
206
206
|
const morphUniformDataTargetNumbers = Primitive.getMorphUniformDataTargetNumbers();
|
|
207
207
|
const morphUniformDataTargetNumbersStr = `
|
|
208
208
|
const rnMorphUniformDataTargetNumbers: array<u32, ${morphUniformDataTargetNumbers.length}> = array<u32, ${morphUniformDataTargetNumbers.length}>(${morphUniformDataTargetNumbers.map((num) => `${num}u`).join(", ")});
|
|
@@ -278,7 +278,7 @@ var WebGpuStrategyBasic = class _WebGpuStrategyBasic {
|
|
|
278
278
|
* @param info - Shader semantics information containing type and binding details
|
|
279
279
|
* @returns WGSL shader code for the property accessor function
|
|
280
280
|
*/
|
|
281
|
-
static
|
|
281
|
+
static nF(engine, info) {
|
|
282
282
|
var _a, _b;
|
|
283
283
|
const returnType = info.compositionType.toWGSLType(info.componentType);
|
|
284
284
|
const methodName = info.semantic.replace(".", "_");
|
|
@@ -406,7 +406,7 @@ ${indexStr}
|
|
|
406
406
|
* @param info - Shader semantics information containing type and binding details
|
|
407
407
|
* @returns WGSL shader code for the property accessor function
|
|
408
408
|
*/
|
|
409
|
-
static
|
|
409
|
+
static oF(engine, materialTypeName, info) {
|
|
410
410
|
var _a, _b;
|
|
411
411
|
const returnType = info.compositionType.toWGSLType(info.componentType);
|
|
412
412
|
const methodName = info.semantic.replace(".", "_");
|
|
@@ -572,51 +572,51 @@ ${indexStr}
|
|
|
572
572
|
* Initializes morph target arrays and updates blend shape storage buffers when needed.
|
|
573
573
|
*/
|
|
574
574
|
common_$load() {
|
|
575
|
-
this.
|
|
575
|
+
this.qF();
|
|
576
576
|
}
|
|
577
|
-
|
|
577
|
+
qF() {
|
|
578
578
|
const morphUniformDataOffsets = Primitive.getMorphUniformDataOffsets();
|
|
579
579
|
const morphOffsetsUniformDataSize = Math.max(
|
|
580
580
|
Math.ceil(morphUniformDataOffsets[morphUniformDataOffsets.length - 1] / 4) * 4 * 4,
|
|
581
581
|
4
|
|
582
582
|
);
|
|
583
|
-
if (morphOffsetsUniformDataSize !== this.
|
|
583
|
+
if (morphOffsetsUniformDataSize !== this.FE) {
|
|
584
584
|
const webGpuResourceRepository = this.c.webGpuResourceRepository;
|
|
585
|
-
if (this.
|
|
585
|
+
if (this.kE !== CGAPIResourceRepository.InvalidCGAPIResourceUid) {
|
|
586
586
|
webGpuResourceRepository.flush();
|
|
587
587
|
webGpuResourceRepository.clearCache();
|
|
588
|
-
webGpuResourceRepository.deleteUniformBuffer(this.
|
|
589
|
-
this.
|
|
588
|
+
webGpuResourceRepository.deleteUniformBuffer(this.kE);
|
|
589
|
+
this.kE = CGAPIResourceRepository.InvalidCGAPIResourceUid;
|
|
590
590
|
}
|
|
591
|
-
this.
|
|
592
|
-
if (this.
|
|
591
|
+
this.FE = morphOffsetsUniformDataSize;
|
|
592
|
+
if (this.kE === CGAPIResourceRepository.InvalidCGAPIResourceUid) {
|
|
593
593
|
const inputArrayOffsets = new Uint32Array(morphOffsetsUniformDataSize);
|
|
594
|
-
this.
|
|
595
|
-
this.
|
|
594
|
+
this.DE = inputArrayOffsets;
|
|
595
|
+
this.kE = webGpuResourceRepository.createUniformMorphOffsetsBuffer(
|
|
596
596
|
morphOffsetsUniformDataSize * 4
|
|
597
597
|
);
|
|
598
|
-
this.
|
|
598
|
+
this.jK();
|
|
599
599
|
}
|
|
600
|
-
this.
|
|
600
|
+
this.FE = morphOffsetsUniformDataSize;
|
|
601
601
|
}
|
|
602
602
|
const blendShapeWeightsUniformDataSize = BlendShapeComponent._getMorphWeightsUniformBufferFloatCount(this.c);
|
|
603
|
-
if (blendShapeWeightsUniformDataSize !== this.
|
|
603
|
+
if (blendShapeWeightsUniformDataSize !== this.VE) {
|
|
604
604
|
const webGpuResourceRepository = this.c.webGpuResourceRepository;
|
|
605
|
-
if (this.
|
|
605
|
+
if (this.lE !== CGAPIResourceRepository.InvalidCGAPIResourceUid) {
|
|
606
606
|
webGpuResourceRepository.flush();
|
|
607
607
|
webGpuResourceRepository.clearCache();
|
|
608
|
-
webGpuResourceRepository.deleteUniformBuffer(this.
|
|
609
|
-
this.
|
|
608
|
+
webGpuResourceRepository.deleteUniformBuffer(this.lE);
|
|
609
|
+
this.lE = CGAPIResourceRepository.InvalidCGAPIResourceUid;
|
|
610
610
|
}
|
|
611
|
-
if (this.
|
|
611
|
+
if (this.lE === CGAPIResourceRepository.InvalidCGAPIResourceUid) {
|
|
612
612
|
const inputArrayWeights = new Float32Array(blendShapeWeightsUniformDataSize);
|
|
613
|
-
this.
|
|
614
|
-
this.
|
|
613
|
+
this.pE = inputArrayWeights;
|
|
614
|
+
this.lE = webGpuResourceRepository.createUniformMorphWeightsBuffer(
|
|
615
615
|
blendShapeWeightsUniformDataSize * 4
|
|
616
616
|
);
|
|
617
|
-
this.
|
|
617
|
+
this.ZE(true);
|
|
618
618
|
}
|
|
619
|
-
this.
|
|
619
|
+
this.VE = blendShapeWeightsUniformDataSize;
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
622
|
/**
|
|
@@ -625,7 +625,7 @@ ${indexStr}
|
|
|
625
625
|
*
|
|
626
626
|
* @param meshComponent - The mesh component containing primitives to setup
|
|
627
627
|
*/
|
|
628
|
-
|
|
628
|
+
pK(meshComponent) {
|
|
629
629
|
if (meshComponent.mesh == null) {
|
|
630
630
|
MeshComponent.alertNoMeshSet(meshComponent);
|
|
631
631
|
return;
|
|
@@ -657,9 +657,9 @@ ${indexStr}
|
|
|
657
657
|
primitive,
|
|
658
658
|
_WebGpuStrategyBasic.getVertexShaderMethodDefinitions_storageBuffer(this.c, ShaderType.VertexShader),
|
|
659
659
|
_WebGpuStrategyBasic.getVertexShaderMethodDefinitions_storageBuffer(this.c, ShaderType.PixelShader),
|
|
660
|
-
_WebGpuStrategyBasic.
|
|
661
|
-
_WebGpuStrategyBasic.
|
|
662
|
-
_WebGpuStrategyBasic.
|
|
660
|
+
_WebGpuStrategyBasic.nF,
|
|
661
|
+
_WebGpuStrategyBasic.oF,
|
|
662
|
+
_WebGpuStrategyBasic.mF(this.c)
|
|
663
663
|
);
|
|
664
664
|
primitive._backupMaterial();
|
|
665
665
|
} catch (e) {
|
|
@@ -670,9 +670,9 @@ ${indexStr}
|
|
|
670
670
|
primitive,
|
|
671
671
|
_WebGpuStrategyBasic.getVertexShaderMethodDefinitions_storageBuffer(this.c, ShaderType.VertexShader),
|
|
672
672
|
_WebGpuStrategyBasic.getVertexShaderMethodDefinitions_storageBuffer(this.c, ShaderType.PixelShader),
|
|
673
|
-
_WebGpuStrategyBasic.
|
|
674
|
-
_WebGpuStrategyBasic.
|
|
675
|
-
_WebGpuStrategyBasic.
|
|
673
|
+
_WebGpuStrategyBasic.nF,
|
|
674
|
+
_WebGpuStrategyBasic.oF,
|
|
675
|
+
_WebGpuStrategyBasic.mF(this.c)
|
|
676
676
|
);
|
|
677
677
|
}
|
|
678
678
|
}
|
|
@@ -704,37 +704,37 @@ ${indexStr}
|
|
|
704
704
|
* This method should be called once per frame before any rendering operations.
|
|
705
705
|
*/
|
|
706
706
|
prerender() {
|
|
707
|
-
if (AnimationComponent.getIsAnimating(this.c) || TransformComponent.getUpdateCount(this.c) !== this.Lc || SceneGraphComponent.getUpdateCount(this.c) !== this.
|
|
708
|
-
const isStorageBufferRecreated = this.
|
|
707
|
+
if (AnimationComponent.getIsAnimating(this.c) || TransformComponent.getUpdateCount(this.c) !== this.Lc || SceneGraphComponent.getUpdateCount(this.c) !== this.TE || CameraComponent.getCurrentCameraUpdateCount(this.c) !== this.ZA || _getCameraControllerUpdateCount(this.c) !== this.Nc || this.c.materialRepository.stateVersion !== this.PE || this.c.lightClusterSystem.dataVersion !== this.QE || LightComponent.getUpdateCount(this.c) !== this.Mc || this.c._gpuInstanceDataVersion !== this.RE) {
|
|
708
|
+
const isStorageBufferRecreated = this.lK();
|
|
709
709
|
this.c.webGpuResourceRepository._markGpuCullingInputsDirty();
|
|
710
710
|
const lightClusterDataVersion = this.c.lightClusterSystem.dataVersion;
|
|
711
|
-
if (isStorageBufferRecreated || lightClusterDataVersion !== this.
|
|
712
|
-
this.
|
|
713
|
-
this.
|
|
711
|
+
if (isStorageBufferRecreated || lightClusterDataVersion !== this.hK) {
|
|
712
|
+
this.mK();
|
|
713
|
+
this.hK = lightClusterDataVersion;
|
|
714
714
|
}
|
|
715
715
|
this.Lc = TransformComponent.getUpdateCount(this.c);
|
|
716
|
-
this.
|
|
717
|
-
this.
|
|
716
|
+
this.TE = SceneGraphComponent.getUpdateCount(this.c);
|
|
717
|
+
this.ZA = CameraComponent.getCurrentCameraUpdateCount(this.c);
|
|
718
718
|
this.Nc = _getCameraControllerUpdateCount(this.c);
|
|
719
|
-
this.
|
|
720
|
-
this.
|
|
719
|
+
this.PE = this.c.materialRepository.stateVersion;
|
|
720
|
+
this.QE = this.c.lightClusterSystem.dataVersion;
|
|
721
721
|
this.Mc = LightComponent.getUpdateCount(this.c);
|
|
722
|
-
this.
|
|
722
|
+
this.RE = this.c._gpuInstanceDataVersion;
|
|
723
723
|
}
|
|
724
724
|
const morphMaxIndex = Primitive.getPrimitiveCountHasMorph();
|
|
725
|
-
if (morphMaxIndex !== this.
|
|
726
|
-
this.
|
|
727
|
-
this.
|
|
725
|
+
if (morphMaxIndex !== this.OE) {
|
|
726
|
+
this.nK();
|
|
727
|
+
this.OE = morphMaxIndex;
|
|
728
728
|
this.c.webGpuResourceRepository._markGpuCullingInputsDirty();
|
|
729
729
|
}
|
|
730
|
-
if (BlendShapeComponent.updateCount !== this.
|
|
731
|
-
this.
|
|
730
|
+
if (BlendShapeComponent.updateCount !== this.NE || BlendShapeComponent.getCountOfBlendShapeComponents(this.c) !== this.WE) {
|
|
731
|
+
this.ZE();
|
|
732
732
|
this.c.webGpuResourceRepository._markGpuCullingInputsDirty();
|
|
733
|
-
this.
|
|
734
|
-
this.
|
|
733
|
+
this.NE = BlendShapeComponent.updateCount;
|
|
734
|
+
this.WE = BlendShapeComponent.getCountOfBlendShapeComponents(this.c);
|
|
735
735
|
this.c.materialRepository._makeShaderInvalidateToMorphMaterials();
|
|
736
736
|
} else {
|
|
737
|
-
this.
|
|
737
|
+
this.vF();
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
740
|
/**
|
|
@@ -749,12 +749,12 @@ ${indexStr}
|
|
|
749
749
|
*/
|
|
750
750
|
common_$render(primitiveUids, renderPass, _renderPassTickCount, displayIdx) {
|
|
751
751
|
if (renderPass.isBufferLessRenderingMode()) {
|
|
752
|
-
this.
|
|
752
|
+
this.yF(renderPass);
|
|
753
753
|
return true;
|
|
754
754
|
}
|
|
755
755
|
let renderedSomething = false;
|
|
756
756
|
const isZWrite = renderPass.isDepthTest && renderPass.depthWriteMask;
|
|
757
|
-
const useDepthPrepass = this.
|
|
757
|
+
const useDepthPrepass = this.oK(renderPass);
|
|
758
758
|
if (useDepthPrepass) {
|
|
759
759
|
for (let i = renderPass._lastOpaqueIndex; i >= 0; i--) {
|
|
760
760
|
this.renderInner(primitiveUids[i], renderPass, true, displayIdx, { depthOnly: true });
|
|
@@ -798,12 +798,12 @@ ${indexStr}
|
|
|
798
798
|
*
|
|
799
799
|
* @param renderPass - The render pass containing the material and rendering configuration
|
|
800
800
|
*/
|
|
801
|
-
|
|
801
|
+
yF(renderPass) {
|
|
802
802
|
const material = renderPass.material;
|
|
803
803
|
const primitive = renderPass._dummyPrimitiveForBufferLessRendering;
|
|
804
804
|
this._setupShaderProgram(material, primitive);
|
|
805
805
|
const webGpuResourceRepository = this.c.webGpuResourceRepository;
|
|
806
|
-
const cameraSID = this.
|
|
806
|
+
const cameraSID = this.kK(renderPass, 0, false);
|
|
807
807
|
webGpuResourceRepository.setDrawParameters(material.materialSID, cameraSID, 0, 0);
|
|
808
808
|
const isZWrite = renderPass.isDepthTest && renderPass.depthWriteMask;
|
|
809
809
|
webGpuResourceRepository.draw(this.c, primitive, material, renderPass, cameraSID, isZWrite, 0);
|
|
@@ -812,7 +812,7 @@ ${indexStr}
|
|
|
812
812
|
* Whether the depth prepass can run for the render pass: it must be enabled, draw the scene itself (render passes
|
|
813
813
|
* with a material override such as shadow maps and post effects are excluded), and write depth.
|
|
814
814
|
*/
|
|
815
|
-
|
|
815
|
+
oK(renderPass) {
|
|
816
816
|
const framebuffer = renderPass.getFramebuffer();
|
|
817
817
|
return this.c.config.isDepthPrepassEnabled && renderPass.material == null && renderPass.isDepthTest && renderPass.depthWriteMask && (framebuffer == null || framebuffer.depthAttachment != null) && renderPass._toRenderOpaquePrimitives && renderPass._lastOpaqueIndex >= 0;
|
|
818
818
|
}
|
|
@@ -845,7 +845,7 @@ ${indexStr}
|
|
|
845
845
|
}
|
|
846
846
|
const webGpuResourceRepository = this.c.webGpuResourceRepository;
|
|
847
847
|
const webxrSystem = this.c._webXRSystemIfEnabled;
|
|
848
|
-
const cameraSID = this.
|
|
848
|
+
const cameraSID = this.kK(
|
|
849
849
|
renderPass,
|
|
850
850
|
displayIdx,
|
|
851
851
|
((_a = webxrSystem == null ? void 0 : webxrSystem.isWebXRMode) != null ? _a : false) && renderPass.isVrRendering
|
|
@@ -874,34 +874,34 @@ ${indexStr}
|
|
|
874
874
|
* This buffer holds transform matrices, material properties, and other per-instance data
|
|
875
875
|
* required for rendering all objects in the scene.
|
|
876
876
|
*/
|
|
877
|
-
|
|
877
|
+
lK() {
|
|
878
878
|
const memoryManager = this.c.memoryManager;
|
|
879
879
|
const gpuInstanceDataBuffers = memoryManager.getBuffers(BufferUse.GPUInstanceData);
|
|
880
880
|
const gpuInstanceDataBufferCount = gpuInstanceDataBuffers.length;
|
|
881
881
|
const webGpuResourceRepository = this.c.webGpuResourceRepository;
|
|
882
|
-
if (gpuInstanceDataBufferCount !== this.
|
|
883
|
-
this.
|
|
884
|
-
webGpuResourceRepository.destroyStorageBuffer(this.
|
|
885
|
-
this.
|
|
882
|
+
if (gpuInstanceDataBufferCount !== this.UE) {
|
|
883
|
+
this.UE = gpuInstanceDataBufferCount;
|
|
884
|
+
webGpuResourceRepository.destroyStorageBuffer(this.eK);
|
|
885
|
+
this.eK = CGAPIResourceRepository.InvalidCGAPIResourceUid;
|
|
886
886
|
}
|
|
887
|
-
if (this.
|
|
887
|
+
if (this.eK !== CGAPIResourceRepository.InvalidCGAPIResourceUid) {
|
|
888
888
|
const lightClusterSystem = this.c.lightClusterSystem;
|
|
889
889
|
webGpuResourceRepository.updateStorageBuffer(
|
|
890
|
-
this.
|
|
890
|
+
this.eK,
|
|
891
891
|
gpuInstanceDataBuffers,
|
|
892
892
|
lightClusterSystem._getExcludedByteRanges()
|
|
893
893
|
);
|
|
894
894
|
const dirtyRanges = lightClusterSystem._takeDirtyByteRanges();
|
|
895
895
|
if (dirtyRanges.length > 0) {
|
|
896
896
|
webGpuResourceRepository.updateStorageBufferRanges(
|
|
897
|
-
this.
|
|
897
|
+
this.eK,
|
|
898
898
|
gpuInstanceDataBuffers,
|
|
899
899
|
dirtyRanges
|
|
900
900
|
);
|
|
901
901
|
}
|
|
902
902
|
return false;
|
|
903
903
|
}
|
|
904
|
-
this.
|
|
904
|
+
this.eK = webGpuResourceRepository.createStorageBuffer(gpuInstanceDataBuffers);
|
|
905
905
|
this.c.lightClusterSystem._takeDirtyByteRanges();
|
|
906
906
|
return true;
|
|
907
907
|
}
|
|
@@ -909,7 +909,7 @@ ${indexStr}
|
|
|
909
909
|
* Builds the Clustered Forward light cluster tables with compute shaders when the LightClusterSystem
|
|
910
910
|
* builds them on the GPU. It must run after every upload of the GPU instance data, which overwrites the tables.
|
|
911
911
|
*/
|
|
912
|
-
|
|
912
|
+
mK() {
|
|
913
913
|
var _a, _b;
|
|
914
914
|
const params = this.c.lightClusterSystem._getGpuBuildParams();
|
|
915
915
|
if (params == null) {
|
|
@@ -920,27 +920,27 @@ ${indexStr}
|
|
|
920
920
|
if (storageBuffer == null) {
|
|
921
921
|
return;
|
|
922
922
|
}
|
|
923
|
-
(_b = this[_a = "
|
|
923
|
+
(_b = this[_a = "gK"]) != null ? _b : this[_a] = new WebGpuLightClusterBuilder(
|
|
924
924
|
webGpuResourceRepository.getWebGpuDeviceWrapper().gpuDevice
|
|
925
925
|
);
|
|
926
926
|
const gpuTimer = this.c.gpuTimerEnabled ? webGpuResourceRepository._getGpuTimer() : void 0;
|
|
927
|
-
this.
|
|
927
|
+
this.gK.build(storageBuffer, params, gpuTimer);
|
|
928
928
|
}
|
|
929
929
|
/**
|
|
930
930
|
* Creates or updates the storage buffer containing blend shape vertex data.
|
|
931
931
|
* This buffer holds morph target positions and other vertex attributes needed for blend shape animation.
|
|
932
932
|
*/
|
|
933
|
-
|
|
933
|
+
nK() {
|
|
934
934
|
const memoryManager = this.c.memoryManager;
|
|
935
935
|
const blendShapeDataBuffers = memoryManager.getBuffers(BufferUse.GPUVertexData);
|
|
936
936
|
if (blendShapeDataBuffers.length === 0) {
|
|
937
937
|
return;
|
|
938
938
|
}
|
|
939
939
|
const blendShapeDataBufferByteLength = blendShapeDataBuffers.reduce((acc, buffer) => acc + buffer.byteLength, 0);
|
|
940
|
-
if (blendShapeDataBufferByteLength !== this.
|
|
941
|
-
this.c.webGpuResourceRepository.deleteStorageBlendShapeBuffer(this.
|
|
942
|
-
this.
|
|
943
|
-
this.
|
|
940
|
+
if (blendShapeDataBufferByteLength !== this.iK) {
|
|
941
|
+
this.c.webGpuResourceRepository.deleteStorageBlendShapeBuffer(this.fK);
|
|
942
|
+
this.fK = CGAPIResourceRepository.InvalidCGAPIResourceUid;
|
|
943
|
+
this.iK = blendShapeDataBufferByteLength;
|
|
944
944
|
}
|
|
945
945
|
const webGpuResourceRepository = this.c.webGpuResourceRepository;
|
|
946
946
|
const float32Array = new Float32Array(blendShapeDataBufferByteLength / 4);
|
|
@@ -950,19 +950,19 @@ ${indexStr}
|
|
|
950
950
|
float32Array.set(new Float32Array(buffer.getArrayBuffer()), offset);
|
|
951
951
|
offset += buffer.byteLength / 4;
|
|
952
952
|
}
|
|
953
|
-
if (this.
|
|
953
|
+
if (this.fK !== CGAPIResourceRepository.InvalidCGAPIResourceUid) {
|
|
954
954
|
const componentSizeForDataTexture = blendShapeDataBufferByteLength / 4;
|
|
955
955
|
webGpuResourceRepository.updateStorageBlendShapeBuffer(
|
|
956
|
-
this.
|
|
956
|
+
this.fK,
|
|
957
957
|
float32Array,
|
|
958
958
|
componentSizeForDataTexture
|
|
959
959
|
);
|
|
960
960
|
} else {
|
|
961
|
-
this.
|
|
961
|
+
this.fK = webGpuResourceRepository.createStorageBlendShapeBuffer(float32Array);
|
|
962
962
|
}
|
|
963
|
-
this.
|
|
963
|
+
this.jK();
|
|
964
964
|
}
|
|
965
|
-
|
|
965
|
+
jK() {
|
|
966
966
|
const webGpuResourceRepository = this.c.webGpuResourceRepository;
|
|
967
967
|
const morphUniformDataOffsets = Primitive.getMorphUniformDataOffsets();
|
|
968
968
|
for (let i = 0; i < Primitive.getPrimitiveCountHasMorph(); i++) {
|
|
@@ -975,20 +975,20 @@ ${indexStr}
|
|
|
975
975
|
BufferUse.GPUVertexData,
|
|
976
976
|
accessor.bufferView.buffer.indexOfTheBufferUsage
|
|
977
977
|
);
|
|
978
|
-
this.
|
|
978
|
+
this.DE[morphUniformDataOffsets[i] + j] = (byteOffsetOfExistingBuffer + accessor.byteOffsetInBuffer) / 4 / 4;
|
|
979
979
|
}
|
|
980
980
|
} else {
|
|
981
981
|
break;
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
984
|
const elementNumToCopy = morphUniformDataOffsets[morphUniformDataOffsets.length - 1];
|
|
985
|
-
webGpuResourceRepository.updateUniformMorphOffsetsBuffer(this.
|
|
985
|
+
webGpuResourceRepository.updateUniformMorphOffsetsBuffer(this.DE, elementNumToCopy);
|
|
986
986
|
}
|
|
987
987
|
/**
|
|
988
988
|
* Updates uniform buffers containing morph target weights for blend shape animation.
|
|
989
989
|
* Copies weight values from blend shape components to GPU-accessible uniform buffers.
|
|
990
990
|
*/
|
|
991
|
-
|
|
991
|
+
ZE(isNewBuffer = false) {
|
|
992
992
|
const memoryManager = this.c.memoryManager;
|
|
993
993
|
const blendShapeDataBuffer = memoryManager.getBuffer(BufferUse.GPUVertexData);
|
|
994
994
|
if (blendShapeDataBuffer == null) {
|
|
@@ -999,17 +999,17 @@ ${indexStr}
|
|
|
999
999
|
}
|
|
1000
1000
|
const elementNumToCopy = BlendShapeComponent._writeMorphWeightsUniformArray(
|
|
1001
1001
|
this.c,
|
|
1002
|
-
this.
|
|
1002
|
+
this.pE,
|
|
1003
1003
|
isNewBuffer
|
|
1004
1004
|
);
|
|
1005
|
-
this.
|
|
1005
|
+
this.EE = false;
|
|
1006
1006
|
if (elementNumToCopy > 0) {
|
|
1007
|
-
this.
|
|
1007
|
+
this._E(elementNumToCopy);
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
|
-
|
|
1010
|
+
_E(elementNumToCopy) {
|
|
1011
1011
|
this.c.webGpuResourceRepository.updateUniformMorphWeightsBuffer(
|
|
1012
|
-
this.
|
|
1012
|
+
this.pE,
|
|
1013
1013
|
elementNumToCopy
|
|
1014
1014
|
);
|
|
1015
1015
|
}
|
|
@@ -1017,17 +1017,17 @@ ${indexStr}
|
|
|
1017
1017
|
* Makes the weights of the previous frame in the morph weights uniform buffer equal to the current weights once
|
|
1018
1018
|
* the weights stopped changing (temporal anti-aliasing only).
|
|
1019
1019
|
*/
|
|
1020
|
-
|
|
1021
|
-
if (this.
|
|
1020
|
+
vF() {
|
|
1021
|
+
if (this.EE || this.pE == null) {
|
|
1022
1022
|
return;
|
|
1023
1023
|
}
|
|
1024
|
-
this.
|
|
1024
|
+
this.EE = true;
|
|
1025
1025
|
const elementNumToCopy = BlendShapeComponent._settlePreviousMorphWeights(
|
|
1026
1026
|
this.c,
|
|
1027
|
-
this.
|
|
1027
|
+
this.pE
|
|
1028
1028
|
);
|
|
1029
1029
|
if (elementNumToCopy > 0) {
|
|
1030
|
-
this.
|
|
1030
|
+
this._E(elementNumToCopy);
|
|
1031
1031
|
}
|
|
1032
1032
|
}
|
|
1033
1033
|
/**
|
|
@@ -1039,7 +1039,7 @@ ${indexStr}
|
|
|
1039
1039
|
* @param isVRMainPass - Whether this is a VR main rendering pass
|
|
1040
1040
|
* @returns The component SID of the appropriate camera, or -1 if no camera is available
|
|
1041
1041
|
*/
|
|
1042
|
-
|
|
1042
|
+
kK(renderPass, displayIdx, isVRMainPass) {
|
|
1043
1043
|
if (isVRMainPass) {
|
|
1044
1044
|
const webxrSystem = this.c._webXRSystemIfEnabled;
|
|
1045
1045
|
let cameraComponentSid = -1;
|
|
@@ -1071,24 +1071,24 @@ ${indexStr}
|
|
|
1071
1071
|
destroy() {
|
|
1072
1072
|
var _a;
|
|
1073
1073
|
const webGpuResourceRepository = this.c.webGpuResourceRepository;
|
|
1074
|
-
(_a = this.
|
|
1075
|
-
this.
|
|
1074
|
+
(_a = this.gK) == null ? void 0 : _a.destroy();
|
|
1075
|
+
this.gK = void 0;
|
|
1076
1076
|
webGpuResourceRepository._destroyGpuCulling();
|
|
1077
|
-
if (this.
|
|
1078
|
-
webGpuResourceRepository.destroyStorageBuffer(this.
|
|
1079
|
-
this.
|
|
1077
|
+
if (this.eK !== CGAPIResourceRepository.InvalidCGAPIResourceUid) {
|
|
1078
|
+
webGpuResourceRepository.destroyStorageBuffer(this.eK);
|
|
1079
|
+
this.eK = CGAPIResourceRepository.InvalidCGAPIResourceUid;
|
|
1080
1080
|
}
|
|
1081
|
-
if (this.
|
|
1082
|
-
webGpuResourceRepository.deleteStorageBlendShapeBuffer(this.
|
|
1083
|
-
this.
|
|
1081
|
+
if (this.fK !== CGAPIResourceRepository.InvalidCGAPIResourceUid) {
|
|
1082
|
+
webGpuResourceRepository.deleteStorageBlendShapeBuffer(this.fK);
|
|
1083
|
+
this.fK = CGAPIResourceRepository.InvalidCGAPIResourceUid;
|
|
1084
1084
|
}
|
|
1085
|
-
if (this.
|
|
1086
|
-
webGpuResourceRepository.deleteUniformBuffer(this.
|
|
1087
|
-
this.
|
|
1085
|
+
if (this.kE !== CGAPIResourceRepository.InvalidCGAPIResourceUid) {
|
|
1086
|
+
webGpuResourceRepository.deleteUniformBuffer(this.kE);
|
|
1087
|
+
this.kE = CGAPIResourceRepository.InvalidCGAPIResourceUid;
|
|
1088
1088
|
}
|
|
1089
|
-
if (this.
|
|
1090
|
-
webGpuResourceRepository.deleteUniformBuffer(this.
|
|
1091
|
-
this.
|
|
1089
|
+
if (this.lE !== CGAPIResourceRepository.InvalidCGAPIResourceUid) {
|
|
1090
|
+
webGpuResourceRepository.deleteUniformBuffer(this.lE);
|
|
1091
|
+
this.lE = CGAPIResourceRepository.InvalidCGAPIResourceUid;
|
|
1092
1092
|
}
|
|
1093
1093
|
}
|
|
1094
1094
|
};
|