@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,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 {};
|
|
@@ -1,12 +1,71 @@
|
|
|
1
|
+
import { Vector3 } from "../../math/Vector3.js";
|
|
1
2
|
import Node from "../core/Node.js";
|
|
2
3
|
|
|
4
|
+
/**
|
|
5
|
+
* This node can be used to evaluate whether a primitive is front or back facing.
|
|
6
|
+
*
|
|
7
|
+
* @augments Node
|
|
8
|
+
*/
|
|
3
9
|
declare class FrontFacingNode extends Node<"bool"> {
|
|
4
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Constructs a new front facing node.
|
|
12
|
+
*/
|
|
5
13
|
constructor();
|
|
14
|
+
/**
|
|
15
|
+
* This flag can be used for type testing.
|
|
16
|
+
*
|
|
17
|
+
* @type {boolean}
|
|
18
|
+
* @readonly
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
readonly isFrontFacingNode: boolean;
|
|
6
22
|
}
|
|
7
23
|
|
|
8
24
|
export default FrontFacingNode;
|
|
9
25
|
|
|
26
|
+
/**
|
|
27
|
+
* TSL object that represents whether a primitive is front or back facing
|
|
28
|
+
*
|
|
29
|
+
* @tsl
|
|
30
|
+
* @type {FrontFacingNode<bool>}
|
|
31
|
+
*/
|
|
10
32
|
export const frontFacing: FrontFacingNode;
|
|
11
|
-
|
|
12
|
-
|
|
33
|
+
/**
|
|
34
|
+
* TSL object that represents the front facing status as a number instead of a bool.
|
|
35
|
+
* `1` means front facing, `-1` means back facing.
|
|
36
|
+
*
|
|
37
|
+
* @tsl
|
|
38
|
+
* @type {Node<float>}
|
|
39
|
+
*/
|
|
40
|
+
export const faceDirection: Node<"float">;
|
|
41
|
+
/**
|
|
42
|
+
* Negates a vector if the rendering occurs on the back side of a face,
|
|
43
|
+
* based on the material's side configuration.
|
|
44
|
+
*
|
|
45
|
+
* - If the material's side is `BackSide`, the vector is inverted (negated).
|
|
46
|
+
* - If the material's side is `DoubleSide`, the vector is multiplied by `faceDirection`
|
|
47
|
+
* (negated only for back-facing fragments).
|
|
48
|
+
* - If the material's side is `FrontSide` (default), the vector remains unchanged.
|
|
49
|
+
*
|
|
50
|
+
* @tsl
|
|
51
|
+
* @function
|
|
52
|
+
* @param {Node<vec3>} vector - The vector to process.
|
|
53
|
+
* @returns {Node<vec3>} The processed vector.
|
|
54
|
+
*/
|
|
55
|
+
export const negateOnBackSide: (vector: Node<"vec3"> | Vector3) => Node<"vec3">;
|
|
56
|
+
/**
|
|
57
|
+
* Negates a vector if the rendering occurs on the back side of a face,
|
|
58
|
+
* based on the material's side configuration.
|
|
59
|
+
*
|
|
60
|
+
* - If the material's side is `BackSide`, the vector is inverted (negated).
|
|
61
|
+
* - If the material's side is `DoubleSide`, the vector is multiplied by `faceDirection`
|
|
62
|
+
* (negated only for back-facing fragments).
|
|
63
|
+
* - If the material's side is `FrontSide` (default), the vector remains unchanged.
|
|
64
|
+
*
|
|
65
|
+
* @tsl
|
|
66
|
+
* @function
|
|
67
|
+
* @deprecated since r185. Use {@link negateOnBackSide} instead.
|
|
68
|
+
* @param {Node<vec3>} vector - The vector to convert.
|
|
69
|
+
* @returns {Node<vec3>} The converted vector.
|
|
70
|
+
*/
|
|
71
|
+
export const directionToFaceDirection: (vector: Node<"vec3"> | Vector3) => Node<"vec3">;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Color } from "../../math/Color.js";
|
|
2
|
+
import { Vector3 } from "../../math/Vector3.js";
|
|
3
|
+
import { Vector4 } from "../../math/Vector4.js";
|
|
4
|
+
import Node from "../core/Node.js";
|
|
5
|
+
|
|
6
|
+
type ColorParameter = Node<"float"> | number | Node<"vec3"> | Vector3 | Node<"color"> | Color | Node<"vec4"> | Vector4;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Premultiplies the RGB channels of a color by its alpha channel.
|
|
10
|
+
*
|
|
11
|
+
* This function is useful for converting a non-premultiplied alpha color
|
|
12
|
+
* into a premultiplied alpha format, where the RGB values are scaled
|
|
13
|
+
* by the alpha value. Premultiplied alpha is often used in graphics
|
|
14
|
+
* rendering for certain operations, such as compositing and image processing.
|
|
15
|
+
*
|
|
16
|
+
* @tsl
|
|
17
|
+
* @function
|
|
18
|
+
* @param {Node<vec4>} color - The input color with non-premultiplied alpha.
|
|
19
|
+
* @return {Node<vec4>} The color with premultiplied alpha.
|
|
20
|
+
*/
|
|
21
|
+
export const premultiplyAlpha: (color: ColorParameter) => Node<"vec4">;
|
|
22
|
+
/**
|
|
23
|
+
* Unpremultiplies the RGB channels of a color by its alpha channel.
|
|
24
|
+
*
|
|
25
|
+
* This function is useful for converting a premultiplied alpha color
|
|
26
|
+
* back into a non-premultiplied alpha format, where the RGB values are
|
|
27
|
+
* divided by the alpha value. Unpremultiplied alpha is often used in graphics
|
|
28
|
+
* rendering for certain operations, such as compositing and image processing.
|
|
29
|
+
*
|
|
30
|
+
* @tsl
|
|
31
|
+
* @function
|
|
32
|
+
* @param {Node<vec4>} color - The input color with premultiplied alpha.
|
|
33
|
+
* @return {Node<vec4>} The color with non-premultiplied alpha.
|
|
34
|
+
*/
|
|
35
|
+
export const unpremultiplyAlpha: (color: ColorParameter) => Node<"vec4">;
|
|
36
|
+
|
|
37
|
+
export {};
|
|
@@ -11,73 +11,81 @@ export type AtomicMethod =
|
|
|
11
11
|
| typeof AtomicFunctionNode.ATOMIC_OR
|
|
12
12
|
| typeof AtomicFunctionNode.ATOMIC_XOR;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
interface AtomicFunctionNodeInterface {
|
|
15
15
|
method: AtomicMethod;
|
|
16
16
|
pointerNode: Node;
|
|
17
|
-
valueNode: Node;
|
|
17
|
+
valueNode: Node | null;
|
|
18
18
|
parents: boolean;
|
|
19
|
-
|
|
20
|
-
constructor(method: AtomicMethod, pointerNode: Node, valueNode: Node);
|
|
21
|
-
|
|
22
|
-
static ATOMIC_LOAD: "atomicLoad";
|
|
23
|
-
static ATOMIC_STORE: "atomicStore";
|
|
24
|
-
static ATOMIC_ADD: "atomicAdd";
|
|
25
|
-
static ATOMIC_SUB: "atomicSub";
|
|
26
|
-
static ATOMIC_MAX: "atomicMax";
|
|
27
|
-
static ATOMIC_MIN: "atomicMin";
|
|
28
|
-
static ATOMIC_AND: "atomicAnd";
|
|
29
|
-
static ATOMIC_OR: "atomicOr";
|
|
30
|
-
static ATOMIC_XOR: "atomicXor";
|
|
31
19
|
}
|
|
32
20
|
|
|
21
|
+
declare const AtomicFunctionNode: {
|
|
22
|
+
new<TNodeType>(
|
|
23
|
+
method: AtomicMethod,
|
|
24
|
+
pointerNode: Node,
|
|
25
|
+
valueNode: Node | null,
|
|
26
|
+
): AtomicFunctionNode<TNodeType>;
|
|
27
|
+
|
|
28
|
+
ATOMIC_LOAD: "atomicLoad";
|
|
29
|
+
ATOMIC_STORE: "atomicStore";
|
|
30
|
+
ATOMIC_ADD: "atomicAdd";
|
|
31
|
+
ATOMIC_SUB: "atomicSub";
|
|
32
|
+
ATOMIC_MAX: "atomicMax";
|
|
33
|
+
ATOMIC_MIN: "atomicMin";
|
|
34
|
+
ATOMIC_AND: "atomicAnd";
|
|
35
|
+
ATOMIC_OR: "atomicOr";
|
|
36
|
+
ATOMIC_XOR: "atomicXor";
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type AtomicFunctionNode<TNodeType> = Node<TNodeType> & AtomicFunctionNodeInterface;
|
|
40
|
+
|
|
33
41
|
export default AtomicFunctionNode;
|
|
34
42
|
|
|
35
|
-
export const atomicFunc: (
|
|
43
|
+
export const atomicFunc: <TNodeType>(
|
|
36
44
|
method: AtomicMethod,
|
|
37
|
-
pointerNode: Node
|
|
38
|
-
valueNode: Node,
|
|
39
|
-
) => AtomicFunctionNode
|
|
45
|
+
pointerNode: Node<TNodeType>,
|
|
46
|
+
valueNode: Node | null,
|
|
47
|
+
) => AtomicFunctionNode<TNodeType>;
|
|
40
48
|
|
|
41
|
-
export const atomicLoad: (
|
|
42
|
-
pointerNode: Node
|
|
43
|
-
) => AtomicFunctionNode
|
|
49
|
+
export const atomicLoad: <TNodeType>(
|
|
50
|
+
pointerNode: Node<TNodeType>,
|
|
51
|
+
) => AtomicFunctionNode<TNodeType>;
|
|
44
52
|
|
|
45
|
-
export const atomicStore: (
|
|
46
|
-
pointerNode: Node
|
|
53
|
+
export const atomicStore: <TNodeType>(
|
|
54
|
+
pointerNode: Node<TNodeType>,
|
|
47
55
|
valueNode: Node | number,
|
|
48
|
-
) => AtomicFunctionNode
|
|
56
|
+
) => AtomicFunctionNode<TNodeType>;
|
|
49
57
|
|
|
50
|
-
export const atomicAdd: (
|
|
51
|
-
pointerNode: Node
|
|
58
|
+
export const atomicAdd: <TNodeType>(
|
|
59
|
+
pointerNode: Node<TNodeType>,
|
|
52
60
|
valueNode: Node | number,
|
|
53
|
-
) => AtomicFunctionNode
|
|
61
|
+
) => AtomicFunctionNode<TNodeType>;
|
|
54
62
|
|
|
55
|
-
export const atomicSub: (
|
|
56
|
-
pointerNode: Node
|
|
63
|
+
export const atomicSub: <TNodeType>(
|
|
64
|
+
pointerNode: Node<TNodeType>,
|
|
57
65
|
valueNode: Node | number,
|
|
58
|
-
) => AtomicFunctionNode
|
|
66
|
+
) => AtomicFunctionNode<TNodeType>;
|
|
59
67
|
|
|
60
|
-
export const atomicMax: (
|
|
61
|
-
pointerNode: Node
|
|
68
|
+
export const atomicMax: <TNodeType>(
|
|
69
|
+
pointerNode: Node<TNodeType>,
|
|
62
70
|
valueNode: Node,
|
|
63
|
-
) => AtomicFunctionNode
|
|
71
|
+
) => AtomicFunctionNode<TNodeType>;
|
|
64
72
|
|
|
65
|
-
export const atomicMin: (
|
|
66
|
-
pointerNode: Node
|
|
73
|
+
export const atomicMin: <TNodeType>(
|
|
74
|
+
pointerNode: Node<TNodeType>,
|
|
67
75
|
valueNode: Node,
|
|
68
|
-
) => AtomicFunctionNode
|
|
76
|
+
) => AtomicFunctionNode<TNodeType>;
|
|
69
77
|
|
|
70
|
-
export const atomicAnd: (
|
|
71
|
-
pointerNode: Node
|
|
78
|
+
export const atomicAnd: <TNodeType>(
|
|
79
|
+
pointerNode: Node<TNodeType>,
|
|
72
80
|
valueNode: Node,
|
|
73
|
-
) => AtomicFunctionNode
|
|
81
|
+
) => AtomicFunctionNode<TNodeType>;
|
|
74
82
|
|
|
75
|
-
export const atomicOr: (
|
|
76
|
-
pointerNode: Node
|
|
83
|
+
export const atomicOr: <TNodeType>(
|
|
84
|
+
pointerNode: Node<TNodeType>,
|
|
77
85
|
valueNode: Node,
|
|
78
|
-
) => AtomicFunctionNode
|
|
86
|
+
) => AtomicFunctionNode<TNodeType>;
|
|
79
87
|
|
|
80
|
-
export const atomicXor: (
|
|
81
|
-
pointerNode: Node
|
|
88
|
+
export const atomicXor: <TNodeType>(
|
|
89
|
+
pointerNode: Node<TNodeType>,
|
|
82
90
|
valueNode: Node,
|
|
83
|
-
) => AtomicFunctionNode
|
|
91
|
+
) => AtomicFunctionNode<TNodeType>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ContextNode from "../core/ContextNode.js";
|
|
2
2
|
import LightingModel, { LightingModelReflectedLight } from "../core/LightingModel.js";
|
|
3
3
|
import Node from "../core/Node.js";
|
|
4
|
+
import LightingNode from "./LightingNode.js";
|
|
4
5
|
import LightsNode from "./LightsNode.js";
|
|
5
6
|
|
|
6
7
|
export interface LightingContext {
|
|
@@ -9,18 +10,21 @@ export interface LightingContext {
|
|
|
9
10
|
iblIrradiance: Node;
|
|
10
11
|
ambientOcclusion: Node;
|
|
11
12
|
reflectedLight: LightingModelReflectedLight;
|
|
13
|
+
materialLightings: LightingNode[];
|
|
12
14
|
backdrop: Node;
|
|
13
15
|
backdropAlpha: Node;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export default class LightingContextNode extends ContextNode<unknown> {
|
|
17
|
-
|
|
19
|
+
lightingModel: LightingModel | null;
|
|
20
|
+
materialLightings: LightingNode[];
|
|
18
21
|
backdropNode: Node | null;
|
|
19
22
|
backdropAlphaNode: Node | null;
|
|
20
23
|
|
|
21
24
|
constructor(
|
|
22
25
|
lightsNode: LightsNode,
|
|
23
26
|
lightingModel?: LightingModel | null,
|
|
27
|
+
materialLightings?: LightingNode[],
|
|
24
28
|
backdropNode?: Node | null,
|
|
25
29
|
backdropAlphaNode?: Node | null,
|
|
26
30
|
);
|
|
@@ -30,5 +34,8 @@ export default class LightingContextNode extends ContextNode<unknown> {
|
|
|
30
34
|
|
|
31
35
|
export const lightingContext: (
|
|
32
36
|
node: LightsNode,
|
|
33
|
-
|
|
37
|
+
lightingModel?: LightingModel | null,
|
|
38
|
+
materialLightings?: LightingNode[],
|
|
39
|
+
backdropNode?: Node | null,
|
|
40
|
+
backdropAlphaNode?: Node | null,
|
|
34
41
|
) => LightingContextNode;
|
|
@@ -18,13 +18,13 @@ export interface DirectRectAreaLightData {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
declare class LightsNode extends Node {
|
|
21
|
-
totalDiffuseNode: Node
|
|
22
|
-
totalSpecularNode: Node
|
|
23
|
-
outgoingLightNode: Node
|
|
21
|
+
totalDiffuseNode: Node<"vec3">;
|
|
22
|
+
totalSpecularNode: Node<"vec3">;
|
|
23
|
+
outgoingLightNode: Node<"vec3">;
|
|
24
24
|
|
|
25
25
|
constructor();
|
|
26
26
|
|
|
27
|
-
setupLightsNode(builder: NodeBuilder):
|
|
27
|
+
setupLightsNode(builder: NodeBuilder): LightingNode[];
|
|
28
28
|
|
|
29
29
|
setupDirectLight(builder: NodeBuilder, lightNode: Node, lightData: DirectLightData): void;
|
|
30
30
|
|