@types/three 0.184.0 → 0.185.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.
- three/README.md +1 -1
- three/examples/jsm/Addons.d.ts +2 -0
- three/examples/jsm/controls/FirstPersonControls.d.ts +9 -0
- three/examples/jsm/controls/OrbitControls.d.ts +2 -2
- three/examples/jsm/controls/TransformControls.d.ts +32 -1
- three/examples/jsm/csm/CSMFrustum.d.ts +73 -13
- three/examples/jsm/exporters/DRACOExporter.d.ts +1 -1
- three/examples/jsm/exporters/GLTFExporter.d.ts +2 -2
- three/examples/jsm/exporters/PLYExporter.d.ts +5 -4
- three/examples/jsm/exporters/USDZExporter.d.ts +5 -1
- three/examples/jsm/generators/CityGenerator.d.ts +75 -0
- three/examples/jsm/generators/ForestGenerator.d.ts +79 -0
- three/examples/jsm/generators/TerrainGenerator.d.ts +67 -0
- three/examples/jsm/generators/TreeGenerator.d.ts +97 -0
- three/examples/jsm/generators/city/SidewalkGenerator.d.ts +40 -0
- three/examples/jsm/generators/city/SkyscraperGenerator.d.ts +83 -0
- three/examples/jsm/geometries/LoftGeometry.d.ts +83 -0
- three/examples/jsm/inspector/tabs/Parameters.d.ts +5 -2
- three/examples/jsm/lighting/ClusteredLighting.d.ts +45 -0
- three/examples/jsm/lighting/LightProbeGrid.d.ts +131 -13
- three/examples/jsm/loaders/DRACOLoader.d.ts +20 -6
- three/examples/jsm/loaders/EXRLoader.d.ts +2 -12
- three/examples/jsm/loaders/GLTFLoader.d.ts +1 -1
- three/examples/jsm/loaders/HDRLoader.d.ts +2 -12
- three/examples/jsm/loaders/KTX2Loader.d.ts +1 -1
- three/examples/jsm/loaders/LWOLoader.d.ts +6 -0
- three/examples/jsm/loaders/RGBELoader.d.ts +1 -7
- three/examples/jsm/loaders/SVGLoader.d.ts +9 -6
- three/examples/jsm/loaders/TGALoader.d.ts +2 -2
- three/examples/jsm/loaders/TIFFLoader.d.ts +2 -11
- three/examples/jsm/loaders/USDLoader.d.ts +6 -1
- three/examples/jsm/misc/TileCreasedNormalsPlugin.d.ts +49 -0
- three/examples/jsm/objects/MarchingCubes.d.ts +2 -2
- three/examples/jsm/objects/Reflector.d.ts +38 -5
- three/examples/jsm/objects/SkyMesh.d.ts +1 -1
- three/examples/jsm/physics/RapierPhysics.d.ts +1 -0
- three/examples/jsm/tsl/display/BloomNode.d.ts +23 -6
- three/examples/jsm/tsl/display/ImportanceSampledEnvironment.d.ts +84 -0
- three/examples/jsm/tsl/display/RecurrentDenoiseNode.d.ts +89 -0
- three/examples/jsm/tsl/display/SSAAPassNode.d.ts +0 -2
- three/examples/jsm/tsl/display/SSGINode.d.ts +4 -1
- three/examples/jsm/tsl/display/SSRNode.d.ts +303 -30
- three/examples/jsm/tsl/display/TRAANode.d.ts +1 -1
- three/examples/jsm/tsl/display/TemporalReprojectNode.d.ts +64 -0
- three/examples/jsm/tsl/lighting/ClusteredLightsNode.d.ts +54 -0
- three/examples/jsm/tsl/math/curlNoise.d.ts +38 -0
- three/examples/jsm/tsl/utils/GroundedSkybox.d.ts +17 -0
- three/examples/jsm/tsl/utils/RNoise.d.ts +12 -0
- three/examples/jsm/tsl/utils/SpecularHelpers.d.ts +20 -0
- three/examples/jsm/webxr/WebGLXRFallback.d.ts +14 -0
- three/package.json +3 -3
- three/src/Three.TSL.d.ts +10 -3
- three/src/Three.WebGPU.Nodes.d.ts +2 -2
- three/src/Three.WebGPU.d.ts +5 -3
- three/src/animation/AnimationClip.d.ts +0 -10
- three/src/cameras/Camera.d.ts +1 -1
- three/src/core/InterleavedBuffer.d.ts +1 -1
- three/src/core/Object3D.d.ts +8 -4
- three/src/core/RenderTarget.d.ts +11 -0
- three/src/core/Timer.d.ts +1 -1
- three/src/core/UniformsGroup.d.ts +1 -1
- three/src/extras/Controls.d.ts +6 -5
- three/src/extras/core/ShapePath.d.ts +61 -65
- three/src/loaders/DataTextureLoader.d.ts +37 -3
- three/src/loaders/MaterialLoader.d.ts +8 -0
- three/src/materials/LineBasicMaterial.d.ts +5 -0
- three/src/materials/Material.d.ts +9 -1
- three/src/materials/MeshBasicMaterial.d.ts +30 -0
- three/src/materials/MeshDepthMaterial.d.ts +13 -0
- three/src/materials/MeshDistanceMaterial.d.ts +13 -0
- three/src/materials/MeshLambertMaterial.d.ts +50 -1
- three/src/materials/MeshMatcapMaterial.d.ts +31 -1
- three/src/materials/MeshNormalMaterial.d.ts +11 -1
- three/src/materials/MeshPhongMaterial.d.ts +50 -1
- three/src/materials/MeshPhysicalMaterial.d.ts +50 -0
- three/src/materials/MeshStandardMaterial.d.ts +53 -1
- three/src/materials/MeshToonMaterial.d.ts +43 -1
- three/src/materials/PointsMaterial.d.ts +9 -0
- three/src/materials/ShaderMaterial.d.ts +2 -0
- three/src/materials/SpriteMaterial.d.ts +9 -0
- three/src/materials/nodes/Line2NodeMaterial.d.ts +18 -13
- three/src/materials/nodes/NodeMaterial.d.ts +33 -13
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +0 -84
- three/src/math/Box2.d.ts +3 -3
- three/src/math/Box3.d.ts +255 -19
- three/src/math/Color.d.ts +10 -10
- three/src/math/FrustumArray.d.ts +75 -16
- three/src/math/Interpolant.d.ts +111 -8
- three/src/math/Matrix2.d.ts +1 -1
- three/src/math/Matrix3.d.ts +10 -1
- three/src/math/Matrix4.d.ts +329 -105
- three/src/math/Vector2.d.ts +1 -2
- three/src/math/Vector3.d.ts +3 -4
- three/src/math/Vector4.d.ts +1 -2
- three/src/math/interpolants/BezierInterpolant.d.ts +19 -3
- three/src/math/interpolants/CubicInterpolant.d.ts +18 -3
- three/src/math/interpolants/DiscreteInterpolant.d.ts +8 -3
- three/src/math/interpolants/LinearInterpolant.d.ts +7 -3
- three/src/math/interpolants/QuaternionLinearInterpolant.d.ts +7 -3
- three/src/nodes/Nodes.d.ts +4 -13
- three/src/nodes/TSL.d.ts +7 -5
- three/src/nodes/accessors/Batch.d.ts +19 -0
- three/src/nodes/accessors/Instance.d.ts +34 -0
- three/src/nodes/accessors/MaterialNode.d.ts +86 -79
- three/src/nodes/accessors/Morph.d.ts +11 -0
- three/src/nodes/accessors/Skinning.d.ts +23 -0
- three/src/nodes/accessors/StorageBufferNode.d.ts +22 -23
- three/src/nodes/accessors/StorageTexture3DNode.d.ts +17 -0
- three/src/nodes/accessors/StorageTextureNode.d.ts +6 -4
- three/src/nodes/accessors/TextureNode.d.ts +15 -10
- three/src/nodes/core/ArrayNode.d.ts +16 -8
- three/src/nodes/core/ContextNode.d.ts +5 -6
- three/src/nodes/core/LightingModel.d.ts +2 -0
- three/src/nodes/core/Node.d.ts +50 -51
- three/src/nodes/core/NodeBuilder.d.ts +1 -133
- three/src/nodes/core/OverrideContextNode.d.ts +92 -0
- three/src/nodes/core/PropertyNode.d.ts +13 -2
- three/src/nodes/core/StructNode.d.ts +0 -2
- three/src/nodes/core/StructTypeNode.d.ts +5 -4
- three/src/nodes/core/UniformNode.d.ts +48 -9
- three/src/nodes/display/BlendModes.d.ts +72 -11
- three/src/nodes/display/FrontFacingNode.d.ts +62 -3
- three/src/nodes/display/PassNode.d.ts +0 -2
- three/src/nodes/display/PremultiplyAlphaFunctions.d.ts +37 -0
- three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +53 -45
- three/src/nodes/lighting/LightingContextNode.d.ts +9 -2
- three/src/nodes/lighting/LightsNode.d.ts +4 -4
- three/src/nodes/math/MathNode.d.ts +358 -304
- three/src/nodes/math/OperatorNode.d.ts +253 -82
- three/src/nodes/tsl/TSLCore.d.ts +16 -9
- three/src/nodes/utils/ArrayElementNode.d.ts +5 -4
- three/src/nodes/utils/EquirectUV.d.ts +31 -1
- three/src/nodes/utils/Packing.d.ts +50 -3
- three/src/nodes/utils/RTTNode.d.ts +7 -12
- three/src/nodes/utils/Remap.d.ts +216 -29
- three/src/nodes/utils/SampleNode.d.ts +18 -8
- three/src/objects/BatchedMesh.d.ts +1 -1
- three/src/objects/InstancedMesh.d.ts +0 -8
- three/src/objects/Skeleton.d.ts +0 -2
- three/src/renderers/common/Backend.d.ts +0 -3
- three/src/renderers/common/CanvasTarget.d.ts +0 -49
- three/src/renderers/common/ClippingContext.d.ts +6 -1
- three/src/renderers/common/CubeRenderTarget.d.ts +2 -1
- three/src/renderers/common/Info.d.ts +26 -66
- three/src/renderers/common/InspectorBase.d.ts +0 -7
- three/src/renderers/common/Lighting.d.ts +49 -5
- three/src/renderers/common/Renderer.d.ts +34 -458
- three/src/renderers/common/RendererUtils.d.ts +1 -2
- three/src/renderers/common/TimestampQueryPool.d.ts +1 -1
- three/src/renderers/common/XRManager.d.ts +32 -299
- three/src/renderers/common/nodes/NodeLibrary.d.ts +0 -117
- three/src/renderers/webgl/WebGLPrograms.d.ts +2 -0
- three/src/renderers/webgl/WebGLRenderLists.d.ts +5 -1
- three/src/renderers/webgl/WebGLState.d.ts +2 -0
- three/src/renderers/webgl-fallback/WebGLBackend.d.ts +1 -1
- three/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts +0 -10
- three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +0 -1
- three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +5 -121
- three/src/textures/CubeDepthTexture.d.ts +2 -3
- three/src/textures/DataTexture.d.ts +2 -1
- three/src/textures/DepthTexture.d.ts +5 -5
- three/examples/jsm/lighting/TiledLighting.d.ts +0 -9
- three/examples/jsm/tsl/display/AnamorphicNode.d.ts +0 -31
- three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +0 -22
- three/src/nodes/accessors/BatchNode.d.ts +0 -12
- three/src/nodes/accessors/InstanceNode.d.ts +0 -30
- three/src/nodes/accessors/InstancedMeshNode.d.ts +0 -10
- three/src/nodes/accessors/MorphNode.d.ts +0 -14
- three/src/nodes/accessors/SkinningNode.d.ts +0 -32
- three/src/renderers/common/Animation.d.ts +0 -102
- three/src/renderers/common/Attributes.d.ts +0 -59
- three/src/renderers/common/Background.d.ts +0 -47
- three/src/renderers/common/BindGroup.d.ts +0 -39
- three/src/renderers/common/Binding.d.ts +0 -50
- three/src/renderers/common/Bindings.d.ts +0 -132
- three/src/renderers/common/Buffer.d.ts +0 -90
- three/src/renderers/common/ChainMap.d.ts +0 -49
- three/src/renderers/common/Color4.d.ts +0 -55
- three/src/renderers/common/ComputePipeline.d.ts +0 -34
- three/src/renderers/common/DataMap.d.ts +0 -42
- three/src/renderers/common/Geometries.d.ts +0 -111
- three/src/renderers/common/Pipeline.d.ts +0 -29
- three/src/renderers/common/Pipelines.d.ts +0 -186
- three/src/renderers/common/ProgrammableStage.d.ts +0 -73
- three/src/renderers/common/RenderBundle.d.ts +0 -25
- three/src/renderers/common/RenderBundles.d.ts +0 -34
- three/src/renderers/common/RenderContext.d.ts +0 -235
- three/src/renderers/common/RenderContexts.d.ts +0 -47
- three/src/renderers/common/RenderList.d.ts +0 -226
- three/src/renderers/common/RenderLists.d.ts +0 -46
- three/src/renderers/common/RenderObject.d.ts +0 -448
- three/src/renderers/common/RenderObjectPipeline.d.ts +0 -33
- three/src/renderers/common/RenderObjects.d.ts +0 -151
- three/src/renderers/common/SampledTexture.d.ts +0 -28
- three/src/renderers/common/Sampler.d.ts +0 -19
- three/src/renderers/common/Textures.d.ts +0 -125
- three/src/renderers/common/Uniform.d.ts +0 -262
- three/src/renderers/common/UniformBuffer.d.ts +0 -20
- three/src/renderers/common/UniformsGroup.d.ts +0 -152
- three/src/renderers/common/XRRenderTarget.d.ts +0 -67
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +0 -121
- three/src/renderers/common/nodes/NodeManager.d.ts +0 -309
- three/src/renderers/common/nodes/NodeSampledTexture.d.ts +0 -29
- three/src/renderers/common/nodes/NodeSampler.d.ts +0 -12
- three/src/renderers/common/nodes/NodeUniform.d.ts +0 -250
- three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +0 -41
- three/src/renderers/webgpu/nodes/WGSLNodeFunction.d.ts +0 -6
- three/src/renderers/webgpu/nodes/WGSLNodeParser.d.ts +0 -6
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { RenderTarget } from "../../core/RenderTarget.js";
|
|
2
|
-
import { Vector3 } from "../../math/Vector3.js";
|
|
3
|
-
import { Texture } from "../../textures/Texture.js";
|
|
4
|
-
import Backend from "./Backend.js";
|
|
5
|
-
import DataMap from "./DataMap.js";
|
|
6
|
-
import Info from "./Info.js";
|
|
7
|
-
import Renderer from "./Renderer.js";
|
|
8
|
-
|
|
9
|
-
interface TextureOptions {
|
|
10
|
-
width?: number;
|
|
11
|
-
height?: number;
|
|
12
|
-
depth?: number;
|
|
13
|
-
needsMipmaps?: boolean;
|
|
14
|
-
levels?: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* This module manages the textures of the renderer.
|
|
19
|
-
*
|
|
20
|
-
* @private
|
|
21
|
-
* @augments DataMap
|
|
22
|
-
*/
|
|
23
|
-
declare class Textures extends DataMap {
|
|
24
|
-
/**
|
|
25
|
-
* Constructs a new texture management component.
|
|
26
|
-
*
|
|
27
|
-
* @param {Renderer} renderer - The renderer.
|
|
28
|
-
* @param {Backend} backend - The renderer's backend.
|
|
29
|
-
* @param {Info} info - Renderer component for managing metrics and monitoring data.
|
|
30
|
-
*/
|
|
31
|
-
constructor(renderer: Renderer, backend: Backend, info: Info);
|
|
32
|
-
/**
|
|
33
|
-
* The renderer.
|
|
34
|
-
*
|
|
35
|
-
* @type {Renderer}
|
|
36
|
-
*/
|
|
37
|
-
renderer: Renderer;
|
|
38
|
-
/**
|
|
39
|
-
* The backend.
|
|
40
|
-
*
|
|
41
|
-
* @type {Backend}
|
|
42
|
-
*/
|
|
43
|
-
backend: Backend;
|
|
44
|
-
/**
|
|
45
|
-
* Renderer component for managing metrics and monitoring data.
|
|
46
|
-
*
|
|
47
|
-
* @type {Info}
|
|
48
|
-
*/
|
|
49
|
-
info: Info;
|
|
50
|
-
/**
|
|
51
|
-
* Updates the given render target. Based on the given render target configuration,
|
|
52
|
-
* it updates the texture states representing the attachments of the framebuffer.
|
|
53
|
-
*
|
|
54
|
-
* @param {RenderTarget} renderTarget - The render target to update.
|
|
55
|
-
* @param {number} [activeMipmapLevel=0] - The active mipmap level.
|
|
56
|
-
*/
|
|
57
|
-
updateRenderTarget(renderTarget: RenderTarget, activeMipmapLevel?: number): void;
|
|
58
|
-
/**
|
|
59
|
-
* Updates the given texture. Depending on the texture state, this method
|
|
60
|
-
* triggers the upload of texture data to the GPU memory. If the texture data are
|
|
61
|
-
* not yet ready for the upload, it uses default texture data for as a placeholder.
|
|
62
|
-
*
|
|
63
|
-
* @param {Texture} texture - The texture to update.
|
|
64
|
-
* @param {Object} [options={}] - The options.
|
|
65
|
-
*/
|
|
66
|
-
updateTexture(texture: Texture, options?: TextureOptions): void;
|
|
67
|
-
/**
|
|
68
|
-
* Updates the sampler for the given texture. This method has no effect
|
|
69
|
-
* for the WebGL backend since it has no concept of samplers. Texture
|
|
70
|
-
* parameters are configured with the `texParameter()` command for each
|
|
71
|
-
* texture.
|
|
72
|
-
*
|
|
73
|
-
* In WebGPU, samplers are objects like textures and it's possible to share
|
|
74
|
-
* them when the texture parameters match.
|
|
75
|
-
*
|
|
76
|
-
* @param {Texture} texture - The texture to update the sampler for.
|
|
77
|
-
* @return {string} The current sampler key.
|
|
78
|
-
*/
|
|
79
|
-
updateSampler(texture: Texture): string;
|
|
80
|
-
/**
|
|
81
|
-
* Computes the size of the given texture and writes the result
|
|
82
|
-
* into the target vector. This vector is also returned by the
|
|
83
|
-
* method.
|
|
84
|
-
*
|
|
85
|
-
* If no texture data are available for the compute yet, the method
|
|
86
|
-
* returns default size values.
|
|
87
|
-
*
|
|
88
|
-
* @param {Texture} texture - The texture to compute the size for.
|
|
89
|
-
* @param {Vector3} target - The target vector.
|
|
90
|
-
* @return {Vector3} The target vector.
|
|
91
|
-
*/
|
|
92
|
-
getSize(texture: Texture, target?: Vector3): Vector3;
|
|
93
|
-
/**
|
|
94
|
-
* Computes the number of mipmap levels for the given texture.
|
|
95
|
-
*
|
|
96
|
-
* @param {Texture} texture - The texture.
|
|
97
|
-
* @param {number} width - The texture's width.
|
|
98
|
-
* @param {number} height - The texture's height.
|
|
99
|
-
* @return {number} The number of mipmap levels.
|
|
100
|
-
*/
|
|
101
|
-
getMipLevels(texture: Texture, width: number, height: number): number;
|
|
102
|
-
/**
|
|
103
|
-
* Returns `true` if the given texture makes use of mipmapping.
|
|
104
|
-
*
|
|
105
|
-
* @param {Texture} texture - The texture.
|
|
106
|
-
* @return {boolean} Whether mipmaps are required or not.
|
|
107
|
-
*/
|
|
108
|
-
needsMipmaps(texture: Texture): boolean;
|
|
109
|
-
/**
|
|
110
|
-
* Frees internal resources when the given render target isn't
|
|
111
|
-
* required anymore.
|
|
112
|
-
*
|
|
113
|
-
* @param {RenderTarget} renderTarget - The render target to destroy.
|
|
114
|
-
*/
|
|
115
|
-
_destroyRenderTarget(renderTarget: RenderTarget): void;
|
|
116
|
-
/**
|
|
117
|
-
* Frees internal resource when the given texture isn't
|
|
118
|
-
* required anymore.
|
|
119
|
-
*
|
|
120
|
-
* @param {Texture} texture - The texture to destroy.
|
|
121
|
-
*/
|
|
122
|
-
_destroyTexture(texture: Texture): void;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export default Textures;
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
import { Color } from "../../math/Color.js";
|
|
2
|
-
import { Matrix2 } from "../../math/Matrix2.js";
|
|
3
|
-
import { Matrix3 } from "../../math/Matrix3.js";
|
|
4
|
-
import { Matrix4 } from "../../math/Matrix4.js";
|
|
5
|
-
import { Vector2 } from "../../math/Vector2.js";
|
|
6
|
-
import { Vector3 } from "../../math/Vector3.js";
|
|
7
|
-
import { Vector4 } from "../../math/Vector4.js";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Represents a Number uniform.
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
13
|
-
* @augments Uniform
|
|
14
|
-
*/
|
|
15
|
-
export class NumberUniform extends Uniform<number> {
|
|
16
|
-
/**
|
|
17
|
-
* Constructs a new Number uniform.
|
|
18
|
-
*
|
|
19
|
-
* @param {string} name - The uniform's name.
|
|
20
|
-
* @param {number} value - The uniform's value.
|
|
21
|
-
*/
|
|
22
|
-
constructor(name: string, value?: number);
|
|
23
|
-
/**
|
|
24
|
-
* This flag can be used for type testing.
|
|
25
|
-
*
|
|
26
|
-
* @type {boolean}
|
|
27
|
-
* @readonly
|
|
28
|
-
* @default true
|
|
29
|
-
*/
|
|
30
|
-
readonly isNumberUniform: boolean;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Represents a Vector2 uniform.
|
|
34
|
-
*
|
|
35
|
-
* @private
|
|
36
|
-
* @augments Uniform
|
|
37
|
-
*/
|
|
38
|
-
export class Vector2Uniform extends Uniform<Vector2> {
|
|
39
|
-
/**
|
|
40
|
-
* Constructs a new Number uniform.
|
|
41
|
-
*
|
|
42
|
-
* @param {string} name - The uniform's name.
|
|
43
|
-
* @param {Vector2} value - The uniform's value.
|
|
44
|
-
*/
|
|
45
|
-
constructor(name: string, value?: Vector2);
|
|
46
|
-
/**
|
|
47
|
-
* This flag can be used for type testing.
|
|
48
|
-
*
|
|
49
|
-
* @type {boolean}
|
|
50
|
-
* @readonly
|
|
51
|
-
* @default true
|
|
52
|
-
*/
|
|
53
|
-
readonly isVector2Uniform: boolean;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Represents a Vector3 uniform.
|
|
57
|
-
*
|
|
58
|
-
* @private
|
|
59
|
-
* @augments Uniform
|
|
60
|
-
*/
|
|
61
|
-
export class Vector3Uniform extends Uniform<Vector3> {
|
|
62
|
-
/**
|
|
63
|
-
* Constructs a new Number uniform.
|
|
64
|
-
*
|
|
65
|
-
* @param {string} name - The uniform's name.
|
|
66
|
-
* @param {Vector3} value - The uniform's value.
|
|
67
|
-
*/
|
|
68
|
-
constructor(name: string, value?: Vector3);
|
|
69
|
-
/**
|
|
70
|
-
* This flag can be used for type testing.
|
|
71
|
-
*
|
|
72
|
-
* @type {boolean}
|
|
73
|
-
* @readonly
|
|
74
|
-
* @default true
|
|
75
|
-
*/
|
|
76
|
-
readonly isVector3Uniform: boolean;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Represents a Vector4 uniform.
|
|
80
|
-
*
|
|
81
|
-
* @private
|
|
82
|
-
* @augments Uniform
|
|
83
|
-
*/
|
|
84
|
-
export class Vector4Uniform extends Uniform<Vector4> {
|
|
85
|
-
/**
|
|
86
|
-
* Constructs a new Number uniform.
|
|
87
|
-
*
|
|
88
|
-
* @param {string} name - The uniform's name.
|
|
89
|
-
* @param {Vector4} value - The uniform's value.
|
|
90
|
-
*/
|
|
91
|
-
constructor(name: string, value?: Vector4);
|
|
92
|
-
/**
|
|
93
|
-
* This flag can be used for type testing.
|
|
94
|
-
*
|
|
95
|
-
* @type {boolean}
|
|
96
|
-
* @readonly
|
|
97
|
-
* @default true
|
|
98
|
-
*/
|
|
99
|
-
readonly isVector4Uniform: boolean;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Represents a Color uniform.
|
|
103
|
-
*
|
|
104
|
-
* @private
|
|
105
|
-
* @augments Uniform
|
|
106
|
-
*/
|
|
107
|
-
export class ColorUniform extends Uniform<Color> {
|
|
108
|
-
/**
|
|
109
|
-
* Constructs a new Number uniform.
|
|
110
|
-
*
|
|
111
|
-
* @param {string} name - The uniform's name.
|
|
112
|
-
* @param {Color} value - The uniform's value.
|
|
113
|
-
*/
|
|
114
|
-
constructor(name: string, value?: Color);
|
|
115
|
-
/**
|
|
116
|
-
* This flag can be used for type testing.
|
|
117
|
-
*
|
|
118
|
-
* @type {boolean}
|
|
119
|
-
* @readonly
|
|
120
|
-
* @default true
|
|
121
|
-
*/
|
|
122
|
-
readonly isColorUniform: boolean;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Represents a Matrix2 uniform.
|
|
126
|
-
*
|
|
127
|
-
* @private
|
|
128
|
-
* @augments Uniform
|
|
129
|
-
*/
|
|
130
|
-
export class Matrix2Uniform extends Uniform<Matrix2> {
|
|
131
|
-
/**
|
|
132
|
-
* Constructs a new Number uniform.
|
|
133
|
-
*
|
|
134
|
-
* @param {string} name - The uniform's name.
|
|
135
|
-
* @param {Matrix2} value - The uniform's value.
|
|
136
|
-
*/
|
|
137
|
-
constructor(name: string, value?: Matrix2);
|
|
138
|
-
/**
|
|
139
|
-
* This flag can be used for type testing.
|
|
140
|
-
*
|
|
141
|
-
* @type {boolean}
|
|
142
|
-
* @readonly
|
|
143
|
-
* @default true
|
|
144
|
-
*/
|
|
145
|
-
readonly isMatrix2Uniform: boolean;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Represents a Matrix3 uniform.
|
|
149
|
-
*
|
|
150
|
-
* @private
|
|
151
|
-
* @augments Uniform
|
|
152
|
-
*/
|
|
153
|
-
export class Matrix3Uniform extends Uniform<Matrix3> {
|
|
154
|
-
/**
|
|
155
|
-
* Constructs a new Number uniform.
|
|
156
|
-
*
|
|
157
|
-
* @param {string} name - The uniform's name.
|
|
158
|
-
* @param {Matrix3} value - The uniform's value.
|
|
159
|
-
*/
|
|
160
|
-
constructor(name: string, value?: Matrix3);
|
|
161
|
-
/**
|
|
162
|
-
* This flag can be used for type testing.
|
|
163
|
-
*
|
|
164
|
-
* @type {boolean}
|
|
165
|
-
* @readonly
|
|
166
|
-
* @default true
|
|
167
|
-
*/
|
|
168
|
-
readonly isMatrix3Uniform: boolean;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Represents a Matrix4 uniform.
|
|
172
|
-
*
|
|
173
|
-
* @private
|
|
174
|
-
* @augments Uniform
|
|
175
|
-
*/
|
|
176
|
-
export class Matrix4Uniform extends Uniform<Matrix4> {
|
|
177
|
-
/**
|
|
178
|
-
* Constructs a new Number uniform.
|
|
179
|
-
*
|
|
180
|
-
* @param {string} name - The uniform's name.
|
|
181
|
-
* @param {Matrix4} value - The uniform's value.
|
|
182
|
-
*/
|
|
183
|
-
constructor(name: string, value?: Matrix4);
|
|
184
|
-
/**
|
|
185
|
-
* This flag can be used for type testing.
|
|
186
|
-
*
|
|
187
|
-
* @type {boolean}
|
|
188
|
-
* @readonly
|
|
189
|
-
* @default true
|
|
190
|
-
*/
|
|
191
|
-
readonly isMatrix4Uniform: boolean;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Abstract base class for uniforms.
|
|
195
|
-
*
|
|
196
|
-
* @abstract
|
|
197
|
-
* @private
|
|
198
|
-
*/
|
|
199
|
-
declare class Uniform<TValue> {
|
|
200
|
-
/**
|
|
201
|
-
* Constructs a new uniform.
|
|
202
|
-
*
|
|
203
|
-
* @param {string} name - The uniform's name.
|
|
204
|
-
* @param {any} value - The uniform's value.
|
|
205
|
-
*/
|
|
206
|
-
constructor(name: string, value: TValue);
|
|
207
|
-
/**
|
|
208
|
-
* The uniform's name.
|
|
209
|
-
*
|
|
210
|
-
* @type {string}
|
|
211
|
-
*/
|
|
212
|
-
name: string;
|
|
213
|
-
/**
|
|
214
|
-
* The uniform's value.
|
|
215
|
-
*
|
|
216
|
-
* @type {any}
|
|
217
|
-
*/
|
|
218
|
-
value: TValue;
|
|
219
|
-
/**
|
|
220
|
-
* Used to build the uniform buffer according to the STD140 layout.
|
|
221
|
-
* Derived uniforms will set this property to a data type specific
|
|
222
|
-
* value.
|
|
223
|
-
*
|
|
224
|
-
* @type {number}
|
|
225
|
-
*/
|
|
226
|
-
boundary: number;
|
|
227
|
-
/**
|
|
228
|
-
* The item size. Derived uniforms will set this property to a data
|
|
229
|
-
* type specific value.
|
|
230
|
-
*
|
|
231
|
-
* @type {number}
|
|
232
|
-
*/
|
|
233
|
-
itemSize: number;
|
|
234
|
-
/**
|
|
235
|
-
* This property is set by {@link UniformsGroup} and marks
|
|
236
|
-
* the start position in the uniform buffer.
|
|
237
|
-
*
|
|
238
|
-
* @type {number}
|
|
239
|
-
*/
|
|
240
|
-
offset: number;
|
|
241
|
-
/**
|
|
242
|
-
* This property is set by {@link UniformsGroup} and marks
|
|
243
|
-
* the index position in the uniform array.
|
|
244
|
-
*
|
|
245
|
-
* @type {number}
|
|
246
|
-
*/
|
|
247
|
-
index: number;
|
|
248
|
-
/**
|
|
249
|
-
* Sets the uniform's value.
|
|
250
|
-
*
|
|
251
|
-
* @param {any} value - The value to set.
|
|
252
|
-
*/
|
|
253
|
-
setValue(value: TValue): void;
|
|
254
|
-
/**
|
|
255
|
-
* Returns the uniform's value.
|
|
256
|
-
*
|
|
257
|
-
* @return {any} The value.
|
|
258
|
-
*/
|
|
259
|
-
getValue(): TValue;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
export type { Uniform };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import Buffer from "./Buffer.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Represents a uniform buffer binding type.
|
|
5
|
-
*
|
|
6
|
-
* @private
|
|
7
|
-
* @augments Buffer
|
|
8
|
-
*/
|
|
9
|
-
declare class UniformBuffer extends Buffer {
|
|
10
|
-
/**
|
|
11
|
-
* This flag can be used for type testing.
|
|
12
|
-
*
|
|
13
|
-
* @type {boolean}
|
|
14
|
-
* @readonly
|
|
15
|
-
* @default true
|
|
16
|
-
*/
|
|
17
|
-
readonly isUniformBuffer: boolean;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default UniformBuffer;
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ColorNodeUniform,
|
|
3
|
-
Matrix3NodeUniform,
|
|
4
|
-
Matrix4NodeUniform,
|
|
5
|
-
NodeUniformGPU,
|
|
6
|
-
NumberNodeUniform,
|
|
7
|
-
Vector2NodeUniform,
|
|
8
|
-
Vector3NodeUniform,
|
|
9
|
-
Vector4NodeUniform,
|
|
10
|
-
} from "./nodes/NodeUniform.js";
|
|
11
|
-
import { Uniform } from "./Uniform.js";
|
|
12
|
-
import UniformBuffer from "./UniformBuffer.js";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* This class represents a uniform buffer binding but with
|
|
16
|
-
* an API that allows to maintain individual uniform objects.
|
|
17
|
-
*
|
|
18
|
-
* @private
|
|
19
|
-
* @augments UniformBuffer
|
|
20
|
-
*/
|
|
21
|
-
declare class UniformsGroup extends UniformBuffer {
|
|
22
|
-
/**
|
|
23
|
-
* Constructs a new uniforms group.
|
|
24
|
-
*
|
|
25
|
-
* @param {string} name - The group's name.
|
|
26
|
-
*/
|
|
27
|
-
constructor(name: string);
|
|
28
|
-
/**
|
|
29
|
-
* This flag can be used for type testing.
|
|
30
|
-
*
|
|
31
|
-
* @type {boolean}
|
|
32
|
-
* @readonly
|
|
33
|
-
* @default true
|
|
34
|
-
*/
|
|
35
|
-
readonly isUniformsGroup: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* An array with the raw uniform values.
|
|
38
|
-
*
|
|
39
|
-
* @private
|
|
40
|
-
* @type {?Array<number>}
|
|
41
|
-
* @default null
|
|
42
|
-
*/
|
|
43
|
-
private _values;
|
|
44
|
-
/**
|
|
45
|
-
* An array of uniform objects.
|
|
46
|
-
*
|
|
47
|
-
* The order of uniforms in this array must match the order of uniforms in the shader.
|
|
48
|
-
*
|
|
49
|
-
* @type {Array<Uniform>}
|
|
50
|
-
*/
|
|
51
|
-
uniforms: NodeUniformGPU[];
|
|
52
|
-
/**
|
|
53
|
-
* A cache for the uniform update ranges.
|
|
54
|
-
*
|
|
55
|
-
* @private
|
|
56
|
-
* @type {Map<number, {start: number, count: number}>}
|
|
57
|
-
*/
|
|
58
|
-
private _updateRangeCache;
|
|
59
|
-
/**
|
|
60
|
-
* Adds a uniform's update range to this buffer.
|
|
61
|
-
*
|
|
62
|
-
* @param {Uniform} uniform - The uniform.
|
|
63
|
-
*/
|
|
64
|
-
addUniformUpdateRange(uniform: Uniform<unknown>): void;
|
|
65
|
-
/**
|
|
66
|
-
* Adds a uniform to this group.
|
|
67
|
-
*
|
|
68
|
-
* @param {Uniform} uniform - The uniform to add.
|
|
69
|
-
* @return {UniformsGroup} A reference to this group.
|
|
70
|
-
*/
|
|
71
|
-
addUniform(uniform: NodeUniformGPU): this;
|
|
72
|
-
/**
|
|
73
|
-
* Removes a uniform from this group.
|
|
74
|
-
*
|
|
75
|
-
* @param {Uniform} uniform - The uniform to remove.
|
|
76
|
-
* @return {UniformsGroup} A reference to this group.
|
|
77
|
-
*/
|
|
78
|
-
removeUniform(uniform: NodeUniformGPU): this;
|
|
79
|
-
/**
|
|
80
|
-
* An array with the raw uniform values.
|
|
81
|
-
*
|
|
82
|
-
* @type {Array<number>}
|
|
83
|
-
*/
|
|
84
|
-
get values(): number[];
|
|
85
|
-
/**
|
|
86
|
-
* Updates a given uniform by calling an update method matching
|
|
87
|
-
* the uniforms type.
|
|
88
|
-
*
|
|
89
|
-
* @param {Uniform} uniform - The uniform to update.
|
|
90
|
-
* @return {boolean} Whether the uniform has been updated or not.
|
|
91
|
-
*/
|
|
92
|
-
updateByType(uniform: NodeUniformGPU): boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Updates a given Number uniform.
|
|
95
|
-
*
|
|
96
|
-
* @param {NumberUniform} uniform - The Number uniform.
|
|
97
|
-
* @return {boolean} Whether the uniform has been updated or not.
|
|
98
|
-
*/
|
|
99
|
-
updateNumber(uniform: NumberNodeUniform<unknown>): boolean;
|
|
100
|
-
/**
|
|
101
|
-
* Updates a given Vector2 uniform.
|
|
102
|
-
*
|
|
103
|
-
* @param {Vector2Uniform} uniform - The Vector2 uniform.
|
|
104
|
-
* @return {boolean} Whether the uniform has been updated or not.
|
|
105
|
-
*/
|
|
106
|
-
updateVector2(uniform: Vector2NodeUniform<unknown>): boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Updates a given Vector3 uniform.
|
|
109
|
-
*
|
|
110
|
-
* @param {Vector3Uniform} uniform - The Vector3 uniform.
|
|
111
|
-
* @return {boolean} Whether the uniform has been updated or not.
|
|
112
|
-
*/
|
|
113
|
-
updateVector3(uniform: Vector3NodeUniform<unknown>): boolean;
|
|
114
|
-
/**
|
|
115
|
-
* Updates a given Vector4 uniform.
|
|
116
|
-
*
|
|
117
|
-
* @param {Vector4Uniform} uniform - The Vector4 uniform.
|
|
118
|
-
* @return {boolean} Whether the uniform has been updated or not.
|
|
119
|
-
*/
|
|
120
|
-
updateVector4(uniform: Vector4NodeUniform<unknown>): boolean;
|
|
121
|
-
/**
|
|
122
|
-
* Updates a given Color uniform.
|
|
123
|
-
*
|
|
124
|
-
* @param {ColorUniform} uniform - The Color uniform.
|
|
125
|
-
* @return {boolean} Whether the uniform has been updated or not.
|
|
126
|
-
*/
|
|
127
|
-
updateColor(uniform: ColorNodeUniform<unknown>): boolean;
|
|
128
|
-
/**
|
|
129
|
-
* Updates a given Matrix3 uniform.
|
|
130
|
-
*
|
|
131
|
-
* @param {Matrix3Uniform} uniform - The Matrix3 uniform.
|
|
132
|
-
* @return {boolean} Whether the uniform has been updated or not.
|
|
133
|
-
*/
|
|
134
|
-
updateMatrix3(uniform: Matrix3NodeUniform<unknown>): boolean;
|
|
135
|
-
/**
|
|
136
|
-
* Updates a given Matrix4 uniform.
|
|
137
|
-
*
|
|
138
|
-
* @param {Matrix4Uniform} uniform - The Matrix4 uniform.
|
|
139
|
-
* @return {boolean} Whether the uniform has been updated or not.
|
|
140
|
-
*/
|
|
141
|
-
updateMatrix4(uniform: Matrix4NodeUniform<unknown>): boolean;
|
|
142
|
-
/**
|
|
143
|
-
* Returns a typed array that matches the given data type.
|
|
144
|
-
*
|
|
145
|
-
* @private
|
|
146
|
-
* @param {string} type - The data type.
|
|
147
|
-
* @return {TypedArray} The typed array.
|
|
148
|
-
*/
|
|
149
|
-
private _getBufferForType;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export default UniformsGroup;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { RenderTarget, RenderTargetOptions } from "../../core/RenderTarget.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A special type of render target that is used when rendering
|
|
5
|
-
* with the WebXR Device API.
|
|
6
|
-
*
|
|
7
|
-
* @private
|
|
8
|
-
* @augments RenderTarget
|
|
9
|
-
*/
|
|
10
|
-
export class XRRenderTarget extends RenderTarget {
|
|
11
|
-
/**
|
|
12
|
-
* Constructs a new XR render target.
|
|
13
|
-
*
|
|
14
|
-
* @param {number} [width=1] - The width of the render target.
|
|
15
|
-
* @param {number} [height=1] - The height of the render target.
|
|
16
|
-
* @param {Object} [options={}] - The configuration options.
|
|
17
|
-
*/
|
|
18
|
-
constructor(width?: number, height?: number, options?: RenderTargetOptions);
|
|
19
|
-
/**
|
|
20
|
-
* This flag can be used for type testing.
|
|
21
|
-
*
|
|
22
|
-
* @type {boolean}
|
|
23
|
-
* @readonly
|
|
24
|
-
* @default true
|
|
25
|
-
*/
|
|
26
|
-
readonly isXRRenderTarget: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Whether the attachments of the render target
|
|
29
|
-
* are defined by external textures. This flag is
|
|
30
|
-
* set to `true` when using the WebXR Layers API.
|
|
31
|
-
*
|
|
32
|
-
* @private
|
|
33
|
-
* @type {boolean}
|
|
34
|
-
* @default false
|
|
35
|
-
*/
|
|
36
|
-
private _hasExternalTextures;
|
|
37
|
-
/**
|
|
38
|
-
* Whether a depth buffer should automatically be allocated
|
|
39
|
-
* for this XR render target or not.
|
|
40
|
-
*
|
|
41
|
-
* Allocating a depth buffer is the default behavior of XR render
|
|
42
|
-
* targets. However, when using the WebXR Layers API, this flag
|
|
43
|
-
* must be set to `false` when the `ignoreDepthValues` property of
|
|
44
|
-
* the projection layers evaluates to `false`.
|
|
45
|
-
*
|
|
46
|
-
* Reference: {@link https://www.w3.org/TR/webxrlayers-1/#dom-xrprojectionlayer-ignoredepthvalues}.
|
|
47
|
-
*
|
|
48
|
-
* @private
|
|
49
|
-
* @type {boolean}
|
|
50
|
-
* @default true
|
|
51
|
-
*/
|
|
52
|
-
private _autoAllocateDepthBuffer;
|
|
53
|
-
/**
|
|
54
|
-
* Whether this render target is associated with a XRWebGLLayer.
|
|
55
|
-
*
|
|
56
|
-
* A XRWebGLLayer points to an opaque framebuffer. Basically,
|
|
57
|
-
* this means that you don't have access to its bound color,
|
|
58
|
-
* stencil and depth buffers. We need to handle this framebuffer
|
|
59
|
-
* differently since its textures are always bound.
|
|
60
|
-
*
|
|
61
|
-
* @private
|
|
62
|
-
* @type {boolean}
|
|
63
|
-
* @default false
|
|
64
|
-
*/
|
|
65
|
-
private _isOpaqueFramebuffer;
|
|
66
|
-
copy(source: XRRenderTarget): this;
|
|
67
|
-
}
|