rhodonite 0.27.0 → 0.28.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 +10 -10
- package/VERSION-FILE +1 -1
- package/dist/esm/effekseer/EffekseerComponent.js +3 -3
- package/dist/esm/foundation/components/Camera/CameraComponent.js +1 -1
- package/dist/esm/foundation/components/Light/LightComponent.d.ts +14 -0
- 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.d.ts +33 -5
- package/dist/esm/foundation/components/MeshRenderer/MeshRendererComponent.js +1 -1
- package/dist/esm/foundation/components/Physics/PhysicsComponent.js +1 -1
- package/dist/esm/foundation/components/Raymarching/RaymarchingSdfEvaluator.js +1 -1
- 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/GlobalRetargetReverse.js +1 -1
- package/dist/esm/foundation/components/Skeletal/SkeletalComponent.js +1 -1
- package/dist/esm/foundation/components/Transform/TransformComponent.js +1 -1
- package/dist/esm/foundation/constraints/VrmRollConstraint.js +1 -1
- package/dist/esm/foundation/core/Component.js +1 -1
- package/dist/esm/foundation/core/Config.d.ts +15 -0
- package/dist/esm/foundation/core/Config.js +1 -1
- package/dist/esm/foundation/core/GlobalDataRepository.d.ts +3 -3
- package/dist/esm/foundation/core/GlobalDataRepository.js +1 -1
- package/dist/esm/foundation/definitions/RenderBackend.d.ts +21 -0
- package/dist/esm/foundation/definitions/RenderBackend.js +1 -0
- package/dist/esm/foundation/definitions/ShaderSemantics.js +1 -1
- package/dist/esm/foundation/definitions/ShaderSemanticsInfo.d.ts +1 -0
- package/dist/esm/foundation/definitions/ShaderSemanticsInfo.js +1 -1
- package/dist/esm/foundation/definitions/VertexAttribute.js +1 -1
- package/dist/esm/foundation/definitions/index.d.ts +1 -1
- package/dist/esm/foundation/definitions/index.js +1 -1
- package/dist/esm/foundation/exporter/Gltf2Exporter.d.ts +6 -0
- package/dist/esm/foundation/exporter/Gltf2Exporter.js +1 -1
- package/dist/esm/foundation/geometry/Frustum.js +1 -1
- package/dist/esm/foundation/geometry/Mesh.d.ts +33 -68
- package/dist/esm/foundation/geometry/Mesh.js +1 -1
- package/dist/esm/foundation/geometry/Primitive.d.ts +1 -1
- package/dist/esm/foundation/geometry/Primitive.js +1 -1
- package/dist/esm/foundation/geometry/shapes/Cylinder.js +1 -1
- package/dist/esm/foundation/geometry/shapes/Joint.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.js +1 -1
- package/dist/esm/foundation/gizmos/JointGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/LightGizmo.d.ts +108 -10
- 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/MaterialHelper.d.ts +2 -0
- package/dist/esm/foundation/helpers/MaterialHelper.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/PointShadowMap.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/ShadowCasterFilter.d.ts +8 -0
- package/dist/esm/foundation/helpers/Shadow/ShadowCasterFilter.js +1 -0
- package/dist/esm/foundation/helpers/Shadow/ShadowDirectionalAutoFit.d.ts +28 -0
- package/dist/esm/foundation/helpers/Shadow/ShadowDirectionalAutoFit.js +1 -0
- package/dist/esm/foundation/helpers/Shadow/ShadowMap.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/ShadowSpotLightZNear.d.ts +8 -0
- package/dist/esm/foundation/helpers/Shadow/ShadowSpotLightZNear.js +1 -0
- package/dist/esm/foundation/helpers/Shadow/ShadowSystem.d.ts +1 -29
- package/dist/esm/foundation/helpers/Shadow/ShadowSystem.js +1 -1
- package/dist/esm/foundation/helpers/materials/createClassicUberMaterial.js +1 -1
- package/dist/esm/foundation/helpers/materials/createEnvConstantScreenSpaceMaterial.d.ts +21 -0
- package/dist/esm/foundation/helpers/materials/createEnvConstantScreenSpaceMaterial.js +1 -0
- package/dist/esm/foundation/helpers/materials/createGaussianBlurForEncodedDepthMaterial.js +1 -1
- package/dist/esm/foundation/helpers/materials/createGaussianBlurMaterial.js +1 -1
- package/dist/esm/foundation/helpers/materials/createMotionVectorMaterial.js +1 -1
- package/dist/esm/foundation/helpers/materials/createNodeBasedRaymarchingMaterials.js +1 -1
- package/dist/esm/foundation/helpers/materials/createPbrUberMaterial.js +1 -1
- package/dist/esm/foundation/helpers/materials/createTemporalAAResolveMaterial.js +1 -1
- package/dist/esm/foundation/helpers/materials/index.d.ts +1 -0
- package/dist/esm/foundation/helpers/materials/index.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.js +1 -1
- package/dist/esm/foundation/importer/GltfImporter.js +1 -1
- package/dist/esm/foundation/importer/ModelConverter.d.ts +19 -0
- 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/ColorGradingUsingLUTsMaterialContent.d.ts +0 -20
- package/dist/esm/foundation/materials/contents/ColorGradingUsingLUTsMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/CustomMaterialContent.d.ts +3 -1
- package/dist/esm/foundation/materials/contents/CustomMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/DepthEncodeMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/DetectHighLuminanceMaterialContent.d.ts +0 -16
- package/dist/esm/foundation/materials/contents/DetectHighLuminanceMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/EntityUIDOutputMaterialContent.d.ts +0 -17
- package/dist/esm/foundation/materials/contents/EntityUIDOutputMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/FurnaceTestMaterialContent.d.ts +0 -21
- package/dist/esm/foundation/materials/contents/FurnaceTestMaterialContent.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/contents/MatCapMaterialContent.d.ts +0 -16
- package/dist/esm/foundation/materials/contents/MatCapMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/ShadowMapDecodeClassicMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/SynthesizeHdrMaterialContent.d.ts +0 -23
- package/dist/esm/foundation/materials/contents/SynthesizeHdrMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/contents/VarianceShadowMapDecodeClassicMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/core/AbstractMaterialContent.d.ts +6 -61
- package/dist/esm/foundation/materials/core/AbstractMaterialContent.js +1 -1
- package/dist/esm/foundation/materials/core/AbstractShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/core/AbstractShaderNode.js +2 -2
- package/dist/esm/foundation/materials/core/Material.d.ts +7 -114
- package/dist/esm/foundation/materials/core/Material.js +1 -1
- package/dist/esm/foundation/materials/core/MaterialRepository.js +1 -1
- package/dist/esm/foundation/materials/core/ShaderGraphResolver.js +6 -6
- package/dist/esm/foundation/materials/core/ShaderNodeFactories.d.ts +23 -0
- package/dist/esm/foundation/materials/core/ShaderNodeFactories.js +1 -0
- package/dist/esm/foundation/materials/core/ShaderProgramDefinitions.d.ts +41 -0
- package/dist/esm/foundation/materials/core/ShaderProgramDefinitions.js +23 -0
- 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/AbsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AcosShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AddShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AlphaTestShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AndShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/Atan2ShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributeColorShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributeInstanceIdsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributeJointShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributeNormalShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributePositionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributeTangentShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributeTexcoordShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/AttributeWeightShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/BlockBeginShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/BlockEndShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/BranchShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/CalcBitangentShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/CastToFloatShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/CastToFloatShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/ClampShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/ClampShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/ClassicShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/ConstantVariableShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/CosShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/CosShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/DotProductShaderNode.d.ts +2 -2
- package/dist/esm/foundation/materials/nodes/DotProductShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/EqualShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/EqualShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/FlatShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/GreaterOrEqualShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/GreaterOrEqualShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/GreaterShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/GreaterThanShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/GreaterThanShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/LengthShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/LengthShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/LessOrEqualShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/LessOrEqualShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/LessThanShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/LessThanShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/MergeVectorShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/MinShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/MultiplyShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/MultiplyShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/NormalMatrixShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/NormalizeShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/NormalizeShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/NotEqualShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/NotEqualShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/OrShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrAnisotropyPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrAnisotropyRotationShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrBaseColorPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrClearcoatPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrDiffuseTransmissionPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrEmissivePropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrIridescencePropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrMetallicRoughnessPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrNormalPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrOcclusionPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrShaderShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrSheenPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrSpecularPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrTransmissionPropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PbrVolumePropsShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/PremultipliedAlphaShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/PremultipliedAlphaShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/ProcessGeometryShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/ProjectionMatrixShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/Random_HashPRNGShaderNode.js +2 -2
- package/dist/esm/foundation/materials/nodes/Random_SinHashShaderNode.js +2 -2
- package/dist/esm/foundation/materials/nodes/RemapShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/RemapShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/SinShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/SinShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/SmoothStepShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/SmoothStepShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/SplitVectorShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/SplitVectorShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/StepShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/TanShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/TanShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/Texture2DShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/TimeShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/TransformShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/TransformShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/UniformDataShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/ViewMatrixShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/WireframeMaterialNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/WorldMatrixShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/BendXYShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/BendXZShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/BendYXShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/BendYZShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/BendZXShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/BendZYShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/InitialPositionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/OpSmoothIntersectionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/OpSmoothSubtractionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/OpSmoothUnionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/OpSubtractionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/OpUnionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/OutDistanceShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/OutUnionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchCameraPositionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchHitDistanceShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchHitNormalShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchHitPositionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchObjectIdShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchObjectIdUniformShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchRayDirectionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchTBNShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/RaymarchViewDirectionShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdApplyTransformShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdApplyWorldMatrixShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdBarXShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdBarYShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdBarZShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdBoxShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdCapsuleShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatXShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatXYShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatYShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatYZShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatZShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRepeatZXShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdRoundBoxShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdSphereShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdTorusShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdTubeXShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdTubeYShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/SdTubeZShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/TwistXShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/TwistYShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/raymarching/TwistZShaderNode.js +1 -1
- package/dist/esm/foundation/math/IdentityMatrix33.js +2 -2
- package/dist/esm/foundation/math/IdentityMatrix44.js +2 -2
- package/dist/esm/foundation/math/MathClassUtil.js +1 -1
- package/dist/esm/foundation/math/MathUtil.d.ts +11 -0
- package/dist/esm/foundation/math/MathUtil.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/memory/Accessor.js +6 -6
- package/dist/esm/foundation/memory/Buffer.js +3 -3
- package/dist/esm/foundation/memory/BufferView.js +1 -1
- package/dist/esm/foundation/misc/Logger.js +1 -1
- package/dist/esm/foundation/misc/Time.js +1 -1
- package/dist/esm/foundation/physics/Rapier/RapierCharacterControllerStrategy.js +1 -1
- package/dist/esm/foundation/physics/Rapier/RapierPhysicsStrategy.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/CGAPIResourceRepository.d.ts +74 -4
- package/dist/esm/foundation/renderer/CGAPIResourceRepository.js +1 -1
- package/dist/esm/foundation/renderer/Frame.js +1 -1
- package/dist/esm/foundation/renderer/FrameBuffer.js +1 -1
- package/dist/esm/foundation/renderer/FrameRenderer.d.ts +42 -0
- package/dist/esm/foundation/renderer/FrameRenderer.js +0 -0
- package/dist/esm/foundation/renderer/RenderPass.js +1 -1
- package/dist/esm/foundation/renderer/ShaderPropertyLayout.d.ts +77 -0
- package/dist/esm/foundation/renderer/ShaderPropertyLayout.js +1 -0
- package/dist/esm/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +1 -1
- package/dist/esm/foundation/renderer/TemporalAA/TemporalAASystem.d.ts +9 -3
- package/dist/esm/foundation/renderer/TemporalAA/TemporalAASystem.js +1 -1
- package/dist/esm/foundation/renderer/lightCluster/LightClusterSystem.d.ts +12 -0
- package/dist/esm/foundation/renderer/lightCluster/LightClusterSystem.js +1 -1
- package/dist/esm/foundation/renderer/lightCluster/LightClusterSystemStub.js +1 -1
- package/dist/esm/foundation/renderer/pipelines/DeferredRenderPipeline.js +1 -1
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +82 -176
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.js +1 -1
- package/dist/esm/foundation/renderer/pipelines/RaymarchingRenderer.d.ts +263 -0
- package/dist/esm/foundation/renderer/pipelines/RaymarchingRenderer.js +1 -0
- package/dist/esm/foundation/system/Engine.d.ts +19 -44
- package/dist/esm/foundation/system/Engine.js +1 -1
- package/dist/esm/foundation/system/EngineState.d.ts +9 -3
- package/dist/esm/foundation/system/EngineState.js +1 -1
- package/dist/esm/foundation/system/GpuDriverWorkarounds.d.ts +50 -0
- package/dist/esm/foundation/system/GpuDriverWorkarounds.js +1 -0
- package/dist/esm/foundation/system/ModuleManager.js +1 -1
- package/dist/esm/foundation/system/index.d.ts +1 -0
- package/dist/esm/foundation/system/index.js +1 -1
- package/dist/esm/foundation/textures/AbstractReadableRenderTargetTexture.d.ts +39 -0
- package/dist/esm/foundation/textures/AbstractReadableRenderTargetTexture.js +1 -0
- package/dist/esm/foundation/textures/AbstractRenderTargetTexture.d.ts +60 -0
- package/dist/esm/foundation/textures/AbstractRenderTargetTexture.js +1 -0
- package/dist/esm/foundation/textures/AbstractTexture.js +1 -1
- package/dist/esm/foundation/textures/CubeTexture.js +1 -1
- package/dist/esm/foundation/textures/RenderBuffer.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTexture.d.ts +5 -67
- package/dist/esm/foundation/textures/RenderTargetTexture.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTexture2DArray.d.ts +5 -71
- package/dist/esm/foundation/textures/RenderTargetTexture2DArray.js +1 -1
- package/dist/esm/foundation/textures/RenderTargetTextureCube.d.ts +8 -50
- package/dist/esm/foundation/textures/RenderTargetTextureCube.js +1 -1
- package/dist/esm/foundation/textures/Texture.d.ts +19 -1
- package/dist/esm/foundation/textures/Texture.js +1 -1
- package/dist/esm/foundation/textures/TextureArray.js +1 -1
- package/dist/esm/foundation/textures/TextureDataFloat.js +1 -1
- package/dist/esm/foundation/textures/VideoTexture.d.ts +11 -0
- package/dist/esm/foundation/textures/VideoTexture.js +1 -1
- package/dist/esm/foundation/textures/decodeBasisImage.d.ts +14 -0
- package/dist/esm/foundation/textures/decodeBasisImage.js +1 -0
- package/dist/esm/foundation/textures/index.d.ts +2 -0
- package/dist/esm/foundation/textures/index.js +1 -1
- package/dist/esm/types/glTF2.d.ts +9 -0
- package/dist/esm/version.js +1 -1
- package/dist/esm/webgl/ComponentDataAccessorGLSL.d.ts +9 -0
- package/dist/esm/webgl/ComponentDataAccessorGLSL.js +27 -0
- package/dist/esm/webgl/InstanceSidTable.js +1 -1
- package/dist/esm/webgl/MultiDraw.d.ts +1 -1
- package/dist/esm/webgl/MultiDraw.js +1 -1
- package/dist/esm/webgl/MultiDrawRepository.js +1 -1
- package/dist/esm/webgl/ShaderPropertyAccessorGLSL.d.ts +11 -0
- package/dist/esm/webgl/ShaderPropertyAccessorGLSL.js +29 -0
- package/dist/esm/webgl/WebGLCompressedTextures.d.ts +48 -0
- package/dist/esm/webgl/WebGLCompressedTextures.js +1 -0
- package/dist/esm/webgl/WebGLContextWrapper.d.ts +9 -52
- package/dist/esm/webgl/WebGLContextWrapper.js +1 -1
- package/dist/esm/webgl/WebGLCubeTextureFileLoader.d.ts +38 -0
- package/dist/esm/webgl/WebGLCubeTextureFileLoader.js +1 -0
- package/dist/esm/webgl/WebGLCubeTextures.d.ts +92 -0
- package/dist/esm/webgl/WebGLCubeTextures.js +42 -0
- package/dist/esm/webgl/WebGLDataTexture.d.ts +108 -0
- package/dist/esm/webgl/WebGLDataTexture.js +1 -0
- package/dist/esm/webgl/WebGLDrawState.d.ts +84 -0
- package/dist/esm/webgl/WebGLDrawState.js +1 -0
- package/dist/esm/webgl/WebGLExternalState.d.ts +43 -0
- package/dist/esm/webgl/WebGLExternalState.js +1 -0
- package/dist/esm/webgl/WebGLFrameRenderer.d.ts +32 -0
- package/dist/esm/webgl/WebGLFrameRenderer.js +1 -0
- package/dist/esm/webgl/WebGLFramebuffers.d.ts +142 -0
- package/dist/esm/webgl/WebGLFramebuffers.js +1 -0
- package/dist/esm/webgl/WebGLGpuTimer.js +1 -1
- package/dist/esm/webgl/WebGLMaterialParameters.d.ts +47 -0
- package/dist/esm/webgl/WebGLMaterialParameters.js +1 -0
- package/dist/esm/webgl/WebGLMeshResources.d.ts +115 -0
- package/dist/esm/webgl/WebGLMeshResources.js +1 -0
- package/dist/esm/webgl/WebGLMorphUniformBuffers.d.ts +66 -0
- package/dist/esm/webgl/WebGLMorphUniformBuffers.js +57 -0
- package/dist/esm/webgl/WebGLResourceRepository.d.ts +100 -178
- package/dist/esm/webgl/WebGLResourceRepository.js +1 -55
- package/dist/esm/webgl/WebGLSamplers.d.ts +78 -0
- package/dist/esm/webgl/WebGLSamplers.js +1 -0
- package/dist/esm/webgl/WebGLShaderProgramBuilder.d.ts +40 -0
- package/dist/esm/webgl/WebGLShaderProgramBuilder.js +15 -0
- package/dist/esm/webgl/WebGLShaderPrograms.d.ts +88 -0
- package/dist/esm/webgl/WebGLShaderPrograms.js +14 -0
- package/dist/esm/webgl/WebGLStereoUtil.d.ts +0 -27
- package/dist/esm/webgl/WebGLStereoUtil.js +3 -3
- package/dist/esm/webgl/WebGLStrategyDataUploader.d.ts +152 -0
- package/dist/esm/webgl/WebGLStrategyDataUploader.js +1 -0
- package/dist/esm/webgl/WebGLStrategyMeshBatchRenderer.d.ts +40 -0
- package/dist/esm/webgl/WebGLStrategyMeshBatchRenderer.js +1 -0
- package/dist/esm/webgl/WebGLStrategyMeshDrawer.d.ts +92 -0
- package/dist/esm/webgl/WebGLStrategyMeshDrawer.js +1 -0
- package/dist/esm/webgl/WebGLStrategyWebGL2.d.ts +7 -360
- package/dist/esm/webgl/WebGLStrategyWebGL2.js +1 -146
- package/dist/esm/webgl/WebGLTextureUnitState.d.ts +79 -0
- package/dist/esm/webgl/WebGLTextureUnitState.js +1 -0
- package/dist/esm/webgl/WebGLTextureUploads.d.ts +106 -0
- package/dist/esm/webgl/WebGLTextureUploads.js +1 -0
- package/dist/esm/webgl/WebGLTextures.d.ts +316 -0
- package/dist/esm/webgl/WebGLTextures.js +1 -0
- package/dist/esm/webgl/WebGLUniformBuffers.d.ts +35 -0
- package/dist/esm/webgl/WebGLUniformBuffers.js +1 -0
- package/dist/esm/webgl/WebGLUniforms.d.ts +117 -0
- package/dist/esm/webgl/WebGLUniforms.js +1 -0
- package/dist/esm/webgl/WebGLVertexBuffers.d.ts +172 -0
- package/dist/esm/webgl/WebGLVertexBuffers.js +1 -0
- package/dist/esm/webgl/debug/BufferLayoutDecoder.d.ts +4 -4
- package/dist/esm/webgl/debug/BufferLayoutDecoder.js +1 -1
- package/dist/esm/webgl/debug/ShaderParameterDebugger.js +1 -1
- package/dist/esm/webgl/debug/types.d.ts +2 -2
- package/dist/esm/webgl/getRenderingStrategy.d.ts +2 -2
- package/dist/esm/webgl/getRenderingStrategy.js +1 -1
- package/dist/esm/webgl/main.d.ts +4 -17
- package/dist/esm/webgl/main.js +1 -1
- package/dist/esm/webgl/readColorAttachmentAsRgba8.d.ts +36 -0
- package/dist/esm/webgl/readColorAttachmentAsRgba8.js +1 -0
- package/dist/esm/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.frag.js +17 -8
- package/dist/esm/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.vert.js +5 -5
- package/dist/esm/webgl/shaderity_shaders/ColorGradingUsingLUTsShader/ColorGradingUsingLUTsShader.vert.js +1 -1
- package/dist/esm/webgl/shaderity_shaders/DepthEncodeSingleShader/DepthEncodeSingleShader.vert.js +2 -2
- package/dist/esm/webgl/shaderity_shaders/DepthMomentEncodeShader/DepthMomentEncodeShader.vert.js +3 -3
- package/dist/esm/webgl/shaderity_shaders/DetectHighLuminanceAndCorrectShader/DetectHighLuminanceAndCorrectShader.vert.js +2 -2
- package/dist/esm/webgl/shaderity_shaders/EntityUIDOutputSingleShader/EntityUIDOutputSingleShader.vert.js +2 -2
- package/dist/esm/webgl/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.frag.js +84 -0
- package/dist/esm/webgl/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.vert.js +34 -0
- package/dist/esm/webgl/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.frag.js +5 -5
- package/dist/esm/webgl/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.vert.js +2 -2
- package/dist/esm/webgl/shaderity_shaders/FlatSingleShader/FlatSingleShader.frag.js +7 -7
- package/dist/esm/webgl/shaderity_shaders/FlatSingleShader/FlatSingleShader.vert.js +4 -4
- package/dist/esm/webgl/shaderity_shaders/GammaCorrectionShader/GammaCorrectionShader.frag.js +1 -1
- package/dist/esm/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.glsl.js +8 -5
- package/dist/esm/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.vert.glsl.js +1 -1
- package/dist/esm/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.glsl.js +43 -40
- package/dist/esm/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.vert.glsl.js +4 -4
- package/dist/esm/webgl/shaderity_shaders/MatCapShader/MatCapShader.vert.js +1 -1
- package/dist/esm/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.js +3 -3
- package/dist/esm/webgl/shaderity_shaders/PanoramaToCubeShader/PanoramaToCubeShader.frag.js +1 -1
- package/dist/esm/webgl/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.frag.glsl.js +1 -1
- package/dist/esm/webgl/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.vert.glsl.js +4 -4
- package/dist/esm/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +124 -112
- package/dist/esm/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.vert.js +6 -6
- package/dist/esm/webgl/shaderity_shaders/PrefilterIBLShader/PrefilterIBLShader.frag.js +5 -5
- package/dist/esm/webgl/shaderity_shaders/ShadowMapDecodeClassicSingleShader/ShadowMapDecodeClassicSingleShader.vert.js +2 -2
- package/dist/esm/webgl/shaderity_shaders/SummedAreaTableShader/SummedAreaTableShader.frag.js +3 -3
- package/dist/esm/webgl/shaderity_shaders/ToneMappingShader/ToneMappingShader.frag.js +1 -1
- package/dist/esm/webgl/shaderity_shaders/VarianceShadowMapDecodeClassicShader/VarianceShadowMapDecodeClassicShader.vert.js +2 -2
- package/dist/esm/webgl/shaderity_shaders/common/iblDefinition.glsl.js +54 -1
- package/dist/esm/webgl/shaderity_shaders/common/morphVariables.glsl.js +2 -2
- package/dist/esm/webgl/shaderity_shaders/common/opticalDefinition.glsl.js +4 -1
- package/dist/esm/webgl/shaderity_shaders/common/prerequisites.glsl.js +3 -3
- package/dist/esm/webgl/shaderity_shaders/nodes/ClassicShader.glsl.js +10 -1
- package/dist/esm/webgl/shaderity_shaders/nodes/PbrShader.glsl.js +12 -0
- package/dist/esm/webgl/shaders/RaymarchingShaderPart.d.ts +2 -2
- package/dist/esm/webgl/shaders/RaymarchingShaderPart.js +30 -18
- package/dist/esm/webgl/shaders/RaymarchingShadowShaderPart.js +9 -9
- package/dist/esm/webgl/shaders/StandardShaderPart.d.ts +3 -3
- package/dist/esm/webgl/shaders/StandardShaderPart.js +16 -16
- package/dist/esm/webgl/shaders/glslCommonChunks.d.ts +2 -2
- 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.d.ts +2 -2
- package/dist/esm/webgl/shaders/nodes/ConstantVariableShader.js +7 -7
- package/dist/esm/webgl/shaders/nodes/DiscardShader.d.ts +1 -1
- package/dist/esm/webgl/shaders/nodes/DiscardShader.js +3 -3
- package/dist/esm/webgl/shaders/nodes/EndShader.d.ts +2 -2
- package/dist/esm/webgl/shaders/nodes/EndShader.js +3 -3
- package/dist/esm/webgl/shaders/nodes/OutDistance.d.ts +1 -1
- package/dist/esm/webgl/shaders/nodes/OutDistance.js +1 -1
- package/dist/esm/webgl/shaders/nodes/OutUnion.js +1 -1
- package/dist/esm/webgl/shaders/nodes/RaymarchObjectIdUniform.js +3 -3
- package/dist/esm/webgl/shaders/nodes/SdApplyTransform.js +5 -5
- package/dist/esm/webgl/shaders/nodes/SdApplyWorldMatrix.d.ts +1 -1
- package/dist/esm/webgl/shaders/nodes/SdApplyWorldMatrix.js +3 -3
- package/dist/esm/webgl/shaders/nodes/Texture2DShader.js +18 -18
- package/dist/esm/webgl/shaders/nodes/UniformDataShader.js +14 -14
- package/dist/esm/webgl/textureLoader/KTX2TextureLoader.d.ts +1 -1
- package/dist/esm/webgl/textureLoader/KTX2TextureLoader.js +1 -1
- package/dist/esm/webgpu/AttributeReader.d.ts +18 -0
- package/dist/esm/webgpu/AttributeReader.js +1 -0
- package/dist/esm/webgpu/GpuCullingRegistry.js +1 -1
- package/dist/esm/webgpu/GpuDeformRegistry.js +1 -1
- package/dist/esm/webgpu/RangeAllocator.js +1 -1
- package/dist/esm/webgpu/ShaderPropertyAccessorWGSL.d.ts +11 -0
- package/dist/esm/webgpu/ShaderPropertyAccessorWGSL.js +24 -0
- package/dist/esm/webgpu/WebGpuBindGroups.d.ts +131 -0
- package/dist/esm/webgpu/WebGpuBindGroups.js +1 -0
- package/dist/esm/webgpu/WebGpuBufferArena.js +1 -1
- package/dist/esm/webgpu/WebGpuCompressedTextures.d.ts +38 -0
- package/dist/esm/webgpu/WebGpuCompressedTextures.js +1 -0
- package/dist/esm/webgpu/WebGpuCubeTextureShaders.d.ts +1 -0
- package/dist/esm/webgpu/WebGpuCubeTextureShaders.js +60 -0
- package/dist/esm/webgpu/WebGpuCubeTextures.d.ts +72 -0
- package/dist/esm/webgpu/WebGpuCubeTextures.js +1 -0
- package/dist/esm/webgpu/WebGpuDraw.d.ts +63 -0
- package/dist/esm/webgpu/WebGpuDraw.js +1 -0
- package/dist/esm/webgpu/WebGpuDrawParameters.d.ts +61 -0
- package/dist/esm/webgpu/WebGpuDrawParameters.js +1 -0
- package/dist/esm/webgpu/WebGpuExternalRenderPass.d.ts +44 -0
- package/dist/esm/webgpu/WebGpuExternalRenderPass.js +1 -0
- package/dist/esm/webgpu/WebGpuFrame.d.ts +55 -0
- package/dist/esm/webgpu/WebGpuFrame.js +1 -0
- package/dist/esm/webgpu/WebGpuFrameRenderer.d.ts +25 -0
- package/dist/esm/webgpu/WebGpuFrameRenderer.js +1 -0
- package/dist/esm/webgpu/WebGpuGpuCulling.js +1 -236
- package/dist/esm/webgpu/WebGpuGpuCullingShaders.d.ts +34 -0
- package/dist/esm/webgpu/WebGpuGpuCullingShaders.js +236 -0
- package/dist/esm/webgpu/WebGpuGpuTimer.js +1 -1
- package/dist/esm/webgpu/WebGpuLightClusterBuilder.js +1 -153
- package/dist/esm/webgpu/WebGpuLightClusterShaders.d.ts +14 -0
- package/dist/esm/webgpu/WebGpuLightClusterShaders.js +153 -0
- package/dist/esm/webgpu/WebGpuMipmapGenerator.d.ts +54 -0
- package/dist/esm/webgpu/WebGpuMipmapGenerator.js +1 -0
- package/dist/esm/webgpu/WebGpuMipmapShaders.d.ts +1 -0
- package/dist/esm/webgpu/WebGpuMipmapShaders.js +26 -0
- package/dist/esm/webgpu/WebGpuRenderBundles.d.ts +117 -0
- package/dist/esm/webgpu/WebGpuRenderBundles.js +1 -0
- package/dist/esm/webgpu/WebGpuRenderPassEncoders.d.ts +140 -0
- package/dist/esm/webgpu/WebGpuRenderPassEncoders.js +1 -0
- package/dist/esm/webgpu/WebGpuRenderPipelines.d.ts +75 -0
- package/dist/esm/webgpu/WebGpuRenderPipelines.js +3 -0
- package/dist/esm/webgpu/WebGpuRenderTargetTextures.d.ts +78 -0
- package/dist/esm/webgpu/WebGpuRenderTargetTextures.js +1 -0
- package/dist/esm/webgpu/WebGpuResourceRepository.d.ts +52 -322
- package/dist/esm/webgpu/WebGpuResourceRepository.js +1 -116
- package/dist/esm/webgpu/WebGpuSamplers.d.ts +45 -0
- package/dist/esm/webgpu/WebGpuSamplers.js +1 -0
- package/dist/esm/webgpu/WebGpuShaderProgramBuilder.d.ts +25 -0
- package/dist/esm/webgpu/WebGpuShaderProgramBuilder.js +9 -0
- package/dist/esm/webgpu/WebGpuStorageBuffers.d.ts +77 -0
- package/dist/esm/webgpu/WebGpuStorageBuffers.js +1 -0
- package/dist/esm/webgpu/WebGpuStrategyBasic.d.ts +2 -73
- package/dist/esm/webgpu/WebGpuStrategyBasic.js +1 -139
- package/dist/esm/webgpu/WebGpuStrategyStorage.d.ts +62 -0
- package/dist/esm/webgpu/WebGpuStrategyStorage.js +1 -0
- package/dist/esm/webgpu/WebGpuTextureReadback.d.ts +111 -0
- package/dist/esm/webgpu/WebGpuTextureReadback.js +1 -0
- package/dist/esm/webgpu/WebGpuTextureReadbackShaders.d.ts +4 -0
- package/dist/esm/webgpu/WebGpuTextureReadbackShaders.js +26 -0
- package/dist/esm/webgpu/WebGpuTextureUploads.d.ts +109 -0
- package/dist/esm/webgpu/WebGpuTextureUploads.js +1 -0
- package/dist/esm/webgpu/WebGpuTextures.d.ts +196 -0
- package/dist/esm/webgpu/WebGpuTextures.js +1 -0
- package/dist/esm/webgpu/WebGpuVertexBuffers.d.ts +142 -0
- package/dist/esm/webgpu/WebGpuVertexBuffers.js +1 -0
- package/dist/esm/webgpu/WebGpuVertexDeformer.js +1 -124
- package/dist/esm/webgpu/WebGpuVertexDeformerShaders.d.ts +7 -0
- package/dist/esm/webgpu/WebGpuVertexDeformerShaders.js +124 -0
- package/dist/esm/webgpu/WebGpuVertexShaderDefinitions.d.ts +16 -0
- package/dist/esm/webgpu/WebGpuVertexShaderDefinitions.js +84 -0
- package/dist/esm/webgpu/assertArrayBufferView.d.ts +9 -0
- package/dist/esm/webgpu/assertArrayBufferView.js +1 -0
- package/dist/esm/webgpu/main.d.ts +2 -16
- package/dist/esm/webgpu/main.js +1 -1
- package/dist/esm/webgpu/padCompressedRowsForUpload.d.ts +20 -0
- package/dist/esm/webgpu/padCompressedRowsForUpload.js +1 -0
- package/dist/esm/webgpu/removeRowPadding.d.ts +21 -0
- package/dist/esm/webgpu/removeRowPadding.js +1 -0
- package/dist/esm/webgpu/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.frag.js +15 -8
- package/dist/esm/webgpu/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.frag.wgsl.js +84 -0
- package/dist/esm/webgpu/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.vert.wgsl.js +19 -0
- package/dist/esm/webgpu/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.frag.js +6 -6
- package/dist/esm/webgpu/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.vert.js +3 -3
- package/dist/esm/webgpu/shaderity_shaders/FlatSingleShader/FlatSingleShader.frag.js +5 -5
- package/dist/esm/webgpu/shaderity_shaders/GammaCorrectionShader/GammaCorrectionShader.frag.js +3 -3
- package/dist/esm/webgpu/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.wgsl.js +9 -6
- package/dist/esm/webgpu/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.wgsl.js +44 -41
- package/dist/esm/webgpu/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.vert.wgsl.js +2 -2
- package/dist/esm/webgpu/shaderity_shaders/PanoramaToCubeShader/PanoramaToCubeShader.frag.wgsl.js +1 -1
- package/dist/esm/webgpu/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.frag.wgsl.js +2 -2
- package/dist/esm/webgpu/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.vert.wgsl.js +3 -3
- package/dist/esm/webgpu/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +125 -114
- package/dist/esm/webgpu/shaderity_shaders/PrefilterIBLShader/PrefilterIBLShader.frag.wgsl.js +5 -5
- package/dist/esm/webgpu/shaderity_shaders/ToneMappingShader/ToneMappingShader.frag.wgsl.js +1 -1
- package/dist/esm/webgpu/shaderity_shaders/common/iblDefinition.wgsl.js +55 -1
- package/dist/esm/webgpu/shaderity_shaders/common/opticalDefinition.wgsl.js +4 -1
- package/dist/esm/webgpu/shaderity_shaders/common/processGeometry.wgsl.js +1 -1
- package/dist/esm/webgpu/shaderity_shaders/nodes/ClassicShader.wgsl.js +7 -0
- package/dist/esm/webgpu/shaderity_shaders/nodes/PbrShader.wgsl.js +13 -2
- package/dist/esm/webgpu/wgslCommonChunks.d.ts +2 -2
- package/dist/esm/xr/WebARSystem.js +1 -1
- package/dist/esm/xr/WebXRSystem.d.ts +0 -4
- package/dist/esm/xr/WebXRSystem.js +1 -1
- package/dist/esmdev/effekseer/EffekseerComponent.js +3 -3
- package/dist/esmdev/foundation/components/Camera/CameraComponent.js +4 -4
- package/dist/esmdev/foundation/components/Light/LightComponent.d.ts +14 -0
- package/dist/esmdev/foundation/components/Light/LightComponent.js +38 -11
- package/dist/esmdev/foundation/components/Mesh/MeshComponent.js +47 -44
- package/dist/esmdev/foundation/components/MeshRenderer/MeshRendererComponent.d.ts +33 -5
- package/dist/esmdev/foundation/components/MeshRenderer/MeshRendererComponent.js +152 -102
- package/dist/esmdev/foundation/components/Physics/PhysicsComponent.js +65 -65
- package/dist/esmdev/foundation/components/Raymarching/RaymarchingComponent.js +54 -54
- package/dist/esmdev/foundation/components/Raymarching/RaymarchingSdfEvaluator.js +250 -250
- package/dist/esmdev/foundation/components/SceneGraph/SceneGraphComponent.js +335 -335
- 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.js +222 -222
- package/dist/esmdev/foundation/components/Transform/TransformComponent.js +66 -66
- 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 +41 -41
- package/dist/esmdev/foundation/core/ComponentRepository.js +37 -37
- package/dist/esmdev/foundation/core/Config.d.ts +15 -0
- package/dist/esmdev/foundation/core/Config.js +27 -10
- package/dist/esmdev/foundation/core/Entity.js +9 -9
- package/dist/esmdev/foundation/core/EntityRepository.js +19 -19
- package/dist/esmdev/foundation/core/GlobalDataRepository.d.ts +3 -3
- package/dist/esmdev/foundation/core/GlobalDataRepository.js +33 -20
- package/dist/esmdev/foundation/core/MemoryManager.js +27 -27
- package/dist/esmdev/foundation/core/RnObject.js +36 -36
- 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/RenderBackend.d.ts +21 -0
- package/dist/esmdev/foundation/definitions/RenderBackend.js +60 -0
- package/dist/esmdev/foundation/definitions/ShaderSemantics.js +6 -6
- package/dist/esmdev/foundation/definitions/ShaderSemanticsInfo.d.ts +1 -0
- package/dist/esmdev/foundation/definitions/ShaderSemanticsInfo.js +1 -1
- 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/definitions/index.d.ts +1 -1
- package/dist/esmdev/foundation/definitions/index.js +2 -2
- package/dist/esmdev/foundation/enhanced_js_objects/Array.js +2 -2
- package/dist/esmdev/foundation/exporter/Gltf2Exporter.d.ts +6 -0
- package/dist/esmdev/foundation/exporter/Gltf2Exporter.js +140 -110
- package/dist/esmdev/foundation/geometry/ComplexVertexAttribute.js +24 -24
- package/dist/esmdev/foundation/geometry/Frustum.js +40 -40
- package/dist/esmdev/foundation/geometry/Mesh.d.ts +33 -68
- package/dist/esmdev/foundation/geometry/Mesh.js +211 -405
- package/dist/esmdev/foundation/geometry/Primitive.d.ts +1 -1
- package/dist/esmdev/foundation/geometry/Primitive.js +141 -135
- 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 +16 -16
- 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 +37 -37
- package/dist/esmdev/foundation/gizmos/LightGizmo.d.ts +108 -10
- package/dist/esmdev/foundation/gizmos/LightGizmo.js +248 -49
- package/dist/esmdev/foundation/gizmos/LocatorGizmo.js +25 -25
- package/dist/esmdev/foundation/gizmos/RotationGizmo.js +212 -212
- package/dist/esmdev/foundation/gizmos/ScaleGizmo.js +130 -130
- 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 +42 -38
- package/dist/esmdev/foundation/helpers/GaussianBlurHelper.js +18 -18
- package/dist/esmdev/foundation/helpers/MaterialHelper.d.ts +2 -0
- package/dist/esmdev/foundation/helpers/MaterialHelper.js +3 -1
- package/dist/esmdev/foundation/helpers/Shadow/PointShadowMap.js +12 -12
- package/dist/esmdev/foundation/helpers/Shadow/ShadowCasterFilter.d.ts +8 -0
- package/dist/esmdev/foundation/helpers/Shadow/ShadowCasterFilter.js +17 -0
- package/dist/esmdev/foundation/helpers/Shadow/ShadowDirectionalAutoFit.d.ts +28 -0
- package/dist/esmdev/foundation/helpers/Shadow/ShadowDirectionalAutoFit.js +126 -0
- package/dist/esmdev/foundation/helpers/Shadow/ShadowMap.js +5 -5
- package/dist/esmdev/foundation/helpers/Shadow/ShadowSpotLightZNear.d.ts +8 -0
- package/dist/esmdev/foundation/helpers/Shadow/ShadowSpotLightZNear.js +87 -0
- package/dist/esmdev/foundation/helpers/Shadow/ShadowSystem.d.ts +1 -29
- package/dist/esmdev/foundation/helpers/Shadow/ShadowSystem.js +100 -309
- package/dist/esmdev/foundation/helpers/materials/createClassicUberMaterial.js +13 -5
- package/dist/esmdev/foundation/helpers/materials/createEnvConstantScreenSpaceMaterial.d.ts +21 -0
- package/dist/esmdev/foundation/helpers/materials/createEnvConstantScreenSpaceMaterial.js +32 -0
- package/dist/esmdev/foundation/helpers/materials/createGaussianBlurForEncodedDepthMaterial.js +12 -4
- package/dist/esmdev/foundation/helpers/materials/createGaussianBlurMaterial.js +13 -5
- package/dist/esmdev/foundation/helpers/materials/createMotionVectorMaterial.js +7 -3
- package/dist/esmdev/foundation/helpers/materials/createNodeBasedRaymarchingMaterials.js +41 -18
- package/dist/esmdev/foundation/helpers/materials/createPbrUberMaterial.js +13 -5
- package/dist/esmdev/foundation/helpers/materials/createTemporalAAResolveMaterial.js +22 -8
- package/dist/esmdev/foundation/helpers/materials/index.d.ts +1 -0
- package/dist/esmdev/foundation/helpers/materials/index.js +3 -1
- package/dist/esmdev/foundation/helpers/materials/nodeBasedMaterialCommon.js +26 -14
- 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.d.ts +19 -0
- package/dist/esmdev/foundation/importer/ModelConverter.js +183 -132
- 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/ColorGradingUsingLUTsMaterialContent.d.ts +0 -20
- package/dist/esmdev/foundation/materials/contents/ColorGradingUsingLUTsMaterialContent.js +1 -33
- package/dist/esmdev/foundation/materials/contents/CustomMaterialContent.d.ts +3 -1
- package/dist/esmdev/foundation/materials/contents/CustomMaterialContent.js +31 -30
- package/dist/esmdev/foundation/materials/contents/DepthEncodeMaterialContent.js +15 -9
- package/dist/esmdev/foundation/materials/contents/DetectHighLuminanceMaterialContent.d.ts +0 -16
- package/dist/esmdev/foundation/materials/contents/DetectHighLuminanceMaterialContent.js +5 -20
- package/dist/esmdev/foundation/materials/contents/EntityUIDOutputMaterialContent.d.ts +0 -17
- package/dist/esmdev/foundation/materials/contents/EntityUIDOutputMaterialContent.js +5 -19
- package/dist/esmdev/foundation/materials/contents/FurnaceTestMaterialContent.d.ts +0 -21
- package/dist/esmdev/foundation/materials/contents/FurnaceTestMaterialContent.js +16 -28
- package/dist/esmdev/foundation/materials/contents/MToon0xMaterialContent.js +200 -174
- package/dist/esmdev/foundation/materials/contents/MToon1MaterialContent.js +21 -22
- package/dist/esmdev/foundation/materials/contents/MatCapMaterialContent.d.ts +0 -16
- package/dist/esmdev/foundation/materials/contents/MatCapMaterialContent.js +7 -20
- package/dist/esmdev/foundation/materials/contents/ShadowMapDecodeClassicMaterialContent.js +34 -21
- package/dist/esmdev/foundation/materials/contents/SynthesizeHdrMaterialContent.d.ts +0 -23
- package/dist/esmdev/foundation/materials/contents/SynthesizeHdrMaterialContent.js +5 -29
- package/dist/esmdev/foundation/materials/contents/VarianceShadowMapDecodeClassicMaterialContent.js +42 -26
- package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.d.ts +6 -61
- package/dist/esmdev/foundation/materials/core/AbstractMaterialContent.js +61 -153
- package/dist/esmdev/foundation/materials/core/AbstractShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/core/AbstractShaderNode.js +31 -31
- package/dist/esmdev/foundation/materials/core/DummyTextures.js +3 -3
- package/dist/esmdev/foundation/materials/core/Material.d.ts +7 -114
- package/dist/esmdev/foundation/materials/core/Material.js +116 -364
- package/dist/esmdev/foundation/materials/core/MaterialRepository.js +65 -65
- package/dist/esmdev/foundation/materials/core/ShaderGraphResolver.js +46 -1399
- package/dist/esmdev/foundation/materials/core/ShaderNodeFactories.d.ts +23 -0
- package/dist/esmdev/foundation/materials/core/ShaderNodeFactories.js +609 -0
- package/dist/esmdev/foundation/materials/core/ShaderProgramDefinitions.d.ts +41 -0
- package/dist/esmdev/foundation/materials/core/ShaderProgramDefinitions.js +95 -0
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGL.js +26 -20
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGPU.js +29 -23
- package/dist/esmdev/foundation/materials/nodes/AbsShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/AcosShaderNode.js +16 -16
- package/dist/esmdev/foundation/materials/nodes/AddShaderNode.js +21 -21
- 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 +18 -18
- 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 +18 -18
- package/dist/esmdev/foundation/materials/nodes/CalcBitangentShaderNode.js +7 -7
- package/dist/esmdev/foundation/materials/nodes/CastToFloatShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/CastToFloatShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/ClampShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/ClampShaderNode.js +19 -19
- 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.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/CosShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/DiscardShaderNode.js +2 -2
- package/dist/esmdev/foundation/materials/nodes/DotProductShaderNode.d.ts +2 -2
- package/dist/esmdev/foundation/materials/nodes/DotProductShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/EqualShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/EqualShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/FlatShaderNode.js +5 -5
- package/dist/esmdev/foundation/materials/nodes/GreaterOrEqualShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/GreaterOrEqualShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/GreaterShaderNode.js +3 -3
- package/dist/esmdev/foundation/materials/nodes/GreaterThanShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/GreaterThanShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/LengthShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/LengthShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/LessOrEqualShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/LessOrEqualShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/LessThanShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/LessThanShaderNode.js +14 -14
- package/dist/esmdev/foundation/materials/nodes/MergeVectorShaderNode.js +23 -23
- package/dist/esmdev/foundation/materials/nodes/MinShaderNode.js +21 -21
- package/dist/esmdev/foundation/materials/nodes/MultiplyShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/MultiplyShaderNode.js +25 -25
- package/dist/esmdev/foundation/materials/nodes/NormalMatrixShaderNode.js +1 -1
- package/dist/esmdev/foundation/materials/nodes/NormalizeShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/NormalizeShaderNode.js +13 -13
- package/dist/esmdev/foundation/materials/nodes/NotEqualShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/NotEqualShaderNode.js +14 -14
- 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.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/PremultipliedAlphaShaderNode.js +8 -8
- 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 +15 -15
- package/dist/esmdev/foundation/materials/nodes/Random_SinHashShaderNode.js +15 -15
- package/dist/esmdev/foundation/materials/nodes/RemapShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/RemapShaderNode.js +21 -21
- package/dist/esmdev/foundation/materials/nodes/SinShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/SinShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/SmoothStepShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/SmoothStepShaderNode.js +19 -19
- package/dist/esmdev/foundation/materials/nodes/SplitVectorShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/SplitVectorShaderNode.js +22 -22
- package/dist/esmdev/foundation/materials/nodes/StepShaderNode.js +17 -17
- package/dist/esmdev/foundation/materials/nodes/TanShaderNode.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/TanShaderNode.js +17 -17
- 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.d.ts +1 -1
- package/dist/esmdev/foundation/materials/nodes/TransformShaderNode.js +14 -14
- 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/MathUtil.d.ts +11 -0
- package/dist/esmdev/foundation/math/MathUtil.js +5 -1
- package/dist/esmdev/foundation/math/Quaternion.js +20 -20
- package/dist/esmdev/foundation/math/Transform3D.js +74 -74
- 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 +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 +10 -10
- package/dist/esmdev/foundation/physics/Rapier/RapierCharacterControllerStrategy.js +190 -190
- 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 +55 -55
- package/dist/esmdev/foundation/renderer/CGAPIResourceRepository.d.ts +74 -4
- package/dist/esmdev/foundation/renderer/CGAPIResourceRepository.js +4 -4
- 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 +28 -28
- package/dist/esmdev/foundation/renderer/FrameRenderer.d.ts +42 -0
- package/dist/esmdev/foundation/renderer/FrameRenderer.js +1 -0
- package/dist/esmdev/foundation/renderer/RenderPass.js +101 -101
- package/dist/esmdev/foundation/renderer/ShaderPropertyLayout.d.ts +77 -0
- package/dist/esmdev/foundation/renderer/ShaderPropertyLayout.js +61 -0
- package/dist/esmdev/foundation/renderer/TemporalAA/PreviousFrameDataTracker.js +10 -10
- package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.d.ts +9 -3
- package/dist/esmdev/foundation/renderer/TemporalAA/TemporalAASystem.js +97 -83
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystem.d.ts +12 -0
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystem.js +193 -155
- 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 +82 -176
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.js +440 -1108
- package/dist/esmdev/foundation/renderer/pipelines/RaymarchingRenderer.d.ts +263 -0
- package/dist/esmdev/foundation/renderer/pipelines/RaymarchingRenderer.js +858 -0
- package/dist/esmdev/foundation/system/Engine.d.ts +19 -44
- package/dist/esmdev/foundation/system/Engine.js +235 -601
- package/dist/esmdev/foundation/system/EngineState.d.ts +9 -3
- package/dist/esmdev/foundation/system/EngineState.js +4 -4
- package/dist/esmdev/foundation/system/EventPubSub.js +8 -8
- package/dist/esmdev/foundation/system/GpuDriverWorkarounds.d.ts +50 -0
- package/dist/esmdev/foundation/system/GpuDriverWorkarounds.js +93 -0
- package/dist/esmdev/foundation/system/InputManager.js +56 -56
- package/dist/esmdev/foundation/system/ModuleManager.js +6 -6
- package/dist/esmdev/foundation/system/index.d.ts +1 -0
- package/dist/esmdev/foundation/system/index.js +2 -1
- package/dist/esmdev/foundation/textures/AbstractReadableRenderTargetTexture.d.ts +39 -0
- package/dist/esmdev/foundation/textures/AbstractReadableRenderTargetTexture.js +88 -0
- package/dist/esmdev/foundation/textures/AbstractRenderTargetTexture.d.ts +60 -0
- package/dist/esmdev/foundation/textures/AbstractRenderTargetTexture.js +59 -0
- package/dist/esmdev/foundation/textures/AbstractTexture.js +49 -49
- package/dist/esmdev/foundation/textures/CubeTexture.js +35 -42
- package/dist/esmdev/foundation/textures/RenderBuffer.js +16 -17
- package/dist/esmdev/foundation/textures/RenderTargetTexture.d.ts +5 -67
- package/dist/esmdev/foundation/textures/RenderTargetTexture.js +18 -140
- package/dist/esmdev/foundation/textures/RenderTargetTexture2DArray.d.ts +5 -71
- package/dist/esmdev/foundation/textures/RenderTargetTexture2DArray.js +34 -177
- package/dist/esmdev/foundation/textures/RenderTargetTextureCube.d.ts +8 -50
- package/dist/esmdev/foundation/textures/RenderTargetTextureCube.js +31 -88
- package/dist/esmdev/foundation/textures/Sampler.js +24 -24
- package/dist/esmdev/foundation/textures/Texture.d.ts +19 -1
- package/dist/esmdev/foundation/textures/Texture.js +133 -146
- package/dist/esmdev/foundation/textures/TextureArray.js +13 -16
- package/dist/esmdev/foundation/textures/TextureDataFloat.js +26 -26
- package/dist/esmdev/foundation/textures/VideoTexture.d.ts +11 -0
- package/dist/esmdev/foundation/textures/VideoTexture.js +47 -46
- package/dist/esmdev/foundation/textures/decodeBasisImage.d.ts +14 -0
- package/dist/esmdev/foundation/textures/decodeBasisImage.js +14 -0
- package/dist/esmdev/foundation/textures/index.d.ts +2 -0
- package/dist/esmdev/foundation/textures/index.js +3 -1
- package/dist/esmdev/types/glTF2.d.ts +9 -0
- package/dist/esmdev/types/glTF2.js +1 -1
- package/dist/esmdev/version.js +2 -2
- package/dist/esmdev/webgl/ComponentDataAccessorGLSL.d.ts +9 -0
- package/dist/esmdev/webgl/ComponentDataAccessorGLSL.js +146 -0
- package/dist/esmdev/webgl/InstanceSidTable.js +62 -62
- package/dist/esmdev/webgl/MultiDraw.d.ts +1 -1
- package/dist/esmdev/webgl/MultiDraw.js +4 -4
- package/dist/esmdev/webgl/MultiDrawRepository.js +34 -34
- package/dist/esmdev/webgl/ShaderPropertyAccessorGLSL.d.ts +11 -0
- package/dist/esmdev/webgl/ShaderPropertyAccessorGLSL.js +142 -0
- package/dist/esmdev/webgl/WebGLCompressedTextures.d.ts +48 -0
- package/dist/esmdev/webgl/WebGLCompressedTextures.js +105 -0
- package/dist/esmdev/webgl/WebGLContextWrapper.d.ts +9 -52
- package/dist/esmdev/webgl/WebGLContextWrapper.js +127 -229
- package/dist/esmdev/webgl/WebGLCubeTextureFileLoader.d.ts +38 -0
- package/dist/esmdev/webgl/WebGLCubeTextureFileLoader.js +178 -0
- package/dist/esmdev/webgl/WebGLCubeTextures.d.ts +92 -0
- package/dist/esmdev/webgl/WebGLCubeTextures.js +358 -0
- package/dist/esmdev/webgl/WebGLDataTexture.d.ts +108 -0
- package/dist/esmdev/webgl/WebGLDataTexture.js +337 -0
- package/dist/esmdev/webgl/WebGLDrawState.d.ts +84 -0
- package/dist/esmdev/webgl/WebGLDrawState.js +164 -0
- package/dist/esmdev/webgl/WebGLExternalState.d.ts +43 -0
- package/dist/esmdev/webgl/WebGLExternalState.js +70 -0
- package/dist/esmdev/webgl/WebGLFrameRenderer.d.ts +32 -0
- package/dist/esmdev/webgl/WebGLFrameRenderer.js +155 -0
- package/dist/esmdev/webgl/WebGLFramebuffers.d.ts +142 -0
- package/dist/esmdev/webgl/WebGLFramebuffers.js +245 -0
- package/dist/esmdev/webgl/WebGLGpuTimer.js +32 -32
- package/dist/esmdev/webgl/WebGLMaterialParameters.d.ts +47 -0
- package/dist/esmdev/webgl/WebGLMaterialParameters.js +81 -0
- package/dist/esmdev/webgl/WebGLMeshResources.d.ts +115 -0
- package/dist/esmdev/webgl/WebGLMeshResources.js +303 -0
- package/dist/esmdev/webgl/WebGLMorphUniformBuffers.d.ts +66 -0
- package/dist/esmdev/webgl/WebGLMorphUniformBuffers.js +272 -0
- package/dist/esmdev/webgl/WebGLResourceRepository.d.ts +100 -178
- package/dist/esmdev/webgl/WebGLResourceRepository.js +345 -2592
- package/dist/esmdev/webgl/WebGLSamplers.d.ts +78 -0
- package/dist/esmdev/webgl/WebGLSamplers.js +143 -0
- package/dist/esmdev/webgl/WebGLShaderProgramBuilder.d.ts +40 -0
- package/dist/esmdev/webgl/WebGLShaderProgramBuilder.js +208 -0
- package/dist/esmdev/webgl/WebGLShaderPrograms.d.ts +88 -0
- package/dist/esmdev/webgl/WebGLShaderPrograms.js +240 -0
- package/dist/esmdev/webgl/WebGLStereoUtil.d.ts +0 -27
- package/dist/esmdev/webgl/WebGLStereoUtil.js +36 -115
- package/dist/esmdev/webgl/WebGLStrategyDataUploader.d.ts +152 -0
- package/dist/esmdev/webgl/WebGLStrategyDataUploader.js +370 -0
- package/dist/esmdev/webgl/WebGLStrategyMeshBatchRenderer.d.ts +40 -0
- package/dist/esmdev/webgl/WebGLStrategyMeshBatchRenderer.js +213 -0
- package/dist/esmdev/webgl/WebGLStrategyMeshDrawer.d.ts +92 -0
- package/dist/esmdev/webgl/WebGLStrategyMeshDrawer.js +300 -0
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.d.ts +7 -360
- package/dist/esmdev/webgl/WebGLStrategyWebGL2.js +75 -1856
- package/dist/esmdev/webgl/WebGLTextureUnitState.d.ts +79 -0
- package/dist/esmdev/webgl/WebGLTextureUnitState.js +149 -0
- package/dist/esmdev/webgl/WebGLTextureUploads.d.ts +106 -0
- package/dist/esmdev/webgl/WebGLTextureUploads.js +168 -0
- package/dist/esmdev/webgl/WebGLTextures.d.ts +316 -0
- package/dist/esmdev/webgl/WebGLTextures.js +577 -0
- package/dist/esmdev/webgl/WebGLUniformBuffers.d.ts +35 -0
- package/dist/esmdev/webgl/WebGLUniformBuffers.js +89 -0
- package/dist/esmdev/webgl/WebGLUniforms.d.ts +117 -0
- package/dist/esmdev/webgl/WebGLUniforms.js +283 -0
- package/dist/esmdev/webgl/WebGLVertexBuffers.d.ts +172 -0
- package/dist/esmdev/webgl/WebGLVertexBuffers.js +391 -0
- package/dist/esmdev/webgl/debug/BufferLayoutDecoder.d.ts +4 -4
- package/dist/esmdev/webgl/debug/BufferLayoutDecoder.js +52 -59
- package/dist/esmdev/webgl/debug/ShaderParameterDebugger.js +17 -17
- package/dist/esmdev/webgl/debug/types.d.ts +2 -2
- package/dist/esmdev/webgl/getRenderingStrategy.d.ts +2 -2
- package/dist/esmdev/webgl/getRenderingStrategy.js +5 -5
- package/dist/esmdev/webgl/main.d.ts +4 -17
- package/dist/esmdev/webgl/main.js +5 -3
- package/dist/esmdev/webgl/readColorAttachmentAsRgba8.d.ts +36 -0
- package/dist/esmdev/webgl/readColorAttachmentAsRgba8.js +47 -0
- package/dist/esmdev/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/ColorGradingUsingLUTsShader/ColorGradingUsingLUTsShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/DepthEncodeSingleShader/DepthEncodeSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/DepthMomentEncodeShader/DepthMomentEncodeShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/DetectHighLuminanceAndCorrectShader/DetectHighLuminanceAndCorrectShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/EntityUIDOutputSingleShader/EntityUIDOutputSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.frag.js +12 -0
- package/dist/esmdev/webgl/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.vert.js +12 -0
- package/dist/esmdev/webgl/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/FlatSingleShader/FlatSingleShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/FlatSingleShader/FlatSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/GammaCorrectionShader/GammaCorrectionShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.frag.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MToon0xSingleShader/MToon0xSingleShader.vert.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.frag.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MToon1SingleShader/MToon1SingleShader.vert.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MatCapShader/MatCapShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/MotionVectorShader/MotionVectorShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/PanoramaToCubeShader/PanoramaToCubeShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.frag.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.vert.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/PbrSingleShader/PbrSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/PrefilterIBLShader/PrefilterIBLShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/ShadowMapDecodeClassicSingleShader/ShadowMapDecodeClassicSingleShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/SummedAreaTableShader/SummedAreaTableShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/ToneMappingShader/ToneMappingShader.frag.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/VarianceShadowMapDecodeClassicShader/VarianceShadowMapDecodeClassicShader.vert.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/common/iblDefinition.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/common/morphVariables.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/common/opticalDefinition.glsl.js +5 -2
- package/dist/esmdev/webgl/shaderity_shaders/common/prerequisites.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/nodes/ClassicShader.glsl.js +2 -2
- package/dist/esmdev/webgl/shaderity_shaders/nodes/PbrShader.glsl.js +2 -2
- package/dist/esmdev/webgl/shaders/RaymarchingShaderPart.d.ts +2 -2
- package/dist/esmdev/webgl/shaders/RaymarchingShaderPart.js +35 -23
- package/dist/esmdev/webgl/shaders/RaymarchingShadowShaderPart.js +17 -17
- package/dist/esmdev/webgl/shaders/StandardShaderPart.d.ts +3 -3
- package/dist/esmdev/webgl/shaders/StandardShaderPart.js +15 -15
- package/dist/esmdev/webgl/shaders/glslCommonChunks.d.ts +2 -2
- package/dist/esmdev/webgl/shaders/glslCommonChunks.js +1 -1
- 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.d.ts +2 -2
- package/dist/esmdev/webgl/shaders/nodes/ConstantVariableShader.js +27 -27
- package/dist/esmdev/webgl/shaders/nodes/DiscardShader.d.ts +1 -1
- package/dist/esmdev/webgl/shaders/nodes/DiscardShader.js +8 -8
- package/dist/esmdev/webgl/shaders/nodes/EndShader.d.ts +2 -2
- package/dist/esmdev/webgl/shaders/nodes/EndShader.js +9 -9
- package/dist/esmdev/webgl/shaders/nodes/OutDistance.d.ts +1 -1
- package/dist/esmdev/webgl/shaders/nodes/OutDistance.js +17 -17
- package/dist/esmdev/webgl/shaders/nodes/OutUnion.js +12 -12
- package/dist/esmdev/webgl/shaders/nodes/RaymarchObjectIdUniform.js +11 -11
- package/dist/esmdev/webgl/shaders/nodes/SdApplyTransform.js +12 -12
- package/dist/esmdev/webgl/shaders/nodes/SdApplyWorldMatrix.d.ts +1 -1
- package/dist/esmdev/webgl/shaders/nodes/SdApplyWorldMatrix.js +13 -13
- package/dist/esmdev/webgl/shaders/nodes/Texture2DShader.js +27 -27
- package/dist/esmdev/webgl/shaders/nodes/UniformDataShader.js +27 -27
- package/dist/esmdev/webgl/textureLoader/KTX2TextureLoader.d.ts +1 -1
- package/dist/esmdev/webgl/textureLoader/KTX2TextureLoader.js +36 -30
- package/dist/esmdev/webgpu/AttributeReader.d.ts +18 -0
- package/dist/esmdev/webgpu/AttributeReader.js +57 -0
- 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/ShaderPropertyAccessorWGSL.d.ts +11 -0
- package/dist/esmdev/webgpu/ShaderPropertyAccessorWGSL.js +131 -0
- package/dist/esmdev/webgpu/WebGpuBindGroups.d.ts +131 -0
- package/dist/esmdev/webgpu/WebGpuBindGroups.js +377 -0
- package/dist/esmdev/webgpu/WebGpuBufferArena.js +21 -21
- package/dist/esmdev/webgpu/WebGpuCompressedTextures.d.ts +38 -0
- package/dist/esmdev/webgpu/WebGpuCompressedTextures.js +155 -0
- package/dist/esmdev/webgpu/WebGpuCubeTextureShaders.d.ts +1 -0
- package/dist/esmdev/webgpu/WebGpuCubeTextureShaders.js +68 -0
- package/dist/esmdev/webgpu/WebGpuCubeTextures.d.ts +72 -0
- package/dist/esmdev/webgpu/WebGpuCubeTextures.js +340 -0
- package/dist/esmdev/webgpu/WebGpuDeviceWrapper.js +7 -7
- package/dist/esmdev/webgpu/WebGpuDraw.d.ts +63 -0
- package/dist/esmdev/webgpu/WebGpuDraw.js +133 -0
- package/dist/esmdev/webgpu/WebGpuDrawParameters.d.ts +61 -0
- package/dist/esmdev/webgpu/WebGpuDrawParameters.js +120 -0
- package/dist/esmdev/webgpu/WebGpuExternalRenderPass.d.ts +44 -0
- package/dist/esmdev/webgpu/WebGpuExternalRenderPass.js +115 -0
- package/dist/esmdev/webgpu/WebGpuFrame.d.ts +55 -0
- package/dist/esmdev/webgpu/WebGpuFrame.js +89 -0
- package/dist/esmdev/webgpu/WebGpuFrameRenderer.d.ts +25 -0
- package/dist/esmdev/webgpu/WebGpuFrameRenderer.js +248 -0
- package/dist/esmdev/webgpu/WebGpuGpuCulling.js +200 -454
- package/dist/esmdev/webgpu/WebGpuGpuCullingShaders.d.ts +34 -0
- package/dist/esmdev/webgpu/WebGpuGpuCullingShaders.js +264 -0
- package/dist/esmdev/webgpu/WebGpuGpuTimer.js +52 -52
- package/dist/esmdev/webgpu/WebGpuLightClusterBuilder.js +39 -194
- package/dist/esmdev/webgpu/WebGpuLightClusterShaders.d.ts +14 -0
- package/dist/esmdev/webgpu/WebGpuLightClusterShaders.js +161 -0
- package/dist/esmdev/webgpu/WebGpuMipmapGenerator.d.ts +54 -0
- package/dist/esmdev/webgpu/WebGpuMipmapGenerator.js +187 -0
- package/dist/esmdev/webgpu/WebGpuMipmapShaders.d.ts +1 -0
- package/dist/esmdev/webgpu/WebGpuMipmapShaders.js +34 -0
- package/dist/esmdev/webgpu/WebGpuRenderBundles.d.ts +117 -0
- package/dist/esmdev/webgpu/WebGpuRenderBundles.js +299 -0
- package/dist/esmdev/webgpu/WebGpuRenderPassEncoders.d.ts +140 -0
- package/dist/esmdev/webgpu/WebGpuRenderPassEncoders.js +611 -0
- package/dist/esmdev/webgpu/WebGpuRenderPipelines.d.ts +75 -0
- package/dist/esmdev/webgpu/WebGpuRenderPipelines.js +249 -0
- package/dist/esmdev/webgpu/WebGpuRenderTargetTextures.d.ts +78 -0
- package/dist/esmdev/webgpu/WebGpuRenderTargetTextures.js +108 -0
- package/dist/esmdev/webgpu/WebGpuResourceRepository.d.ts +52 -322
- package/dist/esmdev/webgpu/WebGpuResourceRepository.js +332 -3127
- package/dist/esmdev/webgpu/WebGpuSamplers.d.ts +45 -0
- package/dist/esmdev/webgpu/WebGpuSamplers.js +58 -0
- package/dist/esmdev/webgpu/WebGpuShaderProgramBuilder.d.ts +25 -0
- package/dist/esmdev/webgpu/WebGpuShaderProgramBuilder.js +108 -0
- package/dist/esmdev/webgpu/WebGpuStorageBuffers.d.ts +77 -0
- package/dist/esmdev/webgpu/WebGpuStorageBuffers.js +191 -0
- package/dist/esmdev/webgpu/WebGpuStrategyBasic.d.ts +2 -73
- package/dist/esmdev/webgpu/WebGpuStrategyBasic.js +63 -781
- package/dist/esmdev/webgpu/WebGpuStrategyStorage.d.ts +62 -0
- package/dist/esmdev/webgpu/WebGpuStrategyStorage.js +267 -0
- package/dist/esmdev/webgpu/WebGpuTextureReadback.d.ts +111 -0
- package/dist/esmdev/webgpu/WebGpuTextureReadback.js +188 -0
- package/dist/esmdev/webgpu/WebGpuTextureReadbackShaders.d.ts +4 -0
- package/dist/esmdev/webgpu/WebGpuTextureReadbackShaders.js +34 -0
- package/dist/esmdev/webgpu/WebGpuTextureUploads.d.ts +109 -0
- package/dist/esmdev/webgpu/WebGpuTextureUploads.js +197 -0
- package/dist/esmdev/webgpu/WebGpuTextures.d.ts +196 -0
- package/dist/esmdev/webgpu/WebGpuTextures.js +344 -0
- package/dist/esmdev/webgpu/WebGpuVertexBuffers.d.ts +142 -0
- package/dist/esmdev/webgpu/WebGpuVertexBuffers.js +281 -0
- package/dist/esmdev/webgpu/WebGpuVertexDeformer.js +106 -284
- package/dist/esmdev/webgpu/WebGpuVertexDeformerShaders.d.ts +7 -0
- package/dist/esmdev/webgpu/WebGpuVertexDeformerShaders.js +134 -0
- package/dist/esmdev/webgpu/WebGpuVertexShaderDefinitions.d.ts +16 -0
- package/dist/esmdev/webgpu/WebGpuVertexShaderDefinitions.js +216 -0
- package/dist/esmdev/webgpu/assertArrayBufferView.d.ts +9 -0
- package/dist/esmdev/webgpu/assertArrayBufferView.js +10 -0
- package/dist/esmdev/webgpu/main.d.ts +2 -16
- package/dist/esmdev/webgpu/main.js +3 -3
- package/dist/esmdev/webgpu/padCompressedRowsForUpload.d.ts +20 -0
- package/dist/esmdev/webgpu/padCompressedRowsForUpload.js +20 -0
- package/dist/esmdev/webgpu/removeRowPadding.d.ts +21 -0
- package/dist/esmdev/webgpu/removeRowPadding.js +23 -0
- package/dist/esmdev/webgpu/shaderity_shaders/ClassicSingleShader/ClassicSingleShader.frag.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.frag.wgsl.js +12 -0
- package/dist/esmdev/webgpu/shaderity_shaders/EnvConstantScreenSpaceShader/EnvConstantScreenSpaceShader.vert.wgsl.js +12 -0
- package/dist/esmdev/webgpu/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.frag.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/EnvConstantSingleShader/EnvConstantSingleShader.vert.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/FlatSingleShader/FlatSingleShader.frag.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/GammaCorrectionShader/GammaCorrectionShader.frag.js +2 -2
- 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/MToon1SingleShader/MToon1SingleShader.vert.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/PanoramaToCubeShader/PanoramaToCubeShader.frag.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.frag.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/ParaboloidDepthMomentEncodeShader/ParaboloidDepthMomentEncodeShader.vert.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/PbrSingleShader/PbrSingleShader.frag.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/PrefilterIBLShader/PrefilterIBLShader.frag.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/ToneMappingShader/ToneMappingShader.frag.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/common/iblDefinition.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/common/opticalDefinition.wgsl.js +5 -2
- package/dist/esmdev/webgpu/shaderity_shaders/common/processGeometry.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/nodes/ClassicShader.wgsl.js +2 -2
- package/dist/esmdev/webgpu/shaderity_shaders/nodes/PbrShader.wgsl.js +2 -2
- package/dist/esmdev/webgpu/wgslCommonChunks.d.ts +2 -2
- package/dist/esmdev/webgpu/wgslCommonChunks.js +1 -1
- package/dist/esmdev/xr/WebARSystem.js +69 -69
- package/dist/esmdev/xr/WebXRSystem.d.ts +0 -4
- package/dist/esmdev/xr/WebXRSystem.js +155 -160
- package/package.json +1 -1
- package/dist/esm/foundation/definitions/ProcessApproach.d.ts +0 -21
- package/dist/esm/foundation/definitions/ProcessApproach.js +0 -1
- package/dist/esm/foundation/materials/core/ShaderHandler.d.ts +0 -125
- package/dist/esm/foundation/materials/core/ShaderHandler.js +0 -48
- package/dist/esmdev/foundation/definitions/ProcessApproach.d.ts +0 -21
- package/dist/esmdev/foundation/definitions/ProcessApproach.js +0 -60
- package/dist/esmdev/foundation/materials/core/ShaderHandler.d.ts +0 -125
- package/dist/esmdev/foundation/materials/core/ShaderHandler.js +0 -416
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { Config } from '../foundation/core/Config';
|
|
2
|
+
import type { ShaderSemanticsInfo } from '../foundation/definitions/ShaderSemanticsInfo';
|
|
3
|
+
import type { AbstractTexture } from '../foundation/textures/AbstractTexture';
|
|
4
|
+
import type { Sampler } from '../foundation/textures/Sampler';
|
|
5
|
+
import type { ArrayType, CGAPIResourceHandle, Index, WebGLResourceHandle } from '../types/CommonTypes';
|
|
6
|
+
import type { WebGLContextWrapper } from './WebGLContextWrapper';
|
|
7
|
+
import type { WebGLResource } from './WebGLResourceRepository';
|
|
8
|
+
/**
|
|
9
|
+
* What `WebGLUniforms` needs from the resource repository that owns it.
|
|
10
|
+
*
|
|
11
|
+
* The repository passes itself: these methods are called for every texture of every material in every frame, so
|
|
12
|
+
* they are reached without an extra closure.
|
|
13
|
+
*/
|
|
14
|
+
export interface WebGLUniformResources {
|
|
15
|
+
/** The current WebGL context wrapper, which is replaced when a context is added. */
|
|
16
|
+
readonly currentWebGLContextWrapper: WebGLContextWrapper | undefined;
|
|
17
|
+
/** Returns the WebGL object of a resource handle. */
|
|
18
|
+
getWebGLResource(handle: WebGLResourceHandle): WebGLResource | null;
|
|
19
|
+
bindTexture2D(textureSlotIndex: Index, textureUid: CGAPIResourceHandle): void;
|
|
20
|
+
bindTextureCube(textureSlotIndex: Index, textureUid: CGAPIResourceHandle): void;
|
|
21
|
+
bindTexture2DArray(textureSlotIndex: Index, textureUid: CGAPIResourceHandle): void;
|
|
22
|
+
bindTextureSampler(textureSlotIndex: Index, samplerUid: CGAPIResourceHandle): void;
|
|
23
|
+
createOrGetTextureSamplerClampToEdgeLinear(): WebGLResourceHandle;
|
|
24
|
+
createOrGetTextureSamplerShadow(): WebGLResourceHandle;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Looks up the uniform locations of the WebGL2 shader programs and sets their uniform values, binding the textures
|
|
28
|
+
* and samplers of sampler uniforms.
|
|
29
|
+
*
|
|
30
|
+
* Owned by `WebGLResourceRepository`, which exposes these operations through its public methods.
|
|
31
|
+
*/
|
|
32
|
+
export declare class WebGLUniforms {
|
|
33
|
+
private __resources;
|
|
34
|
+
constructor(resources: WebGLUniformResources);
|
|
35
|
+
private get __glw();
|
|
36
|
+
private get currentWebGLContextWrapper();
|
|
37
|
+
private getWebGLResource;
|
|
38
|
+
private bindTexture2D;
|
|
39
|
+
private bindTextureCube;
|
|
40
|
+
private bindTexture2DArray;
|
|
41
|
+
private bindTextureSampler;
|
|
42
|
+
private createOrGetTextureSamplerClampToEdgeLinear;
|
|
43
|
+
private createOrGetTextureSamplerShadow;
|
|
44
|
+
/**
|
|
45
|
+
* Sets up uniform locations for a shader program based on shader semantics information.
|
|
46
|
+
* This method extracts uniform locations from the compiled shader program and stores them
|
|
47
|
+
* for efficient access during rendering.
|
|
48
|
+
*
|
|
49
|
+
* @param config - Configuration for the shader program
|
|
50
|
+
* @param shaderProgramUid - The handle of the shader program
|
|
51
|
+
* @param infoArray - Array of shader semantics information
|
|
52
|
+
* @returns The WebGL program object with configured uniform locations
|
|
53
|
+
*/
|
|
54
|
+
setupUniformLocations(config: Config, shaderProgramUid: WebGLResourceHandle, infoArray: ShaderSemanticsInfo[]): WebGLProgram;
|
|
55
|
+
/**
|
|
56
|
+
* Sets up basic uniform locations required for data texture operations.
|
|
57
|
+
*
|
|
58
|
+
* @param shaderProgramUid - The handle of the shader program to configure
|
|
59
|
+
*/
|
|
60
|
+
setupBasicUniformLocations(shaderProgramUid: WebGLResourceHandle): void;
|
|
61
|
+
/**
|
|
62
|
+
* Sets a uniform value for texture binding and binds the texture to the appropriate slot.
|
|
63
|
+
*
|
|
64
|
+
* @param shaderProgram_ - The shader program to set the uniform for
|
|
65
|
+
* @param semanticStr - The semantic string identifying the uniform
|
|
66
|
+
* @param value - The value array containing texture slot index and texture data
|
|
67
|
+
*/
|
|
68
|
+
setUniform1iForTexture(shaderProgram_: WebGLProgram, semanticStr: string, value: any): void;
|
|
69
|
+
/**
|
|
70
|
+
* Sets a uniform value in the shader program with automatic type detection and conversion.
|
|
71
|
+
* This method handles various composition types including matrices, vectors, and textures.
|
|
72
|
+
*
|
|
73
|
+
* @param shaderProgram_ - The shader program to set the uniform for
|
|
74
|
+
* @param semanticStr - The semantic string identifying the uniform
|
|
75
|
+
* @param firstTime - Whether this is the first time setting this uniform
|
|
76
|
+
* @param value - The value to set (can be scalar, vector, matrix, or texture data)
|
|
77
|
+
* @returns True if the uniform was successfully set, false otherwise
|
|
78
|
+
*/
|
|
79
|
+
setUniformValue(shaderProgram_: WebGLProgram, semanticStr: string, _firstTime: boolean, value: any): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Binds textures and samplers based on the composition type information.
|
|
82
|
+
* This method handles different texture types including 2D, cube, and texture arrays.
|
|
83
|
+
*
|
|
84
|
+
* @param info - The shader semantics info containing composition type details
|
|
85
|
+
* @param value - Array containing texture slot, texture object, and sampler
|
|
86
|
+
*/
|
|
87
|
+
bindTexture(info: ShaderSemanticsInfo, value: [number, AbstractTexture, Sampler]): void;
|
|
88
|
+
/**
|
|
89
|
+
* Returns the sampler used for a texture uniform that was given no sampler: a shadow comparison sampler for
|
|
90
|
+
* `Texture2DShadow`, the recommended sampler of a cube texture (-1 unbinds the sampler when it has none), and a
|
|
91
|
+
* clamp-to-edge linear sampler otherwise.
|
|
92
|
+
*/
|
|
93
|
+
private __getDefaultSamplerUid;
|
|
94
|
+
/**
|
|
95
|
+
* Internal method for setting uniform values with proper WebGL calls based on data type.
|
|
96
|
+
* This method handles the actual WebGL uniform* calls with appropriate type conversion.
|
|
97
|
+
*
|
|
98
|
+
* @param shaderProgram - The shader program to set the uniform for
|
|
99
|
+
* @param semanticStr - The semantic string identifying the uniform
|
|
100
|
+
* @param info - The shader semantics information
|
|
101
|
+
* @param isMatrix - Whether the value is a matrix
|
|
102
|
+
* @param componentNumber - Number of components in the value
|
|
103
|
+
* @param isVector - Whether the value is a vector/array
|
|
104
|
+
* @param param6 - Object containing the value components
|
|
105
|
+
* @param param6.x - Primary value component
|
|
106
|
+
* @param param6.y - Second value component (optional)
|
|
107
|
+
* @param param6.z - Third value component (optional)
|
|
108
|
+
* @param param6.w - Fourth value component (optional)
|
|
109
|
+
* @returns True if the uniform was successfully set, false if location not found
|
|
110
|
+
*/
|
|
111
|
+
setUniformValueInner(shaderProgram: WebGLProgram, semanticStr: string, info: ShaderSemanticsInfo, isMatrix: boolean, componentNumber: number, isVector: boolean, { x, y, z, w, }: {
|
|
112
|
+
x: number | ArrayType | boolean;
|
|
113
|
+
y?: number | boolean;
|
|
114
|
+
z?: number | boolean;
|
|
115
|
+
w?: number | boolean;
|
|
116
|
+
}): boolean;
|
|
117
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ComponentType as l}from"../foundation/definitions/ComponentType.js";import{CompositionType as c}from"../foundation/definitions/CompositionType.js";import{Logger as G}from"../foundation/misc/Logger.js";var x=class{constructor(t){this.x_=t}get u_(){return this.x_.currentWebGLContextWrapper}get currentWebGLContextWrapper(){return this.x_.currentWebGLContextWrapper}getWebGLResource(t){return this.x_.getWebGLResource(t)}bindTexture2D(t,e){this.x_.bindTexture2D(t,e)}bindTextureCube(t,e){this.x_.bindTextureCube(t,e)}bindTexture2DArray(t,e){this.x_.bindTexture2DArray(t,e)}bindTextureSampler(t,e){this.x_.bindTextureSampler(t,e)}createOrGetTextureSamplerClampToEdgeLinear(){return this.x_.createOrGetTextureSamplerClampToEdgeLinear()}createOrGetTextureSamplerShadow(){return this.x_.createOrGetTextureSamplerShadow()}setupUniformLocations(t,e,n){let f=this.u_.getRawContext(),s=this.getWebGLResource(e),r=n.length;for(let o=0;o<r;o++){let i=n[o];s._shaderSemanticsInfoMap.set(i.semantic,i)}for(let o=0;o<r;o++){let i=n[o];if(i.needUniformInDataTextureMode||c.isTexture(i.compositionType)){let m=i.semantic,p=`u_${i.semantic}`,b=f.getUniformLocation(s,p),T=s;T[m]=b,b==null&&t.cgApiDebugConsoleOutput&&G.default.info(`Can not get the uniform location: ${p}. The uniform may be unused by other code so implicitly removed.`)}}return s}setupBasicUniformLocations(t){let e=this.getWebGLResource(t),n=this.currentWebGLContextWrapper.getRawContext();e.dataTexture=n.getUniformLocation(e,"u_dataTexture"),e.currentComponentSIDs=n.getUniformLocation(e,"u_currentComponentSIDs"),e.lightClusterView=n.getUniformLocation(e,"u_lightClusterView")}setUniform1iForTexture(t,e,n){let a=t,f=a._shaderSemanticsInfoMap.get(e);if(f==null)return;let s=a._textureUnitsOfSamplers;s==null&&(s=new Map,a._textureUnitsOfSamplers=s);let r=n[0];if(s.get(e)!==r){let o=this.u_.getRawContext(),i=a[e];o.uniform1i(i,r),s.set(e,r)}this.bindTexture(f,n)}setUniformValue(t,e,n,a){let s=t._shaderSemanticsInfoMap.get(e);if(s==null)return!1;let r=s.compositionType,o=!0,i;if(r===c.Mat4||r===c.Mat4Array?i=4:r===c.Mat3||r===c.Mat3Array?i=3:(o=!1,i=r.getNumberOfComponents()),c.isTexture(r)){let d=this.setUniformValueInner(t,e,s,o,i,!1,{x:a[0]});return this.bindTexture(s,a),d}return a._v!=null?this.setUniformValueInner(t,e,s,o,i,!0,{x:a._v}):r===c.ScalarArray||r===c.Vec4Array||r===c.Vec3Array||r===c.Vec2Array?this.setUniformValueInner(t,e,s,o,i,!0,{x:a}):r===c.Scalar?this.setUniformValueInner(t,e,s,o,i,!1,{x:a}):this.setUniformValueInner(t,e,s,o,i,!1,a)}bindTexture(t,e){let n=t.compositionType;if(n===c.Texture2D||n===c.Texture2DShadow)this.bindTexture2D(e[0],e[1]._textureResourceUid);else if(n===c.TextureCube)this.bindTextureCube(e[0],e[1]._textureResourceUid);else if(n===c.Texture2DArray)this.bindTexture2DArray(e[0],e[1]._textureResourceUid);else return;let a=e[2],f=a!=null?a._samplerResourceUid:this.rG(n,e[1]);this.bindTextureSampler(e[0],f)}rG(t,e){var n,a;return t===c.Texture2DShadow?this.createOrGetTextureSamplerShadow():t===c.TextureCube?(a=(n=e._recommendedTextureSampler)==null?void 0:n._samplerResourceUid)!=null?a:-1:this.createOrGetTextureSamplerClampToEdgeLinear()}setUniformValueInner(t,e,n,a,f,s,{x:r,y:o,z:i,w:d}){let u=t[e];if(u==null)return!1;let m=this.u_.getRawContext();if(a)return f===4?m.uniformMatrix4fv(u,!1,r):m.uniformMatrix3fv(u,!1,r),!0;let p=n.componentType===l.Int||n.componentType===l.Short||n.componentType===l.Byte;if(s)switch(f){case 1:p?m.uniform1iv(u,r):m.uniform1fv(u,r);break;case 2:p?m.uniform2iv(u,r):m.uniform2fv(u,r);break;case 3:p?m.uniform3iv(u,r):m.uniform3fv(u,r);break;case 4:p?m.uniform4iv(u,r):m.uniform4fv(u,r);break}else switch(f){case 1:p?m.uniform1i(u,r):m.uniform1f(u,r);break;case 2:p?m.uniform2i(u,r,o):m.uniform2f(u,r,o);break;case 3:p?m.uniform3i(u,r,o,i):m.uniform3f(u,r,o,i);break;case 4:p?m.uniform4i(u,r,o,i,d):m.uniform4f(u,r,o,i,d);break}return!0}};export{x as WebGLUniforms};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import type { Primitive } from '../foundation/geometry/Primitive';
|
|
2
|
+
import type { Accessor } from '../foundation/memory/Accessor';
|
|
3
|
+
import { type VertexHandles } from '../foundation/renderer/CGAPIResourceRepository';
|
|
4
|
+
import type { TypedArray, WebGLResourceHandle } from '../types/CommonTypes';
|
|
5
|
+
import type { MultiDrawGroup } from './MultiDraw';
|
|
6
|
+
import type { WebGLContextWrapper } from './WebGLContextWrapper';
|
|
7
|
+
import type { WebGLResource } from './WebGLResourceRepository';
|
|
8
|
+
/**
|
|
9
|
+
* What `WebGLVertexBuffers` needs from the resource repository that owns it.
|
|
10
|
+
*/
|
|
11
|
+
export interface WebGLVertexBufferResources {
|
|
12
|
+
/** The current context wrapper, which is replaced when a context is added. */
|
|
13
|
+
getContextWrapper(): WebGLContextWrapper | undefined;
|
|
14
|
+
/** Registers a WebGL object and returns its resource handle. */
|
|
15
|
+
registerResource(obj: WebGLResource): WebGLResourceHandle;
|
|
16
|
+
/** Returns the WebGL object of a resource handle. */
|
|
17
|
+
getWebGLResource(handle: WebGLResourceHandle): WebGLResource | null;
|
|
18
|
+
/** Forgets a resource handle (the WebGL object is deleted by the caller). */
|
|
19
|
+
deleteWebGLResource(handle: WebGLResourceHandle): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Creates, updates and deletes the vertex buffers, index buffers and vertex array objects of the WebGL2 backend, and
|
|
23
|
+
* sets up the vertex attributes of a vertex array object.
|
|
24
|
+
*
|
|
25
|
+
* Owned by `WebGLResourceRepository`, which exposes these operations through its public methods.
|
|
26
|
+
*/
|
|
27
|
+
export declare class WebGLVertexBuffers {
|
|
28
|
+
private __resources;
|
|
29
|
+
constructor(resources: WebGLVertexBufferResources);
|
|
30
|
+
/** The current context wrapper; throws when no context has been added. */
|
|
31
|
+
private get __glw();
|
|
32
|
+
private __registerResource;
|
|
33
|
+
private getWebGLResource;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a buffer object for `target` with STATIC_DRAW data and registers it.
|
|
36
|
+
*
|
|
37
|
+
* The vertex array is unbound first, so that binding an ELEMENT_ARRAY_BUFFER does not change the VAO bound by
|
|
38
|
+
* the caller.
|
|
39
|
+
*/
|
|
40
|
+
private __createBuffer;
|
|
41
|
+
/**
|
|
42
|
+
* Overwrites the beginning of a registered buffer object with `data`.
|
|
43
|
+
*
|
|
44
|
+
* @param unbindVertexArray - Whether to unbind the vertex array first. An ELEMENT_ARRAY_BUFFER binding is part of
|
|
45
|
+
* the VAO state, so updating an index buffer must unbind it; an ARRAY_BUFFER binding is not.
|
|
46
|
+
*/
|
|
47
|
+
private __updateBuffer;
|
|
48
|
+
/** Deletes a registered buffer object and forgets its handle. */
|
|
49
|
+
private __deleteBuffer;
|
|
50
|
+
/**
|
|
51
|
+
* Creates an index buffer from the provided accessor data.
|
|
52
|
+
*
|
|
53
|
+
* @param accessor - The accessor containing index data
|
|
54
|
+
* @returns The handle of the created index buffer
|
|
55
|
+
* @throws Error if no WebGL context is available
|
|
56
|
+
*/
|
|
57
|
+
createIndexBuffer(accessor: Accessor): number;
|
|
58
|
+
/**
|
|
59
|
+
* Updates an existing index buffer with new data from the accessor.
|
|
60
|
+
*
|
|
61
|
+
* @param accessor - The accessor containing new index data
|
|
62
|
+
* @param resourceHandle - The handle of the index buffer to update
|
|
63
|
+
* @throws Error if no WebGL context is available or IBO not found
|
|
64
|
+
*/
|
|
65
|
+
updateIndexBuffer(accessor: Accessor, resourceHandle: number): void;
|
|
66
|
+
/**
|
|
67
|
+
* Creates a vertex buffer from the provided accessor data.
|
|
68
|
+
*
|
|
69
|
+
* @param accessor - The accessor containing vertex data
|
|
70
|
+
* @returns The handle of the created vertex buffer
|
|
71
|
+
* @throws Error if no WebGL context is available
|
|
72
|
+
*/
|
|
73
|
+
createVertexBuffer(accessor: Accessor): number;
|
|
74
|
+
/**
|
|
75
|
+
* Creates a vertex buffer directly from a typed array.
|
|
76
|
+
*
|
|
77
|
+
* @param typedArray - The typed array containing vertex data
|
|
78
|
+
* @returns The handle of the created vertex buffer
|
|
79
|
+
* @throws Error if no WebGL context is available
|
|
80
|
+
*/
|
|
81
|
+
createVertexBufferFromTypedArray(typedArray: TypedArray): number;
|
|
82
|
+
/**
|
|
83
|
+
* Creates an index buffer directly from a typed array.
|
|
84
|
+
*
|
|
85
|
+
* @param typedArray - The typed array containing index data
|
|
86
|
+
* @returns The handle of the created index buffer
|
|
87
|
+
*/
|
|
88
|
+
createIndexBufferFromTypedArray(typedArray: TypedArray): number;
|
|
89
|
+
/**
|
|
90
|
+
* Updates an existing vertex buffer with new data from the accessor.
|
|
91
|
+
*
|
|
92
|
+
* @param accessor - The accessor containing new vertex data
|
|
93
|
+
* @param resourceHandle - The handle of the vertex buffer to update
|
|
94
|
+
* @throws Error if no WebGL context is available or VBO not found
|
|
95
|
+
*/
|
|
96
|
+
updateVertexBuffer(accessor: Accessor, resourceHandle: number): void;
|
|
97
|
+
/**
|
|
98
|
+
* Overwrites the beginning of an existing vertex buffer with the given typed array.
|
|
99
|
+
*
|
|
100
|
+
* The vertex array binding is left untouched: the ARRAY_BUFFER binding is not part of the VAO state,
|
|
101
|
+
* so this can be called between draw calls without disturbing the bound VAO.
|
|
102
|
+
*
|
|
103
|
+
* @param resourceHandle - The handle of the vertex buffer to update
|
|
104
|
+
* @param typedArray - The data written from the beginning of the buffer
|
|
105
|
+
* @throws Error if no WebGL context is available or VBO not found
|
|
106
|
+
*/
|
|
107
|
+
updateVertexBufferWithTypedArray(resourceHandle: WebGLResourceHandle, typedArray: TypedArray): void;
|
|
108
|
+
/**
|
|
109
|
+
* Creates a new vertex array object (VAO).
|
|
110
|
+
*
|
|
111
|
+
* @returns The handle of the created VAO or undefined if creation failed
|
|
112
|
+
* @throws Error if no WebGL context is available
|
|
113
|
+
*/
|
|
114
|
+
createVertexArray(): number | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Creates vertex buffers and index buffers for a primitive and returns handles for them.
|
|
117
|
+
* This method processes all vertex attributes of the primitive and creates corresponding VBOs.
|
|
118
|
+
*
|
|
119
|
+
* @param primitive - The primitive object containing vertex and index data
|
|
120
|
+
* @returns VertexHandles object containing all created buffer handles and metadata
|
|
121
|
+
*/
|
|
122
|
+
createVertexBufferAndIndexBuffer(primitive: Primitive): VertexHandles;
|
|
123
|
+
/**
|
|
124
|
+
* Updates existing vertex buffers and index buffers with new data from a primitive.
|
|
125
|
+
*
|
|
126
|
+
* @param primitive - The primitive object containing updated vertex and index data
|
|
127
|
+
* @param vertexHandles - The handles of the buffers to update
|
|
128
|
+
*/
|
|
129
|
+
updateVertexBufferAndIndexBuffer(primitive: Primitive, vertexHandles: VertexHandles): void;
|
|
130
|
+
/**
|
|
131
|
+
* Configures vertex data for rendering by setting up VAO with VBOs and IBO.
|
|
132
|
+
* This method binds vertex arrays, index buffers, and configures vertex attribute pointers.
|
|
133
|
+
*
|
|
134
|
+
* @param handles - Object containing VAO, IBO, and VBO handles
|
|
135
|
+
* @param handles.vaoHandle - Handle to the vertex array object
|
|
136
|
+
* @param handles.iboHandle - Handle to the index buffer object (optional)
|
|
137
|
+
* @param handles.vboHandles - Array of vertex buffer object handles
|
|
138
|
+
* @param primitive - The primitive object containing vertex attribute information
|
|
139
|
+
* @param instanceIDBufferUid - Handle to instance ID buffer for instanced rendering (optional)
|
|
140
|
+
* @throws Error if required buffers are not found
|
|
141
|
+
*/
|
|
142
|
+
setVertexDataToPipeline({ vaoHandle, iboHandle, vboHandles, }: {
|
|
143
|
+
vaoHandle: WebGLResourceHandle;
|
|
144
|
+
iboHandle?: WebGLResourceHandle;
|
|
145
|
+
vboHandles: Array<WebGLResourceHandle>;
|
|
146
|
+
}, primitive: Primitive, instanceIDBufferUid?: WebGLResourceHandle): void;
|
|
147
|
+
/**
|
|
148
|
+
* Configures a multi-draw group's VAO with the merged vertex buffers, the merged
|
|
149
|
+
* uint32 index buffer, and the per-vertex instanceBase attribute (divisor 0).
|
|
150
|
+
*
|
|
151
|
+
* @param group - The multi-draw group whose vertexHandles/vertices are already created
|
|
152
|
+
*/
|
|
153
|
+
setMultiDrawVertexDataToPipeline(group: MultiDrawGroup, vaoHandle?: WebGLResourceHandle, useMaterialSidAttribute?: boolean): void;
|
|
154
|
+
/**
|
|
155
|
+
* Deletes the index buffer, the vertex buffers and the vertex array object of a primitive.
|
|
156
|
+
*
|
|
157
|
+
* @param vertexHandles - The handles created by createVertexBufferAndIndexBuffer and createVertexArray
|
|
158
|
+
*/
|
|
159
|
+
deleteVertexDataResources(vertexHandles: VertexHandles): void;
|
|
160
|
+
/**
|
|
161
|
+
* Deletes a vertex array object and forgets its handle.
|
|
162
|
+
*
|
|
163
|
+
* @param vaoHandle - The handle of the vertex array object
|
|
164
|
+
*/
|
|
165
|
+
deleteVertexArray(vaoHandle: WebGLResourceHandle): void;
|
|
166
|
+
/**
|
|
167
|
+
* Deletes a vertex buffer object and forgets its handle.
|
|
168
|
+
*
|
|
169
|
+
* @param vboUid - The handle of the vertex buffer object
|
|
170
|
+
*/
|
|
171
|
+
deleteVertexBuffer(vboUid: WebGLResourceHandle): void;
|
|
172
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ComponentType as y}from"../foundation/definitions/ComponentType.js";import{CompositionType as G}from"../foundation/definitions/CompositionType.js";import{VertexAttribute as b}from"../foundation/definitions/VertexAttribute.js";import{CGAPIResourceRepository as A}from"../foundation/renderer/CGAPIResourceRepository.js";var p=u=>({slot:u,componentCount:1,componentType:y.UnsignedInt.index,normalized:!1,byteStride:4,isInteger:!0});function m(u){return u!=null&&u>=0}function R(u,e){u.enableVertexAttribArray(e.slot),e.isInteger?u.vertexAttribIPointer(e.slot,e.componentCount,e.componentType,e.byteStride,0):u.vertexAttribPointer(e.slot,e.componentCount,e.componentType,e.normalized,e.byteStride,0)}function x(u,e,t){for(let s of b.integerTypeAttributes){let n=s.getAttributeSlot();if(t&&(s===b.Instance||s===b.MaterialSid))continue;e.some(i=>b.toAttributeSlotFromJoinedString(i)===n)||(u.disableVertexAttribArray(n),u.vertexAttribI4ui(n,0,0,0,0))}}var L=class{constructor(e){this.x_=e}get u_(){let e=this.x_.getContextWrapper();if(e==null)throw new Error("No WebGLRenderingContext set as Default.");return e}T_(e){return this.x_.registerResource(e)}getWebGLResource(e){return this.x_.getWebGLResource(e)}Ef(e,t){let s=this.u_,n=s.getRawContext();s.bindVertexArray(null);let a=n.createBuffer(),i=this.T_(a);return n.bindBuffer(e,a),n.bufferData(e,t,n.STATIC_DRAW),n.bindBuffer(e,null),i}LA(e,t,s,n,a){let i=this.u_,o=i.getRawContext(),r=this.getWebGLResource(t);if(r==null)throw new Error(`Not found ${a}.`);n&&i.bindVertexArray(null),o.bindBuffer(e,r),o.bufferSubData(e,0,s),o.bindBuffer(e,null)}GA(e){let t=this.getWebGLResource(e);this.u_.getRawContext().deleteBuffer(t),this.x_.deleteWebGLResource(e)}createIndexBuffer(e){let t=this.u_.getRawContext();return this.Ef(t.ELEMENT_ARRAY_BUFFER,e.getTypedArray())}updateIndexBuffer(e,t){let s=this.u_.getRawContext();this.LA(s.ELEMENT_ARRAY_BUFFER,t,e.getTypedArray(),!0,"IBO")}createVertexBuffer(e){let t=this.u_.getRawContext();return this.Ef(t.ARRAY_BUFFER,e.getUint8Array())}createVertexBufferFromTypedArray(e){let t=this.u_.getRawContext();return this.Ef(t.ARRAY_BUFFER,e)}createIndexBufferFromTypedArray(e){let t=this.u_.getRawContext();return this.Ef(t.ELEMENT_ARRAY_BUFFER,e)}updateVertexBuffer(e,t){let s=this.u_.getRawContext();this.LA(s.ARRAY_BUFFER,t,e.getUint8Array(),!0,"VBO")}updateVertexBufferWithTypedArray(e,t){let s=this.u_.getRawContext();this.LA(s.ARRAY_BUFFER,e,t,!1,"VBO")}createVertexArray(){let e=this.u_.createVertexArray();if(e!=null)return this.T_(e)}createVertexBufferAndIndexBuffer(e){let t=e.hasIndices()?this.createIndexBuffer(e.indicesAccessor):void 0,s=new Array(b.AttributeTypeNumber).fill(!1),n=[];return e.attributeAccessors.forEach((a,i)=>{let o=this.createVertexBuffer(a),r=b.toAttributeSlotFromJoinedString(e.attributeSemantics[i]);s[r]=!0,n.push(o)}),{vaoHandle:-1,iboHandle:t,vboHandles:n,attributesFlags:s,setComplete:!1}}updateVertexBufferAndIndexBuffer(e,t){m(t.iboHandle)&&this.updateIndexBuffer(e.indicesAccessor,t.iboHandle);let s=e.attributeAccessors;for(let n=0;n<s.length;n++)this.updateVertexBuffer(s[n],t.vboHandles[n])}setVertexDataToPipeline({vaoHandle:e,iboHandle:t,vboHandles:s},n,a=A.InvalidCGAPIResourceUid){let i=this.u_,o=i.getRawContextAsWebGL2();if(i.bindVertexArray(this.getWebGLResource(e)),t!=null){let r=this.getWebGLResource(t);if(r==null)throw new Error("Nothing Element Array Buffer!");o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,r)}if(s.forEach((r,l)=>{let f=this.getWebGLResource(r);if(f==null)throw new Error(`Nothing Element Array Buffer at index ${l}`);o.bindBuffer(o.ARRAY_BUFFER,f);let c=n.attributeSemantics[l],d=n.attributeAccessors[l];R(o,{slot:b.toAttributeSlotFromJoinedString(c),componentCount:n.attributeCompositionTypes[l].getNumberOfComponents(),componentType:n.attributeComponentTypes[l].index,normalized:d.normalized,byteStride:d.byteStride,isInteger:b.fromString(c.split(".")[0]).isIntegerType})}),x(o,n.attributeSemantics,!1),a!==A.InvalidCGAPIResourceUid){let r=this.getWebGLResource(a);if(r==null)throw new Error("Nothing Element Array Buffer at index");o.bindBuffer(o.ARRAY_BUFFER,r);let l=b.Instance.getAttributeSlot();R(o,{slot:l,componentCount:G.Vec4.getNumberOfComponents(),componentType:y.UnsignedInt.index,normalized:!1,byteStride:0,isInteger:!0}),i.vertexAttribDivisor(l,1)}o.bindBuffer(o.ARRAY_BUFFER,null),i.bindVertexArray(null),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,null)}setMultiDrawVertexDataToPipeline(e,t=(a=>(a=(n=>(n=e.vertexHandles)==null?void 0:n.vaoHandle)())!=null?a:A.InvalidCGAPIResourceUid)(),s=!0){let i=e.vertexHandles;if(i==null)return;let o=this.u_,r=o.getRawContextAsWebGL2();o.bindVertexArray(this.getWebGLResource(t)),i.iboHandle!=null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,this.getWebGLResource(i.iboHandle));for(let c=0;c<e.attributes.length;c++){let d=e.attributes[c];r.bindBuffer(r.ARRAY_BUFFER,this.getWebGLResource(i.vboHandles[c])),R(r,{slot:b.toAttributeSlotFromJoinedString(d.semantic),componentCount:d.compositionType.getNumberOfComponents(),componentType:d.componentType.index,normalized:d.normalized,byteStride:d.byteStride,isInteger:d.isIntegerType})}x(r,e.attributes.map(c=>c.semantic),!0),r.bindBuffer(r.ARRAY_BUFFER,this.getWebGLResource(e.instanceBaseVboHandle));let l=b.Instance.getAttributeSlot();R(r,p(l)),o.vertexAttribDivisor(l,0);let f=b.MaterialSid.getAttributeSlot();s?(r.bindBuffer(r.ARRAY_BUFFER,this.getWebGLResource(e.materialSidVboHandle)),R(r,p(f)),o.vertexAttribDivisor(f,0)):(r.disableVertexAttribArray(f),r.vertexAttribI4ui(f,0,0,0,0)),r.bindBuffer(r.ARRAY_BUFFER,null),o.bindVertexArray(null),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,null)}deleteVertexDataResources(e){m(e.iboHandle)&&this.GA(e.iboHandle);for(let t of e.vboHandles)this.GA(t);this.deleteVertexArray(e.vaoHandle)}deleteVertexArray(e){let t=this.getWebGLResource(e);this.u_.deleteVertexArray(t),this.x_.deleteWebGLResource(e)}deleteVertexBuffer(e){this.GA(e)}};export{L as WebGLVertexBuffers};
|
|
@@ -18,13 +18,13 @@ type FetchPlan = {
|
|
|
18
18
|
warning?: string;
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Returns how the shaders fetch a material or global property of the given composition type
|
|
22
|
+
* (see {@link getShaderPropertyFetch}).
|
|
22
23
|
*/
|
|
23
24
|
export declare function getFetchPlan(compositionType: CompositionTypeEnum): FetchPlan;
|
|
24
25
|
/**
|
|
25
|
-
* Decodes the location(s) of a material semantic for a given material SID
|
|
26
|
-
*
|
|
27
|
-
* Mirrors `WebGLStrategyWebGL2.__getShaderPropertyOfMaterial`:
|
|
26
|
+
* Decodes the location(s) of a material semantic for a given material SID, with the layout
|
|
27
|
+
* that the generated material accessors read (see {@link computeShaderPropertyIndices}):
|
|
28
28
|
* - `bufferViewIndex = floor(materialSID / materialCountPerBufferView)`
|
|
29
29
|
* - `indexInBufferView = materialSID % materialCountPerBufferView`
|
|
30
30
|
* - non-array: `vec4Index = offsets[bv] + vec4Size * indexInBufferView`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CompositionType as
|
|
1
|
+
import{CompositionType as l}from"../../foundation/definitions/CompositionType.js";import{computeShaderPropertyIndices as V,getShaderPropertyFetch as P,getShaderPropertyStrides as F}from"../../foundation/renderer/ShaderPropertyLayout.js";var T={fetchElement:1,fetchScalarNo16BytesAligned:1,fetchVec2No16BytesAligned:2,fetchVec3No16BytesAligned:3,fetchMat2:1,fetchMat2No16BytesAligned:1,fetchMat3:3,fetchMat3No16BytesAligned:9,fetchMat4:4,fetchMat4x3:3};function L(e){var a;let t=P(e);if(t==null)return{fetchFunction:"unknown",unit:"vec4",count:1,warning:`Unsupported composition type "${e.str}".`};let r={fetchFunction:t.functionName,unit:t.index==="scalar_idx"?"scalar":"vec4",count:(a=T[t.functionName])!=null?a:1};return e===l.Mat2?r.warning="MAT2 declares vec4SizeOfProperty=2 but fetchMat2 reads one texel.":e===l.Mat2Array&&(r.unit="scalar-weird",r.warning="fetchMat2No16BytesAligned computes vec4_idx from scalar_idx * 4; the decoder mirrors the shader."),r}function O(e){switch(e){case l.Mat4:case l.Mat4Array:return{fetchFunction:"fetchMat4",unit:"vec4",count:4};case l.Mat3:return{fetchFunction:"fetchMat3No16BytesAligned",unit:"scalar",count:9};case l.Vec4:case l.Vec4Array:return{fetchFunction:"fetchVec4",unit:"vec4",count:1};case l.Vec3:return{fetchFunction:"fetchVec3No16BytesAligned",unit:"scalar",count:3};case l.Scalar:return{fetchFunction:"fetchScalarNo16BytesAligned",unit:"scalar",count:1};case l.Mat4x3Array:return{fetchFunction:"fetchMat4x3",unit:"vec4",count:3};default:return L(e)}}function B(e,t,r,a,u,s){let m=[];e.warning!=null&&m.push(e.warning);let i=r,h=e.count;if(e.unit==="scalar"&&a!=null){i=Math.floor(a/4);let f=a%4;h=Math.ceil((f+e.count)/4)}else e.unit==="scalar-weird"&&a!=null&&(i=a*4,h=1);let p=s.width>0?Math.floor(i/s.width):-1,n=s.width>0?i%s.width:-1,o=[];for(let f=0;f<h;f++){let d=s.readVec4(i+f);if(d==null){m.push(`vec4 ${i+f} is outside the GPUInstanceData buffers.`);break}o.push(d)}return{bufferViewIndex:t,vec4Index:i,byteOffset:i*16,row:p,col:n,fetchFunction:e.fetchFunction,vec4s:o,scalarIndex:e.unit==="scalar"?a:void 0,arrayElement:u,warnings:m}}function E(e){var t;return(t=e.arrayLength)!=null?t:1}function k(e){var x,w,I;let{info:t,offsets:r,materialSID:a,materialCountPerBufferView:u,layout:s}=e,m=(x=e.maxArrayElements)!=null?x:4,i=L(t.compositionType),h=E(t),p=F(t),n=u>0?Math.floor(a/u):0,o=u>0?a%u:0;t.soloDatum&&(n=0);let f=[];t.soloDatum&&u>0&&Math.floor(a/u)!==0&&f.push("soloDatum is stored once per material type, but the shader still applies indexInBufferView to the offset."),r.length===0&&f.push("No material buffer view offsets were found."),r[n]==null&&f.push(`No offset for buffer view ${n}; falling back to offsets[0].`);let d=(I=(w=r[n])!=null?w:r[0])!=null?I:0,b=[];if(l.isArray(t.compositionType)){t.arrayLength==null&&f.push("Array semantic has no arrayLength; the shader uses 1 while allocation may use 100.");let y=Math.min(h,m);for(let c=0;c<y;c++){let{vec4Index:g,scalarIndex:M}=V(p,d,o,c);b.push(B(i,n,g,M,c,s))}h>y&&f.push(`Only the first ${y} of ${h} array elements are decoded.`)}else{let{vec4Index:y,scalarIndex:c}=V(p,d,o,0);b.push(B(i,n,y,c,void 0,s))}return f.length>0&&b.length>0&&b[0].warnings.push(...f),{bufferViewOffsets:r,bufferViewIndex:n,indexInBufferView:o,arrayLengthForShader:h,locations:b}}function $(e){var p;let{info:t,offset:r,layout:a}=e,u=(p=e.maxArrayElements)!=null?p:4,s=L(t.compositionType),m=E(t),i=F(t),h=[];if(l.isArray(t.compositionType)){let n=Math.min(m,u);for(let o=0;o<n;o++){let{vec4Index:f,scalarIndex:d}=V(i,r,0,o);h.push(B(s,0,f,d,o,a))}}else{let{vec4Index:n,scalarIndex:o}=V(i,r,0,0);h.push(B(s,0,n,o,void 0,a))}return{bufferViewOffsets:[r],bufferViewIndex:0,indexInBufferView:0,arrayLengthForShader:m,locations:h}}function R(e){var b,x,w,I;let{memberInfo:t,offsets:r,componentSID:a,componentCountPerBufferView:u,layout:s}=e,m=(b=e.maxArrayElements)!=null?b:4,i=O(t.compositionType),h=t.compositionType.getVec4SizeOfProperty(),p=u>0?Math.floor(a/u):0,n=u>0?a%u:0,o=(w=(x=r[p])!=null?x:r[0])!=null?w:0,f=[],d=(I=t.arrayLength)!=null?I:0;if(l.isArray(t.compositionType)){let y=Math.min(d,m);for(let c=0;c<y;c++){let g=o+n*h*d+h*c;f.push(B(i,p,g,g*4,c,s))}}else{let y=o,c=o*4;switch(t.compositionType){case l.Mat4:y=o+4*n,c=y*4;break;case l.Mat3:c=o*4+9*n;break;case l.Vec4:y=o+n,c=y*4;break;case l.Vec3:c=o*4+3*n;break;case l.Scalar:c=o*4+n;break;default:break}f.push(B(i,p,y,c,void 0,s))}return{bufferViewOffsets:r,bufferViewIndex:p,indexInBufferView:n,arrayLengthForShader:d,locations:f}}function z(e){var g,M,A,v;let{memberInfo:t,offsets:r,locationMemberOffsets:a,componentSID:u,componentCountPerBufferView:s,layout:m}=e,i=(g=e.maxArrayElements)!=null?g:4,h=(M=e.radix)!=null?M:65536,p=t.compositionType.getVec4SizeOfProperty(),n=s>0?Math.floor(u/s):0,o=s>0?u%s:0,d=((v=(A=a[n])!=null?A:a[0])!=null?v:0)+o,b=m.readVec4(d),x=[];if(b==null)return x.push({bufferViewIndex:n,vec4Index:d,byteOffset:d*16,row:m.width>0?Math.floor(d/m.width):-1,col:m.width>0?d%m.width:-1,fetchFunction:"fetchElement",vec4s:[],warnings:["The variable-length location member could not be read."]}),{bufferViewOffsets:r,bufferViewIndex:n,indexInBufferView:o,arrayLengthForShader:0,locations:x};let w=Math.trunc(b[0])*h+Math.trunc(b[1]),I=Math.max(0,Math.trunc(b[2])),y=O(t.compositionType),c=Math.min(I,i);for(let S=0;S<c;S++){let C=w+p*S;x.push(B(y,n,C,C*4,S,m))}return I>c&&x.length>0&&x[0].warnings.push(`Only the first ${c} of ${I} elements are decoded.`),{bufferViewOffsets:r,bufferViewIndex:n,indexInBufferView:o,arrayLengthForShader:I,locations:x}}export{R as decodeComponentMember,$ as decodeGlobalProperty,k as decodeMaterialProperty,z as decodeVariableLengthComponentMember,L as getFetchPlan};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Component as M}from"../../foundation/core/Component.js";import{BufferUse as C}from"../../foundation/definitions/BufferUse.js";import{CompositionType as B}from"../../foundation/definitions/CompositionType.js";import{ProcessApproach as U}from"../../foundation/definitions/ProcessApproach.js";import{decodeComponentMember as W,decodeGlobalProperty as k,decodeMaterialProperty as N,decodeVariableLengthComponentMember as V}from"./BufferLayoutDecoder.js";var T=4,R=16;function S(o){return U.isWebGL2Approach(o.processApproach)?"WebGL2":U.isWebGpuApproach(o.processApproach)?"WebGPU":"None"}function v(o,r){var e,t;if(r!=="WebGL2")return 0;try{return(t=(e=o.getCurrentWebGLContextWrapper())==null?void 0:e.getMaxTextureSize())!=null?t:0}catch{return 0}}function E(o,r){let e=(t,n)=>o.memoryManager.readFloat32Array(C.GPUInstanceData,t,n);return{width:r,readVec4:t=>{let n=e(t*16,4);return n==null?null:[n[0],n[1],n[2],n[3]]},readScalar:t=>{let n=e(t*4,1);return n==null?null:n[0]}}}function w(o){let r=Math.min(o.length,R),e=[];for(let t=0;t<r;t++)e.push(o[t]);return o.length>R?{values:e,length:o.length,truncated:!0}:e}function D(o){let r=Math.min(o.length,R),e=[];for(let t=0;t<r;t++)e.push(A(o[t]));return o.length>R?{values:e,length:o.length,truncated:!0}:e}function A(o){if(o==null)return null;if(typeof o=="number"||typeof o=="string"||typeof o=="boolean")return o;if(ArrayBuffer.isView(o))return w(o);if(Array.isArray(o))return D(o);if(typeof o=="object"){let r=o;if(ArrayBuffer.isView(r._v))return w(r._v);if(Array.isArray(r._v))return D(r._v);if(ArrayBuffer.isView(r.elements))return w(r.elements);if(Array.isArray(r.elements))return D(r.elements);let e={};for(let t of["x","y","z","w","r","g","b","a"])typeof r[t]=="number"&&(e[t]=r[t]);if(Object.keys(e).length>0)return e;try{let t=JSON.stringify(o);if(t!=null&&t.length<=2e3)return JSON.parse(t)}catch{}return String(o)}return String(o)}function O(o,r){var i,s,a,l;if(!Array.isArray(o))return;let e=typeof o[0]=="number"?o[0]:null,t=o[1],n=o[2];return{unit:r==="WebGL2"?e:null,binding:e,textureUid:(s=(i=t==null?void 0:t.objectUID)!=null?i:t==null?void 0:t.uid)!=null?s:null,samplerUid:(l=(a=n==null?void 0:n.objectUID)!=null?a:n==null?void 0:n.uid)!=null?l:null}}function F(o){var t;if(o==null||o.vec4s.length===0)return null;let r=o.vec4s.flat(),e=o.scalarIndex!=null?o.scalarIndex%4:0;switch(o.fetchFunction){case"fetchElement":case"fetchVec4":return o.vec4s[0];case"fetchScalarNo16BytesAligned":return(t=r[e])!=null?t:null;case"fetchVec2No16BytesAligned":return r.slice(e,e+2);case"fetchVec3No16BytesAligned":return r.slice(e,e+3);case"fetchMat3No16BytesAligned":return r.slice(e,e+9);case"fetchMat4No16BytesAligned":return r.slice(e,e+16);case"fetchMat4":return o.vec4s;case"fetchMat3":return o.vec4s.map(n=>[n[0],n[1],n[2]]);case"fetchMat2":case"fetchMat2No16BytesAligned":return o.vec4s[0];case"fetchMat4x3":return o.vec4s;default:return o.vec4s}}var L=class o{static reportMaterial(r,e,t){var b,m;let n=S(r),i=r.processApproach.str;if(!(n!=="None"))return{available:!1,reason:`Shader parameter inspection is available in WebGL2 and WebGPU (current: ${i}).`,backend:n,processApproach:i,materialTypeName:e.materialTypeName,materialUID:e.materialUID,materialSID:e.materialSID,materialCountPerBufferView:0,bufferViewIndex:0,shaderProgramUid:-1,bufferWidth:0,sharedProgramMaterialMismatch:!1,entries:[]};let a=v(r,n),l=E(r,a),f=n==="WebGPU",p=(b=r.materialRepository.getMaterialCountPerBufferView(e.materialTypeName))!=null?b:1,y=Math.floor(e.materialSID/p),c=o.tP(e,t),h=!f&&c>=0?o.readRealUniforms(r,c):null,d=[];for(let u of e.fieldsInfoArray){let g=B.isTexture(u.compositionType),P=g?"texture":f?u.soloDatum?"soloDatum":"storageBuffer":u.needUniformInDataTextureMode?"uniform":u.soloDatum?"soloDatum":"dataTexture",I={semantic:u.semantic,stage:u.stage.str,compositionType:u.compositionType.str,componentType:u.componentType.str,arrayLength:u.arrayLength,isTexture:g,isInternalSetting:u.isInternalSetting===!0,needUniformInDataTextureMode:u.needUniformInDataTextureMode===!0,soloDatum:u.soloDatum===!0,source:P,valuePreview:g?null:A(e.getParameter(u.semantic))};if(g)I.texture=O(e.getTextureParameter(u.semantic),n);else{let G=r.materialRepository.getLocationOffsetOfMemberOfMaterial(r,e.materialTypeName,u.semantic);if(I.buffer=N({info:u,offsets:G,materialSID:e.materialSID,materialCountPerBufferView:p,layout:l,maxArrayElements:T}),P==="uniform")for(let x of I.buffer.locations)x.warnings.push("The shader reads this value from a real uniform, not from the data texture.")}h!=null&&(I.realUniform=(m=h.get(u.semantic))!=null?m:{locationFound:!1,value:null}),d.push(I)}return{available:!0,backend:n,processApproach:i,materialTypeName:e.materialTypeName,materialUID:e.materialUID,materialSID:e.materialSID,materialCountPerBufferView:p,bufferViewIndex:y,shaderProgramUid:c,bufferWidth:a,sharedProgramMaterialMismatch:!f&&c>=0?o.oP(r,c,e):!1,entries:d}}static reportGlobals(r,e){let t=S(r),n=r.processApproach.str;if(!(t!=="None"))return{available:!1,reason:`Shader parameter inspection is available in WebGL2 and WebGPU (current: ${n}).`,backend:t,processApproach:n,bufferWidth:0,shaderProgramUid:-1,entries:[]};let s=v(r,t),a=E(r,s),l=t==="WebGPU",f=!l&&e!=null&&e>=0?o.readRealUniforms(r,e):null,p=r.globalDataRepository.getPropertyTable().map(y=>{var b;let c=y.info,h=l?"storageBuffer":c.needUniformInDataTextureMode?"uniform":"dataTexture",d={semantic:c.semantic,stage:c.stage.str,compositionType:c.compositionType.str,componentType:c.componentType.str,arrayLength:c.arrayLength,isTexture:!1,isInternalSetting:c.isInternalSetting===!0,needUniformInDataTextureMode:c.needUniformInDataTextureMode===!0,soloDatum:!1,source:h,valuePreview:A(y.value)};if(d.buffer=k({info:c,offset:y.vec4Index,layout:a,maxArrayElements:T}),h==="uniform")for(let m of d.buffer.locations)m.warnings.push("The shader reads this value from a real uniform, not from the data texture.");return f!=null&&(d.realUniform=(b=f.get(c.semantic))!=null?b:{locationFound:!1,value:null}),d});return{available:!0,backend:t,processApproach:n,bufferWidth:s,shaderProgramUid:e!=null?e:-1,entries:p}}static reportComponent(r,e){var d;let t=e.constructor,n=t.name,i=S(r);if(!(i!=="None"))return{available:!1,reason:`Shader parameter inspection is available in WebGL2 and WebGPU (current: ${r.processApproach.str}).`,backend:i,componentClassName:n,componentSID:e.componentSID,componentCountPerBufferView:0,entries:[]};let a=M.getMemberInfo(r).get(t);if(a==null)return{available:!1,reason:`No member information is registered for ${n}.`,backend:i,componentClassName:n,componentSID:e.componentSID,componentCountPerBufferView:0,entries:[]};let l=i==="WebGPU",f=(d=M.getComponentCountPerBufferView(r).get(t))!=null?d:1,p=M.getArrayLengthOfMember(r).get(t),y=v(r,i),c=E(r,y),h=[];for(let[b,m]of a){if(m.bufferUse!==C.GPUInstanceData)continue;let u=M.getLocationOffsetOfMemberOfComponent(r,t,b),g=p==null?void 0:p.get(b),P;if(m.isVariableLength===!0){let I=M._getVariableLengthLocationMemberName(b),G=M.getLocationOffsetOfMemberOfComponent(r,t,I);P=V({memberInfo:{compositionType:m.compositionType,arrayLength:g,isVariableLength:!0},offsets:u,locationMemberOffsets:G,componentSID:e.componentSID,componentCountPerBufferView:f,layout:c,maxArrayElements:T})}else P=W({memberInfo:{compositionType:m.compositionType,arrayLength:g},offsets:u,componentSID:e.componentSID,componentCountPerBufferView:f,layout:c,maxArrayElements:T});h.push({semantic:b,stage:m.shaderType.str,compositionType:m.compositionType.str,componentType:m.componentType.str,arrayLength:g,isTexture:!1,isInternalSetting:!1,needUniformInDataTextureMode:!1,soloDatum:!1,source:l?"storageBuffer":"dataTexture",valuePreview:F(P.locations[0]),buffer:P})}return{available:!0,backend:i,componentClassName:n,componentSID:e.componentSID,componentCountPerBufferView:f,entries:h}}static reportEntity(r,e){var a,l,f,p,y,c,h,d,b;let t=[],n=(a=e.tryToGetMesh())==null?void 0:a.mesh;if(n!=null)for(let m of n.primitives)t.push(o.reportMaterial(r,m.material,m));let i=[],s=[(l=e.tryToGetSceneGraph)==null?void 0:l.call(e),(f=e.tryToGetTransform)==null?void 0:f.call(e),(p=e.tryToGetCamera)==null?void 0:p.call(e),(y=e.tryToGetLight)==null?void 0:y.call(e),(c=e.tryToGetSkeletal)==null?void 0:c.call(e),(h=e.tryToGetBlendShape)==null?void 0:h.call(e),(d=e.tryToGetMeshRenderer)==null?void 0:d.call(e),(b=e.tryToGetPhysics)==null?void 0:b.call(e)];for(let m of s)m!=null&&i.push(o.reportComponent(r,m));return{entityUID:e.entityUID,materials:t,components:i}}static reportAll(r){var s;let t=r.materialRepository.getAllMaterials().map(a=>a.deref()).filter(a=>a!=null).map(a=>o.reportMaterial(r,a)),n=(s=t.find(a=>a.shaderProgramUid>=0))==null?void 0:s.shaderProgramUid;return{globals:o.reportGlobals(r,n),materials:t}}static readRealUniforms(r,e){if(S(r)!=="WebGL2")return null;let t=r.webglResourceRepository.getWebGLResource(e);if(t==null)return null;let n=r.getCurrentWebGLContextWrapper();if(n==null)return null;let i=n.getRawContext(),s=new Map,a=t._shaderSemanticsInfoMap;if(a!=null)for(let l of a.keys()){let f=t[l];if(f==null){s.set(l,{locationFound:!1,value:null});continue}try{s.set(l,{locationFound:!0,value:A(i.getUniform(t,f))})}catch{s.set(l,{locationFound:!1,value:null})}}for(let l of["dataTexture","currentComponentSIDs"]){let f=t[l];if(f!=null)try{s.set(l,{locationFound:!0,value:A(i.getUniform(t,f))})}catch{s.set(l,{locationFound:!1,value:null})}}return s}static decode(r,e){let t=S(r);if(t==="None")return null;let n=v(r,t),i=E(r,n);return{vec4Index:e,byteOffset:e*16,row:n>0?Math.floor(e/n):-1,col:n>0?e%n:-1,vec4:i.readVec4(e)}}static formatEntries(r){var t,n,i;let e=[];for(let s of r){if(s.buffer==null||s.buffer.locations.length===0){e.push({semantic:s.semantic,arrayElement:"",source:s.source,value:s.valuePreview,fetch:"",vec4:"",byteOffset:"",row:"",col:"",vec4s:"",uniform:(t=s.realUniform)!=null&&t.locationFound?s.realUniform.value:"",warnings:""});continue}for(let a of s.buffer.locations)e.push({semantic:s.semantic,arrayElement:(n=a.arrayElement)!=null?n:"",source:s.source,value:s.valuePreview,fetch:a.fetchFunction,vec4:a.vec4Index,byteOffset:a.byteOffset,row:a.row>=0?a.row:"",col:a.col>=0?a.col:"",vec4s:a.vec4s.map(l=>l.join(",")).join(" | "),uniform:(i=s.realUniform)!=null&&i.locationFound?s.realUniform.value:"",warnings:a.warnings.join("; ")})}return e}static format(r){return{...r,entries:o.formatEntries(r.entries)}}static dumpMaterial(r,e,t){let n=o.reportMaterial(r,e,t);return console.table(o.formatEntries(n.entries)),n}static dumpPrimitive(r,e){return o.dumpMaterial(r,e.material,e)}static dumpGlobals(r,e){let t=o.reportGlobals(r,e);return console.table(o.formatEntries(t.entries)),t}static dumpEntity(r,e){let t=o.reportEntity(r,e);for(let n of t.materials)console.log(`Material: ${n.materialTypeName} (SID ${n.materialSID})`),console.table(o.formatEntries(n.entries));return t}static dumpAll(r){let e=o.reportAll(r);console.log("Globals"),console.table(o.formatEntries(e.globals.entries));for(let t of e.materials)console.log(`Material: ${t.materialTypeName} (SID ${t.materialSID})`),console.table(o.formatEntries(t.entries));return e}static installConsoleHelpers(r,e=typeof window!="undefined"?window:void 0){e!=null&&(e.RnShaderParameters={reportAll:()=>o.reportAll(r),reportMaterial:(t,n)=>o.reportMaterial(r,t,n),reportEntity:t=>o.reportEntity(r,t),globals:t=>o.reportGlobals(r,t),decode:t=>o.decode(r,t),dumpAll:()=>o.dumpAll(r),dumpPrimitive:t=>o.dumpPrimitive(r,t)})}static tP(r,e){if(e!=null)return r.getShaderProgramUid(e);for(let t of r.getBelongPrimitives().values())return r.getShaderProgramUid(t);return-1}static oP(r,e,t){let n=r.webglResourceRepository.getWebGLResource(e);return n==null||n._material==null?!1:n._material.deref()!==t}};export{L as ShaderParameterDebugger,A as serializeValue};
|
|
1
|
+
import{Component as M}from"../../foundation/core/Component.js";import{BufferUse as L}from"../../foundation/definitions/BufferUse.js";import{CompositionType as k}from"../../foundation/definitions/CompositionType.js";import{RenderBackend as U}from"../../foundation/definitions/RenderBackend.js";import{decodeComponentMember as x,decodeGlobalProperty as W,decodeMaterialProperty as N,decodeVariableLengthComponentMember as V}from"./BufferLayoutDecoder.js";var v=4,G=16;function S(n){return U.isWebGL2Backend(n.renderBackend)?"WebGL2":U.isWebGpuBackend(n.renderBackend)?"WebGPU":"None"}function E(n,r){var e,t;if(r!=="WebGL2")return 0;try{return(t=(e=n.getCurrentWebGLContextWrapper())==null?void 0:e.getMaxTextureSize())!=null?t:0}catch{return 0}}function R(n,r){let e=(t,a)=>n.memoryManager.readFloat32Array(L.GPUInstanceData,t,a);return{width:r,readVec4:t=>{let a=e(t*16,4);return a==null?null:[a[0],a[1],a[2],a[3]]},readScalar:t=>{let a=e(t*4,1);return a==null?null:a[0]}}}function w(n){let r=Math.min(n.length,G),e=[];for(let t=0;t<r;t++)e.push(n[t]);return n.length>G?{values:e,length:n.length,truncated:!0}:e}function D(n){let r=Math.min(n.length,G),e=[];for(let t=0;t<r;t++)e.push(T(n[t]));return n.length>G?{values:e,length:n.length,truncated:!0}:e}function T(n){if(n==null)return null;if(typeof n=="number"||typeof n=="string"||typeof n=="boolean")return n;if(ArrayBuffer.isView(n))return w(n);if(Array.isArray(n))return D(n);if(typeof n=="object"){let r=n;if(ArrayBuffer.isView(r._v))return w(r._v);if(Array.isArray(r._v))return D(r._v);if(ArrayBuffer.isView(r.elements))return w(r.elements);if(Array.isArray(r.elements))return D(r.elements);let e={};for(let t of["x","y","z","w","r","g","b","a"])typeof r[t]=="number"&&(e[t]=r[t]);if(Object.keys(e).length>0)return e;try{let t=JSON.stringify(n);if(t!=null&&t.length<=2e3)return JSON.parse(t)}catch{}return String(n)}return String(n)}function O(n,r){var i,s,o,l;if(!Array.isArray(n))return;let e=typeof n[0]=="number"?n[0]:null,t=n[1],a=n[2];return{unit:r==="WebGL2"?e:null,binding:e,textureUid:(s=(i=t==null?void 0:t.objectUID)!=null?i:t==null?void 0:t.uid)!=null?s:null,samplerUid:(l=(o=a==null?void 0:a.objectUID)!=null?o:a==null?void 0:a.uid)!=null?l:null}}function F(n){var t;if(n==null||n.vec4s.length===0)return null;let r=n.vec4s.flat(),e=n.scalarIndex!=null?n.scalarIndex%4:0;switch(n.fetchFunction){case"fetchElement":case"fetchVec4":return n.vec4s[0];case"fetchScalarNo16BytesAligned":return(t=r[e])!=null?t:null;case"fetchVec2No16BytesAligned":return r.slice(e,e+2);case"fetchVec3No16BytesAligned":return r.slice(e,e+3);case"fetchMat3No16BytesAligned":return r.slice(e,e+9);case"fetchMat4No16BytesAligned":return r.slice(e,e+16);case"fetchMat4":return n.vec4s;case"fetchMat3":return n.vec4s.map(a=>[a[0],a[1],a[2]]);case"fetchMat2":case"fetchMat2No16BytesAligned":return n.vec4s[0];case"fetchMat4x3":return n.vec4s;default:return n.vec4s}}var B=class n{static reportMaterial(r,e,t){var b,m;let a=S(r),i=r.renderBackend.str;if(!(a!=="None"))return{available:!1,reason:`Shader parameter inspection is available in WebGL2 and WebGPU (current: ${i}).`,backend:a,renderBackend:i,materialTypeName:e.materialTypeName,materialUID:e.materialUID,materialSID:e.materialSID,materialCountPerBufferView:0,bufferViewIndex:0,shaderProgramUid:-1,bufferWidth:0,sharedProgramMaterialMismatch:!1,entries:[]};let o=E(r,a),l=R(r,o),f=a==="WebGPU",p=(b=r.materialRepository.getMaterialCountPerBufferView(e.materialTypeName))!=null?b:1,h=Math.floor(e.materialSID/p),u=n.oP(e,t),y=!f&&u>=0?n.readRealUniforms(r,u):null,d=[];for(let c of e.fieldsInfoArray){let g=k.isTexture(c.compositionType),P=g?"texture":f?c.soloDatum?"soloDatum":"storageBuffer":c.needUniformInDataTextureMode?"uniform":c.soloDatum?"soloDatum":"dataTexture",I={semantic:c.semantic,stage:c.stage.str,compositionType:c.compositionType.str,componentType:c.componentType.str,arrayLength:c.arrayLength,isTexture:g,isInternalSetting:c.isInternalSetting===!0,needUniformInDataTextureMode:c.needUniformInDataTextureMode===!0,soloDatum:c.soloDatum===!0,source:P,valuePreview:g?null:T(e.getParameter(c.semantic))};if(g)I.texture=O(e.getTextureParameter(c.semantic),a);else{let A=r.materialRepository.getLocationOffsetOfMemberOfMaterial(r,e.materialTypeName,c.semantic);if(I.buffer=N({info:c,offsets:A,materialSID:e.materialSID,materialCountPerBufferView:p,layout:l,maxArrayElements:v}),P==="uniform")for(let C of I.buffer.locations)C.warnings.push("The shader reads this value from a real uniform, not from the data texture.")}y!=null&&(I.realUniform=(m=y.get(c.semantic))!=null?m:{locationFound:!1,value:null}),d.push(I)}return{available:!0,backend:a,renderBackend:i,materialTypeName:e.materialTypeName,materialUID:e.materialUID,materialSID:e.materialSID,materialCountPerBufferView:p,bufferViewIndex:h,shaderProgramUid:u,bufferWidth:o,sharedProgramMaterialMismatch:!f&&u>=0?n.iP(r,u,e):!1,entries:d}}static reportGlobals(r,e){let t=S(r),a=r.renderBackend.str;if(!(t!=="None"))return{available:!1,reason:`Shader parameter inspection is available in WebGL2 and WebGPU (current: ${a}).`,backend:t,renderBackend:a,bufferWidth:0,shaderProgramUid:-1,entries:[]};let s=E(r,t),o=R(r,s),l=t==="WebGPU",f=!l&&e!=null&&e>=0?n.readRealUniforms(r,e):null,p=r.globalDataRepository.getPropertyTable().map(h=>{var b;let u=h.info,y=l?"storageBuffer":u.needUniformInDataTextureMode?"uniform":"dataTexture",d={semantic:u.semantic,stage:u.stage.str,compositionType:u.compositionType.str,componentType:u.componentType.str,arrayLength:u.arrayLength,isTexture:!1,isInternalSetting:u.isInternalSetting===!0,needUniformInDataTextureMode:u.needUniformInDataTextureMode===!0,soloDatum:!1,source:y,valuePreview:T(h.value)};if(d.buffer=W({info:u,offset:h.vec4Index,layout:o,maxArrayElements:v}),y==="uniform")for(let m of d.buffer.locations)m.warnings.push("The shader reads this value from a real uniform, not from the data texture.");return f!=null&&(d.realUniform=(b=f.get(u.semantic))!=null?b:{locationFound:!1,value:null}),d});return{available:!0,backend:t,renderBackend:a,bufferWidth:s,shaderProgramUid:e!=null?e:-1,entries:p}}static reportComponent(r,e){var d;let t=e.constructor,a=t.name,i=S(r);if(!(i!=="None"))return{available:!1,reason:`Shader parameter inspection is available in WebGL2 and WebGPU (current: ${r.renderBackend.str}).`,backend:i,componentClassName:a,componentSID:e.componentSID,componentCountPerBufferView:0,entries:[]};let o=M.getMemberInfo(r).get(t);if(o==null)return{available:!1,reason:`No member information is registered for ${a}.`,backend:i,componentClassName:a,componentSID:e.componentSID,componentCountPerBufferView:0,entries:[]};let l=i==="WebGPU",f=(d=M.getComponentCountPerBufferView(r).get(t))!=null?d:1,p=M.getArrayLengthOfMember(r).get(t),h=E(r,i),u=R(r,h),y=[];for(let[b,m]of o){if(m.bufferUse!==L.GPUInstanceData)continue;let c=M.getLocationOffsetOfMemberOfComponent(r,t,b),g=p==null?void 0:p.get(b),P;if(m.isVariableLength===!0){let I=M._getVariableLengthLocationMemberName(b),A=M.getLocationOffsetOfMemberOfComponent(r,t,I);P=V({memberInfo:{compositionType:m.compositionType,arrayLength:g,isVariableLength:!0},offsets:c,locationMemberOffsets:A,componentSID:e.componentSID,componentCountPerBufferView:f,layout:u,maxArrayElements:v})}else P=x({memberInfo:{compositionType:m.compositionType,arrayLength:g},offsets:c,componentSID:e.componentSID,componentCountPerBufferView:f,layout:u,maxArrayElements:v});y.push({semantic:b,stage:m.shaderType.str,compositionType:m.compositionType.str,componentType:m.componentType.str,arrayLength:g,isTexture:!1,isInternalSetting:!1,needUniformInDataTextureMode:!1,soloDatum:!1,source:l?"storageBuffer":"dataTexture",valuePreview:F(P.locations[0]),buffer:P})}return{available:!0,backend:i,componentClassName:a,componentSID:e.componentSID,componentCountPerBufferView:f,entries:y}}static reportEntity(r,e){var o,l,f,p,h,u,y,d,b;let t=[],a=(o=e.tryToGetMesh())==null?void 0:o.mesh;if(a!=null)for(let m of a.primitives)t.push(n.reportMaterial(r,m.material,m));let i=[],s=[(l=e.tryToGetSceneGraph)==null?void 0:l.call(e),(f=e.tryToGetTransform)==null?void 0:f.call(e),(p=e.tryToGetCamera)==null?void 0:p.call(e),(h=e.tryToGetLight)==null?void 0:h.call(e),(u=e.tryToGetSkeletal)==null?void 0:u.call(e),(y=e.tryToGetBlendShape)==null?void 0:y.call(e),(d=e.tryToGetMeshRenderer)==null?void 0:d.call(e),(b=e.tryToGetPhysics)==null?void 0:b.call(e)];for(let m of s)m!=null&&i.push(n.reportComponent(r,m));return{entityUID:e.entityUID,materials:t,components:i}}static reportAll(r){var s;let t=r.materialRepository.getAllMaterials().map(o=>o.deref()).filter(o=>o!=null).map(o=>n.reportMaterial(r,o)),a=(s=t.find(o=>o.shaderProgramUid>=0))==null?void 0:s.shaderProgramUid;return{globals:n.reportGlobals(r,a),materials:t}}static readRealUniforms(r,e){if(S(r)!=="WebGL2")return null;let t=r.webglResourceRepository.getWebGLResource(e);if(t==null)return null;let a=r.getCurrentWebGLContextWrapper();if(a==null)return null;let i=a.getRawContext(),s=new Map,o=t._shaderSemanticsInfoMap;if(o!=null)for(let l of o.keys()){let f=t[l];if(f==null){s.set(l,{locationFound:!1,value:null});continue}try{s.set(l,{locationFound:!0,value:T(i.getUniform(t,f))})}catch{s.set(l,{locationFound:!1,value:null})}}for(let l of["dataTexture","currentComponentSIDs"]){let f=t[l];if(f!=null)try{s.set(l,{locationFound:!0,value:T(i.getUniform(t,f))})}catch{s.set(l,{locationFound:!1,value:null})}}return s}static decode(r,e){let t=S(r);if(t==="None")return null;let a=E(r,t),i=R(r,a);return{vec4Index:e,byteOffset:e*16,row:a>0?Math.floor(e/a):-1,col:a>0?e%a:-1,vec4:i.readVec4(e)}}static formatEntries(r){var t,a,i;let e=[];for(let s of r){if(s.buffer==null||s.buffer.locations.length===0){e.push({semantic:s.semantic,arrayElement:"",source:s.source,value:s.valuePreview,fetch:"",vec4:"",byteOffset:"",row:"",col:"",vec4s:"",uniform:(t=s.realUniform)!=null&&t.locationFound?s.realUniform.value:"",warnings:""});continue}for(let o of s.buffer.locations)e.push({semantic:s.semantic,arrayElement:(a=o.arrayElement)!=null?a:"",source:s.source,value:s.valuePreview,fetch:o.fetchFunction,vec4:o.vec4Index,byteOffset:o.byteOffset,row:o.row>=0?o.row:"",col:o.col>=0?o.col:"",vec4s:o.vec4s.map(l=>l.join(",")).join(" | "),uniform:(i=s.realUniform)!=null&&i.locationFound?s.realUniform.value:"",warnings:o.warnings.join("; ")})}return e}static format(r){return{...r,entries:n.formatEntries(r.entries)}}static dumpMaterial(r,e,t){let a=n.reportMaterial(r,e,t);return console.table(n.formatEntries(a.entries)),a}static dumpPrimitive(r,e){return n.dumpMaterial(r,e.material,e)}static dumpGlobals(r,e){let t=n.reportGlobals(r,e);return console.table(n.formatEntries(t.entries)),t}static dumpEntity(r,e){let t=n.reportEntity(r,e);for(let a of t.materials)console.log(`Material: ${a.materialTypeName} (SID ${a.materialSID})`),console.table(n.formatEntries(a.entries));return t}static dumpAll(r){let e=n.reportAll(r);console.log("Globals"),console.table(n.formatEntries(e.globals.entries));for(let t of e.materials)console.log(`Material: ${t.materialTypeName} (SID ${t.materialSID})`),console.table(n.formatEntries(t.entries));return e}static installConsoleHelpers(r,e=typeof window!="undefined"?window:void 0){e!=null&&(e.RnShaderParameters={reportAll:()=>n.reportAll(r),reportMaterial:(t,a)=>n.reportMaterial(r,t,a),reportEntity:t=>n.reportEntity(r,t),globals:t=>n.reportGlobals(r,t),decode:t=>n.decode(r,t),dumpAll:()=>n.dumpAll(r),dumpPrimitive:t=>n.dumpPrimitive(r,t)})}static oP(r,e){if(e!=null)return r.getShaderProgramUid(e);for(let t of r.getBelongPrimitives().values())return r.getShaderProgramUid(t);return-1}static iP(r,e,t){let a=r.webglResourceRepository.getWebGLResource(e);return a==null||a._material==null?!1:a._material.deref()!==t}};export{B as ShaderParameterDebugger,T as serializeValue};
|
|
@@ -68,7 +68,7 @@ export type MaterialParameterReport = {
|
|
|
68
68
|
available: boolean;
|
|
69
69
|
reason?: string;
|
|
70
70
|
backend: ShaderParameterBackend;
|
|
71
|
-
|
|
71
|
+
renderBackend: string;
|
|
72
72
|
materialTypeName: string;
|
|
73
73
|
materialUID: number;
|
|
74
74
|
materialSID: number;
|
|
@@ -88,7 +88,7 @@ export type GlobalParameterReport = {
|
|
|
88
88
|
available: boolean;
|
|
89
89
|
reason?: string;
|
|
90
90
|
backend: ShaderParameterBackend;
|
|
91
|
-
|
|
91
|
+
renderBackend: string;
|
|
92
92
|
/** Data-texture width in WebGL2. Zero in WebGPU. */
|
|
93
93
|
bufferWidth: number;
|
|
94
94
|
shaderProgramUid: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type RenderBackendEnum } from '../foundation/definitions/RenderBackend';
|
|
2
2
|
import type { Engine } from '../foundation/system/Engine';
|
|
3
3
|
import type { WebGLStrategy } from './WebGLStrategy';
|
|
4
|
-
declare const getRenderingStrategy: (engine: Engine,
|
|
4
|
+
declare const getRenderingStrategy: (engine: Engine, renderBackend: RenderBackendEnum) => WebGLStrategy;
|
|
5
5
|
export default getRenderingStrategy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{RenderBackend as r}from"../foundation/definitions/RenderBackend.js";import{ModuleManager as o}from"../foundation/system/ModuleManager.js";var a=(t,e)=>{let n=o.getInstance().getModule("webgl");if(r.isWebGL2Backend(e))return n.WebGLStrategyWebGL2.init(t);throw new Error(`No WebGL rendering strategy for render backend "${e.str}".`)},b=a;export{b as default};
|
package/dist/esm/webgl/main.d.ts
CHANGED
|
@@ -1,30 +1,17 @@
|
|
|
1
1
|
import getRenderingStrategy from './getRenderingStrategy';
|
|
2
2
|
import { StandardShaderPart } from './shaders/StandardShaderPart';
|
|
3
3
|
import { WebGLContextWrapper } from './WebGLContextWrapper';
|
|
4
|
+
import { WebGLFrameRenderer } from './WebGLFrameRenderer';
|
|
5
|
+
import { WebGLMeshResources } from './WebGLMeshResources';
|
|
4
6
|
import { type VertexHandles as vertexHandles, WebGLResourceRepository } from './WebGLResourceRepository';
|
|
5
7
|
import type { WebGLStrategy as webGLStrategy } from './WebGLStrategy';
|
|
6
8
|
import { WebGLStrategyWebGL2 } from './WebGLStrategyWebGL2';
|
|
7
9
|
declare const WebGL: Readonly<{
|
|
8
|
-
glslCommonChunks: Readonly<{
|
|
9
|
-
alphaProcess: string;
|
|
10
|
-
enableVertexExtensions: string;
|
|
11
|
-
fullscreen: string;
|
|
12
|
-
glslPrecision: string;
|
|
13
|
-
iblDefinition: string;
|
|
14
|
-
mainPrerequisites: string;
|
|
15
|
-
opticalDefinition: string;
|
|
16
|
-
outputSrgb: string;
|
|
17
|
-
pbrDefinition: string;
|
|
18
|
-
prerequisites: string;
|
|
19
|
-
processGeometry: string;
|
|
20
|
-
shadow: string;
|
|
21
|
-
vertexIn: string;
|
|
22
|
-
vertexInOut: string;
|
|
23
|
-
wireframe: string;
|
|
24
|
-
}>;
|
|
25
10
|
getRenderingStrategy: typeof getRenderingStrategy;
|
|
26
11
|
StandardShaderPart: typeof StandardShaderPart;
|
|
27
12
|
WebGLContextWrapper: typeof WebGLContextWrapper;
|
|
13
|
+
WebGLFrameRenderer: typeof WebGLFrameRenderer;
|
|
14
|
+
WebGLMeshResources: typeof WebGLMeshResources;
|
|
28
15
|
WebGLResourceRepository: typeof WebGLResourceRepository;
|
|
29
16
|
WebGLStrategyWebGL2: typeof WebGLStrategyWebGL2;
|
|
30
17
|
}>;
|
package/dist/esm/webgl/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"./getRenderingStrategy.js";import{
|
|
1
|
+
import t from"./getRenderingStrategy.js";import{StandardShaderPart as r}from"./shaders/StandardShaderPart.js";import{WebGLContextWrapper as o}from"./WebGLContextWrapper.js";import{WebGLFrameRenderer as a}from"./WebGLFrameRenderer.js";import{WebGLMeshResources as n}from"./WebGLMeshResources.js";import{WebGLResourceRepository as p}from"./WebGLResourceRepository.js";import{WebGLStrategyWebGL2 as b}from"./WebGLStrategyWebGL2.js";var e=Object.freeze({getRenderingStrategy:t,StandardShaderPart:r,WebGLContextWrapper:o,WebGLFrameRenderer:a,WebGLMeshResources:n,WebGLResourceRepository:p,WebGLStrategyWebGL2:b}),i=e,m=typeof global!="undefined"?global:typeof window!="undefined"?window:void 0;m.RnWebGL=e;export{i as default};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts floating-point RGBA values to 8-bit unsigned normalized values, as a draw into an rgba8unorm target would:
|
|
3
|
+
* each value is clamped to [0, 1], scaled to [0, 255] and rounded to the nearest integer.
|
|
4
|
+
*
|
|
5
|
+
* @param floats - RGBA values
|
|
6
|
+
* @returns The bytes, one per value
|
|
7
|
+
*/
|
|
8
|
+
export declare function convertFloatsToUnorm8(floats: Float32Array): Uint8Array;
|
|
9
|
+
/**
|
|
10
|
+
* Reads a region of a color attachment of the bound READ_FRAMEBUFFER as RGBA8, `width * 4` bytes per row.
|
|
11
|
+
*
|
|
12
|
+
* readPixels accepts RGBA / UNSIGNED_BYTE only for normalized fixed-point buffers, so floating-point buffers are read
|
|
13
|
+
* as RGBA / FLOAT and converted like `convertFloatsToUnorm8`. This makes the result match the WebGPU backend, which
|
|
14
|
+
* converts other formats to rgba8unorm. Integer buffers cannot be converted and throw.
|
|
15
|
+
*
|
|
16
|
+
* The caller binds the READ_FRAMEBUFFER and sets its read buffer to `attachment`.
|
|
17
|
+
*
|
|
18
|
+
* @param gl - The context
|
|
19
|
+
* @param attachment - The color attachment that is the read buffer (gl.COLOR_ATTACHMENT0 + i)
|
|
20
|
+
* @param x - X offset of the region
|
|
21
|
+
* @param y - Y offset of the region
|
|
22
|
+
* @param width - Width of the region
|
|
23
|
+
* @param height - Height of the region
|
|
24
|
+
*/
|
|
25
|
+
export declare function readColorAttachmentAsRgba8(gl: WebGL2RenderingContext, attachment: number, x: number, y: number, width: number, height: number): Uint8Array;
|
|
26
|
+
/**
|
|
27
|
+
* Binds `framebuffer` as the READ_FRAMEBUFFER, sets its read buffer to `attachment`, runs `read`, and restores the
|
|
28
|
+
* READ_FRAMEBUFFER binding and the read buffer of `framebuffer`, so that a readback does not change the state that
|
|
29
|
+
* rendering relies on.
|
|
30
|
+
*
|
|
31
|
+
* @param gl - The context
|
|
32
|
+
* @param framebuffer - The framebuffer to read from
|
|
33
|
+
* @param attachment - The color attachment to read (gl.COLOR_ATTACHMENT0 + i)
|
|
34
|
+
* @param read - Reads the pixels while the framebuffer is bound
|
|
35
|
+
*/
|
|
36
|
+
export declare function withReadFramebuffer<T>(gl: WebGL2RenderingContext, framebuffer: WebGLFramebuffer, attachment: number, read: () => T): T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function f(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let n=e[r];t[r]=n>=1?255:n>0?Math.round(n*255):0}return t}function A(e,t,r,n,a,o){let F=e.getFramebufferAttachmentParameter(e.READ_FRAMEBUFFER,t,e.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE);if(F===e.UNSIGNED_NORMALIZED){let u=new Uint8Array(a*o*4);return e.readPixels(r,n,a,o,e.RGBA,e.UNSIGNED_BYTE,u),u}if(F===e.FLOAT){let u=new Float32Array(a*o*4);return e.readPixels(r,n,a,o,e.RGBA,e.FLOAT,u),f(u)}throw new Error(`readColorAttachmentAsRgba8: cannot read back a color buffer whose component type is 0x${F.toString(16)}.`)}function b(e,t,r,n){let a=e.getParameter(e.READ_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.READ_FRAMEBUFFER,t);let o=e.getParameter(e.READ_BUFFER);e.readBuffer(r);try{return n()}finally{e.readBuffer(o),e.bindFramebuffer(e.READ_FRAMEBUFFER,a)}}export{f as convertFloatsToUnorm8,A as readColorAttachmentAsRgba8,b as withReadFramebuffer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var o=`
|
|
2
2
|
|
|
3
3
|
/* shaderity: @{glslPrecision} */
|
|
4
4
|
|
|
@@ -8,14 +8,14 @@ var e=`
|
|
|
8
8
|
|
|
9
9
|
/* shaderity: @{prerequisites} */
|
|
10
10
|
|
|
11
|
-
uniform int u_shadingModel; // initialValue=0
|
|
12
|
-
uniform float u_alphaCutoff; // initialValue=0.01
|
|
13
|
-
uniform float u_shininess; // initialValue=5
|
|
14
|
-
uniform vec4 u_diffuseColorFactor; // initialValue=(1,1,1,1)
|
|
11
|
+
uniform int u_shadingModel; // initialValue=0, min=0, max=3, valueStep=1
|
|
12
|
+
uniform float u_alphaCutoff; // initialValue=0.01, min=0, max=1, valueStep=0.001
|
|
13
|
+
uniform float u_shininess; // initialValue=5, min=0, max=100, valueStep=0.1
|
|
14
|
+
uniform vec4 u_diffuseColorFactor; // initialValue=(1,1,1,1), min=0, max=1, valueStep=0.001
|
|
15
15
|
uniform sampler2D u_diffuseColorTexture; // initialValue=(1,white)
|
|
16
16
|
uniform sampler2D u_normalTexture; // initialValue=(2,blue)
|
|
17
|
-
uniform vec4 u_diffuseColorTextureTransform; // initialValue=(1,1,0,0)
|
|
18
|
-
uniform float u_diffuseColorTextureRotation; // initialValue=0
|
|
17
|
+
uniform vec4 u_diffuseColorTextureTransform; // initialValue=(1,1,0,0), min=-10, max=10, valueStep=0.001
|
|
18
|
+
uniform float u_diffuseColorTextureRotation; // initialValue=0, min=-6.2832, max=6.2832, valueStep=0.001
|
|
19
19
|
|
|
20
20
|
/* shaderity: @{renderTargetBegin} */
|
|
21
21
|
// #pragma shaderity: require(../common/deliot2019SeamlessTexture.glsl)
|
|
@@ -120,6 +120,15 @@ void classicShader(in vec4 vertexColor, in vec4 diffuseColorFactor, in vec4 diff
|
|
|
120
120
|
|
|
121
121
|
shadingColor.rgb += diffuse + specular;
|
|
122
122
|
}
|
|
123
|
+
|
|
124
|
+
// Ambient lights: a uniform diffuse term with the same scale as the diffuse term of the lights above.
|
|
125
|
+
#ifdef RN_IS_LIGHTING
|
|
126
|
+
vec3 ambientAlbedo = diffuseColor.rgb / 2.0;
|
|
127
|
+
if (shadingModel == 1u) { // LAMBERT
|
|
128
|
+
ambientAlbedo *= 2.0; // for energy conservation, as above
|
|
129
|
+
}
|
|
130
|
+
shadingColor.rgb += ambientAlbedo * get_ambientLightIntensity(0u, 0u);
|
|
131
|
+
#endif
|
|
123
132
|
} else {
|
|
124
133
|
shadingColor.rgb = diffuseColor.rgb;
|
|
125
134
|
}
|
|
@@ -157,4 +166,4 @@ void main ()
|
|
|
157
166
|
// Pre-multiplied alpha
|
|
158
167
|
rt0 = vec4(shadingColor.rgb * shadingColor.a, shadingColor.a);
|
|
159
168
|
}
|
|
160
|
-
`,i="fragment",t=!0,
|
|
169
|
+
`,i="fragment",t=!0,a={code:o,shaderStage:i,isFragmentShader:t};export{o as code,a as default,t as isFragmentShader,i as shaderStage};
|