rhodonite 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -19
- package/VERSION-FILE +1 -1
- package/dist/esm/foundation/components/BlendShape/BlendShapeComponent.d.ts +54 -0
- package/dist/esm/foundation/components/BlendShape/BlendShapeComponent.js +1 -1
- package/dist/esm/foundation/components/Camera/CameraComponent.d.ts +34 -0
- package/dist/esm/foundation/components/Camera/CameraComponent.js +1 -1
- package/dist/esm/foundation/components/Light/LightComponent.d.ts +3 -1
- package/dist/esm/foundation/components/Light/LightComponent.js +1 -1
- package/dist/esm/foundation/components/Mesh/MeshComponent.js +1 -1
- package/dist/esm/foundation/components/MeshRenderer/MeshRendererComponent.js +1 -1
- package/dist/esm/foundation/components/SceneGraph/SceneGraphComponent.d.ts +16 -0
- package/dist/esm/foundation/components/SceneGraph/SceneGraphComponent.js +1 -1
- package/dist/esm/foundation/components/Shape/ShapeComponent.js +1 -1
- package/dist/esm/foundation/components/Skeletal/AnimationRetarget/AbsoluteAnimation.js +1 -1
- package/dist/esm/foundation/components/Skeletal/AnimationRetarget/GlobalRetarget.js +1 -1
- package/dist/esm/foundation/components/Skeletal/AnimationRetarget/GlobalRetargetReverse.js +1 -1
- package/dist/esm/foundation/components/Skeletal/SkeletalComponent.d.ts +48 -0
- package/dist/esm/foundation/components/Skeletal/SkeletalComponent.js +1 -1
- package/dist/esm/foundation/components/Transform/TransformComponent.js +1 -1
- package/dist/esm/foundation/components/Trigger/TriggerComponent.js +1 -1
- package/dist/esm/foundation/components/Vrm/VrmComponent.js +1 -1
- package/dist/esm/foundation/constraints/VrmAimConstraint.js +1 -1
- package/dist/esm/foundation/constraints/VrmRollConstraint.js +1 -1
- package/dist/esm/foundation/constraints/VrmRotationConstraint.js +1 -1
- package/dist/esm/foundation/core/Component.js +1 -1
- package/dist/esm/foundation/core/ComponentRepository.js +1 -1
- package/dist/esm/foundation/core/Entity.js +1 -1
- package/dist/esm/foundation/core/EntityRepository.js +1 -1
- package/dist/esm/foundation/geometry/ComplexVertexAttribute.js +1 -1
- package/dist/esm/foundation/geometry/Mesh.js +1 -1
- package/dist/esm/foundation/geometry/Primitive.js +1 -1
- package/dist/esm/foundation/gizmos/AABBGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/CapsuleColliderGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/Gizmo.d.ts +13 -0
- package/dist/esm/foundation/gizmos/Gizmo.js +1 -1
- package/dist/esm/foundation/gizmos/JointGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/LightGizmo.d.ts +0 -1
- package/dist/esm/foundation/gizmos/LightGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/LocatorGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/RotationGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/ScaleGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/ShapeGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/SphereColliderGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/TranslationGizmo.js +1 -1
- package/dist/esm/foundation/helpers/BloomHelper.js +1 -1
- package/dist/esm/foundation/helpers/GaussianBlurHelper.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/PointShadowMap.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/ShadowMap.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/ShadowSystem.js +1 -1
- package/dist/esm/foundation/helpers/materials/createMotionVectorMaterial.d.ts +25 -0
- package/dist/esm/foundation/helpers/materials/createMotionVectorMaterial.js +1 -0
- package/dist/esm/foundation/helpers/materials/createTemporalAAResolveMaterial.d.ts +33 -0
- package/dist/esm/foundation/helpers/materials/createTemporalAAResolveMaterial.js +1 -0
- package/dist/esm/foundation/importer/AnimationAssigner.js +1 -1
- package/dist/esm/foundation/importer/DrcPointCloudImporter.js +1 -1
- package/dist/esm/foundation/importer/Gltf2Importer.js +1 -1
- package/dist/esm/foundation/importer/GltfImporter.js +1 -1
- package/dist/esm/foundation/importer/ModelConverter.js +1 -1
- package/dist/esm/foundation/importer/RhodoniteImportExtension.js +1 -1
- package/dist/esm/foundation/importer/Vrm0xImporter.js +1 -1
- package/dist/esm/foundation/importer/VrmImporter.js +1 -1
- package/dist/esm/foundation/materials/contents/CustomMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/MToon0xMaterialContent.js +18 -18
- package/dist/esm/foundation/materials/contents/MToon1MaterialContent.js +6 -6
- package/dist/esm/foundation/materials/core/AbstractMaterialContent.d.ts +11 -0
- package/dist/esm/foundation/materials/core/AbstractMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/core/ShaderityUtilityWebGL.js +2 -2
- package/dist/esm/foundation/materials/core/ShaderityUtilityWebGPU.js +2 -2
- package/dist/esm/foundation/materials/nodes/CastToFloatShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/MergeVectorShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/Random_HashPRNGShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/Random_SinHashShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/SplitVectorShaderNode.js +1 -1
- package/dist/esm/foundation/math/MathClassUtil.js +1 -1
- package/dist/esm/foundation/math/Quaternion.js +1 -1
- package/dist/esm/foundation/math/Transform3D.js +1 -1
- package/dist/esm/foundation/math/shapes/MathSphere.js +1 -1
- package/dist/esm/foundation/memory/Accessor.js +6 -6
- package/dist/esm/foundation/memory/BufferView.js +1 -1
- package/dist/esm/foundation/misc/cache/Cache.js +1 -1
- package/dist/esm/foundation/physics/VRMSpring/CapsuleCollider.js +1 -1
- package/dist/esm/foundation/physics/VRMSpring/SphereCollider.js +1 -1
- package/dist/esm/foundation/physics/VRMSpring/VRMSpringBone.js +1 -1
- package/dist/esm/foundation/renderer/Frame.js +1 -1
- package/dist/esm/foundation/renderer/RenderPass.js +1 -1
- package/dist/esm/foundation/renderer/TemporalAA/PreviousFrameDataTracker.d.ts +33 -0
- package/dist/esm/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +1 -0
- package/dist/esm/foundation/renderer/TemporalAA/TemporalAASystem.d.ts +135 -0
- package/dist/esm/foundation/renderer/TemporalAA/TemporalAASystem.js +1 -0
- package/dist/esm/foundation/renderer/pipelines/DeferredRenderPipeline.js +1 -1
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +62 -16
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.js +1 -1
- package/dist/esm/foundation/system/Engine.d.ts +37 -3
- package/dist/esm/foundation/system/Engine.js +1 -1
- package/dist/esm/foundation/textures/AbstractTexture.js +1 -1
- package/dist/esm/foundation/textures/CubeTexture.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTexture.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTexture2DArray.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTextureCube.js +1 -1
- package/dist/esm/foundation/textures/Texture.js +1 -1
- package/dist/esm/foundation/textures/TextureDataFloat.js +1 -1
- package/dist/esm/foundation/textures/VideoTexture.js +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/webgl/MultiDraw.js +1 -1
- package/dist/esm/webgl/MultiDrawRepository.js +1 -1
- package/dist/esm/webgl/WebGLStereoUtil.js +1 -1
- package/dist/esm/webgl/WebGLStrategyWebGL2.d.ts +8 -0
- package/dist/esm/webgl/WebGLStrategyWebGL2.js +47 -28
- package/dist/esm/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.vert.js +0 -3
- package/dist/esm/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.js +35 -0
- package/dist/esm/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.js +140 -0
- package/dist/esm/webgl/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.js +175 -0
- package/dist/esm/webgl/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.js +18 -0
- package/dist/esm/webgl/shaders/StandardShaderPart.js +3 -3
- package/dist/esm/webgl/shaders/nodes/ConstantVariableShader.js +5 -5
- package/dist/esm/webgl/shaders/nodes/UniformDataShader.js +9 -9
- package/dist/esm/webgpu/GpuCullingRegistry.js +1 -1
- package/dist/esm/webgpu/GpuDeformRegistry.js +1 -1
- package/dist/esm/webgpu/WebGpuGpuCulling.js +1 -1
- package/dist/esm/webgpu/WebGpuGpuTimer.js +1 -1
- package/dist/esm/webgpu/WebGpuLightClusterBuilder.js +1 -1
- package/dist/esm/webgpu/WebGpuResourceRepository.js +3 -3
- package/dist/esm/webgpu/WebGpuStrategyBasic.d.ts +8 -0
- package/dist/esm/webgpu/WebGpuStrategyBasic.js +78 -59
- package/dist/esm/webgpu/WebGpuVertexDeformer.js +1 -1
- package/dist/esm/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.wgsl.js +30 -0
- package/dist/esm/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.wgsl.js +133 -0
- package/dist/esm/webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.wgsl.js +169 -0
- package/dist/esm/webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.wgsl.js +19 -0
- package/dist/esmdev/foundation/components/BlendShape/BlendShapeComponent.d.ts +54 -0
- package/dist/esmdev/foundation/components/BlendShape/BlendShapeComponent.js +107 -1
- package/dist/esmdev/foundation/components/Camera/CameraComponent.d.ts +34 -0
- package/dist/esmdev/foundation/components/Camera/CameraComponent.js +118 -46
- package/dist/esmdev/foundation/components/CameraController/CameraControllerComponent.js +8 -8
- package/dist/esmdev/foundation/components/CharacterController/CharacterAnimationController.js +74 -74
- package/dist/esmdev/foundation/components/CharacterController/CharacterControllerComponent.js +39 -39
- package/dist/esmdev/foundation/components/Constraint/ConstraintComponent.js +4 -4
- package/dist/esmdev/foundation/components/Light/LightComponent.d.ts +3 -1
- package/dist/esmdev/foundation/components/Light/LightComponent.js +126 -121
- package/dist/esmdev/foundation/components/Mesh/MeshComponent.js +50 -50
- package/dist/esmdev/foundation/components/MeshRenderer/MeshRendererComponent.js +96 -92
- package/dist/esmdev/foundation/components/Physics/PhysicsComponent.js +73 -73
- package/dist/esmdev/foundation/components/Raymarching/RaymarchingComponent.js +54 -54
- package/dist/esmdev/foundation/components/Raymarching/RaymarchingSdfEvaluator.js +251 -251
- package/dist/esmdev/foundation/components/SceneGraph/SceneGraphComponent.d.ts +16 -0
- package/dist/esmdev/foundation/components/SceneGraph/SceneGraphComponent.js +375 -343
- package/dist/esmdev/foundation/components/Shape/ShapeComponent.js +31 -31
- package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/AbsoluteAnimation.js +5 -5
- package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/GlobalRetarget.js +5 -5
- package/dist/esmdev/foundation/components/Skeletal/AnimationRetarget/GlobalRetargetReverse.js +9 -9
- package/dist/esmdev/foundation/components/Skeletal/SkeletalComponent.d.ts +48 -0
- package/dist/esmdev/foundation/components/Skeletal/SkeletalComponent.js +337 -205
- package/dist/esmdev/foundation/components/Transform/TransformComponent.js +93 -93
- package/dist/esmdev/foundation/components/Trigger/TriggerComponent.js +61 -61
- package/dist/esmdev/foundation/components/Vrm/VrmComponent.js +44 -44
- package/dist/esmdev/foundation/constraints/VrmAimConstraint.js +11 -11
- package/dist/esmdev/foundation/constraints/VrmRollConstraint.js +16 -16
- package/dist/esmdev/foundation/constraints/VrmRotationConstraint.js +10 -10
- package/dist/esmdev/foundation/core/Component.js +32 -32
- package/dist/esmdev/foundation/core/ComponentMemoryRegistry.js +42 -42
- package/dist/esmdev/foundation/core/ComponentRepository.js +37 -37
- package/dist/esmdev/foundation/core/Config.js +9 -9
- package/dist/esmdev/foundation/core/Entity.js +9 -9
- package/dist/esmdev/foundation/core/EntityRepository.js +19 -19
- package/dist/esmdev/foundation/core/GlobalDataRepository.js +17 -17
- package/dist/esmdev/foundation/core/MemoryManager.js +25 -25
- package/dist/esmdev/foundation/core/RnObject.js +37 -37
- package/dist/esmdev/foundation/definitions/Blend.js +3 -3
- package/dist/esmdev/foundation/definitions/ComponentType.js +7 -7
- package/dist/esmdev/foundation/definitions/CompositionType.js +50 -50
- package/dist/esmdev/foundation/definitions/CompressionTextureType.js +6 -6
- package/dist/esmdev/foundation/definitions/ShaderSemantics.js +6 -6
- package/dist/esmdev/foundation/definitions/TextureFormat.js +3 -3
- package/dist/esmdev/foundation/definitions/TextureParameter.js +3 -3
- package/dist/esmdev/foundation/definitions/VertexAttribute.js +30 -30
- package/dist/esmdev/foundation/enhanced_js_objects/Array.js +2 -2
- package/dist/esmdev/foundation/exporter/Gltf2Exporter.js +112 -112
- package/dist/esmdev/foundation/geometry/ComplexVertexAttribute.js +24 -24
- package/dist/esmdev/foundation/geometry/Frustum.js +41 -41
- package/dist/esmdev/foundation/geometry/Mesh.js +218 -218
- package/dist/esmdev/foundation/geometry/Primitive.js +133 -133
- package/dist/esmdev/foundation/geometry/SimpleVertexAttribute.js +7 -7
- package/dist/esmdev/foundation/geometry/shapes/Cylinder.js +3 -3
- package/dist/esmdev/foundation/geometry/shapes/Joint.js +33 -33
- package/dist/esmdev/foundation/gizmos/AABBGizmo.js +17 -20
- package/dist/esmdev/foundation/gizmos/CapsuleColliderGizmo.js +24 -26
- package/dist/esmdev/foundation/gizmos/Gizmo.d.ts +13 -0
- package/dist/esmdev/foundation/gizmos/Gizmo.js +43 -21
- package/dist/esmdev/foundation/gizmos/JointGizmo.js +38 -40
- package/dist/esmdev/foundation/gizmos/LightGizmo.d.ts +0 -1
- package/dist/esmdev/foundation/gizmos/LightGizmo.js +26 -30
- package/dist/esmdev/foundation/gizmos/LocatorGizmo.js +26 -29
- package/dist/esmdev/foundation/gizmos/RotationGizmo.js +217 -219
- package/dist/esmdev/foundation/gizmos/ScaleGizmo.js +135 -137
- package/dist/esmdev/foundation/gizmos/ShapeGizmo.js +44 -47
- package/dist/esmdev/foundation/gizmos/SphereColliderGizmo.js +25 -27
- package/dist/esmdev/foundation/gizmos/TranslationGizmo.js +132 -134
- package/dist/esmdev/foundation/helpers/BloomHelper.js +34 -34
- package/dist/esmdev/foundation/helpers/GaussianBlurHelper.js +18 -18
- package/dist/esmdev/foundation/helpers/Shadow/PointShadowMap.js +12 -12
- package/dist/esmdev/foundation/helpers/Shadow/ShadowMap.js +5 -5
- package/dist/esmdev/foundation/helpers/Shadow/ShadowSystem.js +119 -119
- package/dist/esmdev/foundation/helpers/materials/createMotionVectorMaterial.d.ts +25 -0
- package/dist/esmdev/foundation/helpers/materials/createMotionVectorMaterial.js +61 -0
- package/dist/esmdev/foundation/helpers/materials/createTemporalAAResolveMaterial.d.ts +33 -0
- package/dist/esmdev/foundation/helpers/materials/createTemporalAAResolveMaterial.js +127 -0
- package/dist/esmdev/foundation/importer/AnimationAssigner.js +44 -44
- package/dist/esmdev/foundation/importer/DrcPointCloudImporter.js +33 -33
- package/dist/esmdev/foundation/importer/Gltf2Importer.js +14 -14
- package/dist/esmdev/foundation/importer/GltfImporter.js +22 -22
- package/dist/esmdev/foundation/importer/ModelConverter.js +131 -131
- package/dist/esmdev/foundation/importer/RhodoniteImportExtension.js +6 -6
- package/dist/esmdev/foundation/importer/Vrm0xImporter.js +48 -48
- package/dist/esmdev/foundation/importer/VrmImporter.js +10 -10
- package/dist/esmdev/foundation/materials/contents/CustomMaterialContent.js +27 -27
- package/dist/esmdev/foundation/materials/contents/DepthEncodeMaterialContent.js +2 -2
- package/dist/esmdev/foundation/materials/contents/MToon0xMaterialContent.js +138 -138
- package/dist/esmdev/foundation/materials/contents/MToon1MaterialContent.js +19 -19
- package/dist/esmdev/foundation/materials/contents/ShadowMapDecodeClassicMaterialContent.js +5 -5
- package/dist/esmdev/foundation/materials/contents/VarianceShadowMapDecodeClassicMaterialContent.js +5 -5
- package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.d.ts +11 -0
- package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.js +68 -53
- package/dist/esmdev/foundation/materials/core/AbstractShaderNode.js +26 -26
- package/dist/esmdev/foundation/materials/core/DummyTextures.js +3 -3
- package/dist/esmdev/foundation/materials/core/Material.js +115 -115
- package/dist/esmdev/foundation/materials/core/MaterialRepository.js +65 -65
- package/dist/esmdev/foundation/materials/core/ShaderGraphResolver.js +38 -38
- package/dist/esmdev/foundation/materials/core/ShaderHandler.js +4 -4
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGL.js +16 -17
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGPU.js +17 -18
- package/dist/esmdev/foundation/materials/nodes/AbsShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/AcosShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/AddShaderNode.js +18 -18
- package/dist/esmdev/foundation/materials/nodes/AlphaTestShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/AndShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/Atan2ShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/AttributeColorShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeInstanceIdsShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeJointShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeNormalShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributePositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/AttributeTangentShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/AttributeTexcoordShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/AttributeWeightShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/BlockBeginShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/BlockEndShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/BranchShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/CalcBitangentShaderNode.js +7 -7
- package/dist/esmdev/foundation/materials/nodes/CastToFloatShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/ClampShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/ClassicShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/ConstantScalarVariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVariableShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/ConstantVector2VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVector3VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/ConstantVector4VariableShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/CosShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/DiscardShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/DotProductShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/EqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/FlatShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/GreaterOrEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/GreaterShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/GreaterThanShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/LengthShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/LessOrEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/LessThanShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/MergeVectorShaderNode.js +19 -19
- package/dist/esmdev/foundation/materials/nodes/MinShaderNode.js +18 -18
- package/dist/esmdev/foundation/materials/nodes/MultiplyShaderNode.js +21 -21
- package/dist/esmdev/foundation/materials/nodes/NormalMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/NormalizeShaderNode.js +9 -9
- package/dist/esmdev/foundation/materials/nodes/NotEqualShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/OrShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/OutColorShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/OutPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/PbrAnisotropyPropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrAnisotropyRotationShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/PbrBaseColorPropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrClearcoatPropsShaderNode.js +7 -7
- package/dist/esmdev/foundation/materials/nodes/PbrDiffuseTransmissionPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrEmissivePropsShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/PbrIridescencePropsShaderNode.js +8 -8
- package/dist/esmdev/foundation/materials/nodes/PbrMetallicRoughnessPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrNormalPropsShaderNode.js +11 -11
- package/dist/esmdev/foundation/materials/nodes/PbrOcclusionPropsShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/PbrShaderShaderNode.js +21 -21
- package/dist/esmdev/foundation/materials/nodes/PbrSheenPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrSpecularPropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PbrTransmissionPropsShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/PbrVolumePropsShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/PremultipliedAlphaShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/ProcessGeometryShaderNode.js +22 -22
- package/dist/esmdev/foundation/materials/nodes/ProjectionMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/Random_HashPRNGShaderNode.js +12 -12
- package/dist/esmdev/foundation/materials/nodes/Random_SinHashShaderNode.js +12 -12
- package/dist/esmdev/foundation/materials/nodes/RemapShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/SinShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/SmoothStepShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/SplitVectorShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/StepShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/TanShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/Texture2DShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/TimeShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/TransformShaderNode.js +10 -10
- package/dist/esmdev/foundation/materials/nodes/UniformDataShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/ViewMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/WireframeMaterialNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/WorldMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendXYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendXZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendYXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendYZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendZXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/BendZYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/InitialPositionShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothIntersectionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothSubtractionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSmoothUnionShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpSubtractionShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/raymarching/OpUnionShaderNode.js +6 -6
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutDistanceShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutShadingColorShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/OutUnionShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchCameraPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitDistanceShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitNormalShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchHitPositionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchObjectIdShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchObjectIdUniformShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchRayDirectionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchTBNShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/RaymarchViewDirectionShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdApplyTransformShaderNode.js +9 -9
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdApplyWorldMatrixShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarXShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarYShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBarZShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdBoxShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdCapsuleShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatXYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatYZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatZShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRepeatZXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdRoundBoxShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdSphereShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTorusShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeXShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeYShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/SdTubeZShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistXShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistYShaderNode.js +4 -4
- package/dist/esmdev/foundation/materials/nodes/raymarching/TwistZShaderNode.js +4 -4
- package/dist/esmdev/foundation/math/AABB.js +132 -132
- package/dist/esmdev/foundation/math/AnimatedQuaternion.js +54 -54
- package/dist/esmdev/foundation/math/AnimatedScalar.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedValueEvaluationState.js +20 -20
- package/dist/esmdev/foundation/math/AnimatedVector2.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedVector3.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedVector4.js +55 -55
- package/dist/esmdev/foundation/math/AnimatedVectorN.js +55 -55
- package/dist/esmdev/foundation/math/IdentityMatrix33.js +2 -2
- package/dist/esmdev/foundation/math/IdentityMatrix44.js +2 -2
- package/dist/esmdev/foundation/math/MathClassUtil.js +4 -4
- package/dist/esmdev/foundation/math/Quaternion.js +20 -20
- package/dist/esmdev/foundation/math/Transform3D.js +83 -83
- package/dist/esmdev/foundation/math/shapes/MathSphere.js +9 -9
- package/dist/esmdev/foundation/memory/Accessor.js +370 -370
- package/dist/esmdev/foundation/memory/Buffer.js +40 -40
- package/dist/esmdev/foundation/memory/BufferView.js +33 -33
- package/dist/esmdev/foundation/misc/DataUtil.js +2 -2
- package/dist/esmdev/foundation/misc/EnumIO.js +10 -10
- package/dist/esmdev/foundation/misc/Logger.js +14 -14
- package/dist/esmdev/foundation/misc/RnPromise.js +14 -14
- package/dist/esmdev/foundation/misc/Time.js +27 -27
- package/dist/esmdev/foundation/misc/WeakOption.js +14 -14
- package/dist/esmdev/foundation/misc/cache/Cache.js +2 -2
- package/dist/esmdev/foundation/misc/cache/SymbolWeakMap.js +8 -8
- package/dist/esmdev/foundation/physics/PhysicsWorldQuery.js +13 -13
- package/dist/esmdev/foundation/physics/Rapier/RapierCharacterControllerStrategy.js +203 -203
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsStrategy.js +241 -241
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsWorldQueryStrategy.js +3 -3
- package/dist/esmdev/foundation/physics/VRMSpring/CapsuleCollider.js +42 -42
- package/dist/esmdev/foundation/physics/VRMSpring/SphereCollider.js +27 -27
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBone.js +10 -10
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBonePhysicsStrategy.js +51 -51
- package/dist/esmdev/foundation/renderer/Expression.js +6 -6
- package/dist/esmdev/foundation/renderer/Frame.js +12 -12
- package/dist/esmdev/foundation/renderer/FrameBuffer.js +25 -25
- package/dist/esmdev/foundation/renderer/RenderPass.js +102 -99
- package/dist/esmdev/foundation/renderer/TemporalAA/PreviousFrameDataTracker.d.ts +33 -0
- package/dist/esmdev/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +66 -0
- package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.d.ts +135 -0
- package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.js +275 -0
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystem.js +153 -153
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystemStub.js +3 -3
- package/dist/esmdev/foundation/renderer/pipelines/DeferredRenderPipeline.js +6 -6
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +62 -16
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.js +535 -428
- package/dist/esmdev/foundation/system/Engine.d.ts +37 -3
- package/dist/esmdev/foundation/system/Engine.js +266 -224
- package/dist/esmdev/foundation/system/EventPubSub.js +8 -8
- package/dist/esmdev/foundation/system/InputManager.js +56 -56
- package/dist/esmdev/foundation/system/ModuleManager.js +6 -6
- package/dist/esmdev/foundation/textures/AbstractTexture.js +50 -50
- package/dist/esmdev/foundation/textures/CubeTexture.js +32 -32
- package/dist/esmdev/foundation/textures/RenderBuffer.js +11 -11
- package/dist/esmdev/foundation/textures/RenderTargetTexture.js +25 -25
- package/dist/esmdev/foundation/textures/RenderTargetTexture2DArray.js +37 -37
- package/dist/esmdev/foundation/textures/RenderTargetTextureCube.js +19 -19
- package/dist/esmdev/foundation/textures/Sampler.js +24 -24
- package/dist/esmdev/foundation/textures/Texture.js +83 -83
- package/dist/esmdev/foundation/textures/TextureArray.js +8 -8
- package/dist/esmdev/foundation/textures/TextureDataFloat.js +26 -26
- package/dist/esmdev/foundation/textures/VideoTexture.js +24 -24
- package/dist/esmdev/version.js +2 -2
- package/dist/esmdev/webgl/InstanceSidTable.js +62 -62
- package/dist/esmdev/webgl/MultiDraw.js +2 -2
- package/dist/esmdev/webgl/MultiDrawRepository.js +30 -30
- package/dist/esmdev/webgl/WebGLContextWrapper.js +164 -164
- package/dist/esmdev/webgl/WebGLGpuTimer.js +32 -32
- package/dist/esmdev/webgl/WebGLResourceRepository.js +306 -306
- package/dist/esmdev/webgl/WebGLStereoUtil.js +42 -42
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.d.ts +8 -0
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.js +296 -261
- package/dist/esmdev/webgl/debug/ShaderParameterDebugger.js +4 -4
- package/dist/esmdev/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.js +12 -0
- package/dist/esmdev/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.js +12 -0
- package/dist/esmdev/webgl/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.js +12 -0
- package/dist/esmdev/webgl/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.js +12 -0
- package/dist/esmdev/webgl/shaders/RaymarchingShaderPart.js +4 -4
- package/dist/esmdev/webgl/shaders/RaymarchingShadowShaderPart.js +14 -14
- package/dist/esmdev/webgl/shaders/StandardShaderPart.js +3 -3
- package/dist/esmdev/webgl/shaders/nodes/BlockBeginShader.js +10 -10
- package/dist/esmdev/webgl/shaders/nodes/BlockEndShader.js +10 -10
- package/dist/esmdev/webgl/shaders/nodes/ConstantVariableShader.js +21 -21
- package/dist/esmdev/webgl/shaders/nodes/DiscardShader.js +3 -3
- package/dist/esmdev/webgl/shaders/nodes/EndShader.js +3 -3
- package/dist/esmdev/webgl/shaders/nodes/OutDistance.js +12 -12
- package/dist/esmdev/webgl/shaders/nodes/OutUnion.js +9 -9
- package/dist/esmdev/webgl/shaders/nodes/RaymarchObjectIdUniform.js +8 -8
- package/dist/esmdev/webgl/shaders/nodes/SdApplyTransform.js +9 -9
- package/dist/esmdev/webgl/shaders/nodes/SdApplyWorldMatrix.js +8 -8
- package/dist/esmdev/webgl/shaders/nodes/Texture2DShader.js +23 -23
- package/dist/esmdev/webgl/shaders/nodes/UniformDataShader.js +23 -23
- package/dist/esmdev/webgl/textureLoader/KTX2TextureLoader.js +27 -27
- package/dist/esmdev/webgpu/GpuCullingRegistry.js +94 -94
- package/dist/esmdev/webgpu/GpuDeformRegistry.js +53 -53
- package/dist/esmdev/webgpu/RangeAllocator.js +16 -16
- package/dist/esmdev/webgpu/WebGpuBufferArena.js +21 -21
- package/dist/esmdev/webgpu/WebGpuDeviceWrapper.js +7 -7
- package/dist/esmdev/webgpu/WebGpuGpuCulling.js +198 -198
- package/dist/esmdev/webgpu/WebGpuGpuTimer.js +52 -52
- package/dist/esmdev/webgpu/WebGpuLightClusterBuilder.js +37 -37
- package/dist/esmdev/webgpu/WebGpuResourceRepository.js +597 -597
- package/dist/esmdev/webgpu/WebGpuStrategyBasic.d.ts +8 -0
- package/dist/esmdev/webgpu/WebGpuStrategyBasic.js +170 -133
- package/dist/esmdev/webgpu/WebGpuVertexDeformer.js +128 -128
- package/dist/esmdev/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.frag.wgsl.js +12 -0
- package/dist/esmdev/webgpu/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.wgsl.js +12 -0
- package/dist/esmdev/webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.frag.wgsl.js +12 -0
- package/dist/esmdev/webgpu/shaderity_shaders/TemporalAAResolveShader/TemporalAAResolveShader.vert.wgsl.js +12 -0
- package/dist/esmdev/xr/WebARSystem.js +69 -69
- package/dist/esmdev/xr/WebXRSystem.js +153 -153
- package/package.json +1 -1
|
@@ -9,26 +9,26 @@ import { Logger } from "../../misc/Logger.js";
|
|
|
9
9
|
import { Material } from "./Material.js";
|
|
10
10
|
var _MaterialRepository = class _MaterialRepository {
|
|
11
11
|
constructor() {
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
12
|
+
this.qs = /* @__PURE__ */ new Map();
|
|
13
|
+
this.ss = /* @__PURE__ */ new Map();
|
|
14
|
+
this.xs = /* @__PURE__ */ new Map();
|
|
15
|
+
this.vs = /* @__PURE__ */ new Map();
|
|
16
|
+
this.ws = /* @__PURE__ */ new Map();
|
|
17
|
+
this.rs = /* @__PURE__ */ new Map();
|
|
18
|
+
this.ts = /* @__PURE__ */ new Map();
|
|
19
|
+
this.Ni = /* @__PURE__ */ new Map();
|
|
20
20
|
/** Tracks version incremented when a new buffer view is allocated for a material type. */
|
|
21
|
-
this.
|
|
21
|
+
this.us = /* @__PURE__ */ new Map();
|
|
22
22
|
/** Solo datum fields for each material type (engine-specific, not shared across engines) */
|
|
23
23
|
this._soloDatumFields = /* @__PURE__ */ new Map();
|
|
24
24
|
/** State version counter for tracking material changes (engine-specific) */
|
|
25
|
-
this.
|
|
25
|
+
this.Mi = 0;
|
|
26
26
|
/**
|
|
27
27
|
* State version counter for changes that invalidate WebGPU bind groups and
|
|
28
28
|
* render bundles (texture bindings, pipelines). Uniform-only updates do not
|
|
29
29
|
* bump this, so render bundles stay reusable across frames.
|
|
30
30
|
*/
|
|
31
|
-
this.
|
|
31
|
+
this.ys = 0;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Registers a new material type with the repository.
|
|
@@ -41,8 +41,8 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
41
41
|
* @returns True if the material type was successfully registered, false if it was already registered
|
|
42
42
|
*/
|
|
43
43
|
registerMaterial(engine, materialTypeName, materialNode, materialCountPerBufferView = engine.config.materialCountPerBufferView) {
|
|
44
|
-
if (!this.
|
|
45
|
-
this.
|
|
44
|
+
if (!this.ws.has(materialTypeName)) {
|
|
45
|
+
this.zs(materialTypeName, materialNode, materialCountPerBufferView);
|
|
46
46
|
return true;
|
|
47
47
|
}
|
|
48
48
|
return false;
|
|
@@ -58,7 +58,7 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
58
58
|
* @returns Always returns true as the registration is forced
|
|
59
59
|
*/
|
|
60
60
|
forceRegisterMaterial(engine, materialTypeName, materialNode, materialCountPerBufferView = engine.config.materialCountPerBufferView) {
|
|
61
|
-
this.
|
|
61
|
+
this.zs(materialTypeName, materialNode, materialCountPerBufferView);
|
|
62
62
|
return true;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
@@ -68,7 +68,7 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
68
68
|
* @returns True if the material type is registered, false otherwise
|
|
69
69
|
*/
|
|
70
70
|
isRegisteredMaterialType(materialTypeName) {
|
|
71
|
-
return this.
|
|
71
|
+
return this.ws.has(materialTypeName);
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Retrieves a material instance by its unique identifier.
|
|
@@ -79,7 +79,7 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
79
79
|
*/
|
|
80
80
|
getMaterialByMaterialUid(materialUid) {
|
|
81
81
|
var _a;
|
|
82
|
-
return (_a = this.
|
|
82
|
+
return (_a = this.qs.get(materialUid)) == null ? void 0 : _a.deref();
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
85
|
* Gets all currently active material instances from the repository.
|
|
@@ -89,7 +89,7 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
89
89
|
* @returns Array of WeakRef objects pointing to all registered materials
|
|
90
90
|
*/
|
|
91
91
|
getAllMaterials() {
|
|
92
|
-
return Array.from(this.
|
|
92
|
+
return Array.from(this.qs.values());
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
95
|
* Creates a new material instance of the specified type.
|
|
@@ -102,25 +102,25 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
102
102
|
* @throws Error if the material type is not registered or maximum instances exceeded
|
|
103
103
|
*/
|
|
104
104
|
createMaterial(engine, materialTypeName, materialNode) {
|
|
105
|
-
let countOfThisType = this.
|
|
106
|
-
const materialCountPerBufferView = this.
|
|
105
|
+
let countOfThisType = this.vs.get(materialTypeName);
|
|
106
|
+
const materialCountPerBufferView = this.rs.get(materialTypeName);
|
|
107
107
|
const indexInTheBufferView = countOfThisType % materialCountPerBufferView;
|
|
108
108
|
const indexOfBufferViews = Math.floor(countOfThisType / materialCountPerBufferView);
|
|
109
109
|
let newlyAllocatedBufferView = false;
|
|
110
110
|
if (indexInTheBufferView === 0) {
|
|
111
|
-
newlyAllocatedBufferView = this.
|
|
111
|
+
newlyAllocatedBufferView = this.Cs(engine, materialTypeName, materialNode, indexOfBufferViews);
|
|
112
112
|
}
|
|
113
113
|
const material = new Material(
|
|
114
114
|
engine,
|
|
115
|
-
this.
|
|
116
|
-
++_MaterialRepository.
|
|
115
|
+
this.xs.get(materialTypeName),
|
|
116
|
+
++_MaterialRepository.Bs,
|
|
117
117
|
countOfThisType++,
|
|
118
118
|
materialTypeName,
|
|
119
119
|
materialNode
|
|
120
120
|
);
|
|
121
|
-
this.
|
|
121
|
+
this.Ds(material, countOfThisType, indexOfBufferViews, indexInTheBufferView);
|
|
122
122
|
if (newlyAllocatedBufferView && indexOfBufferViews > 0) {
|
|
123
|
-
this.
|
|
123
|
+
this.Es(materialTypeName);
|
|
124
124
|
}
|
|
125
125
|
return material;
|
|
126
126
|
}
|
|
@@ -135,7 +135,7 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
135
135
|
*/
|
|
136
136
|
isMaterialCompatible(currentMaterial, newMaterialNode) {
|
|
137
137
|
var _a;
|
|
138
|
-
const existingMaterial = (_a = this.
|
|
138
|
+
const existingMaterial = (_a = this.qs.get(currentMaterial.materialUID)) == null ? void 0 : _a.deref();
|
|
139
139
|
if (Is.not.exist(existingMaterial)) {
|
|
140
140
|
return false;
|
|
141
141
|
}
|
|
@@ -157,20 +157,20 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
157
157
|
* @param countOfThisType - The current count of instances for this material type
|
|
158
158
|
* @private
|
|
159
159
|
*/
|
|
160
|
-
|
|
160
|
+
Ds(material, countOfThisType, indexOfBufferViews, _indexInTheBufferView) {
|
|
161
161
|
{
|
|
162
|
-
this.
|
|
163
|
-
let map = this.
|
|
162
|
+
this.qs.set(material.materialUID, new WeakRef(material));
|
|
163
|
+
let map = this.ss.get(material.Rr);
|
|
164
164
|
if (Is.not.exist(map)) {
|
|
165
165
|
map = /* @__PURE__ */ new Map();
|
|
166
|
-
this.
|
|
166
|
+
this.ss.set(material.materialTypeName, map);
|
|
167
167
|
}
|
|
168
168
|
map.set(material.materialSID, new WeakRef(material));
|
|
169
|
-
this.
|
|
169
|
+
this.vs.set(material.materialTypeName, countOfThisType);
|
|
170
170
|
}
|
|
171
171
|
if (Is.exist(material._materialContent)) {
|
|
172
172
|
const semanticsInfoArray = material._materialContent._semanticsInfoArray;
|
|
173
|
-
const accessorMap = this.
|
|
173
|
+
const accessorMap = this.Ni.get(material.materialTypeName).get(indexOfBufferViews);
|
|
174
174
|
semanticsInfoArray.forEach((semanticsInfo) => {
|
|
175
175
|
material._allFieldsInfo.set(semanticsInfo.semantic, semanticsInfo);
|
|
176
176
|
if (!semanticsInfo.soloDatum) {
|
|
@@ -205,7 +205,7 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
205
205
|
* @returns The byte offset divided by 16 (IndexOf16Bytes) for the property location
|
|
206
206
|
*/
|
|
207
207
|
getLocationOffsetOfMemberOfMaterial(engine, materialTypeName, propertyName) {
|
|
208
|
-
const map = this.
|
|
208
|
+
const map = this.ss.get(materialTypeName);
|
|
209
209
|
const materialRef = Array.from(map.values()).find((m) => m.deref() !== void 0);
|
|
210
210
|
if (Is.not.exist(materialRef == null ? void 0 : materialRef.deref())) {
|
|
211
211
|
Logger.default.warn(
|
|
@@ -219,7 +219,7 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
219
219
|
const value = this._soloDatumFields.get(material.materialTypeName).get(propertyName);
|
|
220
220
|
return [value.value._v.byteOffset / 4 / 4];
|
|
221
221
|
}
|
|
222
|
-
const propertiesOfBufferViews = this.
|
|
222
|
+
const propertiesOfBufferViews = this.Ni.get(materialTypeName);
|
|
223
223
|
const locationOffsets = [];
|
|
224
224
|
propertiesOfBufferViews == null ? void 0 : propertiesOfBufferViews.forEach((properties) => {
|
|
225
225
|
const accessor = properties.get(propertyName);
|
|
@@ -242,13 +242,13 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
242
242
|
* @param materialCountPerBufferView - The number of materials per buffer view
|
|
243
243
|
* @private
|
|
244
244
|
*/
|
|
245
|
-
|
|
246
|
-
const materialTid = ++_MaterialRepository.
|
|
247
|
-
this.
|
|
248
|
-
this.
|
|
249
|
-
this.
|
|
250
|
-
this.
|
|
251
|
-
this.
|
|
245
|
+
zs(materialTypeName, materialNode, materialCountPerBufferView) {
|
|
246
|
+
const materialTid = ++_MaterialRepository.As;
|
|
247
|
+
this.ws.set(materialTypeName, materialNode);
|
|
248
|
+
this.xs.set(materialTypeName, materialTid);
|
|
249
|
+
this.rs.set(materialTypeName, materialCountPerBufferView);
|
|
250
|
+
this.vs.set(materialTypeName, 0);
|
|
251
|
+
this.us.set(materialTypeName, 0);
|
|
252
252
|
}
|
|
253
253
|
/**
|
|
254
254
|
* Allocates GPU buffer memory for a material type based on its shader semantics.
|
|
@@ -260,7 +260,7 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
260
260
|
* @returns Whether a new BufferView was allocated (true) or an existing one was reused (false)
|
|
261
261
|
* @private
|
|
262
262
|
*/
|
|
263
|
-
|
|
263
|
+
Cs(engine, materialTypeName, materialNode, indexOfBufferViews) {
|
|
264
264
|
var _a;
|
|
265
265
|
let newlyAllocated = false;
|
|
266
266
|
let totalByteLength = 0;
|
|
@@ -269,7 +269,7 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
269
269
|
const alignedByteLength = calcAlignedByteLength(semanticInfo);
|
|
270
270
|
let dataCount = 1;
|
|
271
271
|
if (!semanticInfo.soloDatum) {
|
|
272
|
-
dataCount = this.
|
|
272
|
+
dataCount = this.rs.get(materialTypeName);
|
|
273
273
|
}
|
|
274
274
|
totalByteLength += alignedByteLength * dataCount;
|
|
275
275
|
alignedByteLengthAndSemanticInfoArray.push({
|
|
@@ -277,15 +277,15 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
277
277
|
semanticInfo
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
|
-
if (!this.
|
|
281
|
-
this.
|
|
280
|
+
if (!this.Ni.has(materialTypeName)) {
|
|
281
|
+
this.Ni.set(materialTypeName, /* @__PURE__ */ new Map());
|
|
282
282
|
}
|
|
283
283
|
let bufferView;
|
|
284
|
-
if (this.
|
|
285
|
-
const map = this.
|
|
284
|
+
if (this.ts.has(materialTypeName)) {
|
|
285
|
+
const map = this.ts.get(materialTypeName);
|
|
286
286
|
bufferView = map.get(indexOfBufferViews);
|
|
287
287
|
} else {
|
|
288
|
-
this.
|
|
288
|
+
this.ts.set(materialTypeName, /* @__PURE__ */ new Map());
|
|
289
289
|
}
|
|
290
290
|
if (bufferView == null) {
|
|
291
291
|
let bufferViewResult;
|
|
@@ -301,17 +301,17 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
301
301
|
}
|
|
302
302
|
} while (bufferViewResult.isErr());
|
|
303
303
|
bufferView = bufferViewResult.get();
|
|
304
|
-
this.
|
|
304
|
+
this.ts.get(materialTypeName).set(indexOfBufferViews, bufferView);
|
|
305
305
|
newlyAllocated = true;
|
|
306
|
-
const currentVersion = (_a = this.
|
|
307
|
-
this.
|
|
306
|
+
const currentVersion = (_a = this.us.get(materialTypeName)) != null ? _a : 0;
|
|
307
|
+
this.us.set(materialTypeName, currentVersion + 1);
|
|
308
308
|
}
|
|
309
309
|
for (let i = 0; i < alignedByteLengthAndSemanticInfoArray.length; i++) {
|
|
310
310
|
const alignedByte = alignedByteLengthAndSemanticInfoArray[i].alignedByte;
|
|
311
311
|
const semanticInfo = alignedByteLengthAndSemanticInfoArray[i].semanticInfo;
|
|
312
312
|
let count = 1;
|
|
313
313
|
if (!semanticInfo.soloDatum) {
|
|
314
|
-
count = this.
|
|
314
|
+
count = this.rs.get(materialTypeName);
|
|
315
315
|
}
|
|
316
316
|
let maxArrayLength = semanticInfo.arrayLength;
|
|
317
317
|
if (CompositionType.isArray(semanticInfo.compositionType) && maxArrayLength == null) {
|
|
@@ -336,10 +336,10 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
336
336
|
value: MathClassUtil.initWithFloat32Array(semanticInfo.initialValue, typedArray)
|
|
337
337
|
});
|
|
338
338
|
} else {
|
|
339
|
-
let properties = this.
|
|
339
|
+
let properties = this.Ni.get(materialTypeName).get(indexOfBufferViews);
|
|
340
340
|
if (properties == null) {
|
|
341
341
|
const map = /* @__PURE__ */ new Map();
|
|
342
|
-
this.
|
|
342
|
+
this.Ni.get(materialTypeName).set(indexOfBufferViews, map);
|
|
343
343
|
properties = map;
|
|
344
344
|
}
|
|
345
345
|
properties.set(semanticInfo.semantic, accessor);
|
|
@@ -348,7 +348,7 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
348
348
|
return newlyAllocated;
|
|
349
349
|
}
|
|
350
350
|
_getMaterialCountPerBufferView(materialTypeName) {
|
|
351
|
-
return this.
|
|
351
|
+
return this.rs.get(materialTypeName);
|
|
352
352
|
}
|
|
353
353
|
/**
|
|
354
354
|
* Public accessor used by debugging tools. The material SID selects a buffer view
|
|
@@ -359,7 +359,7 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
359
359
|
}
|
|
360
360
|
_getBufferViewVersion(materialTypeName) {
|
|
361
361
|
var _a;
|
|
362
|
-
return (_a = this.
|
|
362
|
+
return (_a = this.us.get(materialTypeName)) != null ? _a : 0;
|
|
363
363
|
}
|
|
364
364
|
/**
|
|
365
365
|
* Invalidates all shader programs for all registered materials.
|
|
@@ -370,7 +370,7 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
370
370
|
*/
|
|
371
371
|
_makeShaderInvalidateToAllMaterials() {
|
|
372
372
|
var _a;
|
|
373
|
-
for (const material of this.
|
|
373
|
+
for (const material of this.qs.values()) {
|
|
374
374
|
(_a = material.deref()) == null ? void 0 : _a.makeShadersInvalidate();
|
|
375
375
|
}
|
|
376
376
|
}
|
|
@@ -382,7 +382,7 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
382
382
|
* @internal
|
|
383
383
|
*/
|
|
384
384
|
_makeShaderInvalidateToMorphMaterials() {
|
|
385
|
-
for (const materialRef of this.
|
|
385
|
+
for (const materialRef of this.qs.values()) {
|
|
386
386
|
const material = materialRef.deref();
|
|
387
387
|
if (material == null || material.isMorphing === false) {
|
|
388
388
|
continue;
|
|
@@ -396,9 +396,9 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
|
|
399
|
+
Es(materialTypeName) {
|
|
400
400
|
var _a;
|
|
401
|
-
const materials = this.
|
|
401
|
+
const materials = this.ss.get(materialTypeName);
|
|
402
402
|
if (materials == null) {
|
|
403
403
|
return;
|
|
404
404
|
}
|
|
@@ -412,14 +412,14 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
412
412
|
* @returns The current state version number
|
|
413
413
|
*/
|
|
414
414
|
get stateVersion() {
|
|
415
|
-
return this.
|
|
415
|
+
return this.Mi;
|
|
416
416
|
}
|
|
417
417
|
/**
|
|
418
418
|
* Gets the state version that invalidates GPU bind groups and render bundles.
|
|
419
419
|
* @returns The binding state version number
|
|
420
420
|
*/
|
|
421
421
|
get bindingStateVersion() {
|
|
422
|
-
return this.
|
|
422
|
+
return this.ys;
|
|
423
423
|
}
|
|
424
424
|
/**
|
|
425
425
|
* Increments the state version counter.
|
|
@@ -427,7 +427,7 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
427
427
|
* @internal
|
|
428
428
|
*/
|
|
429
429
|
_incrementStateVersion() {
|
|
430
|
-
this.
|
|
430
|
+
this.Mi++;
|
|
431
431
|
}
|
|
432
432
|
/**
|
|
433
433
|
* Increments the state version that invalidates WebGPU bind groups and
|
|
@@ -435,11 +435,11 @@ var _MaterialRepository = class _MaterialRepository {
|
|
|
435
435
|
* @internal
|
|
436
436
|
*/
|
|
437
437
|
_incrementBindingStateVersion() {
|
|
438
|
-
this.
|
|
438
|
+
this.ys++;
|
|
439
439
|
}
|
|
440
440
|
};
|
|
441
|
-
_MaterialRepository.
|
|
442
|
-
_MaterialRepository.
|
|
441
|
+
_MaterialRepository.As = -1;
|
|
442
|
+
_MaterialRepository.Bs = -1;
|
|
443
443
|
var MaterialRepository = _MaterialRepository;
|
|
444
444
|
export {
|
|
445
445
|
MaterialRepository
|
|
@@ -146,19 +146,19 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
146
146
|
*/
|
|
147
147
|
static createVertexShaderCode(engine, vertexNodes, varyingNodes, commonShaderPart) {
|
|
148
148
|
const shaderNodes = vertexNodes.concat();
|
|
149
|
-
const sortedShaderNodes = this.
|
|
149
|
+
const sortedShaderNodes = this.Fs(shaderNodes);
|
|
150
150
|
let vertexShaderPrerequisites = "";
|
|
151
151
|
const nodes = sortedShaderNodes.concat(varyingNodes);
|
|
152
152
|
vertexShaderPrerequisites += commonShaderPart.getVertexPrerequisites(engine, nodes);
|
|
153
153
|
let shaderBody = "";
|
|
154
|
-
shaderBody += _ShaderGraphResolver.
|
|
154
|
+
shaderBody += _ShaderGraphResolver.Gs(
|
|
155
155
|
engine,
|
|
156
156
|
// sortedShaderNodes,
|
|
157
157
|
sortedShaderNodes.concat(varyingNodes.filter((node) => node.getShaderStage() !== "Fragment")),
|
|
158
158
|
ShaderType.VertexShader
|
|
159
159
|
);
|
|
160
160
|
try {
|
|
161
|
-
shaderBody += _ShaderGraphResolver.
|
|
161
|
+
shaderBody += _ShaderGraphResolver.Hs(engine, nodes, true, commonShaderPart);
|
|
162
162
|
} catch (e) {
|
|
163
163
|
Logger.default.error(e);
|
|
164
164
|
return void 0;
|
|
@@ -179,10 +179,10 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
179
179
|
*/
|
|
180
180
|
static createPixelShaderCode(engine, pixelNodes, commonShaderPart, shadingGroups) {
|
|
181
181
|
const shaderNodes = pixelNodes.concat();
|
|
182
|
-
const sortedShaderNodes = this.
|
|
182
|
+
const sortedShaderNodes = this.Fs(shaderNodes);
|
|
183
183
|
let pixelShaderPrerequisites = commonShaderPart.getPixelPrerequisites(engine, sortedShaderNodes);
|
|
184
184
|
let shaderBody = "";
|
|
185
|
-
shaderBody += _ShaderGraphResolver.
|
|
185
|
+
shaderBody += _ShaderGraphResolver.Gs(
|
|
186
186
|
engine,
|
|
187
187
|
sortedShaderNodes.filter((node) => node.getShaderStage() !== "Vertex"),
|
|
188
188
|
ShaderType.PixelShader,
|
|
@@ -195,19 +195,19 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
195
195
|
const sortedObjectIds = Array.from(shadingGroups.keys()).sort((a, b) => a - b);
|
|
196
196
|
for (const objectId of sortedObjectIds) {
|
|
197
197
|
const shadingNodes = shadingGroups.get(objectId);
|
|
198
|
-
const sortedShadingNodes = this.
|
|
199
|
-
const { varInputNames, varOutputNames, collectedShaderBody } = this.
|
|
198
|
+
const sortedShadingNodes = this.Fs(shadingNodes);
|
|
199
|
+
const { varInputNames, varOutputNames, collectedShaderBody } = this.Is(
|
|
200
200
|
engine,
|
|
201
201
|
sortedShadingNodes,
|
|
202
202
|
false,
|
|
203
203
|
commonShaderPart
|
|
204
204
|
);
|
|
205
|
-
const body = collectedShaderBody + this.
|
|
205
|
+
const body = collectedShaderBody + this.Js(engine, sortedShadingNodes, varInputNames, varOutputNames, false);
|
|
206
206
|
shadingSections.push({ objectId, functionName: `${functionPrefix}_${objectId}`, body });
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
try {
|
|
210
|
-
shaderBody += _ShaderGraphResolver.
|
|
210
|
+
shaderBody += _ShaderGraphResolver.Hs(
|
|
211
211
|
engine,
|
|
212
212
|
sortedShaderNodes,
|
|
213
213
|
false,
|
|
@@ -229,7 +229,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
229
229
|
* Graphs without that prefix (e.g. a single component built directly) are grouped
|
|
230
230
|
* under object id 0.
|
|
231
231
|
*/
|
|
232
|
-
static
|
|
232
|
+
static Ks(json, nodeInstances) {
|
|
233
233
|
var _a, _b;
|
|
234
234
|
const groups = /* @__PURE__ */ new Map();
|
|
235
235
|
const incoming = /* @__PURE__ */ new Map();
|
|
@@ -278,7 +278,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
278
278
|
* @returns True if all nodes are valid, false if any node has missing required connections
|
|
279
279
|
* @private
|
|
280
280
|
*/
|
|
281
|
-
static
|
|
281
|
+
static Us(shaderNodes) {
|
|
282
282
|
const _shaderNodeUids = [];
|
|
283
283
|
for (let i = 0; i < shaderNodes.length; i++) {
|
|
284
284
|
const shaderNode = shaderNodes[i];
|
|
@@ -301,7 +301,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
301
301
|
* @throws Error if the graph contains cycles
|
|
302
302
|
* @private
|
|
303
303
|
*/
|
|
304
|
-
static
|
|
304
|
+
static Fs(shaderNodes) {
|
|
305
305
|
const sortedNodeArray = [];
|
|
306
306
|
const inputNumArray = [];
|
|
307
307
|
const queue = [];
|
|
@@ -367,7 +367,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
367
367
|
* @returns String containing all function definitions
|
|
368
368
|
* @private
|
|
369
369
|
*/
|
|
370
|
-
static
|
|
370
|
+
static Gs(engine, shaderNodes, shaderType, embeddedShaderFunctionNames) {
|
|
371
371
|
let shaderText = "";
|
|
372
372
|
const existVertexFunctions = [];
|
|
373
373
|
for (let i = 0; i < shaderNodes.length; i++) {
|
|
@@ -387,7 +387,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
387
387
|
* Defines varying variables for vertex-to-fragment communication.
|
|
388
388
|
* @private
|
|
389
389
|
*/
|
|
390
|
-
static
|
|
390
|
+
static Ls(engine, shaderNodes, isVertexStage) {
|
|
391
391
|
let shaderBody = "";
|
|
392
392
|
const definedVaryings = /* @__PURE__ */ new Set();
|
|
393
393
|
if (engine.engineState.currentProcessApproach !== ProcessApproach.WebGPU) {
|
|
@@ -421,7 +421,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
421
421
|
* Collects input and output variable names for shader nodes.
|
|
422
422
|
* @private
|
|
423
423
|
*/
|
|
424
|
-
static
|
|
424
|
+
static Is(engine, shaderNodes, isVertexStage, commonShaderPart) {
|
|
425
425
|
const varInputNames = [];
|
|
426
426
|
const varOutputNames = [];
|
|
427
427
|
let collectedShaderBody = "";
|
|
@@ -433,10 +433,10 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
433
433
|
varOutputNames[i] = [];
|
|
434
434
|
}
|
|
435
435
|
for (let i = 0; i < shaderNodes.length; i++) {
|
|
436
|
-
this.
|
|
436
|
+
this.Ms(i, shaderNodes, varOutputNames, existingOutputs, existingOutputsVarName);
|
|
437
437
|
}
|
|
438
438
|
for (let i = 0; i < shaderNodes.length; i++) {
|
|
439
|
-
collectedShaderBody += this.
|
|
439
|
+
collectedShaderBody += this.Ns(
|
|
440
440
|
engine,
|
|
441
441
|
i,
|
|
442
442
|
shaderNodes,
|
|
@@ -454,7 +454,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
454
454
|
* Collects input variables for a specific node.
|
|
455
455
|
* @private
|
|
456
456
|
*/
|
|
457
|
-
static
|
|
457
|
+
static Ns(engine, nodeIndex, shaderNodes, varInputNames, varOutputNames, existingInputs, existingOutputsVarName, isVertexStage, commonShaderPart) {
|
|
458
458
|
const shaderNode = shaderNodes[nodeIndex];
|
|
459
459
|
if (varInputNames[nodeIndex] == null) {
|
|
460
460
|
varInputNames[nodeIndex] = [];
|
|
@@ -467,13 +467,13 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
467
467
|
for (let j = 0; j < shaderNode.getInputs().length; j++) {
|
|
468
468
|
const inputConnection = inputConnections[j];
|
|
469
469
|
if (inputConnection == null) {
|
|
470
|
-
const defaultValue = this.
|
|
470
|
+
const defaultValue = this.Os(engine, shaderNode, j);
|
|
471
471
|
if (defaultValue) {
|
|
472
472
|
varInputNames[nodeIndex].push(defaultValue);
|
|
473
473
|
}
|
|
474
474
|
continue;
|
|
475
475
|
}
|
|
476
|
-
const { varName, rowStr } = this.
|
|
476
|
+
const { varName, rowStr } = this.Ps(
|
|
477
477
|
engine,
|
|
478
478
|
inputConnection,
|
|
479
479
|
shaderNode,
|
|
@@ -497,7 +497,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
497
497
|
* Checks if the defaultValue is a struct type (Record<string, ValueTypes>) rather than a primitive ValueTypes.
|
|
498
498
|
* @private
|
|
499
499
|
*/
|
|
500
|
-
static
|
|
500
|
+
static Qs(defaultValue) {
|
|
501
501
|
if (typeof defaultValue !== "object" || defaultValue === null) {
|
|
502
502
|
return false;
|
|
503
503
|
}
|
|
@@ -511,7 +511,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
511
511
|
* If the glslStr starts with 'struct ', extracts and returns the struct name.
|
|
512
512
|
* @private
|
|
513
513
|
*/
|
|
514
|
-
static
|
|
514
|
+
static Rs(compositionType) {
|
|
515
515
|
const glslStr = compositionType.getGlslStr(ComponentType.Unknown);
|
|
516
516
|
if (glslStr.startsWith("struct ")) {
|
|
517
517
|
return glslStr.replace("struct ", "");
|
|
@@ -522,9 +522,9 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
522
522
|
* Generates a shader initialization string for a struct type default value.
|
|
523
523
|
* @private
|
|
524
524
|
*/
|
|
525
|
-
static
|
|
525
|
+
static Ss(compositionType, defaultValue, isWebGPU) {
|
|
526
526
|
var _a;
|
|
527
|
-
const structName = (_a = this.
|
|
527
|
+
const structName = (_a = this.Rs(compositionType)) != null ? _a : "";
|
|
528
528
|
const memberValues = [];
|
|
529
529
|
for (const [_key, value] of Object.entries(defaultValue)) {
|
|
530
530
|
if (isWebGPU) {
|
|
@@ -541,14 +541,14 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
541
541
|
* Otherwise, a zero value based on the socket's compositionType and componentType will be generated.
|
|
542
542
|
* @private
|
|
543
543
|
*/
|
|
544
|
-
static
|
|
544
|
+
static Os(engine, shaderNode, inputIndex) {
|
|
545
545
|
const inputSocket = shaderNode.getInputs()[inputIndex];
|
|
546
546
|
const isWebGPU = engine.engineState.currentProcessApproach === ProcessApproach.WebGPU;
|
|
547
547
|
const isBool = inputSocket.componentType === ComponentType.Bool;
|
|
548
548
|
const isInt = inputSocket.componentType === ComponentType.Int || inputSocket.componentType === ComponentType.UnsignedInt;
|
|
549
549
|
if (inputSocket.defaultValue != null) {
|
|
550
|
-
if (this.
|
|
551
|
-
return this.
|
|
550
|
+
if (this.Qs(inputSocket.defaultValue)) {
|
|
551
|
+
return this.Ss(inputSocket.compositionType, inputSocket.defaultValue, isWebGPU);
|
|
552
552
|
}
|
|
553
553
|
const primitiveValue = inputSocket.defaultValue;
|
|
554
554
|
if (isBool) {
|
|
@@ -568,7 +568,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
568
568
|
* Processes an input connection and returns variable name and shader statement.
|
|
569
569
|
* @private
|
|
570
570
|
*/
|
|
571
|
-
static
|
|
571
|
+
static Ps(engine, inputConnection, shaderNode, isVertexStage, existingInputs, commonShaderPart) {
|
|
572
572
|
const inputNode = AbstractShaderNode._shaderNodes[inputConnection.shaderNodeUid];
|
|
573
573
|
const outputSocketOfPrev = inputNode.getOutput(inputConnection.outputNameOfPrev);
|
|
574
574
|
const inputSocketOfThis = shaderNode.getInput(inputConnection.inputNameOfThis);
|
|
@@ -596,7 +596,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
596
596
|
* Collects output variables for a specific node.
|
|
597
597
|
* @private
|
|
598
598
|
*/
|
|
599
|
-
static
|
|
599
|
+
static Ms(nodeIndex, shaderNodes, varOutputNames, existingOutputs, existingOutputsVarName) {
|
|
600
600
|
const prevShaderNode = shaderNodes[nodeIndex - 1];
|
|
601
601
|
if (!prevShaderNode) return;
|
|
602
602
|
for (let j = 0; j < shaderNodes.length; j++) {
|
|
@@ -625,7 +625,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
625
625
|
* Generates shader code for the nodes.
|
|
626
626
|
* @private
|
|
627
627
|
*/
|
|
628
|
-
static
|
|
628
|
+
static Js(engine, shaderNodes, varInputNames, varOutputNames, isVertexStage) {
|
|
629
629
|
let shaderBody = "";
|
|
630
630
|
let dummyVarCounter = 0;
|
|
631
631
|
for (let i = 0; i < shaderNodes.length; i++) {
|
|
@@ -681,7 +681,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
681
681
|
* Handles vertex-to-fragment data passing in vertex stage.
|
|
682
682
|
* @private
|
|
683
683
|
*/
|
|
684
|
-
static
|
|
684
|
+
static Ts(engine, shaderNodes, _varInputNames, varOutputNames) {
|
|
685
685
|
let shaderBody = "";
|
|
686
686
|
const assignedVaryings = /* @__PURE__ */ new Set();
|
|
687
687
|
for (let i = 0; i < shaderNodes.length; i++) {
|
|
@@ -740,20 +740,20 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
740
740
|
* @throws Error if shader construction fails
|
|
741
741
|
* @private
|
|
742
742
|
*/
|
|
743
|
-
static
|
|
743
|
+
static Hs(engine, shaderNodes, isVertexStage, commonShaderPart, shadingSections) {
|
|
744
744
|
let shaderBody = "";
|
|
745
|
-
shaderBody += this.
|
|
745
|
+
shaderBody += this.Ls(engine, shaderNodes, isVertexStage);
|
|
746
746
|
shaderBody += commonShaderPart.getMainBegin(engine, isVertexStage);
|
|
747
|
-
const { varInputNames, varOutputNames, collectedShaderBody } = this.
|
|
747
|
+
const { varInputNames, varOutputNames, collectedShaderBody } = this.Is(
|
|
748
748
|
engine,
|
|
749
749
|
shaderNodes,
|
|
750
750
|
isVertexStage,
|
|
751
751
|
commonShaderPart
|
|
752
752
|
);
|
|
753
753
|
shaderBody += collectedShaderBody;
|
|
754
|
-
shaderBody += this.
|
|
754
|
+
shaderBody += this.Js(engine, shaderNodes, varInputNames, varOutputNames, isVertexStage);
|
|
755
755
|
if (isVertexStage) {
|
|
756
|
-
shaderBody += this.
|
|
756
|
+
shaderBody += this.Ts(engine, shaderNodes, varInputNames, varOutputNames);
|
|
757
757
|
}
|
|
758
758
|
shaderBody += commonShaderPart.getMainEnd(engine, isVertexStage, shadingSections);
|
|
759
759
|
return shaderBody;
|
|
@@ -781,7 +781,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
781
781
|
static generateShaderCodeFromJson(engine, json, commonShaderPart, pixelEndNodeNames = ["outColor", "conditionalDiscard", "outDistance", "outUnion", "outShadingColor"]) {
|
|
782
782
|
const { nodeInstances, textureInfos } = constructNodes(json);
|
|
783
783
|
const constructedNodes = Object.values(nodeInstances);
|
|
784
|
-
const nodes = this.
|
|
784
|
+
const nodes = this.Fs(constructedNodes);
|
|
785
785
|
resolveShaderStage(nodes);
|
|
786
786
|
const varyingNodes = filterNodesForVarying(nodes, "outColor");
|
|
787
787
|
const varyingNodesForDiscard = filterNodesForVarying(nodes, "conditionalDiscard");
|
|
@@ -794,7 +794,7 @@ var ShaderGraphResolver = class _ShaderGraphResolver {
|
|
|
794
794
|
allVaryingNodes,
|
|
795
795
|
commonShaderPart
|
|
796
796
|
);
|
|
797
|
-
const shadingGroups = this.
|
|
797
|
+
const shadingGroups = this.Ks(json, nodeInstances);
|
|
798
798
|
const pixelRet = _ShaderGraphResolver.createPixelShaderCode(engine, pixelNodes, commonShaderPart, shadingGroups);
|
|
799
799
|
if (vertexRet == null || pixelRet == null) {
|
|
800
800
|
return;
|
|
@@ -114,7 +114,7 @@ function _createProgramAsSingleOperationWebGL(engine, material, componentDataAcc
|
|
|
114
114
|
const webglResourceRepository = engine.webglResourceRepository;
|
|
115
115
|
const webXRSystem = engine._webXRSystemIfEnabled;
|
|
116
116
|
const isMultiViewVRRendering = Is.exist(webXRSystem) && (webXRSystem == null ? void 0 : webXRSystem.isWebXRMode) && webglResourceRepository.isSupportMultiViewVRRendering(engine);
|
|
117
|
-
const cacheQuery = Component.getStateVersion(engine) + engine.materialRepository._getBufferViewVersion(material.
|
|
117
|
+
const cacheQuery = Component.getStateVersion(engine) + engine.materialRepository._getBufferViewVersion(material.Rr) + material.Rr + material._materialContent.getMaterialSemanticsVariantName() + vertexAttributeDefines + material._getFingerPrint() + definitions + morphedPositionGetter + componentDataAccessMethodDefinitionsForVertexShader + componentDataAccessMethodDefinitionsForPixelShader + morphedPositionGetter + alphaMode + (isMultiViewVRRendering ? "WEBGL2_MULTI_VIEW" : "");
|
|
118
118
|
const shaderCache = engine.shaderProgramCache;
|
|
119
119
|
let shaderProgramUid = shaderCache.get(cacheQuery);
|
|
120
120
|
if (shaderProgramUid != null) {
|
|
@@ -125,9 +125,9 @@ function _createProgramAsSingleOperationWebGL(engine, material, componentDataAcc
|
|
|
125
125
|
propertySetterOfGlobalDataRepository,
|
|
126
126
|
propertySetterOfMaterial
|
|
127
127
|
);
|
|
128
|
-
let vertexShader = _setupGlobalShaderDefinitionWebGL(engine, material.
|
|
128
|
+
let vertexShader = _setupGlobalShaderDefinitionWebGL(engine, material.Rr, primitive);
|
|
129
129
|
vertexShader += "#define RN_IS_VERTEX_SHADER\n";
|
|
130
|
-
let pixelShader = _setupGlobalShaderDefinitionWebGL(engine, material.
|
|
130
|
+
let pixelShader = _setupGlobalShaderDefinitionWebGL(engine, material.Rr, primitive);
|
|
131
131
|
pixelShader += "#define RN_IS_PIXEL_SHADER\n";
|
|
132
132
|
const glslChunks = __getGlslCommonChunks();
|
|
133
133
|
const vertexShaderityObject = ShaderityUtilityWebGL.fillTemplate(
|
|
@@ -260,7 +260,7 @@ function _createProgramAsSingleOperationWebGpu(engine, material, primitive, comp
|
|
|
260
260
|
if (material.isMask()) {
|
|
261
261
|
alphaMode += "#define RN_IS_ALPHA_MODE_MASK\n";
|
|
262
262
|
}
|
|
263
|
-
const cacheQuery = Component.getStateVersion(engine) + engine.materialRepository._getBufferViewVersion(material.
|
|
263
|
+
const cacheQuery = Component.getStateVersion(engine) + engine.materialRepository._getBufferViewVersion(material.Rr) + material.Rr + material._materialContent.getMaterialSemanticsVariantName() + vertexAttributeDefines + material._getFingerPrint() + definitions + componentDataAccessMethodDefinitionsForVertexShader + componentDataAccessMethodDefinitionsForPixelShader + morphedPositionGetter + alphaMode;
|
|
264
264
|
const shaderCache = engine.shaderProgramCache;
|
|
265
265
|
let shaderProgramUid = shaderCache.get(cacheQuery);
|
|
266
266
|
if (shaderProgramUid != null) {
|