rhodonite 0.4.2 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION-FILE +2 -2
- package/dist/esm/effekseer/EffekseerComponent.d.ts +52 -45
- package/dist/esm/effekseer/main.d.ts +6 -6
- package/dist/esm/foundation/cameras/AbstractCameraController.d.ts +14 -14
- package/dist/esm/foundation/cameras/ICameraController.d.ts +9 -9
- package/dist/esm/foundation/cameras/OrbitCameraController.d.ts +128 -123
- package/dist/esm/foundation/cameras/WalkThroughCameraController.d.ts +75 -75
- package/dist/esm/foundation/components/AnimationComponent.d.ts +81 -94
- package/dist/esm/foundation/components/BlendShapeComponent.d.ts +14 -14
- package/dist/esm/foundation/components/CameraComponent.d.ts +116 -116
- package/dist/esm/foundation/components/CameraControllerComponent.d.ts +16 -16
- package/dist/esm/foundation/components/LightComponent.d.ts +28 -28
- package/dist/esm/foundation/components/MeshComponent.d.ts +50 -50
- package/dist/esm/foundation/components/MeshRendererComponent.d.ts +57 -57
- package/dist/esm/foundation/components/PhysicsComponent.d.ts +12 -12
- package/dist/esm/foundation/components/SceneGraphComponent.d.ts +114 -81
- package/dist/esm/foundation/components/SkeletalComponent.d.ts +50 -50
- package/dist/esm/foundation/components/TransformComponent.d.ts +91 -91
- package/dist/esm/foundation/components/WellKnownComponentTIDs.d.ts +16 -16
- package/dist/esm/foundation/core/Component.d.ts +216 -216
- package/dist/esm/foundation/core/ComponentRepository.d.ts +59 -59
- package/dist/esm/foundation/core/Config.d.ts +20 -19
- package/dist/esm/foundation/core/Entity.d.ts +84 -84
- package/dist/esm/foundation/core/EntityRepository.d.ts +62 -62
- package/dist/esm/foundation/core/GlobalDataRepository.d.ts +32 -31
- package/dist/esm/foundation/core/MemoryManager.d.ts +29 -29
- package/dist/esm/foundation/core/RnObject.d.ts +96 -96
- package/dist/esm/foundation/definitions/AlphaMode.d.ts +15 -15
- package/dist/esm/foundation/definitions/AnimationAttribute.d.ts +13 -13
- package/dist/esm/foundation/definitions/AnimationInterpolation.d.ts +12 -12
- package/dist/esm/foundation/definitions/BasisCompressionType.d.ts +26 -26
- package/dist/esm/foundation/definitions/BoneDataType.d.ts +13 -13
- package/dist/esm/foundation/definitions/BufferUse.d.ts +13 -13
- package/dist/esm/foundation/definitions/CameraControllerType.d.ts +11 -11
- package/dist/esm/foundation/definitions/CameraType.d.ts +12 -12
- package/dist/esm/foundation/definitions/ComponentType.d.ts +32 -32
- package/dist/esm/foundation/definitions/CompositionType.d.ts +39 -38
- package/dist/esm/foundation/definitions/CompressionTextureType.d.ts +48 -48
- package/dist/esm/foundation/definitions/FileType.d.ts +17 -17
- package/dist/esm/foundation/definitions/GpuState.d.ts +10 -10
- package/dist/esm/foundation/definitions/HdriFormat.d.ts +10 -10
- package/dist/esm/foundation/definitions/LightType.d.ts +13 -13
- package/dist/esm/foundation/definitions/PixelFormat.d.ts +10 -10
- package/dist/esm/foundation/definitions/PrimitiveMode.d.ts +15 -15
- package/dist/esm/foundation/definitions/ProcessApproach.d.ts +19 -19
- package/dist/esm/foundation/definitions/ProcessStage.d.ts +18 -18
- package/dist/esm/foundation/definitions/RenderBufferTarget.d.ts +27 -27
- package/dist/esm/foundation/definitions/ShaderNode.d.ts +11 -11
- package/dist/esm/foundation/definitions/ShaderSemantics.d.ts +119 -119
- package/dist/esm/foundation/definitions/ShaderType.d.ts +13 -13
- package/dist/esm/foundation/definitions/ShaderVariableType.d.ts +11 -11
- package/dist/esm/foundation/definitions/ShaderVariableUpdateInterval.d.ts +12 -12
- package/dist/esm/foundation/definitions/ShadingModel.d.ts +12 -12
- package/dist/esm/foundation/definitions/ShadowMap.d.ts +11 -11
- package/dist/esm/foundation/definitions/TextureParameter.d.ts +37 -37
- package/dist/esm/foundation/definitions/VertexAttribute.d.ts +38 -38
- package/dist/esm/foundation/definitions/visibility.d.ts +12 -12
- package/dist/esm/foundation/enhanced_js_objects/Array.d.ts +15 -15
- package/dist/esm/foundation/exporter/Gltf2Exporter.d.ts +27 -22
- package/dist/esm/foundation/geometry/Frustum.d.ts +37 -37
- package/dist/esm/foundation/geometry/Mesh.d.ts +148 -124
- package/dist/esm/foundation/geometry/Plane.d.ts +30 -26
- package/dist/esm/foundation/geometry/Primitive.d.ts +78 -78
- package/dist/esm/foundation/geometry/Sphere.d.ts +12 -12
- package/dist/esm/foundation/gizmos/AABBGizmo.d.ts +29 -10
- package/dist/esm/foundation/gizmos/Gizmo.d.ts +39 -16
- package/dist/esm/foundation/gizmos/LocatorGizmo.d.ts +28 -0
- package/dist/esm/foundation/helpers/EntityHelper.d.ts +11 -11
- package/dist/esm/foundation/helpers/MaterialHelper.d.ts +173 -167
- package/dist/esm/foundation/helpers/MeshHelper.d.ts +4 -4
- package/dist/esm/foundation/helpers/RenderableHelper.d.ts +18 -18
- package/dist/esm/foundation/importer/AnimationAssigner.d.ts +16 -16
- package/dist/esm/foundation/importer/DrcPointCloudImporter.d.ts +69 -69
- package/dist/esm/foundation/importer/FormatDetector.d.ts +5 -5
- package/dist/esm/foundation/importer/Gltf1Importer.d.ts +45 -45
- package/dist/esm/foundation/importer/Gltf2Importer.d.ts +46 -46
- package/dist/esm/foundation/importer/GltfImporter.d.ts +57 -57
- package/dist/esm/foundation/importer/ILoaderExtension.d.ts +11 -11
- package/dist/esm/foundation/importer/ModelConverter.d.ts +78 -78
- package/dist/esm/foundation/importer/RhodoniteImportExtension.d.ts +9 -9
- package/dist/esm/foundation/importer/VRMImporter.d.ts +15 -15
- package/dist/esm/foundation/materials/core/AbstractMaterialNode.d.ts +124 -124
- package/dist/esm/foundation/materials/core/AbstractShaderNode.d.ts +33 -33
- package/dist/esm/foundation/materials/core/Material.d.ts +181 -149
- package/dist/esm/foundation/materials/core/ShaderGraphResolver.d.ts +16 -16
- package/dist/esm/foundation/materials/core/ShaderityUtility.d.ts +30 -32
- package/dist/esm/foundation/materials/nodes/AddShaderNode.d.ts +6 -6
- package/dist/esm/foundation/materials/nodes/AttributeNormalShaderNode.d.ts +4 -4
- package/dist/esm/foundation/materials/nodes/AttributePositionShaderNode.d.ts +4 -4
- package/dist/esm/foundation/materials/nodes/BlockBeginShaderNode.d.ts +9 -9
- package/dist/esm/foundation/materials/nodes/BlockEndShaderNode.d.ts +7 -7
- package/dist/esm/foundation/materials/nodes/ConstantVariableShaderNode.d.ts +7 -7
- package/dist/esm/foundation/materials/nodes/DotProductShaderNode.d.ts +6 -6
- package/dist/esm/foundation/materials/nodes/GreaterShaderNode.d.ts +6 -6
- package/dist/esm/foundation/materials/nodes/IfStatementShaderNode.d.ts +4 -4
- package/dist/esm/foundation/materials/nodes/MultiplyShaderNode.d.ts +6 -6
- package/dist/esm/foundation/materials/nodes/NormalMatrixShaderNode.d.ts +4 -4
- package/dist/esm/foundation/materials/nodes/NormalizeShaderNode.d.ts +6 -6
- package/dist/esm/foundation/materials/nodes/OutColorShaderNode.d.ts +4 -4
- package/dist/esm/foundation/materials/nodes/OutPositionShaderNode.d.ts +4 -4
- package/dist/esm/foundation/materials/nodes/ProjectionMatrixShaderNode.d.ts +4 -4
- package/dist/esm/foundation/materials/nodes/ScalarToVector4ShaderNode.d.ts +4 -4
- package/dist/esm/foundation/materials/nodes/TextureFetchMaterialNode.d.ts +6 -6
- package/dist/esm/foundation/materials/nodes/UniformDataShaderNode.d.ts +8 -8
- package/dist/esm/foundation/materials/nodes/VaryingInVariableShaderNode.d.ts +7 -7
- package/dist/esm/foundation/materials/nodes/VaryingOutVariableShaderNode.d.ts +7 -7
- package/dist/esm/foundation/materials/nodes/Vector3AndScalarToVector4ShaderNode.d.ts +4 -4
- package/dist/esm/foundation/materials/nodes/ViewMatrixShaderNode.d.ts +4 -4
- package/dist/esm/foundation/materials/nodes/WireframeMaterialNode.d.ts +4 -4
- package/dist/esm/foundation/materials/nodes/WorldMatrixShaderNode.d.ts +4 -4
- package/dist/esm/foundation/materials/singles/ClassicShadingSingleMaterialNode.d.ts +16 -16
- package/dist/esm/foundation/materials/singles/ColorGradingUsingLUTsSingleMaterialNode.d.ts +16 -16
- package/dist/esm/foundation/materials/singles/CustomSingleMaterialNode.d.ts +30 -31
- package/dist/esm/foundation/materials/singles/DepthEncodeSingleMaterialNode.d.ts +20 -20
- package/dist/esm/foundation/materials/singles/DetectHighLuminanceSingleMaterialNode.d.ts +16 -16
- package/dist/esm/foundation/materials/singles/EntityUIDOutputSingleMaterialNode.d.ts +11 -11
- package/dist/esm/foundation/materials/singles/EnvConstantSingleMaterialNode.d.ts +14 -14
- package/dist/esm/foundation/materials/singles/FXAA3QualitySingleMaterialNode.d.ts +11 -11
- package/dist/esm/foundation/materials/singles/FurnaceTestSingleMaterialNode.d.ts +17 -17
- package/dist/esm/foundation/materials/singles/GammaCorrectionSingleMaterialNode.d.ts +11 -11
- package/dist/esm/foundation/materials/singles/GaussianBlurForEncodedDepthSingleMaterialNode.d.ts +27 -27
- package/dist/esm/foundation/materials/singles/GaussianBlurSingleMaterialNode.d.ts +27 -27
- package/dist/esm/foundation/materials/singles/MToonSingleMaterialNode.d.ts +52 -52
- package/dist/esm/foundation/materials/singles/MatCapSingleMaterialNode.d.ts +14 -14
- package/dist/esm/foundation/materials/singles/PbrExtendedShadingSingleMaterialNode.d.ts +29 -29
- package/dist/esm/foundation/materials/singles/PbrShadingSingleMaterialNode.d.ts +36 -36
- package/dist/esm/foundation/materials/singles/ShaderitySingleMaterialNode.d.ts +17 -0
- package/dist/esm/foundation/materials/singles/ShadowMapDecodeClassicSingleMaterialNode.d.ts +41 -41
- package/dist/esm/foundation/materials/singles/SkinPbrShadingSingleMaterialNode.d.ts +26 -26
- package/dist/esm/foundation/materials/singles/SynthesizeHDRSingleMaterialNode.d.ts +39 -39
- package/dist/esm/foundation/materials/singles/VarianceShadowMapDecodeClassicSingleMaterialNode.d.ts +52 -52
- package/dist/esm/foundation/math/AABB.d.ts +34 -34
- package/dist/esm/foundation/math/AbstractMathNumber.d.ts +6 -6
- package/dist/esm/foundation/math/AbstractMatrix.d.ts +14 -14
- package/dist/esm/foundation/math/AbstractQuaternion.d.ts +25 -25
- package/dist/esm/foundation/math/AbstractVector.d.ts +21 -21
- package/dist/esm/foundation/math/ColorRgb.d.ts +26 -27
- package/dist/esm/foundation/math/ColorRgba.d.ts +25 -25
- package/dist/esm/foundation/math/IColor.d.ts +64 -64
- package/dist/esm/foundation/math/IMathNumber.d.ts +3 -3
- package/dist/esm/foundation/math/IMatrix.d.ts +226 -226
- package/dist/esm/foundation/math/IQuaternion.d.ts +64 -64
- package/dist/esm/foundation/math/IVector.d.ts +209 -209
- package/dist/esm/foundation/math/IdentityMatrix33.d.ts +40 -40
- package/dist/esm/foundation/math/IdentityMatrix44.d.ts +45 -45
- package/dist/esm/foundation/math/ImageUtil.d.ts +19 -19
- package/dist/esm/foundation/math/LogQuaternion.d.ts +12 -12
- package/dist/esm/foundation/math/MathClassUtil.d.ts +37 -37
- package/dist/esm/foundation/math/MathUtil.d.ts +55 -55
- package/dist/esm/foundation/math/Matrix22.d.ts +69 -69
- package/dist/esm/foundation/math/Matrix33.d.ts +86 -86
- package/dist/esm/foundation/math/Matrix44.d.ts +122 -122
- package/dist/esm/foundation/math/MutableColorRgb.d.ts +32 -33
- package/dist/esm/foundation/math/MutableColorRgba.d.ts +33 -33
- package/dist/esm/foundation/math/MutableMatrix22.d.ts +80 -80
- package/dist/esm/foundation/math/MutableMatrix33.d.ts +110 -110
- package/dist/esm/foundation/math/MutableMatrix44.d.ts +149 -149
- package/dist/esm/foundation/math/MutableQuaternion.d.ts +48 -48
- package/dist/esm/foundation/math/MutableScalar.d.ts +34 -34
- package/dist/esm/foundation/math/MutableVector2.d.ts +80 -75
- package/dist/esm/foundation/math/MutableVector3.d.ts +98 -94
- package/dist/esm/foundation/math/MutableVector4.d.ts +87 -85
- package/dist/esm/foundation/math/Quaternion.d.ts +53 -51
- package/dist/esm/foundation/math/Scalar.d.ts +40 -36
- package/dist/esm/foundation/math/Vector2.d.ts +140 -126
- package/dist/esm/foundation/math/Vector3.d.ts +166 -150
- package/dist/esm/foundation/math/Vector4.d.ts +146 -146
- package/dist/esm/foundation/math/VectorN.d.ts +5 -5
- package/dist/esm/foundation/math/raw/raw_extension.d.ts +59 -23
- package/dist/esm/foundation/memory/Accessor.d.ts +182 -182
- package/dist/esm/foundation/memory/Buffer.d.ts +37 -37
- package/dist/esm/foundation/memory/BufferView.d.ts +60 -60
- package/dist/esm/foundation/misc/Cache.d.ts +19 -0
- package/dist/esm/foundation/misc/DataUtil.d.ts +42 -38
- package/dist/esm/foundation/misc/EnumIO.d.ts +33 -33
- package/dist/esm/foundation/misc/Is.d.ts +26 -26
- package/dist/esm/foundation/misc/ManualCache.d.ts +30 -0
- package/dist/esm/foundation/misc/MiscUtil.d.ts +37 -30
- package/dist/esm/foundation/misc/Option.d.ts +72 -72
- package/dist/esm/foundation/misc/Result.d.ts +40 -40
- package/dist/esm/foundation/misc/RnPromise.d.ts +27 -27
- package/dist/esm/foundation/misc/Time.d.ts +16 -16
- package/dist/esm/foundation/physics/PhysicsStrategy.d.ts +2 -2
- package/dist/esm/foundation/physics/SphereCollider.d.ts +5 -5
- package/dist/esm/foundation/physics/VRMColliderGroup.d.ts +6 -6
- package/dist/esm/foundation/physics/VRMSpringBoneGroup.d.ts +14 -14
- package/dist/esm/foundation/physics/VRMSpringBonePhysicsStrategy.d.ts +39 -39
- package/dist/esm/foundation/renderer/CGAPIResourceRepository.d.ts +5 -5
- package/dist/esm/foundation/renderer/Expression.d.ts +21 -21
- package/dist/esm/foundation/renderer/FrameBuffer.d.ts +32 -32
- package/dist/esm/foundation/renderer/RenderPass.d.ts +113 -115
- package/dist/esm/foundation/system/EventPubSub.d.ts +19 -19
- package/dist/esm/foundation/system/ModuleManager.d.ts +10 -10
- package/dist/esm/foundation/system/System.d.ts +23 -23
- package/dist/esm/foundation/system/SystemState.d.ts +4 -4
- package/dist/esm/foundation/textures/AbstractTexture.d.ts +60 -60
- package/dist/esm/foundation/textures/CubeTexture.d.ts +33 -33
- package/dist/esm/foundation/textures/IRenderable.d.ts +10 -10
- package/dist/esm/foundation/textures/RenderBuffer.d.ts +23 -23
- package/dist/esm/foundation/textures/RenderTargetTexture.d.ts +39 -39
- package/dist/esm/foundation/textures/Texture.d.ts +90 -90
- package/dist/esm/foundation/textures/TextureDataFloat.d.ts +20 -18
- package/dist/esm/foundation/textures/VideoTexture.d.ts +63 -63
- package/dist/esm/index.d.ts +927 -917
- package/dist/esm/index.js +44596 -41597
- package/dist/esm/pbr/main.d.ts +5 -5
- package/dist/esm/sparkgear/SparkGearComponent.d.ts +54 -54
- package/dist/esm/sparkgear/main.d.ts +6 -6
- package/dist/esm/types/BasisTexture.d.ts +23 -23
- package/dist/esm/types/CommonTypes.d.ts +33 -29
- package/dist/esm/types/KTX2Texture.d.ts +67 -67
- package/dist/esm/types/RnM2.d.ts +329 -329
- package/dist/esm/types/TypeConverter.d.ts +1 -1
- package/dist/esm/types/TypeGenerators.d.ts +4 -4
- package/dist/esm/types/VRM.d.ts +160 -160
- package/dist/esm/types/glTF.d.ts +387 -385
- package/dist/esm/types/glTF1.d.ts +88 -88
- package/dist/esm/types/glTF2.d.ts +391 -338
- package/dist/esm/webgl/WebGLContextWrapper.d.ts +99 -99
- package/dist/esm/webgl/WebGLExtendedTypes.d.ts +14 -9
- package/dist/esm/webgl/WebGLExtension.d.ts +24 -24
- package/dist/esm/webgl/WebGLResourceRepository.d.ts +351 -221
- package/dist/esm/webgl/WebGLStrategy.d.ts +27 -22
- package/dist/esm/webgl/WebGLStrategyCommonMethod.d.ts +54 -30
- package/dist/esm/webgl/WebGLStrategyFastest.d.ts +54 -51
- package/dist/esm/webgl/WebGLStrategyUniform.d.ts +44 -40
- package/dist/esm/webgl/getRenderingStrategy.d.ts +4 -4
- package/dist/esm/webgl/main.d.ts +17 -17
- package/dist/esm/webgl/shaders/GLSLShader.d.ts +48 -48
- package/dist/esm/webgl/shaders/nodes/BlockBeginShader.d.ts +16 -16
- package/dist/esm/webgl/shaders/nodes/BlockEndShader.d.ts +16 -16
- package/dist/esm/webgl/shaders/nodes/ClassicShadingShader.d.ts +17 -17
- package/dist/esm/webgl/shaders/nodes/ConstantVariableShader.d.ts +18 -18
- package/dist/esm/webgl/shaders/nodes/EndShader.d.ts +17 -17
- package/dist/esm/webgl/shaders/nodes/IfStatementShader.d.ts +12 -12
- package/dist/esm/webgl/shaders/nodes/TextureFetchShader.d.ts +18 -18
- package/dist/esm/webgl/shaders/nodes/UniformDataShader.d.ts +20 -20
- package/dist/esm/webgl/shaders/nodes/VaryingVariableShader.d.ts +18 -18
- package/dist/esm/webgl/textureLoader/KTX2TextureLoader.d.ts +21 -21
- package/dist/esm/xr/WebVRSystem.d.ts +55 -55
- package/dist/esm/xr/WebXRInput.d.ts +18 -18
- package/dist/esm/xr/WebXRSystem.d.ts +136 -136
- package/dist/esm/xr/main.d.ts +8 -8
- package/package.json +5 -7
- package/dist/VERSION-FILE +0 -2
- package/dist/esm/foundation/components/MeshComponent.test.d.ts +0 -1
- package/dist/esm/foundation/components/SceneGraphComponent.test.d.ts +0 -1
- package/dist/esm/foundation/components/TransformComponent.test.d.ts +0 -1
- package/dist/esm/foundation/core/Entity.test.d.ts +0 -1
- package/dist/esm/foundation/core/EntityRepository.test.d.ts +0 -1
- package/dist/esm/foundation/core/RnObject.test.d.ts +0 -1
- package/dist/esm/foundation/definitions/ShaderVariableTyoe.d.ts +0 -11
- package/dist/esm/foundation/enhanced_js_objects/Array.test.d.ts +0 -5
- package/dist/esm/foundation/geometry/Mesh.test.d.ts +0 -1
- package/dist/esm/foundation/importer/VRizeGltfLoaderExtension.d.ts +0 -21
- package/dist/esm/foundation/materials/core/Material.test.d.ts +0 -1
- package/dist/esm/foundation/materials/core/ShaderityUtility.test.d.ts +0 -1
- package/dist/esm/foundation/materials/nodes/AddShaderNode.test.d.ts +0 -1
- package/dist/esm/foundation/materials/nodes/ConstantVariableShaderNode.test.d.ts +0 -1
- package/dist/esm/foundation/materials/nodes/ScalarToVector4ShaderNode.test.d.ts +0 -1
- package/dist/esm/foundation/materials/nodes/VaryingVariableShaderNode.test.d.ts +0 -1
- package/dist/esm/foundation/materials/singles/VRizeClassicShadingSingleMaterialNode.d.ts +0 -24
- package/dist/esm/foundation/materials/singles/VRizePbrShadingSingleMaterialNode.d.ts +0 -28
- package/dist/esm/foundation/math/AABB.test.d.ts +0 -1
- package/dist/esm/foundation/math/IdentityMatrix33.test.d.ts +0 -1
- package/dist/esm/foundation/math/IdentityMatrix44.test.d.ts +0 -1
- package/dist/esm/foundation/math/Matrix44.test.d.ts +0 -1
- package/dist/esm/foundation/math/MutableMatrix44..test.d.ts +0 -1
- package/dist/esm/foundation/math/MutableVector4.test.d.ts +0 -1
- package/dist/esm/foundation/math/Vector4.test.d.ts +0 -1
- package/dist/esm/foundation/memory/Accessor.test.d.ts +0 -1
- package/dist/esm/foundation/memory/Buffer.test.d.ts +0 -1
- package/dist/esm/foundation/memory/BufferView.test.d.ts +0 -1
- package/dist/esm/foundation/misc/Is.test.d.ts +0 -1
- package/dist/esm/foundation/misc/Option.test.d.ts +0 -1
- package/dist/esm/foundation/misc/Result.test.d.ts +0 -1
- package/dist/esm/foundation/misc/RnPromise.test.d.ts +0 -1
- package/dist/esm/foundation/renderer/RenderPass.test.d.ts +0 -1
- package/dist/esm/foundation/system/EventPubSub.test.d.ts +0 -1
- package/dist/esm/rhodonite-xr.d.ts +0 -8
- package/dist/esm/types/Option.d.ts +0 -68
- package/dist/esm/types/Option.test.d.ts +0 -1
- package/dist/esm/types/Result.d.ts +0 -32
- package/dist/esm/webgl/WebGLResourceRepository.test.d.ts +0 -1
|
@@ -1,221 +1,351 @@
|
|
|
1
|
-
/// <reference types="webgl-ext" />
|
|
2
|
-
import Accessor from '../foundation/memory/Accessor';
|
|
3
|
-
import CGAPIResourceRepository from '../foundation/renderer/CGAPIResourceRepository';
|
|
4
|
-
import Primitive from '../foundation/geometry/Primitive';
|
|
5
|
-
import { AttributeNames } from './shaders/GLSLShader';
|
|
6
|
-
import { VertexAttributeEnum } from '../foundation/definitions/VertexAttribute';
|
|
7
|
-
import { TextureParameterEnum } from '../foundation/definitions/TextureParameter';
|
|
8
|
-
import { PixelFormatEnum } from '../foundation/definitions/PixelFormat';
|
|
9
|
-
import { ComponentTypeEnum } from '../foundation/definitions/ComponentType';
|
|
10
|
-
import WebGLContextWrapper from './WebGLContextWrapper';
|
|
11
|
-
import { ShaderSemanticsInfo } from '../foundation/definitions/ShaderSemantics';
|
|
12
|
-
import IRenderable from '../foundation/textures/IRenderable';
|
|
13
|
-
import FrameBuffer from '../foundation/renderer/FrameBuffer';
|
|
14
|
-
import { HdriFormatEnum } from '../foundation/definitions/HdriFormat';
|
|
15
|
-
import Vector4 from '../foundation/math/Vector4';
|
|
16
|
-
import RenderPass from '../foundation/renderer/RenderPass';
|
|
17
|
-
import { WebGLResourceHandle, TypedArray, Index, Size, Count, CGAPIResourceHandle, Byte, ArrayType } from '../types/CommonTypes';
|
|
18
|
-
import { BasisFile } from '../types/BasisTexture';
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
private
|
|
39
|
-
private
|
|
40
|
-
private
|
|
41
|
-
private
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
*
|
|
105
|
-
*/
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
1
|
+
/// <reference types="webgl-ext" />
|
|
2
|
+
import Accessor from '../foundation/memory/Accessor';
|
|
3
|
+
import CGAPIResourceRepository from '../foundation/renderer/CGAPIResourceRepository';
|
|
4
|
+
import Primitive from '../foundation/geometry/Primitive';
|
|
5
|
+
import { AttributeNames } from './shaders/GLSLShader';
|
|
6
|
+
import { VertexAttributeEnum } from '../foundation/definitions/VertexAttribute';
|
|
7
|
+
import { TextureParameterEnum } from '../foundation/definitions/TextureParameter';
|
|
8
|
+
import { PixelFormatEnum } from '../foundation/definitions/PixelFormat';
|
|
9
|
+
import { ComponentTypeEnum } from '../foundation/definitions/ComponentType';
|
|
10
|
+
import WebGLContextWrapper from './WebGLContextWrapper';
|
|
11
|
+
import { ShaderSemanticsInfo } from '../foundation/definitions/ShaderSemantics';
|
|
12
|
+
import IRenderable from '../foundation/textures/IRenderable';
|
|
13
|
+
import FrameBuffer from '../foundation/renderer/FrameBuffer';
|
|
14
|
+
import { HdriFormatEnum } from '../foundation/definitions/HdriFormat';
|
|
15
|
+
import Vector4 from '../foundation/math/Vector4';
|
|
16
|
+
import RenderPass from '../foundation/renderer/RenderPass';
|
|
17
|
+
import { WebGLResourceHandle, TypedArray, Index, Size, Count, CGAPIResourceHandle, Byte, ArrayType } from '../types/CommonTypes';
|
|
18
|
+
import { BasisFile } from '../types/BasisTexture';
|
|
19
|
+
import { RnWebGLProgram } from './WebGLExtendedTypes';
|
|
20
|
+
import { CompressionTextureTypeEnum } from '../foundation/definitions/CompressionTextureType';
|
|
21
|
+
import Material from '../foundation/materials/core/Material';
|
|
22
|
+
export declare type VertexHandles = {
|
|
23
|
+
vaoHandle: CGAPIResourceHandle;
|
|
24
|
+
iboHandle?: CGAPIResourceHandle;
|
|
25
|
+
vboHandles: Array<CGAPIResourceHandle>;
|
|
26
|
+
attributesFlags: Array<boolean>;
|
|
27
|
+
setComplete: boolean;
|
|
28
|
+
};
|
|
29
|
+
declare type DirectTextureData = TypedArray | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement;
|
|
30
|
+
export declare type TextureData = {
|
|
31
|
+
level: Count;
|
|
32
|
+
width: Count;
|
|
33
|
+
height: Count;
|
|
34
|
+
buffer: ArrayBufferView;
|
|
35
|
+
};
|
|
36
|
+
export declare type WebGLResource = WebGLBuffer | WebGLFramebuffer | WebGLObject | WebGLProgram | WebGLRenderbuffer | WebGLTexture | WebGLTransformFeedback;
|
|
37
|
+
export default class WebGLResourceRepository extends CGAPIResourceRepository {
|
|
38
|
+
private static __instance;
|
|
39
|
+
private __webglContexts;
|
|
40
|
+
private __glw?;
|
|
41
|
+
private __resourceCounter;
|
|
42
|
+
private __webglResources;
|
|
43
|
+
private constructor();
|
|
44
|
+
static getInstance(): WebGLResourceRepository;
|
|
45
|
+
addWebGLContext(gl: WebGLRenderingContext | WebGL2RenderingContext, canvas: HTMLCanvasElement, asCurrent: boolean, isDebug: boolean): void;
|
|
46
|
+
generateWebGLContext(canvas: HTMLCanvasElement, webglOption: WebGLContextAttributes, version: number, asCurrent: boolean, isDebug: boolean, fallback?: boolean): WebGLRenderingContext | WebGL2RenderingContext;
|
|
47
|
+
get currentWebGLContextWrapper(): WebGLContextWrapper | undefined;
|
|
48
|
+
private getResourceNumber;
|
|
49
|
+
getWebGLResource(WebGLResourceHandle: WebGLResourceHandle): WebGLResource | null;
|
|
50
|
+
createIndexBuffer(accessor: Accessor): number;
|
|
51
|
+
updateIndexBuffer(accessor: Accessor, resourceHandle: number): void;
|
|
52
|
+
createVertexBuffer(accessor: Accessor): number;
|
|
53
|
+
createVertexBufferFromTypedArray(typedArray: TypedArray): number;
|
|
54
|
+
updateVertexBuffer(accessor: Accessor, resourceHandle: number): void;
|
|
55
|
+
createVertexArray(): number | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* bind the Texture2D
|
|
58
|
+
* @param textureSlotIndex
|
|
59
|
+
* @param textureUid
|
|
60
|
+
*/
|
|
61
|
+
bindTexture2D(textureSlotIndex: Index, textureUid: CGAPIResourceHandle): void;
|
|
62
|
+
/**
|
|
63
|
+
* bind the TextureCube
|
|
64
|
+
* @param textureSlotIndex
|
|
65
|
+
* @param textureUid
|
|
66
|
+
*/
|
|
67
|
+
bindTextureCube(textureSlotIndex: Index, textureUid: CGAPIResourceHandle): void;
|
|
68
|
+
/**
|
|
69
|
+
* create a VertexBuffer and IndexBuffer
|
|
70
|
+
* @param primitive
|
|
71
|
+
* @returns
|
|
72
|
+
*/
|
|
73
|
+
createVertexBufferAndIndexBuffer(primitive: Primitive): VertexHandles;
|
|
74
|
+
/**
|
|
75
|
+
* update the VertexBuffer and IndexBuffer
|
|
76
|
+
* @param primitive
|
|
77
|
+
* @param vertexHandles
|
|
78
|
+
*/
|
|
79
|
+
updateVertexBufferAndIndexBuffer(primitive: Primitive, vertexHandles: VertexHandles): void;
|
|
80
|
+
/**
|
|
81
|
+
* create a shader program
|
|
82
|
+
* @param param0
|
|
83
|
+
* @returns
|
|
84
|
+
*/
|
|
85
|
+
createShaderProgram({ material, vertexShaderStr, fragmentShaderStr, attributeNames, attributeSemantics, }: {
|
|
86
|
+
material: Material;
|
|
87
|
+
vertexShaderStr: string;
|
|
88
|
+
fragmentShaderStr: string;
|
|
89
|
+
attributeNames: AttributeNames;
|
|
90
|
+
attributeSemantics: Array<VertexAttributeEnum>;
|
|
91
|
+
}): number;
|
|
92
|
+
private __checkShaderCompileStatus;
|
|
93
|
+
private __checkShaderProgramLinkStatus;
|
|
94
|
+
/**
|
|
95
|
+
* setup the uniform locations
|
|
96
|
+
* @param shaderProgramUid
|
|
97
|
+
* @param infoArray
|
|
98
|
+
* @param isUniformOnlyMode
|
|
99
|
+
* @returns
|
|
100
|
+
*/
|
|
101
|
+
setupUniformLocations(shaderProgramUid: WebGLResourceHandle, infoArray: ShaderSemanticsInfo[], isUniformOnlyMode: boolean): WebGLProgram;
|
|
102
|
+
setupBasicUniformLocations(shaderProgramUid: WebGLResourceHandle): void;
|
|
103
|
+
/**
|
|
104
|
+
* set an uniform value
|
|
105
|
+
*/
|
|
106
|
+
setUniformValue(shaderProgram_: WebGLProgram, semanticStr: string, firstTime: boolean, value: any, index?: Index): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* bind the texture
|
|
109
|
+
* @param info
|
|
110
|
+
* @param value
|
|
111
|
+
*/
|
|
112
|
+
bindTexture(info: ShaderSemanticsInfo, value: any): void;
|
|
113
|
+
/**
|
|
114
|
+
* set the uniform value
|
|
115
|
+
* @param shaderProgram
|
|
116
|
+
* @param semanticStr
|
|
117
|
+
* @param info
|
|
118
|
+
* @param isMatrix
|
|
119
|
+
* @param componentNumber
|
|
120
|
+
* @param isVector
|
|
121
|
+
* @param param6
|
|
122
|
+
* @param index
|
|
123
|
+
* @returns
|
|
124
|
+
*/
|
|
125
|
+
setUniformValueInner(shaderProgram: WebGLProgram, semanticStr: string, info: ShaderSemanticsInfo, isMatrix: boolean, componentNumber: number, isVector: boolean, { x, y, z, w, }: {
|
|
126
|
+
x: number | ArrayType | boolean;
|
|
127
|
+
y?: number | boolean;
|
|
128
|
+
z?: number | boolean;
|
|
129
|
+
w?: number | boolean;
|
|
130
|
+
}, index?: Count): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* set the VertexData to the Pipeline
|
|
133
|
+
*/
|
|
134
|
+
setVertexDataToPipeline({ vaoHandle, iboHandle, vboHandles, }: {
|
|
135
|
+
vaoHandle: WebGLResourceHandle;
|
|
136
|
+
iboHandle?: WebGLResourceHandle;
|
|
137
|
+
vboHandles: Array<WebGLResourceHandle>;
|
|
138
|
+
}, primitive: Primitive, instanceIDBufferUid?: WebGLResourceHandle): void;
|
|
139
|
+
/**
|
|
140
|
+
* create a Texture
|
|
141
|
+
* @param data
|
|
142
|
+
* @param param1
|
|
143
|
+
* @returns
|
|
144
|
+
*/
|
|
145
|
+
createTexture(data: DirectTextureData, { level, internalFormat, width, height, border, format, type, magFilter, minFilter, wrapS, wrapT, generateMipmap, anisotropy, isPremultipliedAlpha, }: {
|
|
146
|
+
level: Index;
|
|
147
|
+
internalFormat: TextureParameterEnum | PixelFormatEnum;
|
|
148
|
+
width: Size;
|
|
149
|
+
height: Size;
|
|
150
|
+
border: Size;
|
|
151
|
+
format: PixelFormatEnum;
|
|
152
|
+
type: ComponentTypeEnum;
|
|
153
|
+
magFilter: TextureParameterEnum;
|
|
154
|
+
minFilter: TextureParameterEnum;
|
|
155
|
+
wrapS: TextureParameterEnum;
|
|
156
|
+
wrapT: TextureParameterEnum;
|
|
157
|
+
generateMipmap: boolean;
|
|
158
|
+
anisotropy: boolean;
|
|
159
|
+
isPremultipliedAlpha: boolean;
|
|
160
|
+
}): WebGLResourceHandle;
|
|
161
|
+
/**
|
|
162
|
+
* Create and bind compressed texture object
|
|
163
|
+
* @param textureDataArray transcoded texture data for each mipmaps(levels)
|
|
164
|
+
* @param compressionTextureType
|
|
165
|
+
*/
|
|
166
|
+
createCompressedTexture(textureDataArray: TextureData[], compressionTextureType: CompressionTextureTypeEnum, { magFilter, minFilter, wrapS, wrapT, anisotropy, }: {
|
|
167
|
+
magFilter: TextureParameterEnum;
|
|
168
|
+
minFilter: TextureParameterEnum;
|
|
169
|
+
wrapS: TextureParameterEnum;
|
|
170
|
+
wrapT: TextureParameterEnum;
|
|
171
|
+
anisotropy: boolean;
|
|
172
|
+
}): WebGLResourceHandle;
|
|
173
|
+
/**
|
|
174
|
+
* create CompressedTextureFromBasis
|
|
175
|
+
* @param basisFile
|
|
176
|
+
* @param param1
|
|
177
|
+
* @returns
|
|
178
|
+
*/
|
|
179
|
+
createCompressedTextureFromBasis(basisFile: BasisFile, { border, format, type, magFilter, minFilter, wrapS, wrapT, anisotropy, isPremultipliedAlpha, }: {
|
|
180
|
+
border: Size;
|
|
181
|
+
format: PixelFormatEnum;
|
|
182
|
+
type: ComponentTypeEnum;
|
|
183
|
+
magFilter: TextureParameterEnum;
|
|
184
|
+
minFilter: TextureParameterEnum;
|
|
185
|
+
wrapS: TextureParameterEnum;
|
|
186
|
+
wrapT: TextureParameterEnum;
|
|
187
|
+
anisotropy: boolean;
|
|
188
|
+
isPremultipliedAlpha: boolean;
|
|
189
|
+
}): WebGLResourceHandle;
|
|
190
|
+
/**
|
|
191
|
+
* decode the BasisImage
|
|
192
|
+
* @param basisFile
|
|
193
|
+
* @param basisCompressionType
|
|
194
|
+
* @param imageIndex
|
|
195
|
+
* @param levelIndex
|
|
196
|
+
* @returns
|
|
197
|
+
*/
|
|
198
|
+
private decodeBasisImage;
|
|
199
|
+
/**
|
|
200
|
+
* create a FrameBufferObject
|
|
201
|
+
* @returns
|
|
202
|
+
*/
|
|
203
|
+
createFrameBufferObject(): number;
|
|
204
|
+
/**
|
|
205
|
+
* attach the ColorBuffer to the FrameBufferObject
|
|
206
|
+
* @param framebuffer a Framebuffer
|
|
207
|
+
* @param renderable a ColorBuffer
|
|
208
|
+
*/
|
|
209
|
+
attachColorBufferToFrameBufferObject(framebuffer: FrameBuffer, index: Index, renderable: IRenderable): void;
|
|
210
|
+
/**
|
|
211
|
+
* attach the DepthBuffer to the FrameBufferObject
|
|
212
|
+
* @param framebuffer a Framebuffer
|
|
213
|
+
* @param renderable a DepthBuffer
|
|
214
|
+
*/
|
|
215
|
+
attachDepthBufferToFrameBufferObject(framebuffer: FrameBuffer, renderable: IRenderable): void;
|
|
216
|
+
/**
|
|
217
|
+
* attach the StencilBuffer to the FrameBufferObject
|
|
218
|
+
* @param framebuffer a Framebuffer
|
|
219
|
+
* @param renderable a StencilBuffer
|
|
220
|
+
*/
|
|
221
|
+
attachStencilBufferToFrameBufferObject(framebuffer: FrameBuffer, renderable: IRenderable): void;
|
|
222
|
+
/**
|
|
223
|
+
* attach the depthStencilBuffer to the FrameBufferObject
|
|
224
|
+
* @param framebuffer a Framebuffer
|
|
225
|
+
* @param renderable a depthStencilBuffer
|
|
226
|
+
*/
|
|
227
|
+
attachDepthStencilBufferToFrameBufferObject(framebuffer: FrameBuffer, renderable: IRenderable): void;
|
|
228
|
+
private __attachDepthOrStencilBufferToFrameBufferObject;
|
|
229
|
+
/**
|
|
230
|
+
* create Renderbuffer
|
|
231
|
+
*/
|
|
232
|
+
createRenderBuffer(width: Size, height: Size, internalFormat: TextureParameterEnum, isMSAA: boolean, sampleCountMSAA: Count): number;
|
|
233
|
+
/**
|
|
234
|
+
* set drawTargets
|
|
235
|
+
* @param framebuffer
|
|
236
|
+
*/
|
|
237
|
+
setDrawTargets(framebuffer?: FrameBuffer): void;
|
|
238
|
+
/**
|
|
239
|
+
* bind Framebuffer
|
|
240
|
+
* @param framebuffer
|
|
241
|
+
*/
|
|
242
|
+
bindFramebuffer(framebuffer?: FrameBuffer): void;
|
|
243
|
+
/**
|
|
244
|
+
* unbind Framebuffer
|
|
245
|
+
*/
|
|
246
|
+
unbindFramebuffer(): void;
|
|
247
|
+
/**
|
|
248
|
+
* create a RenderTargetTexture
|
|
249
|
+
* @param param0
|
|
250
|
+
* @returns
|
|
251
|
+
*/
|
|
252
|
+
createRenderTargetTexture({ width, height, level, internalFormat, format, type, magFilter, minFilter, wrapS, wrapT, }: {
|
|
253
|
+
width: Size;
|
|
254
|
+
height: Size;
|
|
255
|
+
level: Index;
|
|
256
|
+
internalFormat: TextureParameterEnum | PixelFormatEnum;
|
|
257
|
+
format: PixelFormatEnum;
|
|
258
|
+
type: ComponentTypeEnum;
|
|
259
|
+
magFilter: TextureParameterEnum;
|
|
260
|
+
minFilter: TextureParameterEnum;
|
|
261
|
+
wrapS: TextureParameterEnum;
|
|
262
|
+
wrapT: TextureParameterEnum;
|
|
263
|
+
}): number;
|
|
264
|
+
/**
|
|
265
|
+
* create a CubeTexture
|
|
266
|
+
*
|
|
267
|
+
* @param mipLevelCount
|
|
268
|
+
* @param images
|
|
269
|
+
* @param width
|
|
270
|
+
* @param height
|
|
271
|
+
* @returns resource handle
|
|
272
|
+
*/
|
|
273
|
+
createCubeTexture(mipLevelCount: Count, images: Array<{
|
|
274
|
+
posX: DirectTextureData;
|
|
275
|
+
negX: DirectTextureData;
|
|
276
|
+
posY: DirectTextureData;
|
|
277
|
+
negY: DirectTextureData;
|
|
278
|
+
posZ: DirectTextureData;
|
|
279
|
+
negZ: DirectTextureData;
|
|
280
|
+
}>, width: Size, height: Size): number;
|
|
281
|
+
/**
|
|
282
|
+
* Create Cube Texture from image files.
|
|
283
|
+
* @param baseUri the base uri to load images;
|
|
284
|
+
* @param mipLevelCount the number of mip levels (include root level). if no mipmap, the value should be 1;
|
|
285
|
+
* @returns the WebGLResourceHandle for the generated Cube Texture
|
|
286
|
+
*/
|
|
287
|
+
createCubeTextureFromFiles(baseUri: string, mipLevelCount: Count, isNamePosNeg: boolean, hdriFormat: HdriFormatEnum): Promise<number>;
|
|
288
|
+
createCubeTextureFromBasis(basisFile: BasisFile, { magFilter, minFilter, wrapS, wrapT, border, }: {
|
|
289
|
+
magFilter?: import("../foundation/misc/EnumIO").EnumIO | undefined;
|
|
290
|
+
minFilter?: import("../foundation/misc/EnumIO").EnumIO | undefined;
|
|
291
|
+
wrapS?: import("../foundation/misc/EnumIO").EnumIO | undefined;
|
|
292
|
+
wrapT?: import("../foundation/misc/EnumIO").EnumIO | undefined;
|
|
293
|
+
border?: number | undefined;
|
|
294
|
+
}): number;
|
|
295
|
+
createDummyBlackCubeTexture(): number;
|
|
296
|
+
createDummyCubeTexture(rgbaStr?: string): number;
|
|
297
|
+
setWebGLTextureDirectly(webGLTexture: WebGLTexture): number;
|
|
298
|
+
createTextureFromDataUri(dataUri: string, { level, internalFormat, border, format, type, magFilter, minFilter, wrapS, wrapT, generateMipmap, anisotropy, isPremultipliedAlpha, }: {
|
|
299
|
+
level: Index;
|
|
300
|
+
internalFormat: TextureParameterEnum | PixelFormatEnum;
|
|
301
|
+
border: Size;
|
|
302
|
+
format: PixelFormatEnum;
|
|
303
|
+
type: ComponentTypeEnum;
|
|
304
|
+
magFilter: TextureParameterEnum;
|
|
305
|
+
minFilter: TextureParameterEnum;
|
|
306
|
+
wrapS: TextureParameterEnum;
|
|
307
|
+
wrapT: TextureParameterEnum;
|
|
308
|
+
generateMipmap: boolean;
|
|
309
|
+
anisotropy: boolean;
|
|
310
|
+
isPremultipliedAlpha: boolean;
|
|
311
|
+
}): Promise<WebGLResourceHandle>;
|
|
312
|
+
updateTexture(textureUid: WebGLResourceHandle, textureData: DirectTextureData, { level, xoffset, yoffset, width, height, format, type, }: {
|
|
313
|
+
level: Index;
|
|
314
|
+
xoffset: Size;
|
|
315
|
+
yoffset: Size;
|
|
316
|
+
width: Size;
|
|
317
|
+
height: Size;
|
|
318
|
+
format: PixelFormatEnum;
|
|
319
|
+
type: ComponentTypeEnum;
|
|
320
|
+
}): void;
|
|
321
|
+
deleteFrameBufferObject(frameBufferObjectHandle: WebGLResourceHandle): void;
|
|
322
|
+
deleteRenderBuffer(renderBufferUid: WebGLResourceHandle): void;
|
|
323
|
+
deleteTexture(textureHandle: WebGLResourceHandle): void;
|
|
324
|
+
createDummyTexture(rgbaStr?: string): number;
|
|
325
|
+
createDummyBlackTexture(): number;
|
|
326
|
+
createDummyWhiteTexture(): number;
|
|
327
|
+
createDummyNormalTexture(): number;
|
|
328
|
+
__createDummyTextureInner(base64: string): number;
|
|
329
|
+
createUniformBuffer(bufferView: TypedArray | DataView): number;
|
|
330
|
+
updateUniformBuffer(uboUid: WebGLResourceHandle, typedArray: TypedArray, offsetByte: Byte, byteLength: Byte): void;
|
|
331
|
+
bindUniformBlock(shaderProgramUid: WebGLResourceHandle, blockName: string, blockIndex: Index): void;
|
|
332
|
+
bindUniformBufferBase(blockIndex: Index, uboUid: WebGLResourceHandle): void;
|
|
333
|
+
deleteUniformBuffer(uboUid: WebGLResourceHandle): void;
|
|
334
|
+
setupUniformBufferDataArea(typedArray?: TypedArray): number;
|
|
335
|
+
getGlslDataUBODefinitionString(): string;
|
|
336
|
+
getGlslDataUBOVec4SizeString(): string;
|
|
337
|
+
createTransformFeedback(): number;
|
|
338
|
+
deleteTransformFeedback(transformFeedbackUid: WebGLResourceHandle): void;
|
|
339
|
+
setViewport(viewport?: Vector4): void;
|
|
340
|
+
clearFrameBuffer(renderPass: RenderPass): void;
|
|
341
|
+
deleteVertexDataResources(vertexHandles: VertexHandles): void;
|
|
342
|
+
deleteVertexArray(vaoHandle: WebGLResourceHandle): void;
|
|
343
|
+
deleteVertexBuffer(vboUid: WebGLResourceHandle): void;
|
|
344
|
+
resizeCanvas(width: Size, height: Size): void;
|
|
345
|
+
switchDepthTest(flag: boolean): void;
|
|
346
|
+
rebuildProgram(this: RnWebGLProgram, updatedVertexSourceCode: string, // The new vertex shader source
|
|
347
|
+
updatedFragmentSourceCode: string, // The new fragment shader source
|
|
348
|
+
onCompiled: (program: WebGLProgram) => void, // Callback triggered by your engine when the compilation is successful. It needs to send back the new linked program.
|
|
349
|
+
onError: (message: string) => void): boolean;
|
|
350
|
+
}
|
|
351
|
+
export {};
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
import MeshComponent from '../foundation/components/MeshComponent';
|
|
2
|
-
import WebGLContextWrapper from './WebGLContextWrapper';
|
|
3
|
-
import Primitive from '../foundation/geometry/Primitive';
|
|
4
|
-
import Matrix44 from '../foundation/math/Matrix44';
|
|
5
|
-
import Matrix33 from '../foundation/math/Matrix33';
|
|
6
|
-
import Entity from '../foundation/core/Entity';
|
|
7
|
-
import CubeTexture from '../foundation/textures/CubeTexture';
|
|
8
|
-
import Material from '../foundation/materials/core/Material';
|
|
9
|
-
import RenderPass from '../foundation/renderer/RenderPass';
|
|
10
|
-
import MeshRendererComponent from '../foundation/components/MeshRendererComponent';
|
|
11
|
-
import { WebGLResourceHandle, Index, Count } from '../types/CommonTypes';
|
|
12
|
-
import { IMatrix44 } from '../foundation/math/IMatrix';
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import MeshComponent from '../foundation/components/MeshComponent';
|
|
2
|
+
import WebGLContextWrapper from './WebGLContextWrapper';
|
|
3
|
+
import Primitive from '../foundation/geometry/Primitive';
|
|
4
|
+
import Matrix44 from '../foundation/math/Matrix44';
|
|
5
|
+
import Matrix33 from '../foundation/math/Matrix33';
|
|
6
|
+
import Entity from '../foundation/core/Entity';
|
|
7
|
+
import CubeTexture from '../foundation/textures/CubeTexture';
|
|
8
|
+
import Material from '../foundation/materials/core/Material';
|
|
9
|
+
import RenderPass from '../foundation/renderer/RenderPass';
|
|
10
|
+
import MeshRendererComponent from '../foundation/components/MeshRendererComponent';
|
|
11
|
+
import { WebGLResourceHandle, Index, Count, CGAPIResourceHandle } from '../types/CommonTypes';
|
|
12
|
+
import { IMatrix44 } from '../foundation/math/IMatrix';
|
|
13
|
+
export declare type ShaderSources = {
|
|
14
|
+
vertex: string;
|
|
15
|
+
pixel: string;
|
|
16
|
+
};
|
|
17
|
+
export default interface WebGLStrategy {
|
|
18
|
+
$load(meshComponent: MeshComponent): void;
|
|
19
|
+
$prerender(meshComponent: MeshComponent, meshRendererComponent: MeshRendererComponent, instanceIDBufferUid: WebGLResourceHandle): void;
|
|
20
|
+
$render?(i: Index, meshComponent: MeshComponent, worldMatrix: Matrix44, normalMatrix: Matrix33, entity: Entity, renderPass: RenderPass, renderPassTickCount: Count, diffuseCube?: CubeTexture, specularCube?: CubeTexture): void;
|
|
21
|
+
common_$prerender(): void;
|
|
22
|
+
common_$render(meshComponentSids: Int32Array, meshComponents: MeshComponent[], viewMatrix: IMatrix44, projectionMatrix: IMatrix44, renderPass: RenderPass, renderPassTickCount: Count): boolean;
|
|
23
|
+
attachGPUData(primitive: Primitive): void;
|
|
24
|
+
attachVertexData(i: number, primitive: Primitive, glw: WebGLContextWrapper, instanceIDBufferUid: WebGLResourceHandle): void;
|
|
25
|
+
attachShaderProgram(material: Material): void;
|
|
26
|
+
setupShaderForMaterial(material: Material, updatedShaderSources?: ShaderSources): CGAPIResourceHandle;
|
|
27
|
+
}
|