rhodonite 0.27.1 → 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/MeshRenderer/MeshRendererComponent.d.ts +5 -5
- package/dist/esm/foundation/components/MeshRenderer/MeshRendererComponent.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/index.d.ts +1 -1
- package/dist/esm/foundation/definitions/index.js +1 -1
- package/dist/esm/foundation/geometry/Mesh.d.ts +18 -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/gizmos/RotationGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/ScaleGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/SphereColliderGizmo.js +1 -1
- package/dist/esm/foundation/gizmos/TranslationGizmo.js +1 -1
- package/dist/esm/foundation/helpers/BloomHelper.js +1 -1
- package/dist/esm/foundation/helpers/GaussianBlurHelper.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/PointShadowMap.js +1 -1
- package/dist/esm/foundation/helpers/Shadow/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/nodeBasedMaterialCommon.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/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 +4 -4
- package/dist/esm/foundation/materials/contents/MToon1MaterialContent.js +3 -3
- 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/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/Atan2ShaderNode.js +1 -1
- package/dist/esm/foundation/materials/nodes/BranchShaderNode.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/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/GreaterOrEqualShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/GreaterOrEqualShaderNode.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/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/PremultipliedAlphaShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/PremultipliedAlphaShaderNode.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/TransformShaderNode.d.ts +1 -1
- package/dist/esm/foundation/materials/nodes/TransformShaderNode.js +1 -1
- 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/Transform3D.js +1 -1
- package/dist/esm/foundation/memory/Accessor.js +1 -1
- package/dist/esm/foundation/memory/Buffer.js +3 -3
- package/dist/esm/foundation/renderer/CGAPIResourceRepository.d.ts +74 -4
- package/dist/esm/foundation/renderer/CGAPIResourceRepository.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/TemporalAASystem.d.ts +9 -3
- package/dist/esm/foundation/renderer/TemporalAA/TemporalAASystem.js +1 -1
- package/dist/esm/foundation/renderer/lightCluster/LightClusterSystem.js +1 -1
- package/dist/esm/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +4 -171
- 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 +17 -28
- package/dist/esm/foundation/system/Engine.js +1 -1
- package/dist/esm/foundation/system/EngineState.d.ts +3 -3
- package/dist/esm/foundation/system/EngineState.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/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/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/shaders/RaymarchingShaderPart.d.ts +2 -2
- package/dist/esm/webgl/shaders/RaymarchingShaderPart.js +9 -9
- 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 +1 -1
- 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 +1 -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/common/processGeometry.wgsl.js +1 -1
- 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/MeshRenderer/MeshRendererComponent.d.ts +5 -5
- package/dist/esmdev/foundation/components/MeshRenderer/MeshRendererComponent.js +11 -11
- package/dist/esmdev/foundation/core/GlobalDataRepository.d.ts +3 -3
- package/dist/esmdev/foundation/core/GlobalDataRepository.js +3 -3
- package/dist/esmdev/foundation/definitions/RenderBackend.d.ts +21 -0
- package/dist/esmdev/foundation/definitions/RenderBackend.js +60 -0
- package/dist/esmdev/foundation/definitions/index.d.ts +1 -1
- package/dist/esmdev/foundation/definitions/index.js +2 -2
- package/dist/esmdev/foundation/geometry/Mesh.d.ts +18 -68
- package/dist/esmdev/foundation/geometry/Mesh.js +159 -383
- package/dist/esmdev/foundation/geometry/Primitive.d.ts +1 -1
- package/dist/esmdev/foundation/geometry/Primitive.js +123 -123
- package/dist/esmdev/foundation/geometry/SimpleVertexAttribute.js +5 -5
- package/dist/esmdev/foundation/geometry/shapes/Cylinder.js +3 -3
- package/dist/esmdev/foundation/geometry/shapes/Joint.js +33 -33
- package/dist/esmdev/foundation/gizmos/AABBGizmo.js +12 -12
- package/dist/esmdev/foundation/gizmos/CapsuleColliderGizmo.js +23 -23
- package/dist/esmdev/foundation/gizmos/Gizmo.js +23 -23
- package/dist/esmdev/foundation/gizmos/JointGizmo.js +37 -37
- package/dist/esmdev/foundation/gizmos/LightGizmo.js +69 -69
- package/dist/esmdev/foundation/gizmos/LocatorGizmo.js +22 -22
- 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 +34 -34
- package/dist/esmdev/foundation/helpers/GaussianBlurHelper.js +18 -18
- package/dist/esmdev/foundation/helpers/Shadow/PointShadowMap.js +12 -12
- package/dist/esmdev/foundation/helpers/Shadow/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 +3 -3
- 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 +76 -285
- package/dist/esmdev/foundation/helpers/materials/nodeBasedMaterialCommon.js +3 -3
- package/dist/esmdev/foundation/importer/AnimationAssigner.js +44 -44
- package/dist/esmdev/foundation/importer/DrcPointCloudImporter.js +30 -30
- package/dist/esmdev/foundation/importer/Gltf2Importer.js +14 -14
- package/dist/esmdev/foundation/importer/GltfImporter.js +22 -22
- package/dist/esmdev/foundation/importer/ModelConverter.js +137 -137
- 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 +2 -2
- package/dist/esmdev/foundation/materials/contents/DetectHighLuminanceMaterialContent.d.ts +0 -16
- package/dist/esmdev/foundation/materials/contents/DetectHighLuminanceMaterialContent.js +3 -19
- package/dist/esmdev/foundation/materials/contents/EntityUIDOutputMaterialContent.d.ts +0 -17
- package/dist/esmdev/foundation/materials/contents/EntityUIDOutputMaterialContent.js +1 -17
- package/dist/esmdev/foundation/materials/contents/FurnaceTestMaterialContent.d.ts +0 -21
- package/dist/esmdev/foundation/materials/contents/FurnaceTestMaterialContent.js +1 -21
- package/dist/esmdev/foundation/materials/contents/MToon0xMaterialContent.js +142 -143
- 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 +1 -17
- package/dist/esmdev/foundation/materials/contents/ShadowMapDecodeClassicMaterialContent.js +7 -8
- package/dist/esmdev/foundation/materials/contents/SynthesizeHdrMaterialContent.d.ts +0 -23
- package/dist/esmdev/foundation/materials/contents/SynthesizeHdrMaterialContent.js +3 -29
- package/dist/esmdev/foundation/materials/contents/VarianceShadowMapDecodeClassicMaterialContent.js +7 -8
- 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 +100 -348
- package/dist/esmdev/foundation/materials/core/MaterialRepository.js +55 -55
- 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 +14 -14
- package/dist/esmdev/foundation/materials/core/ShaderityUtilityWebGPU.js +15 -15
- 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 +14 -14
- 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 +359 -359
- package/dist/esmdev/foundation/memory/Buffer.js +34 -34
- package/dist/esmdev/foundation/memory/BufferView.js +26 -26
- 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 +225 -225
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsWorldQueryStrategy.js +3 -3
- package/dist/esmdev/foundation/physics/VRMSpring/CapsuleCollider.js +36 -36
- package/dist/esmdev/foundation/physics/VRMSpring/SphereCollider.js +26 -26
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBone.js +6 -6
- package/dist/esmdev/foundation/physics/VRMSpring/VRMSpringBonePhysicsStrategy.js +56 -56
- 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 +7 -7
- 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 +94 -94
- 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 +6 -6
- 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.js +162 -162
- package/dist/esmdev/foundation/renderer/lightCluster/LightClusterSystemStub.js +3 -3
- package/dist/esmdev/foundation/renderer/pipelines/DeferredRenderPipeline.js +4 -4
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.d.ts +4 -171
- package/dist/esmdev/foundation/renderer/pipelines/ForwardRenderPipeline.js +335 -1127
- 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 +17 -28
- package/dist/esmdev/foundation/system/Engine.js +207 -574
- package/dist/esmdev/foundation/system/EngineState.d.ts +3 -3
- package/dist/esmdev/foundation/system/EngineState.js +4 -4
- package/dist/esmdev/foundation/system/EventPubSub.js +8 -8
- package/dist/esmdev/foundation/system/InputManager.js +56 -56
- package/dist/esmdev/foundation/system/ModuleManager.js +3 -3
- package/dist/esmdev/foundation/textures/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/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 +128 -230
- 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 +30 -30
- 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 -2596
- 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 +33 -112
- 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 -1863
- 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/shaders/RaymarchingShaderPart.d.ts +2 -2
- package/dist/esmdev/webgl/shaders/RaymarchingShaderPart.js +15 -15
- 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 +5 -5
- package/dist/esmdev/webgl/shaders/nodes/EndShader.d.ts +2 -2
- package/dist/esmdev/webgl/shaders/nodes/EndShader.js +6 -6
- 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 +33 -27
- package/dist/esmdev/webgpu/AttributeReader.d.ts +18 -0
- package/dist/esmdev/webgpu/AttributeReader.js +57 -0
- package/dist/esmdev/webgpu/GpuCullingRegistry.js +91 -91
- package/dist/esmdev/webgpu/GpuDeformRegistry.js +53 -53
- package/dist/esmdev/webgpu/RangeAllocator.js +16 -16
- package/dist/esmdev/webgpu/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 +1 -73
- package/dist/esmdev/webgpu/WebGpuStrategyBasic.js +58 -780
- 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/common/processGeometry.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 +65 -65
- 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,79 @@
|
|
|
1
|
+
import type { Index } from '../types/CommonTypes';
|
|
2
|
+
/**
|
|
3
|
+
* What `WebGLTextureUnitState` needs from the context wrapper that owns it.
|
|
4
|
+
*/
|
|
5
|
+
export interface WebGLTextureUnitStateResources {
|
|
6
|
+
/** The raw WebGL context whose texture units are tracked. */
|
|
7
|
+
getContext(): WebGL2RenderingContext;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Tracks the active texture unit and the textures and samplers bound to the units of a WebGL context, so that the
|
|
11
|
+
* redundant bindings are skipped.
|
|
12
|
+
*
|
|
13
|
+
* Owned by `WebGLContextWrapper`, which exposes these operations through its public methods.
|
|
14
|
+
*/
|
|
15
|
+
export declare class WebGLTextureUnitState {
|
|
16
|
+
private __resources;
|
|
17
|
+
private __activeTextureBackup;
|
|
18
|
+
private __activeTextures2D;
|
|
19
|
+
private __activeTextures2DArray;
|
|
20
|
+
private __activeTexturesCube;
|
|
21
|
+
private __boundTextures;
|
|
22
|
+
private __boundSamplers;
|
|
23
|
+
constructor(resources: WebGLTextureUnitStateResources);
|
|
24
|
+
private get __gl();
|
|
25
|
+
/**
|
|
26
|
+
* Activates a texture unit for subsequent texture operations.
|
|
27
|
+
* Optimized to avoid redundant state changes.
|
|
28
|
+
* @param activeTextureIndex - The texture unit index to activate
|
|
29
|
+
*/
|
|
30
|
+
private __activeTexture;
|
|
31
|
+
/**
|
|
32
|
+
* Binds a 2D texture to a specific texture unit.
|
|
33
|
+
* Optimized to avoid redundant state changes.
|
|
34
|
+
* @param activeTextureIndex - The texture unit index
|
|
35
|
+
* @param texture - The 2D texture to bind
|
|
36
|
+
*/
|
|
37
|
+
bindTexture2D(activeTextureIndex: Index, texture: WebGLTexture): void;
|
|
38
|
+
/**
|
|
39
|
+
* Binds a 2D array texture to a specific texture unit.
|
|
40
|
+
* Optimized to avoid redundant state changes.
|
|
41
|
+
* @param activeTextureIndex - The texture unit index
|
|
42
|
+
* @param texture - The 2D array texture to bind
|
|
43
|
+
*/
|
|
44
|
+
bindTexture2DArray(activeTextureIndex: Index, texture: WebGLTexture): void;
|
|
45
|
+
/**
|
|
46
|
+
* Binds a sampler object to a specific texture unit.
|
|
47
|
+
* Optimized to avoid redundant state changes.
|
|
48
|
+
* @param activeTextureIndex - The texture unit index
|
|
49
|
+
* @param sampler - The sampler object to bind
|
|
50
|
+
*/
|
|
51
|
+
bindTextureSampler(activeTextureIndex: Index, sampler: WebGLSampler): void;
|
|
52
|
+
/**
|
|
53
|
+
* Binds a cube map texture to a specific texture unit.
|
|
54
|
+
* Optimized to avoid redundant state changes.
|
|
55
|
+
* @param activeTextureIndex - The texture unit index
|
|
56
|
+
* @param texture - The cube map texture to bind
|
|
57
|
+
*/
|
|
58
|
+
bindTextureCube(activeTextureIndex: Index, texture: WebGLTexture): void;
|
|
59
|
+
/**
|
|
60
|
+
* Unbinds a 2D texture from a specific texture unit.
|
|
61
|
+
* @param activeTextureIndex - The texture unit index
|
|
62
|
+
*/
|
|
63
|
+
unbindTexture2D(activeTextureIndex: Index): void;
|
|
64
|
+
/**
|
|
65
|
+
* Unbinds a 2D array texture from a specific texture unit.
|
|
66
|
+
* @param activeTextureIndex - The texture unit index
|
|
67
|
+
*/
|
|
68
|
+
unbindTexture2DArray(activeTextureIndex: Index): void;
|
|
69
|
+
/**
|
|
70
|
+
* Unbinds a cube map texture from a specific texture unit.
|
|
71
|
+
* @param activeTextureIndex - The texture unit index
|
|
72
|
+
*/
|
|
73
|
+
unbindTextureCube(activeTextureIndex: Index): void;
|
|
74
|
+
/**
|
|
75
|
+
* Unbinds all currently bound textures from all texture units.
|
|
76
|
+
* This is useful for cleanup operations.
|
|
77
|
+
*/
|
|
78
|
+
unbindTextures(): void;
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=class{constructor(t){this.nU=-1;this.sU=[];this.eU=[];this.hU=[];this.tU=new Map;this.lU=new Map;this.x_=t}get bE(){return this.x_.getContext()}iU(t){this.nU!==t&&(this.bE.activeTexture(this.bE.TEXTURE0+t),this.nU=t)}bindTexture2D(t,i){this.tU.get(t)!==i&&(this.iU(t),this.bE.bindTexture(this.bE.TEXTURE_2D,i),this.tU.set(t,i)),this.sU[t]=i}bindTexture2DArray(t,i){this.tU.get(t)!==i&&(this.iU(t),this.bE.bindTexture(this.bE.TEXTURE_2D_ARRAY,i),this.tU.set(t,i)),this.eU[t]=i}bindTextureSampler(t,i){this.lU.get(t)!==i&&(this.bE.bindSampler(t,i),this.lU.set(t,i))}bindTextureCube(t,i){this.tU.get(t)!==i&&(this.iU(t),this.bE.bindTexture(this.bE.TEXTURE_CUBE_MAP,i),this.tU.set(t,i)),this.hU[t]=i}unbindTexture2D(t){this.iU(t),this.bE.bindTexture(this.bE.TEXTURE_2D,null),this.tU.delete(t),delete this.sU[t]}unbindTexture2DArray(t){this.iU(t),this.bE.bindTexture(this.bE.TEXTURE_2D_ARRAY,null),this.tU.delete(t),delete this.eU[t]}unbindTextureCube(t){this.iU(t),this.bE.bindTexture(this.bE.TEXTURE_CUBE_MAP,null),this.tU.delete(t),delete this.hU[t]}unbindTextures(){for(let t=0;t<this.sU.length;t++)this.sU[t]!=null&&(this.iU(15),this.bE.bindTexture(this.bE.TEXTURE_2D,null),delete this.sU[t]);for(let t=0;t<this.eU.length;t++)this.eU[t]!=null&&(this.iU(15),this.bE.bindTexture(this.bE.TEXTURE_2D_ARRAY,null),delete this.eU[t]);for(let t=0;t<this.hU.length;t++)this.hU[t]!=null&&(this.iU(15),this.bE.bindTexture(this.bE.TEXTURE_CUBE_MAP,null),delete this.hU[t])}};export{e as WebGLTextureUnitState};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { ComponentTypeEnum } from '../foundation/definitions/ComponentType';
|
|
2
|
+
import { type PixelFormatEnum } from '../foundation/definitions/PixelFormat';
|
|
3
|
+
import { type TextureFormatEnum } from '../foundation/definitions/TextureFormat';
|
|
4
|
+
import type { TextureParameterEnum } from '../foundation/definitions/TextureParameter';
|
|
5
|
+
import type { ImageBitmapData } from '../foundation/renderer/CGAPIResourceRepository';
|
|
6
|
+
import type { Index, Size, TypedArray, WebGLResourceHandle } from '../types/CommonTypes';
|
|
7
|
+
import type { WebGLContextWrapper } from './WebGLContextWrapper';
|
|
8
|
+
import type { WebGLResource } from './WebGLResourceRepository';
|
|
9
|
+
/**
|
|
10
|
+
* What `WebGLTextureUploads` needs from the textures module that owns it.
|
|
11
|
+
*/
|
|
12
|
+
export interface WebGLTextureUploadResources {
|
|
13
|
+
/** The current WebGL context wrapper, which is replaced when a context is added. */
|
|
14
|
+
getContextWrapper(): WebGLContextWrapper | undefined;
|
|
15
|
+
/** Registers a WebGL object and returns its resource handle. */
|
|
16
|
+
registerResource(obj: WebGLResource): WebGLResourceHandle;
|
|
17
|
+
/** Returns the WebGL object of a resource handle. */
|
|
18
|
+
getWebGLResource(handle: WebGLResourceHandle): WebGLResource | null;
|
|
19
|
+
/** Generates the mipmap chain of the texture bound to unit 15 and unbinds it. */
|
|
20
|
+
generateMipmapsAndUnbind(gl: WebGL2RenderingContext, width: number, height: number, generateMipmap: boolean): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Uploads image data to 2D textures of the WebGL backend: ImageBitmap and HTMLImageElement sources, and the pixels
|
|
24
|
+
* of one mip level with row padding.
|
|
25
|
+
*
|
|
26
|
+
* Owned by `WebGLTextures`, which exposes these operations through its public methods.
|
|
27
|
+
*/
|
|
28
|
+
export declare class WebGLTextureUploads {
|
|
29
|
+
private __resources;
|
|
30
|
+
constructor(resources: WebGLTextureUploadResources);
|
|
31
|
+
private get __glw();
|
|
32
|
+
private __registerResource;
|
|
33
|
+
private getWebGLResource;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a 2D texture from ImageBitmap data with specified parameters.
|
|
36
|
+
* This method allocates texture storage and uploads the image data to the GPU.
|
|
37
|
+
*
|
|
38
|
+
* @param imageData - The ImageBitmap or ImageBitmapSource data to upload
|
|
39
|
+
* @param params - Configuration object for texture creation
|
|
40
|
+
* @param params.internalFormat - Internal format of the texture
|
|
41
|
+
* @param params.width - Width of the texture
|
|
42
|
+
* @param params.height - Height of the texture
|
|
43
|
+
* @param params.format - Pixel format of the source data
|
|
44
|
+
* @param params.type - Data type of the source data
|
|
45
|
+
* @param params.generateMipmap - Whether to generate mipmaps automatically
|
|
46
|
+
* @returns Promise that resolves to the handle of the created texture
|
|
47
|
+
*/
|
|
48
|
+
createTextureFromImageBitmapData(imageData: ImageBitmapData, { internalFormat, width, height, format, type, generateMipmap, }: {
|
|
49
|
+
internalFormat: TextureFormatEnum;
|
|
50
|
+
width: Size;
|
|
51
|
+
height: Size;
|
|
52
|
+
format: PixelFormatEnum;
|
|
53
|
+
type: ComponentTypeEnum;
|
|
54
|
+
generateMipmap: boolean;
|
|
55
|
+
}): Promise<WebGLResourceHandle>;
|
|
56
|
+
/**
|
|
57
|
+
* Creates a 2D texture from an HTML image element with specified parameters.
|
|
58
|
+
* This method allocates texture storage and uploads the image data to the GPU.
|
|
59
|
+
*
|
|
60
|
+
* @param imageData - The HTML image element containing the image data
|
|
61
|
+
* @param params - Configuration object for texture creation
|
|
62
|
+
* @param params.internalFormat - Internal format of the texture
|
|
63
|
+
* @param params.width - Width of the texture
|
|
64
|
+
* @param params.height - Height of the texture
|
|
65
|
+
* @param params.format - Pixel format of the source data
|
|
66
|
+
* @param params.type - Data type of the source data
|
|
67
|
+
* @param params.generateMipmap - Whether to generate mipmaps automatically
|
|
68
|
+
* @returns Promise that resolves to the handle of the created texture
|
|
69
|
+
*/
|
|
70
|
+
createTextureFromHTMLImageElement(imageData: HTMLImageElement, { internalFormat, width, height, format, type, generateMipmap, }: {
|
|
71
|
+
internalFormat: TextureParameterEnum;
|
|
72
|
+
width: Size;
|
|
73
|
+
height: Size;
|
|
74
|
+
format: PixelFormatEnum;
|
|
75
|
+
type: ComponentTypeEnum;
|
|
76
|
+
generateMipmap: boolean;
|
|
77
|
+
}): Promise<WebGLResourceHandle>;
|
|
78
|
+
/**
|
|
79
|
+
* Loads image data to a specific mip level of an existing 2D texture.
|
|
80
|
+
* This method supports uploading data with row padding, extracting only the relevant pixels.
|
|
81
|
+
*
|
|
82
|
+
* @param params - Configuration object for image loading
|
|
83
|
+
* @param params.mipLevel - The mip level to load the image to
|
|
84
|
+
* @param params.textureUid - The handle of the target texture
|
|
85
|
+
* @param params.format - The format of the image
|
|
86
|
+
* @param params.type - The data type of the image
|
|
87
|
+
* @param params.xOffset - X offset of the copy region
|
|
88
|
+
* @param params.yOffset - Y offset of the copy region
|
|
89
|
+
* @param params.width - Width of the image to copy
|
|
90
|
+
* @param params.height - Height of the image to copy
|
|
91
|
+
* @param params.rowSizeByPixel - Size of each row in pixels (including padding)
|
|
92
|
+
* @param params.data - The typed array containing the image data
|
|
93
|
+
*/
|
|
94
|
+
loadImageToMipLevelOfTexture2D({ mipLevel, textureUid, format, type, xOffset, yOffset, width, height, rowSizeByPixel, data, }: {
|
|
95
|
+
mipLevel: Index;
|
|
96
|
+
textureUid: WebGLResourceHandle;
|
|
97
|
+
format: TextureFormatEnum;
|
|
98
|
+
type: ComponentTypeEnum;
|
|
99
|
+
xOffset: number;
|
|
100
|
+
yOffset: number;
|
|
101
|
+
width: number;
|
|
102
|
+
height: number;
|
|
103
|
+
rowSizeByPixel: number;
|
|
104
|
+
data: TypedArray;
|
|
105
|
+
}): void;
|
|
106
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{PixelFormat as C}from"../foundation/definitions/PixelFormat.js";import{TextureFormat as E}from"../foundation/definitions/TextureFormat.js";import{MathUtil as T}from"../foundation/math/MathUtil.js";import{DataUtil as g}from"../foundation/misc/DataUtil.js";import{MiscUtil as L}from"../foundation/misc/MiscUtil.js";import{GL_TEXTURE_2D as R}from"../types/WebGLConstants.js";var G=class{constructor(o){this.x_=o}get u_(){return this.x_.getContextWrapper()}T_(o){return this.x_.registerResource(o)}getWebGLResource(o){return this.x_.getWebGLResource(o)}async createTextureFromImageBitmapData(o,{internalFormat:l,width:i,height:s,format:d,type:b,generateMipmap:n}){let r=this.u_.getRawContextAsWebGL2(),u=o,e=i,t=s;if(!T.isPowerOfTwoTexture(i,s)&&L.isIOS()){e=g.getNearestPowerOfTwo(i),t=g.getNearestPowerOfTwo(s);let m=new OffscreenCanvas(e,t);m.getContext("2d").drawImage(o,0,0,e,t),u=await createImageBitmap(m)}let p=r.createTexture(),x=this.T_(p);this.u_.bindTexture2D(15,p);let a=n?T.getMipLevelCount(e,t):1;return r.texStorage2D(R,a,l.index,e,t),r.texSubImage2D(r.TEXTURE_2D,0,0,0,d.index,b.index,u),this.x_.generateMipmapsAndUnbind(r,e,t,n),x}async createTextureFromHTMLImageElement(o,{internalFormat:l,width:i,height:s,format:d,type:b,generateMipmap:n}){let r=this.u_.getRawContextAsWebGL2(),u=o,e=i,t=s;if(!T.isPowerOfTwoTexture(i,s)&&L.isIOS()){e=g.getNearestPowerOfTwo(i),t=g.getNearestPowerOfTwo(s);let m=new OffscreenCanvas(e,t);m.getContext("2d").drawImage(o,0,0,e,t),u=await createImageBitmap(m)}let p=r.createTexture(),x=this.T_(p);this.u_.bindTexture2D(15,p);let a=n?T.getMipLevelCount(e,t):1;return r.texStorage2D(R,a,l.index,e,t),r.texSubImage2D(r.TEXTURE_2D,0,0,0,d.index,b.index,u),this.x_.generateMipmapsAndUnbind(r,e,t,n),x}loadImageToMipLevelOfTexture2D({mipLevel:o,textureUid:l,format:i,type:s,xOffset:d,yOffset:b,width:n,height:r,rowSizeByPixel:u,data:e}){let t=this.u_.getRawContextAsWebGL2(),p=this.getWebGLResource(l),x=E.getPixelFormatFromTextureFormat(i),a=C.getCompositionNumFromPixelFormat(x),m=new e.constructor(n*r*a);for(let c=0;c<r;c++){let W=c*u*a,y=c*n*a;for(let f=0;f<n;f++)m.set(e.subarray(W+f*a,W+(f+1)*a),y+f*a)}this.u_.bindTexture2D(15,p),t.texSubImage2D(t.TEXTURE_2D,o,d,b,n,r,x.index,s.index,m),this.u_.unbindTexture2D(15)}};export{G as WebGLTextureUploads};
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import type { ComponentTypeEnum } from '../foundation/definitions/ComponentType';
|
|
2
|
+
import type { CompressionTextureTypeEnum } from '../foundation/definitions/CompressionTextureType';
|
|
3
|
+
import type { PixelFormatEnum } from '../foundation/definitions/PixelFormat';
|
|
4
|
+
import type { TextureFormatEnum } from '../foundation/definitions/TextureFormat';
|
|
5
|
+
import type { TextureParameterEnum } from '../foundation/definitions/TextureParameter';
|
|
6
|
+
import type { DirectTextureData, ImageBitmapData, TextureData } from '../foundation/renderer/CGAPIResourceRepository';
|
|
7
|
+
import type { BasisFile } from '../types/BasisTexture';
|
|
8
|
+
import type { CGAPIResourceHandle, Count, Index, Offset, Size, TypedArray, WebGLResourceHandle } from '../types/CommonTypes';
|
|
9
|
+
import type { WebGLContextWrapper } from './WebGLContextWrapper';
|
|
10
|
+
import type { WebGLResource } from './WebGLResourceRepository';
|
|
11
|
+
/**
|
|
12
|
+
* What `WebGLTextures` needs from the resource repository that owns it.
|
|
13
|
+
*/
|
|
14
|
+
export interface WebGLTextureResources {
|
|
15
|
+
/** The current WebGL context wrapper, which is replaced when a context is added. */
|
|
16
|
+
getContextWrapper(): WebGLContextWrapper | undefined;
|
|
17
|
+
/** Registers a WebGL object and returns its resource handle. */
|
|
18
|
+
registerResource(obj: WebGLResource): WebGLResourceHandle;
|
|
19
|
+
/** Returns the WebGL object of a resource handle. */
|
|
20
|
+
getWebGLResource(handle: WebGLResourceHandle): WebGLResource | null;
|
|
21
|
+
/** Removes a resource handle from the repository. */
|
|
22
|
+
deleteWebGLResource(handle: WebGLResourceHandle): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Creates the 2D, array, cube and compressed textures of the WebGL backend, their samplers and texture views,
|
|
26
|
+
* generates their mip levels, uploads image data and reads 2D textures back.
|
|
27
|
+
*
|
|
28
|
+
* Owned by `WebGLResourceRepository`, which exposes these operations through its public methods.
|
|
29
|
+
*/
|
|
30
|
+
export declare class WebGLTextures {
|
|
31
|
+
private __resources;
|
|
32
|
+
private __compressedTextures;
|
|
33
|
+
private __samplers;
|
|
34
|
+
private __uploads;
|
|
35
|
+
constructor(resources: WebGLTextureResources);
|
|
36
|
+
private get __glw();
|
|
37
|
+
private __registerResource;
|
|
38
|
+
private getWebGLResource;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a 2D texture with immutable storage using texStorage2D.
|
|
41
|
+
* This method allocates texture storage with the specified parameters.
|
|
42
|
+
*
|
|
43
|
+
* @param params - Configuration object for texture creation
|
|
44
|
+
* @param params.levels - Number of mipmap levels to allocate
|
|
45
|
+
* @param params.internalFormat - Internal format of the texture
|
|
46
|
+
* @param params.width - Width of the texture
|
|
47
|
+
* @param params.height - Height of the texture
|
|
48
|
+
* @returns The handle of the created texture
|
|
49
|
+
*/
|
|
50
|
+
createTexStorage2D({ levels, internalFormat, width, height, }: {
|
|
51
|
+
levels: Index;
|
|
52
|
+
internalFormat: TextureParameterEnum | PixelFormatEnum;
|
|
53
|
+
width: Size;
|
|
54
|
+
height: Size;
|
|
55
|
+
}): WebGLResourceHandle;
|
|
56
|
+
/**
|
|
57
|
+
* Creates a new texture sampler with the specified filtering and wrapping parameters.
|
|
58
|
+
*/
|
|
59
|
+
createTextureSampler({ magFilter, minFilter, wrapS, wrapT, wrapR, anisotropy, shadowCompareMode, }: {
|
|
60
|
+
magFilter: TextureParameterEnum;
|
|
61
|
+
minFilter: TextureParameterEnum;
|
|
62
|
+
wrapS: TextureParameterEnum;
|
|
63
|
+
wrapT: TextureParameterEnum;
|
|
64
|
+
wrapR: TextureParameterEnum;
|
|
65
|
+
anisotropy: boolean;
|
|
66
|
+
shadowCompareMode: boolean;
|
|
67
|
+
}): number;
|
|
68
|
+
createOrGetTextureSamplerClampToEdgeLinear(): number;
|
|
69
|
+
createOrGetTextureSamplerRepeatNearest(): number;
|
|
70
|
+
createOrGetTextureSamplerRepeatTriLinear(): number;
|
|
71
|
+
createOrGetTextureSamplerShadow(): number;
|
|
72
|
+
createTextureFromImageBitmapData(imageData: ImageBitmapData, { internalFormat, width, height, format, type, generateMipmap, }: {
|
|
73
|
+
internalFormat: TextureFormatEnum;
|
|
74
|
+
width: Size;
|
|
75
|
+
height: Size;
|
|
76
|
+
format: PixelFormatEnum;
|
|
77
|
+
type: ComponentTypeEnum;
|
|
78
|
+
generateMipmap: boolean;
|
|
79
|
+
}): Promise<WebGLResourceHandle>;
|
|
80
|
+
createTextureFromHTMLImageElement(imageData: HTMLImageElement, { internalFormat, width, height, format, type, generateMipmap, }: {
|
|
81
|
+
internalFormat: TextureParameterEnum;
|
|
82
|
+
width: Size;
|
|
83
|
+
height: Size;
|
|
84
|
+
format: PixelFormatEnum;
|
|
85
|
+
type: ComponentTypeEnum;
|
|
86
|
+
generateMipmap: boolean;
|
|
87
|
+
}): Promise<WebGLResourceHandle>;
|
|
88
|
+
loadImageToMipLevelOfTexture2D({ mipLevel, textureUid, format, type, xOffset, yOffset, width, height, rowSizeByPixel, data, }: {
|
|
89
|
+
mipLevel: Index;
|
|
90
|
+
textureUid: WebGLResourceHandle;
|
|
91
|
+
format: TextureFormatEnum;
|
|
92
|
+
type: ComponentTypeEnum;
|
|
93
|
+
xOffset: number;
|
|
94
|
+
yOffset: number;
|
|
95
|
+
width: number;
|
|
96
|
+
height: number;
|
|
97
|
+
rowSizeByPixel: number;
|
|
98
|
+
data: TypedArray;
|
|
99
|
+
}): void;
|
|
100
|
+
/**
|
|
101
|
+
* Creates a 2D texture array with specified dimensions and format.
|
|
102
|
+
* Texture arrays allow storing multiple texture layers in a single texture object.
|
|
103
|
+
*
|
|
104
|
+
* @param width - Width of each texture layer
|
|
105
|
+
* @param height - Height of each texture layer
|
|
106
|
+
* @param arrayLength - Number of texture layers in the array
|
|
107
|
+
* @param mipLevelCount - Number of mipmap levels
|
|
108
|
+
* @param internalFormat - Internal format of the texture
|
|
109
|
+
* @param format - Pixel format of the source data
|
|
110
|
+
* @param type - Data type of the source data
|
|
111
|
+
* @param imageData - Typed array containing the texture data
|
|
112
|
+
* @returns The handle of the created texture array
|
|
113
|
+
*/
|
|
114
|
+
createTextureArray(width: Size, height: Size, arrayLength: Size, mipLevelCount: Size, internalFormat: TextureFormatEnum, format: PixelFormatEnum, type: ComponentTypeEnum, imageData: TypedArray): CGAPIResourceHandle;
|
|
115
|
+
/**
|
|
116
|
+
* Allocates texture storage without uploading any image data.
|
|
117
|
+
* This method creates an empty texture with the specified format and dimensions.
|
|
118
|
+
*
|
|
119
|
+
* @param params - Configuration object for texture allocation
|
|
120
|
+
* @param params.format - Internal format of the texture
|
|
121
|
+
* @param params.width - Width of the texture
|
|
122
|
+
* @param params.height - Height of the texture
|
|
123
|
+
* @param params.mipLevelCount - Number of mipmap levels to allocate
|
|
124
|
+
* @returns The handle of the allocated texture
|
|
125
|
+
*/
|
|
126
|
+
allocateTexture({ format, width, height, mipLevelCount, }: {
|
|
127
|
+
format: TextureFormatEnum;
|
|
128
|
+
width: Size;
|
|
129
|
+
height: Size;
|
|
130
|
+
mipLevelCount: Count;
|
|
131
|
+
}): WebGLResourceHandle;
|
|
132
|
+
/**
|
|
133
|
+
* Creates a 2D texture from a typed array with specified parameters.
|
|
134
|
+
* This method is useful for creating textures from raw pixel data.
|
|
135
|
+
*
|
|
136
|
+
* @param imageData - The typed array containing the pixel data
|
|
137
|
+
* @param params - Configuration object for texture creation
|
|
138
|
+
* @param params.internalFormat - Internal format of the texture
|
|
139
|
+
* @param params.width - Width of the texture
|
|
140
|
+
* @param params.height - Height of the texture
|
|
141
|
+
* @param params.format - Pixel format of the source data
|
|
142
|
+
* @param params.type - Data type of the source data
|
|
143
|
+
* @param params.generateMipmap - Whether to generate mipmaps automatically
|
|
144
|
+
* @returns The handle of the created texture
|
|
145
|
+
*/
|
|
146
|
+
createTextureFromTypedArray(imageData: TypedArray, { internalFormat, width, height, format, type, generateMipmap, }: {
|
|
147
|
+
internalFormat: TextureFormatEnum;
|
|
148
|
+
width: Size;
|
|
149
|
+
height: Size;
|
|
150
|
+
format: PixelFormatEnum;
|
|
151
|
+
type: ComponentTypeEnum;
|
|
152
|
+
generateMipmap: boolean;
|
|
153
|
+
}): WebGLResourceHandle;
|
|
154
|
+
/**
|
|
155
|
+
* Creates a compressed texture from pre-transcoded texture data for multiple mip levels.
|
|
156
|
+
*/
|
|
157
|
+
createCompressedTexture(textureDataArray: TextureData[], compressionTextureType: CompressionTextureTypeEnum): Promise<WebGLResourceHandle>;
|
|
158
|
+
/**
|
|
159
|
+
* Creates a compressed texture from a Basis Universal file.
|
|
160
|
+
*/
|
|
161
|
+
createCompressedTextureFromBasis(basisFile: BasisFile, { border, }: {
|
|
162
|
+
border: Size;
|
|
163
|
+
}): WebGLResourceHandle;
|
|
164
|
+
/**
|
|
165
|
+
* create a RenderTargetTexture
|
|
166
|
+
* @param param0
|
|
167
|
+
* @returns
|
|
168
|
+
*/
|
|
169
|
+
createRenderTargetTexture({ width, height, mipLevelCount, format, }: {
|
|
170
|
+
width: Size;
|
|
171
|
+
height: Size;
|
|
172
|
+
mipLevelCount: Count;
|
|
173
|
+
format: TextureParameterEnum;
|
|
174
|
+
}): number;
|
|
175
|
+
/**
|
|
176
|
+
* create a RenderTargetTextureArray
|
|
177
|
+
* @param param0
|
|
178
|
+
* @returns
|
|
179
|
+
*/
|
|
180
|
+
createRenderTargetTextureArray({ width, height, internalFormat, arrayLength, }: {
|
|
181
|
+
width: Size;
|
|
182
|
+
height: Size;
|
|
183
|
+
internalFormat: TextureParameterEnum;
|
|
184
|
+
arrayLength: Count;
|
|
185
|
+
}): WebGLResourceHandle;
|
|
186
|
+
/**
|
|
187
|
+
* create a RenderTargetTextureCube
|
|
188
|
+
* @param param0
|
|
189
|
+
* @returns
|
|
190
|
+
*/
|
|
191
|
+
createRenderTargetTextureCube({ width, height, mipLevelCount, format, }: {
|
|
192
|
+
width: Size;
|
|
193
|
+
height: Size;
|
|
194
|
+
mipLevelCount: Size;
|
|
195
|
+
format: TextureParameterEnum;
|
|
196
|
+
}): number;
|
|
197
|
+
setWebGLTextureDirectly(webGLTexture: WebGLTexture): number;
|
|
198
|
+
createTextureFromDataUri(dataUri: string, { internalFormat, format, type, generateMipmap, }: {
|
|
199
|
+
internalFormat: TextureParameterEnum;
|
|
200
|
+
format: PixelFormatEnum;
|
|
201
|
+
type: ComponentTypeEnum;
|
|
202
|
+
generateMipmap: boolean;
|
|
203
|
+
}): Promise<WebGLResourceHandle>;
|
|
204
|
+
updateTexture(textureUid: WebGLResourceHandle, textureData: DirectTextureData, { level, offsetX, offsetY, width, height, format, type, }: {
|
|
205
|
+
level: Index;
|
|
206
|
+
offsetX: Offset;
|
|
207
|
+
offsetY: Offset;
|
|
208
|
+
width: Size;
|
|
209
|
+
height: Size;
|
|
210
|
+
format: PixelFormatEnum;
|
|
211
|
+
type: ComponentTypeEnum;
|
|
212
|
+
}): void;
|
|
213
|
+
/**
|
|
214
|
+
* WebGL has no texture views: returns -1.
|
|
215
|
+
*
|
|
216
|
+
* @param _textureHandle - Handle to the texture
|
|
217
|
+
* @returns -1
|
|
218
|
+
*/
|
|
219
|
+
createTextureView2d(_textureHandle: WebGLResourceHandle): WebGLResourceHandle;
|
|
220
|
+
/**
|
|
221
|
+
* WebGL has no texture views: returns -1.
|
|
222
|
+
*
|
|
223
|
+
* @param _textureHandle - Handle to the texture
|
|
224
|
+
* @returns -1
|
|
225
|
+
*/
|
|
226
|
+
createTextureViewAsRenderTarget(_textureHandle: WebGLResourceHandle): WebGLResourceHandle;
|
|
227
|
+
/**
|
|
228
|
+
* WebGL has no texture views: returns -1.
|
|
229
|
+
*
|
|
230
|
+
* @param _textureHandle - Handle to the cube texture
|
|
231
|
+
* @returns -1
|
|
232
|
+
*/
|
|
233
|
+
createTextureViewCube(_textureHandle: WebGLResourceHandle): WebGLResourceHandle;
|
|
234
|
+
/**
|
|
235
|
+
* WebGL has no texture views: returns -1.
|
|
236
|
+
*
|
|
237
|
+
* @param _textureHandle - Handle to the array texture
|
|
238
|
+
* @param _arrayLayerCount - Number of layers of the view
|
|
239
|
+
* @returns -1
|
|
240
|
+
*/
|
|
241
|
+
createTextureView2dArray(_textureHandle: WebGLResourceHandle, _arrayLayerCount: Count): WebGLResourceHandle;
|
|
242
|
+
/**
|
|
243
|
+
* WebGL has no texture views: returns -1. Layers are attached with
|
|
244
|
+
* attachColorBufferLayerToFrameBufferObject instead.
|
|
245
|
+
*
|
|
246
|
+
* @param _textureHandle - Handle to the array texture
|
|
247
|
+
* @param _arrayIdx - Layer to render to
|
|
248
|
+
* @param _mipLevel - Mip level to render to
|
|
249
|
+
* @returns -1
|
|
250
|
+
*/
|
|
251
|
+
createTextureView2dArrayAsRenderTarget(_textureHandle: WebGLResourceHandle, _arrayIdx: Index, _mipLevel: Index): WebGLResourceHandle;
|
|
252
|
+
/**
|
|
253
|
+
* WebGL has no texture views: returns -1. Faces are attached with
|
|
254
|
+
* attachColorBufferCubeToFrameBufferObject instead.
|
|
255
|
+
*
|
|
256
|
+
* @param _textureHandle - Handle to the cube texture
|
|
257
|
+
* @param _faceIdx - Face to render to
|
|
258
|
+
* @param _mipLevel - Mip level to render to
|
|
259
|
+
* @returns -1
|
|
260
|
+
*/
|
|
261
|
+
createCubeTextureViewAsRenderTarget(_textureHandle: WebGLResourceHandle, _faceIdx: Index, _mipLevel: Index): WebGLResourceHandle;
|
|
262
|
+
deleteTexture(textureHandle: WebGLResourceHandle): void;
|
|
263
|
+
generateMipmaps2d(textureHandle: WebGLResourceHandle, width: number, height: number): void;
|
|
264
|
+
generateMipmapsCube(textureHandle: WebGLResourceHandle, _width: number, _height: number): void;
|
|
265
|
+
/**
|
|
266
|
+
* Reads the pixels of a render target texture as RGBA8, from the frame buffer object it is attached to.
|
|
267
|
+
* Normalized fixed-point buffers are read as stored; floating-point buffers are clamped to [0, 1] and converted
|
|
268
|
+
* to 8 bits, as the WebGPU backend does.
|
|
269
|
+
*
|
|
270
|
+
* @param _textureHandle - Not used: the texture is read through its frame buffer object
|
|
271
|
+
* @param width - Width of the region to read
|
|
272
|
+
* @param height - Height of the region to read
|
|
273
|
+
* @param frameBufferUid - Handle to the frame buffer object the texture is attached to
|
|
274
|
+
* @param colorAttachmentIndex - Index of the color attachment of the texture
|
|
275
|
+
* @returns Promise that resolves to the pixel data, `width * 4` bytes per row, starting from the bottom row
|
|
276
|
+
*/
|
|
277
|
+
getTexturePixelData(_textureHandle: WebGLResourceHandle, width: number, height: number, frameBufferUid: WebGLResourceHandle, colorAttachmentIndex: number): Promise<Uint8Array>;
|
|
278
|
+
/**
|
|
279
|
+
* Internal helper method for common texture setup operations.
|
|
280
|
+
* This method handles mipmap generation and texture parameter setup.
|
|
281
|
+
*
|
|
282
|
+
* @param gl - The WebGL2 rendering context
|
|
283
|
+
* @param width - Width of the texture
|
|
284
|
+
* @param height - Height of the texture
|
|
285
|
+
* @param generateMipmap - Whether to generate mipmaps
|
|
286
|
+
*/
|
|
287
|
+
private __generateMipmapsAndUnbind;
|
|
288
|
+
/**
|
|
289
|
+
* Reads a region of mip level 0 of a 2D texture as RGBA8, through a temporary frame buffer object.
|
|
290
|
+
* Normalized fixed-point textures are read as stored; floating-point textures are clamped to [0, 1] and converted
|
|
291
|
+
* to 8 bits, as the WebGPU backend does. Texels outside the texture are returned as zero.
|
|
292
|
+
*
|
|
293
|
+
* @param texUid - Handle to the texture to read from
|
|
294
|
+
* @param x - X offset of the region, in texels from the left
|
|
295
|
+
* @param y - Y offset of the region, in texels from texel row 0 (the bottom row of a render target, the first row of
|
|
296
|
+
* the uploaded image or data of another texture)
|
|
297
|
+
* @param width - Width of the region to read
|
|
298
|
+
* @param height - Height of the region to read
|
|
299
|
+
* @returns The pixel data, `width * 4` bytes per row from texel row `y`, or an empty array for a missing texture or
|
|
300
|
+
* an empty region
|
|
301
|
+
* @throws When the texture cannot be attached as a color buffer (e.g. a depth, compressed or RGB float texture)
|
|
302
|
+
*/
|
|
303
|
+
getPixelDataFromTexture(texUid: WebGLResourceHandle, x: number, y: number, width: number, height: number): Uint8Array<ArrayBufferLike>;
|
|
304
|
+
/**
|
|
305
|
+
* Reads pixel data directly from a 2D texture asynchronously.
|
|
306
|
+
* This is the async version of getPixelDataFromTexture for API consistency with WebGPU.
|
|
307
|
+
*
|
|
308
|
+
* @param texUid - Handle to the texture to read from
|
|
309
|
+
* @param x - X offset to start reading from
|
|
310
|
+
* @param y - Y offset to start reading from
|
|
311
|
+
* @param width - Width of the region to read
|
|
312
|
+
* @param height - Height of the region to read
|
|
313
|
+
* @returns Promise resolving to the pixel data as a Uint8Array in RGBA format
|
|
314
|
+
*/
|
|
315
|
+
getPixelDataFromTextureAsync(texUid: WebGLResourceHandle, x: number, y: number, width: number, height: number): Promise<Uint8Array>;
|
|
316
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MathUtil as d}from"../foundation/math/MathUtil.js";import{Logger as R}from"../foundation/misc/Logger.js";import{MiscUtil as g}from"../foundation/misc/MiscUtil.js";import{GL_TEXTURE_2D as c}from"../types/WebGLConstants.js";import{readColorAttachmentAsRgba8 as l,withReadFramebuffer as b}from"./readColorAttachmentAsRgba8.js";import{WebGLCompressedTextures as h}from"./WebGLCompressedTextures.js";import{WebGLSamplers as L}from"./WebGLSamplers.js";import{WebGLTextureUploads as G}from"./WebGLTextureUploads.js";var p=class{constructor(e){this.x_=e,this.aL=new h({getContextWrapper:()=>this.x_.getContextWrapper(),registerResource:t=>this.x_.registerResource(t)}),this.rL=new L({getContextWrapper:()=>this.x_.getContextWrapper(),registerResource:t=>this.x_.registerResource(t)}),this.nL=new G({getContextWrapper:()=>this.x_.getContextWrapper(),registerResource:t=>this.x_.registerResource(t),getWebGLResource:t=>this.x_.getWebGLResource(t),generateMipmapsAndUnbind:(t,a,o,n)=>this.oL(t,a,o,n)})}get u_(){return this.x_.getContextWrapper()}T_(e){return this.x_.registerResource(e)}getWebGLResource(e){return this.x_.getWebGLResource(e)}createTexStorage2D({levels:e,internalFormat:t,width:a,height:o}){let n=this.u_.getRawContextAsWebGL2(),r=n.createTexture();this.u_.bindTexture2D(15,r),n.texStorage2D(c,e,t.index,a,o);let u=this.T_(r);return this.u_.unbindTexture2D(15),u}createTextureSampler({magFilter:e,minFilter:t,wrapS:a,wrapT:o,wrapR:n,anisotropy:r,shadowCompareMode:u}){return this.rL.createTextureSampler({magFilter:e,minFilter:t,wrapS:a,wrapT:o,wrapR:n,anisotropy:r,shadowCompareMode:u})}createOrGetTextureSamplerClampToEdgeLinear(){return this.rL.createOrGetTextureSamplerClampToEdgeLinear()}createOrGetTextureSamplerRepeatNearest(){return this.rL.createOrGetTextureSamplerRepeatNearest()}createOrGetTextureSamplerRepeatTriLinear(){return this.rL.createOrGetTextureSamplerRepeatTriLinear()}createOrGetTextureSamplerShadow(){return this.rL.createOrGetTextureSamplerShadow()}async createTextureFromImageBitmapData(e,{internalFormat:t,width:a,height:o,format:n,type:r,generateMipmap:u}){return this.nL.createTextureFromImageBitmapData(e,{internalFormat:t,width:a,height:o,format:n,type:r,generateMipmap:u})}async createTextureFromHTMLImageElement(e,{internalFormat:t,width:a,height:o,format:n,type:r,generateMipmap:u}){return this.nL.createTextureFromHTMLImageElement(e,{internalFormat:t,width:a,height:o,format:n,type:r,generateMipmap:u})}loadImageToMipLevelOfTexture2D({mipLevel:e,textureUid:t,format:a,type:o,xOffset:n,yOffset:r,width:u,height:s,rowSizeByPixel:i,data:m}){this.nL.loadImageToMipLevelOfTexture2D({mipLevel:e,textureUid:t,format:a,type:o,xOffset:n,yOffset:r,width:u,height:s,rowSizeByPixel:i,data:m})}createTextureArray(e,t,a,o,n,r,u,s){let i=this.u_.getRawContextAsWebGL2(),m=i.createTexture(),x=this.T_(m);this.u_.bindTexture2DArray(15,m),i.texStorage3D(i.TEXTURE_2D_ARRAY,o,n.index,e,t,a);for(let T=0;T<a;T++)i.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,T,e,t,1,r.index,u.index,s);return this.u_.unbindTexture2DArray(15),x}allocateTexture({format:e,width:t,height:a,mipLevelCount:o}){let n=this.u_.getRawContextAsWebGL2(),r=n.createTexture(),u=this.T_(r);return this.u_.bindTexture2D(15,r),n.texStorage2D(c,o,e.index,t,a),this.u_.unbindTexture2D(15),u}createTextureFromTypedArray(e,{internalFormat:t,width:a,height:o,format:n,type:r,generateMipmap:u}){let s=this.u_.getRawContextAsWebGL2(),i=s.createTexture(),m=this.T_(i);this.u_.bindTexture2D(15,i);let x=u?d.getMipLevelCount(a,o):1;return s.texStorage2D(c,x,t.index,a,o),s.texSubImage2D(s.TEXTURE_2D,0,0,0,a,o,n.index,r.index,e),this.oL(s,a,o,u),m}async createCompressedTexture(e,t){return this.aL.createCompressedTexture(e,t)}createCompressedTextureFromBasis(e,{border:t}){return this.aL.createCompressedTextureFromBasis(e,{border:t})}createRenderTargetTexture({width:e,height:t,mipLevelCount:a,format:o}){let n=this.u_.getRawContextAsWebGL2(),r=n.createTexture(),u=this.T_(r);return this.u_.bindTexture2D(15,r),n.texStorage2D(n.TEXTURE_2D,a,o.index,e,t),this.u_.unbindTexture2D(15),u}createRenderTargetTextureArray({width:e,height:t,internalFormat:a,arrayLength:o}){let n=this.u_.getRawContextAsWebGL2(),r=n.createTexture(),u=this.T_(r);return this.u_.bindTexture2DArray(15,r),n.texStorage3D(n.TEXTURE_2D_ARRAY,1,a.index,e,t,o),this.u_.unbindTexture2DArray(15),u}createRenderTargetTextureCube({width:e,height:t,mipLevelCount:a,format:o}){let n=this.u_.getRawContextAsWebGL2(),r=n.createTexture(),u=this.T_(r);return this.u_.bindTextureCube(15,r),n.texStorage2D(n.TEXTURE_CUBE_MAP,a,o.index,e,t),this.u_.unbindTextureCube(15),u}setWebGLTextureDirectly(e){let t=e;return this.T_(t)}async createTextureFromDataUri(e,{internalFormat:t,format:a,type:o,generateMipmap:n}){return new Promise(r=>{let u=new Image;e.match(/^data:/)||(u.crossOrigin="Anonymous"),u.onload=()=>{let s=u.width,i=u.height,m=this.createTextureFromHTMLImageElement(u,{internalFormat:t,width:s,height:i,format:a,type:o,generateMipmap:n});r(m)},u.src=e})}updateTexture(e,t,{level:a,offsetX:o,offsetY:n,width:r,height:u,format:s,type:i}){let m=this.getWebGLResource(e);this.u_.bindTexture2D(15,m);let x=this.u_.getRawContextAsWebGL2();x.texSubImage2D(x.TEXTURE_2D,a,o,n,r,u,s.index,i.index,t),this.u_.unbindTexture2D(15)}createTextureView2d(e){return-1}createTextureViewAsRenderTarget(e){return-1}createTextureViewCube(e){return-1}createTextureView2dArray(e,t){return-1}createTextureView2dArrayAsRenderTarget(e,t,a){return-1}createCubeTextureViewAsRenderTarget(e,t,a){return-1}deleteTexture(e){let t=this.getWebGLResource(e),a=this.u_.getRawContext();t!=null&&(a.deleteTexture(t),this.x_.deleteWebGLResource(e),R.default.debug(`gl.deleteTexture called: ${e}`))}generateMipmaps2d(e,t,a){if(!d.isPowerOfTwoTexture(t,a)&&g.isIOS())return;let o=this.u_.getRawContext(),n=this.getWebGLResource(e);this.u_.bindTexture2D(15,n),o.generateMipmap(o.TEXTURE_2D),this.u_.unbindTexture2D(15)}generateMipmapsCube(e,t,a){let o=this.u_.getRawContext(),n=this.getWebGLResource(e);this.u_.bindTextureCube(15,n),o.generateMipmap(o.TEXTURE_CUBE_MAP),this.u_.unbindTextureCube(15)}async getTexturePixelData(e,t,a,o,n){let r=this.u_.getRawContextAsWebGL2(),u=this.getWebGLResource(o);if(u==null)throw new Error("getTexturePixelData: the texture is not attached to a frame buffer object.");if(n<0)throw new Error("getTexturePixelData: only a color attachment can be read back, not a depth or stencil one.");let s=r.COLOR_ATTACHMENT0+n;return b(r,u,s,()=>l(r,s,0,0,t,a))}oL(e,t,a,o){e.generateMipmap(e.TEXTURE_2D),this.u_.unbindTexture2D(15)}getPixelDataFromTexture(e,t,a,o,n){let r=this.u_.getRawContextAsWebGL2(),u=this.getWebGLResource(e);if(u==null||o<=0||n<=0)return new Uint8Array(0);let s=r.createFramebuffer();try{return b(r,s,r.COLOR_ATTACHMENT0,()=>{r.framebufferTexture2D(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,u,0);let i=r.checkFramebufferStatus(r.READ_FRAMEBUFFER);if(i!==r.FRAMEBUFFER_COMPLETE)throw new Error(`getPixelDataFromTexture: the texture cannot be read back (framebuffer status 0x${i.toString(16)}).`);return l(r,r.COLOR_ATTACHMENT0,t,a,o,n)})}finally{r.deleteFramebuffer(s)}}async getPixelDataFromTextureAsync(e,t,a,o,n){return this.getPixelDataFromTexture(e,t,a,o,n)}};export{p as WebGLTextures};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Byte, TypedArray, WebGLResourceHandle } from '../types/CommonTypes';
|
|
2
|
+
import type { WebGLContextWrapper } from './WebGLContextWrapper';
|
|
3
|
+
import type { WebGLResource } from './WebGLResourceRepository';
|
|
4
|
+
/**
|
|
5
|
+
* What `WebGLUniformBuffers` needs from the resource repository that owns it.
|
|
6
|
+
*/
|
|
7
|
+
export interface WebGLUniformBufferResources {
|
|
8
|
+
/** The current WebGL context wrapper, which is replaced when a context is added. */
|
|
9
|
+
getContextWrapper(): WebGLContextWrapper | undefined;
|
|
10
|
+
/** Registers a WebGL object and returns its resource handle. */
|
|
11
|
+
registerResource(obj: WebGLResource): WebGLResourceHandle;
|
|
12
|
+
/** Returns the WebGL object of a resource handle. */
|
|
13
|
+
getWebGLResource(handle: WebGLResourceHandle): WebGLResource | null;
|
|
14
|
+
/** Removes a resource handle from the repository. */
|
|
15
|
+
deleteWebGLResource(handle: WebGLResourceHandle): void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Creates and updates the uniform buffers of the WebGL backend (the shared uniform block area and the morph
|
|
19
|
+
* target buffers) and binds them.
|
|
20
|
+
*
|
|
21
|
+
* Owned by `WebGLResourceRepository`, which exposes these operations through its public methods.
|
|
22
|
+
*/
|
|
23
|
+
export declare class WebGLUniformBuffers {
|
|
24
|
+
private __resources;
|
|
25
|
+
constructor(resources: WebGLUniformBufferResources);
|
|
26
|
+
private get __glw();
|
|
27
|
+
private __registerResource;
|
|
28
|
+
private getWebGLResource;
|
|
29
|
+
createUniformBufferWithBufferView(bufferView: TypedArray | DataView): number;
|
|
30
|
+
updateUniformBuffer(uboUid: WebGLResourceHandle, typedArray: TypedArray, offsetByte: Byte, arrayLength: Byte): void;
|
|
31
|
+
deleteUniformBuffer(uboUid: WebGLResourceHandle): void;
|
|
32
|
+
setupUniformBufferDataArea(typedArray?: TypedArray): number;
|
|
33
|
+
setUniformBlockBindingForMorphOffsetsAndWeights(shaderProgramUid: WebGLResourceHandle, morphOffsetsUBOUid: WebGLResourceHandle, morphWeightsUBOUid: WebGLResourceHandle): void;
|
|
34
|
+
setUniformBlockBindingForMorphOffsetsAndWeightsWithoutShaderProgram(morphOffsetsUBOUid: WebGLResourceHandle, morphWeightsUBOUid: WebGLResourceHandle): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Is as c}from"../foundation/misc/Is.js";var a=class{constructor(r){this.x_=r}get u_(){return this.x_.getContextWrapper()}T_(r){return this.x_.registerResource(r)}getWebGLResource(r){return this.x_.getWebGLResource(r)}createUniformBufferWithBufferView(r){let e=this.u_.getRawContextAsWebGL2();if(e==null)throw new Error("No WebGLRenderingContext set as Default.");let t=e.createBuffer(),o=this.T_(t);return e.bindBuffer(e.UNIFORM_BUFFER,t),e.bufferData(e.UNIFORM_BUFFER,r,e.DYNAMIC_DRAW),e.bindBuffer(e.UNIFORM_BUFFER,null),o}updateUniformBuffer(r,e,t,o){let s=this.u_.getRawContextAsWebGL2(),n=this.getWebGLResource(r);s.bindBuffer(s.UNIFORM_BUFFER,n),s.bufferSubData(s.UNIFORM_BUFFER,0,e,t,o),s.bindBuffer(s.UNIFORM_BUFFER,null)}deleteUniformBuffer(r){let e=this.u_.getRawContext();e==null&&new Error("No WebGLRenderingContext set as Default.");let t=this.getWebGLResource(r);this.x_.deleteWebGLResource(r),e.deleteBuffer(t)}setupUniformBufferDataArea(r){let e=this.u_.getRawContextAsWebGL2();e==null&&new Error("No WebGLRenderingContext set as Default.");let t=e.createBuffer(),o=this.T_(t),s=this.u_.getMaxConventionUniformBlocks(),n=this.u_.getAlignedMaxUniformBlockSize(),u=n*s,i=new Float32Array(u/4);c.exist(r)&&i.set(r.subarray(0,i.length)),e.bindBuffer(e.UNIFORM_BUFFER,t),e.bufferData(e.UNIFORM_BUFFER,i,e.DYNAMIC_DRAW,0,0);for(let f=0;f<s;f++)e.bindBufferRange(e.UNIFORM_BUFFER,f,t,n*f,n);return e.bindBuffer(e.UNIFORM_BUFFER,null),o}setUniformBlockBindingForMorphOffsetsAndWeights(r,e,t){let o=this.u_.getRawContextAsWebGL2(),s=this.getWebGLResource(r),n=this.getWebGLResource(e),u=this.getWebGLResource(t),i=o.getUniformBlockIndex(s,"UniformMorphOffsets"),f=o.getUniformBlockIndex(s,"UniformMorphWeights");o.uniformBlockBinding(s,i,0),o.uniformBlockBinding(s,f,1),o.bindBufferBase(o.UNIFORM_BUFFER,0,n),o.bindBufferBase(o.UNIFORM_BUFFER,1,u)}setUniformBlockBindingForMorphOffsetsAndWeightsWithoutShaderProgram(r,e){let t=this.u_.getRawContextAsWebGL2(),o=this.getWebGLResource(r),s=this.getWebGLResource(e);t.bindBufferBase(t.UNIFORM_BUFFER,0,o),t.bindBufferBase(t.UNIFORM_BUFFER,1,s)}};export{a as WebGLUniformBuffers};
|