@types/three 0.184.1 → 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/Matrix3.d.ts +9 -0
- three/src/math/Matrix4.d.ts +329 -105
- three/src/math/Vector3.d.ts +2 -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
three/src/nodes/core/Node.d.ts
CHANGED
|
@@ -154,30 +154,6 @@ declare class NodeClass<TEventMap extends NodeClassEventMap = NodeClassEventMap>
|
|
|
154
154
|
* @default true
|
|
155
155
|
*/
|
|
156
156
|
readonly isNode: boolean;
|
|
157
|
-
/**
|
|
158
|
-
* The cache key of this node.
|
|
159
|
-
*
|
|
160
|
-
* @private
|
|
161
|
-
* @type {?number}
|
|
162
|
-
* @default null
|
|
163
|
-
*/
|
|
164
|
-
private _cacheKey;
|
|
165
|
-
/**
|
|
166
|
-
* The UUID of the node.
|
|
167
|
-
*
|
|
168
|
-
* @type {string}
|
|
169
|
-
* @default null
|
|
170
|
-
* @private
|
|
171
|
-
*/
|
|
172
|
-
private _uuid;
|
|
173
|
-
/**
|
|
174
|
-
* The cache key's version.
|
|
175
|
-
*
|
|
176
|
-
* @private
|
|
177
|
-
* @type {number}
|
|
178
|
-
* @default 0
|
|
179
|
-
*/
|
|
180
|
-
private _cacheKeyVersion;
|
|
181
157
|
/**
|
|
182
158
|
* The unique ID of the node.
|
|
183
159
|
*
|
|
@@ -238,7 +214,7 @@ declare class NodeClass<TEventMap extends NodeClassEventMap = NodeClassEventMap>
|
|
|
238
214
|
* @param {Function} callback - The update method.
|
|
239
215
|
* @return {Node} A reference to this node.
|
|
240
216
|
*/
|
|
241
|
-
onFrameUpdate(callback: (this: this, frame: NodeFrame) =>
|
|
217
|
+
onFrameUpdate(callback: (this: this, frame: NodeFrame) => unknown): this;
|
|
242
218
|
/**
|
|
243
219
|
* Convenient method for defining {@link Node#update}. Similar to {@link Node#onUpdate}, but
|
|
244
220
|
* this method automatically sets the update type to `RENDER`.
|
|
@@ -246,7 +222,7 @@ declare class NodeClass<TEventMap extends NodeClassEventMap = NodeClassEventMap>
|
|
|
246
222
|
* @param {Function} callback - The update method.
|
|
247
223
|
* @return {Node} A reference to this node.
|
|
248
224
|
*/
|
|
249
|
-
onRenderUpdate(callback: (this: this, frame: NodeFrame) =>
|
|
225
|
+
onRenderUpdate(callback: (this: this, frame: NodeFrame) => unknown): this;
|
|
250
226
|
/**
|
|
251
227
|
* Convenient method for defining {@link Node#update}. Similar to {@link Node#onUpdate}, but
|
|
252
228
|
* this method automatically sets the update type to `OBJECT`.
|
|
@@ -254,7 +230,7 @@ declare class NodeClass<TEventMap extends NodeClassEventMap = NodeClassEventMap>
|
|
|
254
230
|
* @param {Function} callback - The update method.
|
|
255
231
|
* @return {Node} A reference to this node.
|
|
256
232
|
*/
|
|
257
|
-
onObjectUpdate(callback: (this: this, frame: NodeFrame) =>
|
|
233
|
+
onObjectUpdate(callback: (this: this, frame: NodeFrame) => unknown): this;
|
|
258
234
|
/**
|
|
259
235
|
* Convenient method for defining {@link Node#updateReference}.
|
|
260
236
|
*
|
|
@@ -297,14 +273,6 @@ declare class NodeClass<TEventMap extends NodeClassEventMap = NodeClassEventMap>
|
|
|
297
273
|
* @param {traverseCallback} callback - A callback that is executed per node.
|
|
298
274
|
*/
|
|
299
275
|
traverse(callback: (node: Node) => void): void;
|
|
300
|
-
/**
|
|
301
|
-
* Returns the child nodes of this node.
|
|
302
|
-
*
|
|
303
|
-
* @private
|
|
304
|
-
* @param {Set<Node>} [ignores=new Set()] - A set of nodes to ignore during the search to avoid circular references.
|
|
305
|
-
* @returns {Array<Object>} An array of objects describing the child nodes.
|
|
306
|
-
*/
|
|
307
|
-
private _getChildren;
|
|
308
276
|
/**
|
|
309
277
|
* Returns the cache key for this node.
|
|
310
278
|
*
|
|
@@ -389,7 +357,8 @@ declare class NodeClass<TEventMap extends NodeClassEventMap = NodeClassEventMap>
|
|
|
389
357
|
* This method is used during the build process of a node and ensures
|
|
390
358
|
* equal nodes are not built multiple times but just once. For example if
|
|
391
359
|
* `attribute( 'uv' )` is used multiple times by the user, the build
|
|
392
|
-
* process makes sure to process just the first node.
|
|
360
|
+
* process makes sure to process just the first node. It also handles
|
|
361
|
+
* node overrides if an override context is set.
|
|
393
362
|
*
|
|
394
363
|
* @param {NodeBuilder} builder - The current node builder.
|
|
395
364
|
* @return {Node} The shared node if possible. Otherwise `this` is returned.
|
|
@@ -563,6 +532,18 @@ export interface ColorExtensions {
|
|
|
563
532
|
export interface FloatVecExtensions<TVec extends FloatVecType> {
|
|
564
533
|
}
|
|
565
534
|
|
|
535
|
+
export interface FloatOrVecExtensions<TNodeType> {
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export interface IntOrVecExtensions<TNodeType> {
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
export interface UintOrVecExtensions<TNodeType> {
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
export interface BoolOrVecExtensions<TNodeType> {
|
|
545
|
+
}
|
|
546
|
+
|
|
566
547
|
export interface Mat2Extensions {
|
|
567
548
|
}
|
|
568
549
|
|
|
@@ -579,36 +560,54 @@ type Node<TNodeType = unknown> =
|
|
|
579
560
|
& NodeClass
|
|
580
561
|
& NodeElements
|
|
581
562
|
& (unknown extends TNodeType ? {} : NodeExtensions<TNodeType>)
|
|
582
|
-
& (TNodeType extends "float"
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
563
|
+
& (TNodeType extends "float"
|
|
564
|
+
? NumOrBoolExtensions<"float"> & FloatExtensions & NumExtensions<"float"> & FloatOrVecExtensions<"float">
|
|
565
|
+
: TNodeType extends "int" ?
|
|
566
|
+
& NumOrBoolExtensions<"int">
|
|
567
|
+
& IntExtensions
|
|
568
|
+
& NumExtensions<"int">
|
|
569
|
+
& IntegerExtensions<"int">
|
|
570
|
+
& IntOrVecExtensions<"int">
|
|
571
|
+
: TNodeType extends "uint" ?
|
|
572
|
+
& NumOrBoolExtensions<"uint">
|
|
573
|
+
& UintExtensions
|
|
574
|
+
& NumExtensions<"uint">
|
|
575
|
+
& IntegerExtensions<"uint">
|
|
576
|
+
& IntOrVecExtensions<"uint">
|
|
577
|
+
: TNodeType extends "bool" ? NumOrBoolExtensions<"bool"> & BoolExtensions & BoolOrVecExtensions<"bool">
|
|
588
578
|
: TNodeType extends "vec2" ?
|
|
589
579
|
& NumOrBoolVec2Extensions<"float">
|
|
590
580
|
& Vec2Extensions
|
|
591
581
|
& NumVec2Extensions<"float">
|
|
592
582
|
& FloatVecExtensions<"vec2">
|
|
593
|
-
|
|
594
|
-
: TNodeType extends "
|
|
595
|
-
|
|
583
|
+
& FloatOrVecExtensions<"vec2">
|
|
584
|
+
: TNodeType extends "ivec2"
|
|
585
|
+
? NumOrBoolVec2Extensions<"int"> & NumVec2Extensions<"int"> & IntOrVecExtensions<"ivec2">
|
|
586
|
+
: TNodeType extends "uvec2"
|
|
587
|
+
? NumOrBoolVec2Extensions<"uint"> & NumVec2Extensions<"uint"> & IntOrVecExtensions<"uvec2">
|
|
588
|
+
: TNodeType extends "bvec2" ? NumOrBoolVec2Extensions<"bool"> & BoolOrVecExtensions<"bvec2">
|
|
596
589
|
: TNodeType extends "vec3" ?
|
|
597
590
|
& NumOrBoolVec3Extensions<"float">
|
|
598
591
|
& Vec3Extensions
|
|
599
592
|
& NumVec3Extensions<"float">
|
|
600
593
|
& FloatVecExtensions<"vec3">
|
|
601
|
-
|
|
602
|
-
: TNodeType extends "
|
|
603
|
-
|
|
594
|
+
& FloatOrVecExtensions<"vec3">
|
|
595
|
+
: TNodeType extends "ivec3"
|
|
596
|
+
? NumOrBoolVec3Extensions<"int"> & NumVec3Extensions<"int"> & IntOrVecExtensions<"ivec3">
|
|
597
|
+
: TNodeType extends "uvec3"
|
|
598
|
+
? NumOrBoolVec3Extensions<"uint"> & NumVec3Extensions<"uint"> & IntOrVecExtensions<"uvec3">
|
|
599
|
+
: TNodeType extends "bvec3" ? NumOrBoolVec3Extensions<"bool"> & BoolOrVecExtensions<"bvec3">
|
|
604
600
|
: TNodeType extends "vec4" ?
|
|
605
601
|
& NumOrBoolVec4Extensions<"float">
|
|
606
602
|
& Vec4Extensions
|
|
607
603
|
& NumVec4Extensions<"float">
|
|
608
604
|
& FloatVecExtensions<"vec4">
|
|
609
|
-
|
|
610
|
-
: TNodeType extends "
|
|
611
|
-
|
|
605
|
+
& FloatOrVecExtensions<"vec4">
|
|
606
|
+
: TNodeType extends "ivec4"
|
|
607
|
+
? NumOrBoolVec4Extensions<"int"> & NumVec4Extensions<"int"> & IntOrVecExtensions<"ivec4">
|
|
608
|
+
: TNodeType extends "uvec4"
|
|
609
|
+
? NumOrBoolVec4Extensions<"uint"> & NumVec4Extensions<"uint"> & IntOrVecExtensions<"uvec4">
|
|
610
|
+
: TNodeType extends "bvec4" ? NumOrBoolVec4Extensions<"bool"> & BoolOrVecExtensions<"bvec4">
|
|
612
611
|
: TNodeType extends "color" ? ColorExtensions
|
|
613
612
|
: TNodeType extends "mat2" ? Mat2Extensions & MatExtensions<"mat2">
|
|
614
613
|
: TNodeType extends "mat3" ? Mat3Extensions & MatExtensions<"mat3">
|
|
@@ -2,143 +2,11 @@ import { BufferGeometry } from "../../core/BufferGeometry.js";
|
|
|
2
2
|
import { Object3D } from "../../core/Object3D.js";
|
|
3
3
|
import { Material } from "../../materials/Material.js";
|
|
4
4
|
import Renderer from "../../renderers/common/Renderer.js";
|
|
5
|
-
import { Texture } from "../../textures/Texture.js";
|
|
6
|
-
import LightsNode from "../lighting/LightsNode.js";
|
|
7
|
-
import { NodeShaderStage } from "./constants.js";
|
|
8
|
-
import Node from "./Node.js";
|
|
9
|
-
import NodeAttribute from "./NodeAttribute.js";
|
|
10
|
-
import NodeCache from "./NodeCache.js";
|
|
11
|
-
import NodeParser from "./NodeParser.js";
|
|
12
|
-
import NodeUniform from "./NodeUniform.js";
|
|
13
|
-
import NodeVar from "./NodeVar.js";
|
|
14
|
-
import NodeVarying from "./NodeVarying.js";
|
|
15
|
-
import StackNode from "./StackNode.js";
|
|
16
|
-
|
|
17
|
-
export type BuildStageOption = "construct" | "analyze" | "generate";
|
|
18
|
-
|
|
19
|
-
export interface FlowData {
|
|
20
|
-
code: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface NodeData {
|
|
24
|
-
vertex: { [key: string]: unknown };
|
|
25
|
-
fragment: { [key: string]: unknown };
|
|
26
|
-
compute: { [key: string]: unknown };
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface NodeBuilderContext {
|
|
30
|
-
[key: string]: unknown;
|
|
31
|
-
}
|
|
32
5
|
|
|
33
6
|
export default abstract class NodeBuilder {
|
|
34
7
|
object: Object3D;
|
|
35
8
|
material: Material;
|
|
36
9
|
geometry: BufferGeometry;
|
|
37
10
|
renderer: Renderer;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
nodes: Node[];
|
|
41
|
-
updateNodes: Node[];
|
|
42
|
-
hashNodes: { [hash: string]: Node };
|
|
43
|
-
|
|
44
|
-
lightsNode: LightsNode;
|
|
45
|
-
fogNode: Node;
|
|
46
|
-
|
|
47
|
-
vertexShader: string;
|
|
48
|
-
fragmentShader: string;
|
|
49
|
-
computeShader: string;
|
|
50
|
-
|
|
51
|
-
cache: NodeCache;
|
|
52
|
-
globalCache: NodeCache;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @TODO used to be missing. check the actual type later
|
|
56
|
-
*/
|
|
57
|
-
flowsData: any;
|
|
58
|
-
|
|
59
|
-
shaderStage: NodeShaderStage | null;
|
|
60
|
-
buildStage: BuildStageOption | null;
|
|
61
|
-
stack: StackNode;
|
|
62
|
-
|
|
63
|
-
setHashNode(node: Node, hash: string): void;
|
|
64
|
-
addNode(node: Node): void;
|
|
65
|
-
get currentNode(): Node;
|
|
66
|
-
isFilteredTexture(texture: Texture): boolean;
|
|
67
|
-
getMethod(method: string): string;
|
|
68
|
-
getNodeFromHash(hash: string): Node;
|
|
69
|
-
|
|
70
|
-
addFlow(shaderStage: NodeShaderStage, node: Node): Node;
|
|
71
|
-
|
|
72
|
-
setContext(context: NodeBuilderContext): void;
|
|
73
|
-
getContext(): NodeBuilderContext;
|
|
74
|
-
setCache(cache: NodeCache): void;
|
|
75
|
-
getCache(): NodeCache;
|
|
76
|
-
getCacheFromNode(node: Node, parent?: boolean): NodeCache;
|
|
77
|
-
isAvailable(name: string): boolean;
|
|
78
|
-
|
|
79
|
-
abstract getInstanceIndex(): string;
|
|
80
|
-
|
|
81
|
-
abstract getDrawIndex(): string | null;
|
|
82
|
-
|
|
83
|
-
abstract getFrontFacing(): string;
|
|
84
|
-
|
|
85
|
-
abstract getFragCoord(): string;
|
|
86
|
-
|
|
87
|
-
isFlipY(): boolean;
|
|
88
|
-
|
|
89
|
-
// @TODO: rename to .generateConst()
|
|
90
|
-
getConst(type: string, value?: unknown): Node;
|
|
91
|
-
getType(type: string): string;
|
|
92
|
-
|
|
93
|
-
generateMethod(method: string): string;
|
|
94
|
-
|
|
95
|
-
getAttribute(name: string, type: string): NodeAttribute;
|
|
96
|
-
|
|
97
|
-
getPropertyName(node: NodeVar | NodeUniform<unknown, unknown>, shaderStage: NodeShaderStage): string;
|
|
98
|
-
isVector(type: string): boolean;
|
|
99
|
-
|
|
100
|
-
isMatrix(type: string): boolean;
|
|
101
|
-
isReference(type: string): boolean;
|
|
102
|
-
getElementType(type: string): string | null;
|
|
103
|
-
getComponentType(type: string): string | null;
|
|
104
|
-
getVectorType(type: string): string;
|
|
105
|
-
getTypeFromLength(length: number): string;
|
|
106
|
-
getTypeLength(type: string): number;
|
|
107
|
-
getVectorFromMatrix(type: string): string;
|
|
108
|
-
getDataFromNode(node: Node, shaderStage?: NodeShaderStage): NodeData;
|
|
109
|
-
getNodeProperties(node: Node, shaderStage?: NodeShaderStage): { [key: string]: unknown };
|
|
110
|
-
getUniformFromNode(
|
|
111
|
-
node: Node,
|
|
112
|
-
type: string,
|
|
113
|
-
shaderStage?: NodeShaderStage,
|
|
114
|
-
name?: string | null,
|
|
115
|
-
): NodeUniform<unknown, string>;
|
|
116
|
-
getVarFromNode(node: Node, type: string, shaderStage?: NodeShaderStage): NodeVar;
|
|
117
|
-
getVaryFromNode(node: Node, type: string): NodeVarying;
|
|
118
|
-
getCodeFromNode(node: Node, type: string, shaderStage?: NodeShaderStage): string;
|
|
119
|
-
addFlowCode(code: string): void;
|
|
120
|
-
getFlowData(node: Node, shaderStage: NodeShaderStage): FlowData;
|
|
121
|
-
flowNode(node: Node): FlowData;
|
|
122
|
-
flowChildNode(node: Node, output?: string | null): FlowData;
|
|
123
|
-
flowNodeFromShaderStage(
|
|
124
|
-
shaderStage: NodeShaderStage,
|
|
125
|
-
node: Node,
|
|
126
|
-
output?: string | null,
|
|
127
|
-
propertyName?: string,
|
|
128
|
-
): FlowData;
|
|
129
|
-
hasGeometryAttribute(name: string): boolean;
|
|
130
|
-
abstract getAttributes(shaderStage: NodeShaderStage): string;
|
|
131
|
-
abstract getVaryings(shaderStage: NodeShaderStage): string;
|
|
132
|
-
getVars(shaderStage: NodeShaderStage): string;
|
|
133
|
-
abstract getUniforms(stage: NodeShaderStage): string;
|
|
134
|
-
getCodes(shaderStage: NodeShaderStage): string;
|
|
135
|
-
getHash(): string;
|
|
136
|
-
setShaderStage(shaderStage: NodeShaderStage): void;
|
|
137
|
-
getShaderStage(): NodeShaderStage;
|
|
138
|
-
setBuildStage(buildStage: BuildStageOption): void;
|
|
139
|
-
getBuildStage(): BuildStageOption;
|
|
140
|
-
abstract buildCode(): void;
|
|
141
|
-
build(): this;
|
|
142
|
-
format(snippet: string, fromType: string, toType: string): string;
|
|
143
|
-
getSignature(): string;
|
|
11
|
+
context: unknown;
|
|
144
12
|
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import ContextNode from "./ContextNode.js";
|
|
2
|
+
import Node from "./Node.js";
|
|
3
|
+
import NodeBuilder from "./NodeBuilder.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A specialized context node designed to override specific target nodes within a
|
|
7
|
+
* node sub-graph or flow. This allows replacing specific inputs (e.g., normal
|
|
8
|
+
* and position vectors) dynamically during compilation for a specific flow node,
|
|
9
|
+
* without having to reconstruct or duplicate the source nodes.
|
|
10
|
+
*
|
|
11
|
+
* ```js
|
|
12
|
+
* // Method chaining example:
|
|
13
|
+
* node.overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) );
|
|
14
|
+
*
|
|
15
|
+
* // Context assignment example:
|
|
16
|
+
* material.contextNode = overrideNode( positionLocal, () => positionLocal.add( vec3( 1, 0, 0 ) ) );
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @augments ContextNode
|
|
20
|
+
*/
|
|
21
|
+
declare class OverrideContextNode extends ContextNode<unknown> {
|
|
22
|
+
/**
|
|
23
|
+
* Constructs a new override context node.
|
|
24
|
+
*
|
|
25
|
+
* @param {Map<Node, Function>} overrideNodes - A map mapping target nodes to their respective override callback functions.
|
|
26
|
+
* @param {Node|null} [flowNode=null] - The node whose context should be modified.
|
|
27
|
+
*/
|
|
28
|
+
constructor(overrideNodes: Map<Node, (nodeBuilder: NodeBuilder) => Node>, flowNode?: Node | null);
|
|
29
|
+
/**
|
|
30
|
+
* This flag can be used for type testing.
|
|
31
|
+
*
|
|
32
|
+
* @type {boolean}
|
|
33
|
+
* @readonly
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
readonly isOverrideContextNode: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default OverrideContextNode;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* TSL function for creating an `OverrideContextNode` to override a single target node.
|
|
43
|
+
*
|
|
44
|
+
* ```js
|
|
45
|
+
* material.contextNode = overrideNode( positionLocal, ( builder ) => positionLocal.add( vec3( 1, 0, 0 ) ) );
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @tsl
|
|
49
|
+
* @function
|
|
50
|
+
* @param {Node} targetNode - The target node that should be overridden.
|
|
51
|
+
* @param {Function|Node|null} [callback=null] - A callback function returning the overriding node (which receives the builder as its argument), or the overriding node itself.
|
|
52
|
+
* @param {Node|null} [flowNode=null] - The node whose context should be modified.
|
|
53
|
+
* @return {OverrideContextNode} The created override context node.
|
|
54
|
+
*/
|
|
55
|
+
export function overrideNode(
|
|
56
|
+
targetNode: Node,
|
|
57
|
+
callback?: ((nodeBuilder: NodeBuilder) => Node) | Node | null,
|
|
58
|
+
flowNode?: Node | null,
|
|
59
|
+
): OverrideContextNode;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* TSL function for creating an `OverrideContextNode` to override multiple target nodes.
|
|
63
|
+
*
|
|
64
|
+
* ```js
|
|
65
|
+
* material.contextNode = overrideNodes( [
|
|
66
|
+
* [ positionView, customPositionView ],
|
|
67
|
+
* [ positionViewDirection, ( builder ) => customPositionViewDirection ]
|
|
68
|
+
* ] );
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @tsl
|
|
72
|
+
* @function
|
|
73
|
+
* @param {Map<Node, (Function|Node)>|Array<Array<Node|Function|Node>>} overrides - The overrides mapping target nodes to callback functions or overriding nodes.
|
|
74
|
+
* @param {Node|null} [flowNode=null] - The node whose context should be modified.
|
|
75
|
+
* @return {OverrideContextNode} The created override context node.
|
|
76
|
+
*/
|
|
77
|
+
export function overrideNodes(
|
|
78
|
+
overrides:
|
|
79
|
+
| Map<Node, ((nodeBuilder: NodeBuilder) => Node) | Node | null>
|
|
80
|
+
| Array<[Node, ((nodeBuilder: NodeBuilder) => Node) | Node | null]>,
|
|
81
|
+
flowNode?: Node | null,
|
|
82
|
+
): OverrideContextNode;
|
|
83
|
+
|
|
84
|
+
declare module "./Node.js" {
|
|
85
|
+
interface NodeElements {
|
|
86
|
+
overrideNodes: (
|
|
87
|
+
overrides:
|
|
88
|
+
| Map<Node, ((nodeBuilder: NodeBuilder) => Node) | Node | null>
|
|
89
|
+
| Array<[Node, ((nodeBuilder: NodeBuilder) => Node) | Node | null]>,
|
|
90
|
+
) => OverrideContextNode;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -3,6 +3,7 @@ import Node from "./Node.js";
|
|
|
3
3
|
interface PropertyNodeInterface {
|
|
4
4
|
name: string | null;
|
|
5
5
|
varying: boolean;
|
|
6
|
+
placeholderNode: Node;
|
|
6
7
|
|
|
7
8
|
readonly isPropertyNode: true;
|
|
8
9
|
}
|
|
@@ -12,6 +13,7 @@ declare const PropertyNode: {
|
|
|
12
13
|
nodeType: TNodeType,
|
|
13
14
|
name?: string | null,
|
|
14
15
|
varying?: boolean,
|
|
16
|
+
placeholderNode?: Node | null,
|
|
15
17
|
): PropertyNode<TNodeType>;
|
|
16
18
|
};
|
|
17
19
|
|
|
@@ -19,8 +21,16 @@ type PropertyNode<TNodeType> = Node<TNodeType> & PropertyNodeInterface;
|
|
|
19
21
|
|
|
20
22
|
export default PropertyNode;
|
|
21
23
|
|
|
22
|
-
export const property: <const TNodeType>(
|
|
23
|
-
|
|
24
|
+
export const property: <const TNodeType>(
|
|
25
|
+
type: TNodeType,
|
|
26
|
+
name?: string | null,
|
|
27
|
+
placeholderNode?: Node | null,
|
|
28
|
+
) => PropertyNode<TNodeType>;
|
|
29
|
+
export const varyingProperty: <const TNodeType>(
|
|
30
|
+
type: TNodeType,
|
|
31
|
+
name?: string | null,
|
|
32
|
+
placeholderNode?: Node | null,
|
|
33
|
+
) => PropertyNode<TNodeType>;
|
|
24
34
|
|
|
25
35
|
export const diffuseColor: PropertyNode<"vec4">;
|
|
26
36
|
export const diffuseContribution: PropertyNode<"vec3">;
|
|
@@ -52,3 +62,4 @@ export const thickness: PropertyNode<"float">;
|
|
|
52
62
|
export const attenuationDistance: PropertyNode<"float">;
|
|
53
63
|
export const attenuationColor: PropertyNode<"color">;
|
|
54
64
|
export const dispersion: PropertyNode<"float">;
|
|
65
|
+
export const ambientOcclusion: PropertyNode<"float">;
|
|
@@ -43,12 +43,13 @@ declare class StructTypeNode extends Node {
|
|
|
43
43
|
* @readonly
|
|
44
44
|
* @default true
|
|
45
45
|
*/
|
|
46
|
-
readonly
|
|
46
|
+
readonly isStructTypeNode: boolean;
|
|
47
47
|
/**
|
|
48
|
-
* Returns the length of the struct.
|
|
49
|
-
* The length is calculated by summing the lengths of the struct's members.
|
|
48
|
+
* Returns the length of the struct in 4-byte elements (e.g. float or int components).
|
|
49
|
+
* The length is calculated by summing the lengths of the struct's members, accounting for memory alignment.
|
|
50
|
+
* To get the size in bytes, multiply the returned value by 4.
|
|
50
51
|
*
|
|
51
|
-
* @returns {number} The length of the struct.
|
|
52
|
+
* @returns {number} The length of the struct in 4-byte elements.
|
|
52
53
|
*/
|
|
53
54
|
getLength(): number;
|
|
54
55
|
}
|
|
@@ -71,9 +71,17 @@ declare class UniformNodeClass<TValue> extends InputNode<unknown, TValue> {
|
|
|
71
71
|
* @return {string} The uniform hash.
|
|
72
72
|
*/
|
|
73
73
|
getUniformHash(builder: NodeBuilder): string;
|
|
74
|
-
onUpdate(
|
|
74
|
+
onUpdate(
|
|
75
|
+
callback: (this: this, frame: NodeFrame, self: this) => TValue | undefined,
|
|
76
|
+
updateType: NodeUpdateType,
|
|
77
|
+
): this;
|
|
75
78
|
getInputType(builder: NodeBuilder): string;
|
|
76
79
|
generate(builder: NodeBuilder, output: string | null): string;
|
|
80
|
+
|
|
81
|
+
// In UniformNode, callbacks provided to onUpdate-related functions are called with `this` as the last parameter:
|
|
82
|
+
onFrameUpdate(callback: (this: this, frame: NodeFrame, self: this) => TValue | undefined): this;
|
|
83
|
+
onRenderUpdate(callback: (this: this, frame: NodeFrame, self: this) => TValue | undefined): this;
|
|
84
|
+
onObjectUpdate(callback: (this: this, frame: NodeFrame, self: this) => TValue | undefined): this;
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
declare const UniformNode: {
|
|
@@ -90,16 +98,45 @@ type UniformNode<TNodeType, TValue> = UniformNodeClass<TValue> & InputNode<TNode
|
|
|
90
98
|
|
|
91
99
|
export default UniformNode;
|
|
92
100
|
|
|
101
|
+
interface UniformValue {
|
|
102
|
+
float: number;
|
|
103
|
+
int: number;
|
|
104
|
+
uint: number;
|
|
105
|
+
bool: boolean;
|
|
106
|
+
vec2: Vector2;
|
|
107
|
+
ivec2: Vector2;
|
|
108
|
+
uvec2: Vector2;
|
|
109
|
+
vec3: Vector3;
|
|
110
|
+
ivec3: Vector3;
|
|
111
|
+
uvec3: Vector3;
|
|
112
|
+
vec4: Vector4;
|
|
113
|
+
ivec4: Vector4;
|
|
114
|
+
uvec4: Vector4;
|
|
115
|
+
mat2: Matrix2;
|
|
116
|
+
mat3: Matrix3;
|
|
117
|
+
mat4: Matrix4;
|
|
118
|
+
color: Color;
|
|
119
|
+
}
|
|
120
|
+
|
|
93
121
|
interface Uniform {
|
|
122
|
+
<const TNodeType extends keyof UniformValue>(type: TNodeType): UniformNode<TNodeType, UniformValue[TNodeType]>;
|
|
94
123
|
(value: number, type?: "float"): UniformNode<"float", number>;
|
|
95
|
-
(value:
|
|
96
|
-
(value:
|
|
97
|
-
(value:
|
|
98
|
-
(value:
|
|
99
|
-
(value:
|
|
100
|
-
(value:
|
|
101
|
-
(value:
|
|
102
|
-
(value:
|
|
124
|
+
(value: number, type: "int"): UniformNode<"int", number>;
|
|
125
|
+
(value: number, type: "uint"): UniformNode<"uint", number>;
|
|
126
|
+
(value: boolean, type?: "bool"): UniformNode<"bool", boolean>;
|
|
127
|
+
(value: Vector2, type?: "vec2"): UniformNode<"vec2", Vector2>;
|
|
128
|
+
(value: Vector2, type: "ivec2"): UniformNode<"ivec2", Vector2>;
|
|
129
|
+
(value: Vector2, type: "uvec2"): UniformNode<"uvec2", Vector2>;
|
|
130
|
+
(value: Vector3, type?: "vec3"): UniformNode<"vec3", Vector3>;
|
|
131
|
+
(value: Vector3, type: "ivec3"): UniformNode<"ivec3", Vector3>;
|
|
132
|
+
(value: Vector3, type: "uvec3"): UniformNode<"uvec3", Vector3>;
|
|
133
|
+
(value: Vector4, type?: "vec4"): UniformNode<"vec4", Vector4>;
|
|
134
|
+
(value: Vector4, type: "ivec4"): UniformNode<"ivec4", Vector4>;
|
|
135
|
+
(value: Vector4, type: "uvec4"): UniformNode<"uvec4", Vector4>;
|
|
136
|
+
(value: Matrix2, type?: "mat2"): UniformNode<"mat2", Matrix2>;
|
|
137
|
+
(value: Matrix3, type?: "mat3"): UniformNode<"mat3", Matrix3>;
|
|
138
|
+
(value: Matrix4, type?: "mat4"): UniformNode<"mat4", Matrix4>;
|
|
139
|
+
(value: Color, type?: "color"): UniformNode<"color", Color>;
|
|
103
140
|
<TNodeType, TValue>(value: InputNode<TNodeType, TValue>): UniformNode<TNodeType, TValue>;
|
|
104
141
|
<TNodeType, TValue>(value: VarNode<TNodeType, ConstNode<TNodeType, TValue>>): UniformNode<TNodeType, TValue>;
|
|
105
142
|
}
|
|
@@ -113,3 +150,5 @@ interface Uniform {
|
|
|
113
150
|
* @returns {UniformNode}
|
|
114
151
|
*/
|
|
115
152
|
export declare const uniform: Uniform;
|
|
153
|
+
|
|
154
|
+
export {};
|
|
@@ -1,15 +1,76 @@
|
|
|
1
|
+
import { Color } from "../../math/Color.js";
|
|
2
|
+
import { Vector3 } from "../../math/Vector3.js";
|
|
3
|
+
import { Vector4 } from "../../math/Vector4.js";
|
|
1
4
|
import Node from "../core/Node.js";
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
type ColorParameter = Node<"float"> | number | Node<"vec3"> | Vector3 | Node<"color"> | Color | Node<"vec4"> | Vector4;
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Represents a "Color Burn" blend mode.
|
|
10
|
+
*
|
|
11
|
+
* It's designed to darken the base layer's colors based on the color of the blend layer.
|
|
12
|
+
* It significantly increases the contrast of the base layer, making the colors more vibrant and saturated.
|
|
13
|
+
* The darker the color in the blend layer, the stronger the darkening and contrast effect on the base layer.
|
|
14
|
+
*
|
|
15
|
+
* @tsl
|
|
16
|
+
* @function
|
|
17
|
+
* @param {Node<vec3>} base - The base color.
|
|
18
|
+
* @param {Node<vec3>} blend - The blend color. A white (#ffffff) blend color does not alter the base color.
|
|
19
|
+
* @return {Node<vec3>} The result.
|
|
20
|
+
*/
|
|
21
|
+
export const blendBurn: (base: ColorParameter, blend: ColorParameter) => Node<"vec3">;
|
|
22
|
+
/**
|
|
23
|
+
* Represents a "Color Dodge" blend mode.
|
|
24
|
+
*
|
|
25
|
+
* It's designed to lighten the base layer's colors based on the color of the blend layer.
|
|
26
|
+
* It significantly increases the brightness of the base layer, making the colors lighter and more vibrant.
|
|
27
|
+
* The brighter the color in the blend layer, the stronger the lightening and contrast effect on the base layer.
|
|
28
|
+
*
|
|
29
|
+
* @tsl
|
|
30
|
+
* @function
|
|
31
|
+
* @param {Node<vec3>} base - The base color.
|
|
32
|
+
* @param {Node<vec3>} blend - The blend color. A black (#000000) blend color does not alter the base color.
|
|
33
|
+
* @return {Node<vec3>} The result.
|
|
34
|
+
*/
|
|
35
|
+
export const blendDodge: (base: ColorParameter, blend: ColorParameter) => Node<"vec3">;
|
|
36
|
+
/**
|
|
37
|
+
* Represents a "Screen" blend mode.
|
|
38
|
+
*
|
|
39
|
+
* Similar to `blendDodge()`, this mode also lightens the base layer's colors based on the color of the blend layer.
|
|
40
|
+
* The "Screen" blend mode is better for general brightening whereas the "Dodge" results in more subtle and nuanced
|
|
41
|
+
* effects.
|
|
42
|
+
*
|
|
43
|
+
* @tsl
|
|
44
|
+
* @function
|
|
45
|
+
* @param {Node<vec3>} base - The base color.
|
|
46
|
+
* @param {Node<vec3>} blend - The blend color. A black (#000000) blend color does not alter the base color.
|
|
47
|
+
* @return {Node<vec3>} The result.
|
|
48
|
+
*/
|
|
49
|
+
export const blendScreen: (base: ColorParameter, blend: ColorParameter) => Node<"vec3">;
|
|
50
|
+
/**
|
|
51
|
+
* Represents a "Overlay" blend mode.
|
|
52
|
+
*
|
|
53
|
+
* It's designed to increase the contrast of the base layer based on the color of the blend layer.
|
|
54
|
+
* It amplifies the existing colors and contrast in the base layer, making lighter areas lighter and darker areas darker.
|
|
55
|
+
* The color of the blend layer significantly influences the resulting contrast and color shift in the base layer.
|
|
56
|
+
*
|
|
57
|
+
* @tsl
|
|
58
|
+
* @function
|
|
59
|
+
* @param {Node<vec3>} base - The base color.
|
|
60
|
+
* @param {Node<vec3>} blend - The blend color
|
|
61
|
+
* @return {Node<vec3>} The result.
|
|
62
|
+
*/
|
|
63
|
+
export const blendOverlay: (base: ColorParameter, blend: ColorParameter) => Node<"vec3">;
|
|
64
|
+
/**
|
|
65
|
+
* This function blends two color based on their alpha values by replicating the behavior of `THREE.NormalBlending`.
|
|
66
|
+
* It assumes both input colors have non-premultiplied alpha.
|
|
67
|
+
*
|
|
68
|
+
* @tsl
|
|
69
|
+
* @function
|
|
70
|
+
* @param {Node<vec4>} base - The base color.
|
|
71
|
+
* @param {Node<vec4>} blend - The blend color
|
|
72
|
+
* @return {Node<vec4>} The result.
|
|
73
|
+
*/
|
|
74
|
+
export const blendColor: (base: ColorParameter, blend: ColorParameter) => Node<"vec4">;
|
|
6
75
|
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
export const blendOverlay: (base: Node, blend: Node) => Node<"vec3">;
|
|
10
|
-
|
|
11
|
-
export const blendColor: (base: Node, blend: Node) => Node<"vec4">;
|
|
12
|
-
|
|
13
|
-
export const premultiplyAlpha: (color: Node) => Node<"vec4">;
|
|
14
|
-
|
|
15
|
-
export const unpremultiplyAlpha: (color: Node) => Node<"vec4">;
|
|
76
|
+
export {};
|