@types/three 0.143.2 → 0.146.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/animation/CCDIKSolver.d.ts +2 -1
- three/examples/jsm/animation/MMDPhysics.d.ts +6 -1
- three/examples/jsm/controls/FirstPersonControls.d.ts +4 -1
- three/examples/jsm/csm/CSM.d.ts +1 -1
- three/examples/jsm/csm/CSMHelper.d.ts +1 -0
- three/examples/jsm/environments/RoomEnvironment.d.ts +1 -0
- three/examples/jsm/helpers/OctreeHelper.d.ts +3 -0
- three/examples/jsm/helpers/VertexNormalsHelper.d.ts +2 -0
- three/examples/jsm/helpers/VertexTangentsHelper.d.ts +2 -0
- three/examples/jsm/interactive/SelectionHelper.d.ts +1 -3
- three/examples/jsm/libs/stats.module.d.ts +1 -1
- three/examples/jsm/loaders/PCDLoader.d.ts +1 -1
- three/examples/jsm/loaders/RGBELoader.d.ts +0 -1
- three/examples/jsm/loaders/TIFFLoader.d.ts +16 -0
- three/examples/jsm/loaders/USDZLoader.d.ts +18 -0
- three/examples/jsm/materials/MeshGouraudMaterial.d.ts +17 -0
- three/examples/jsm/math/ColorConverter.d.ts +0 -2
- three/examples/jsm/misc/GPUComputationRenderer.d.ts +1 -0
- three/examples/jsm/misc/ProgressiveLightMap.d.ts +1 -2
- three/examples/jsm/misc/Volume.d.ts +1 -1
- three/examples/jsm/modifiers/CurveModifier.d.ts +6 -6
- three/examples/jsm/nodes/Nodes.d.ts +21 -3
- three/examples/jsm/nodes/accessors/BitangentNode.d.ts +18 -0
- three/examples/jsm/nodes/accessors/NormalNode.d.ts +1 -6
- three/examples/jsm/nodes/accessors/PositionNode.d.ts +2 -0
- three/examples/jsm/nodes/accessors/TangentNode.d.ts +18 -0
- three/examples/jsm/nodes/core/CodeNode.d.ts +2 -2
- three/examples/jsm/nodes/core/FunctionCallNode.d.ts +5 -5
- three/examples/jsm/nodes/core/FunctionNode.d.ts +6 -4
- three/examples/jsm/nodes/core/Node.d.ts +1 -0
- three/examples/jsm/nodes/core/NodeBuilder.d.ts +4 -3
- three/examples/jsm/nodes/core/NodeUtils.d.ts +1 -0
- three/examples/jsm/nodes/core/NodeVarying.d.ts +8 -0
- three/examples/jsm/nodes/core/constants.d.ts +13 -13
- three/examples/jsm/nodes/display/BlendModeNode.d.ts +32 -0
- three/examples/jsm/nodes/display/PosterizeNode.d.ts +8 -0
- three/examples/jsm/nodes/materials/Materials.d.ts +8 -6
- three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +22 -0
- three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +94 -0
- three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +4 -0
- three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +6 -0
- three/examples/jsm/nodes/math/MathNode.d.ts +1 -2
- three/examples/jsm/nodes/procedural/CheckerNode.d.ts +2 -2
- three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +10 -8
- three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +49 -9
- three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +30 -0
- three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +6 -0
- three/examples/jsm/nodes/utils/RemapNode.d.ts +13 -0
- three/examples/jsm/nodes/utils/TimerNode.d.ts +6 -1
- three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +22 -0
- three/examples/jsm/objects/ReflectorForSSRPass.d.ts +4 -4
- three/examples/jsm/postprocessing/BloomPass.d.ts +1 -1
- three/examples/jsm/postprocessing/BokehPass.d.ts +0 -2
- three/examples/jsm/postprocessing/EffectComposer.d.ts +1 -0
- three/examples/jsm/postprocessing/Pass.d.ts +2 -0
- three/examples/jsm/postprocessing/SSRPass.d.ts +3 -3
- three/examples/jsm/renderers/webgl/nodes/SlotNode.d.ts +15 -3
- three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +6 -6
- three/examples/jsm/renderers/webgl/nodes/WebGLNodes.d.ts +1 -1
- three/examples/jsm/shaders/AfterimageShader.d.ts +4 -4
- three/examples/jsm/shaders/BleachBypassShader.d.ts +3 -3
- three/examples/jsm/shaders/BlendShader.d.ts +5 -5
- three/examples/jsm/shaders/BokehShader.d.ts +9 -9
- three/examples/jsm/shaders/BokehShader2.d.ts +26 -26
- three/examples/jsm/shaders/BrightnessContrastShader.d.ts +4 -4
- three/examples/jsm/shaders/ColorCorrectionShader.d.ts +5 -5
- three/examples/jsm/shaders/ColorifyShader.d.ts +3 -3
- three/examples/jsm/shaders/ConvolutionShader.d.ts +4 -4
- three/examples/jsm/shaders/CopyShader.d.ts +3 -3
- three/examples/jsm/shaders/DOFMipMapShader.d.ts +5 -5
- three/examples/jsm/shaders/DepthLimitedBlurShader.d.ts +9 -9
- three/examples/jsm/shaders/DigitalGlitch.d.ts +12 -12
- three/examples/jsm/shaders/DotScreenShader.d.ts +6 -6
- three/examples/jsm/shaders/FXAAShader.d.ts +3 -3
- three/examples/jsm/shaders/FilmShader.d.ts +7 -7
- three/examples/jsm/shaders/FocusShader.d.ts +6 -6
- three/examples/jsm/shaders/FreiChenShader.d.ts +3 -3
- three/examples/jsm/shaders/GammaCorrectionShader.d.ts +2 -2
- three/examples/jsm/shaders/GodRaysShader.d.ts +12 -12
- three/examples/jsm/shaders/HalftoneShader.d.ts +14 -14
- three/examples/jsm/shaders/HorizontalBlurShader.d.ts +3 -3
- three/examples/jsm/shaders/HorizontalTiltShiftShader.d.ts +4 -4
- three/examples/jsm/shaders/HueSaturationShader.d.ts +4 -4
- three/examples/jsm/shaders/KaleidoShader.d.ts +4 -4
- three/examples/jsm/shaders/LuminosityHighPassShader.d.ts +6 -6
- three/examples/jsm/shaders/LuminosityShader.d.ts +2 -2
- three/examples/jsm/shaders/MirrorShader.d.ts +3 -3
- three/examples/jsm/shaders/NormalMapShader.d.ts +5 -5
- three/examples/jsm/shaders/PixelShader.d.ts +4 -4
- three/examples/jsm/shaders/RGBShiftShader.d.ts +4 -4
- three/examples/jsm/shaders/SAOShader.d.ts +15 -15
- three/examples/jsm/shaders/SMAAShader.d.ts +10 -10
- three/examples/jsm/shaders/SSAOShader.d.ts +19 -19
- three/examples/jsm/shaders/SepiaShader.d.ts +3 -3
- three/examples/jsm/shaders/SobelOperatorShader.d.ts +3 -3
- three/examples/jsm/shaders/SubsurfaceScatteringShader.d.ts +30 -30
- three/examples/jsm/shaders/TechnicolorShader.d.ts +2 -2
- three/examples/jsm/shaders/ToneMapShader.d.ts +7 -7
- three/examples/jsm/shaders/ToonShader.d.ts +26 -26
- three/examples/jsm/shaders/TriangleBlurShader.d.ts +3 -3
- three/examples/jsm/shaders/UnpackDepthRGBAShader.d.ts +3 -3
- three/examples/jsm/shaders/VelocityShader.d.ts +13 -0
- three/examples/jsm/shaders/VerticalBlurShader.d.ts +3 -3
- three/examples/jsm/shaders/VerticalTiltShiftShader.d.ts +4 -4
- three/examples/jsm/shaders/VignetteShader.d.ts +4 -4
- three/examples/jsm/shaders/VolumeShader.d.ts +7 -7
- three/examples/jsm/shaders/WaterRefractionShader.d.ts +6 -6
- three/examples/jsm/utils/BufferGeometryUtils.d.ts +1 -0
- three/examples/jsm/utils/CameraUtils.d.ts +1 -1
- three/examples/jsm/utils/SceneUtils.d.ts +9 -1
- three/index.d.ts +1 -1
- three/package.json +3 -3
- three/src/Three.d.ts +3 -1
- three/src/constants.d.ts +0 -5
- three/src/core/BufferAttribute.d.ts +0 -4
- three/src/core/BufferGeometry.d.ts +0 -1
- three/src/core/Object3D.d.ts +11 -2
- three/src/extras/core/ShapePath.d.ts +1 -1
- three/src/geometries/BoxGeometry.d.ts +0 -2
- three/src/geometries/CapsuleGeometry.d.ts +0 -2
- three/src/geometries/CircleGeometry.d.ts +0 -2
- three/src/geometries/ConeGeometry.d.ts +0 -2
- three/src/geometries/CylinderGeometry.d.ts +0 -2
- three/src/geometries/DodecahedronGeometry.d.ts +0 -2
- three/src/geometries/ExtrudeGeometry.d.ts +0 -2
- three/src/geometries/IcosahedronGeometry.d.ts +0 -2
- three/src/geometries/LatheGeometry.d.ts +0 -2
- three/src/geometries/OctahedronGeometry.d.ts +0 -2
- three/src/geometries/PlaneGeometry.d.ts +0 -2
- three/src/geometries/PolyhedronGeometry.d.ts +0 -2
- three/src/geometries/RingGeometry.d.ts +0 -2
- three/src/geometries/ShapeGeometry.d.ts +0 -2
- three/src/geometries/SphereGeometry.d.ts +0 -2
- three/src/geometries/TetrahedronGeometry.d.ts +0 -2
- three/src/geometries/TorusGeometry.d.ts +0 -2
- three/src/geometries/TorusKnotGeometry.d.ts +0 -2
- three/src/geometries/TubeGeometry.d.ts +0 -2
- three/src/helpers/ArrowHelper.d.ts +4 -0
- three/src/helpers/Box3Helper.d.ts +2 -0
- three/src/helpers/BoxHelper.d.ts +2 -0
- three/src/helpers/GridHelper.d.ts +1 -4
- three/src/helpers/PlaneHelper.d.ts +2 -0
- three/src/helpers/PolarGridHelper.d.ts +2 -0
- three/src/helpers/SkeletonHelper.d.ts +2 -0
- three/src/loaders/DataTextureLoader.d.ts +1 -1
- three/src/materials/LineBasicMaterial.d.ts +7 -0
- three/src/materials/MeshLambertMaterial.d.ts +52 -1
- three/src/materials/MeshPhysicalMaterial.d.ts +5 -0
- three/src/materials/ShaderMaterial.d.ts +1 -1
- three/src/math/ColorManagement.d.ts +11 -1
- three/src/math/Euler.d.ts +13 -11
- three/src/math/Quaternion.d.ts +10 -6
- three/src/renderers/WebGL3DRenderTarget.d.ts +1 -1
- three/src/renderers/WebGLArrayRenderTarget.d.ts +1 -1
- three/src/renderers/WebGLCubeRenderTarget.d.ts +1 -1
- three/src/renderers/WebGLMultipleRenderTargets.d.ts +1 -1
- three/src/renderers/WebGLRenderTarget.d.ts +1 -1
- three/src/renderers/WebGLRenderer.d.ts +1 -5
- three/src/renderers/shaders/UniformsLib.d.ts +3 -2
- three/src/renderers/shaders/UniformsUtils.d.ts +0 -1
- three/src/renderers/webgl/WebGLCapabilities.d.ts +1 -0
- three/src/scenes/Scene.d.ts +2 -5
- three/src/textures/CanvasTexture.d.ts +2 -2
- three/src/textures/CompressedArrayTexture.d.ts +17 -0
- three/src/textures/Texture.d.ts +5 -1
- three/examples/jsm/nodes/core/NodeVary.d.ts +0 -6
- three/examples/jsm/renderers/webgl/nodes/WebGLPhysicalContextNode.d.ts +0 -13
three/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for three (https://threejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated: Mon,
|
|
11
|
+
* Last updated: Mon, 07 Nov 2022 20:26:35 GMT
|
|
12
12
|
* Dependencies: [@types/webxr](https://npmjs.com/package/@types/webxr)
|
|
13
13
|
* Global values: `THREE`
|
|
14
14
|
|
|
@@ -115,5 +115,10 @@ export class Constraint {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
export class MMDPhysicsHelper extends Object3D {
|
|
118
|
-
|
|
118
|
+
mesh: THREE.SkinnedMesh;
|
|
119
|
+
physics: MMDPhysics;
|
|
120
|
+
materials: [THREE.MeshBasicMaterial, THREE.MeshBasicMaterial, THREE.MeshBasicMaterial];
|
|
121
|
+
|
|
122
|
+
constructor(mesh: THREE.SkinnedMesh, physics: MMDPhysics);
|
|
123
|
+
dispose(): void;
|
|
119
124
|
}
|
|
@@ -22,7 +22,10 @@ export class FirstPersonControls {
|
|
|
22
22
|
mouseDragOn: boolean;
|
|
23
23
|
|
|
24
24
|
handleResize(): void;
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
lookAt(x: Vector3): this;
|
|
27
|
+
lookAt(x: number, y: number, z: number): this;
|
|
28
|
+
|
|
26
29
|
update(delta: number): this;
|
|
27
30
|
dispose(): void;
|
|
28
31
|
}
|
three/examples/jsm/csm/CSM.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { WebGLRenderer, Vector2 } from '../../../src/Three';
|
|
2
2
|
|
|
3
|
-
import { SelectionBox } from './SelectionBox';
|
|
4
|
-
|
|
5
3
|
export class SelectionHelper {
|
|
6
|
-
constructor(
|
|
4
|
+
constructor(renderer: WebGLRenderer, cssClassName: string);
|
|
7
5
|
element: HTMLElement;
|
|
8
6
|
isDown: boolean;
|
|
9
7
|
pointBottomRight: Vector2;
|
|
@@ -11,5 +11,5 @@ export class PCDLoader extends Loader {
|
|
|
11
11
|
onError?: (event: ErrorEvent) => void,
|
|
12
12
|
): void;
|
|
13
13
|
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<Points>;
|
|
14
|
-
parse(data: ArrayBuffer | string
|
|
14
|
+
parse(data: ArrayBuffer | string): Points;
|
|
15
15
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DataTextureLoader, TextureFilter, LoadingManager } from 'three';
|
|
2
|
+
|
|
3
|
+
export interface TIFFResult {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
data: Uint8Array;
|
|
7
|
+
flipY: true;
|
|
8
|
+
magFilter: TextureFilter;
|
|
9
|
+
minFilter: TextureFilter;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class TIFFLoader extends DataTextureLoader {
|
|
13
|
+
constructor(manager?: LoadingManager);
|
|
14
|
+
|
|
15
|
+
parse(buffer: Iterable<number>): TIFFResult;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Loader, LoadingManager, Mesh } from '../../../src/Three';
|
|
2
|
+
|
|
3
|
+
export class USDAParser {
|
|
4
|
+
parse(text: string): object;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export class USDZLoader extends Loader {
|
|
8
|
+
constructor(manager?: LoadingManager);
|
|
9
|
+
|
|
10
|
+
load(
|
|
11
|
+
url: string,
|
|
12
|
+
onLoad: (usdz: Mesh) => void,
|
|
13
|
+
onProgress?: (event: ProgressEvent) => void,
|
|
14
|
+
onError?: (event: ErrorEvent) => void,
|
|
15
|
+
): void;
|
|
16
|
+
|
|
17
|
+
parse(buffer: ArrayBuffer | string): THREE.Group;
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MeshGouraudMaterial
|
|
3
|
+
*
|
|
4
|
+
* Lambert illumination model with Gouraud (per-vertex) shading
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { ShaderMaterial, ShaderMaterialParameters } from '../../../src/Three';
|
|
9
|
+
|
|
10
|
+
export class MeshGouraudMaterial extends ShaderMaterial {
|
|
11
|
+
isMeshGouraudMaterial: true;
|
|
12
|
+
type: 'MeshGouraudMaterial';
|
|
13
|
+
|
|
14
|
+
constructor(parameters?: ShaderMaterialParameters);
|
|
15
|
+
|
|
16
|
+
copy(source: MeshGouraudMaterial): this;
|
|
17
|
+
}
|
|
@@ -16,6 +16,4 @@ export interface CMYK {
|
|
|
16
16
|
export namespace ColorConverter {
|
|
17
17
|
function setHSV(color: Color, h: number, s: number, v: number): Color;
|
|
18
18
|
function getHSV(color: Color, target: HSL): HSL;
|
|
19
|
-
function setCMYK(color: Color, c: number, m: number, y: number, k: number): Color;
|
|
20
|
-
function getCMYK(color: Color, target: CMYK): CMYK;
|
|
21
19
|
}
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
MeshBasicMaterial,
|
|
6
6
|
MeshPhongMaterial,
|
|
7
7
|
Object3D,
|
|
8
|
-
PlaneBufferGeometry,
|
|
9
8
|
PlaneGeometry,
|
|
10
9
|
Texture,
|
|
11
10
|
Vector3,
|
|
@@ -43,7 +42,7 @@ export class ProgressiveLightMap {
|
|
|
43
42
|
|
|
44
43
|
uv_boxes: UVBoxes[];
|
|
45
44
|
|
|
46
|
-
blurringPlane: Mesh<
|
|
45
|
+
blurringPlane: Mesh<PlaneGeometry, MeshBasicMaterial>;
|
|
47
46
|
|
|
48
47
|
labelMaterial: MeshBasicMaterial;
|
|
49
48
|
labelPlane: PlaneGeometry;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Matrix3 } from '../../../src/Three';
|
|
2
2
|
|
|
3
|
-
import { VolumeSlice } from './VolumeSlice
|
|
3
|
+
import { VolumeSlice } from './VolumeSlice';
|
|
4
4
|
|
|
5
5
|
export class Volume {
|
|
6
6
|
constructor(xLength?: number, yLength?: number, zLength?: number, type?: string, arrayBuffer?: ArrayLike<number>);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataTexture,
|
|
3
3
|
Curve,
|
|
4
|
-
|
|
4
|
+
IUniform,
|
|
5
5
|
Material,
|
|
6
6
|
InstancedMesh,
|
|
7
7
|
BufferGeometry,
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
} from '../../../src/Three';
|
|
11
11
|
|
|
12
12
|
export interface SplineUniform {
|
|
13
|
-
spineTexture:
|
|
14
|
-
pathOffset:
|
|
15
|
-
pathSegment:
|
|
16
|
-
spineOffset:
|
|
17
|
-
flow:
|
|
13
|
+
spineTexture: IUniform;
|
|
14
|
+
pathOffset: IUniform;
|
|
15
|
+
pathSegment: IUniform;
|
|
16
|
+
spineOffset: IUniform;
|
|
17
|
+
flow: IUniform;
|
|
18
18
|
}
|
|
19
19
|
export function initSplineTexture(size?: number): DataTexture;
|
|
20
20
|
|
|
@@ -7,7 +7,7 @@ import ConstNode from './core/ConstNode';
|
|
|
7
7
|
import ContextNode from './core/ContextNode';
|
|
8
8
|
import ExpressionNode from './core/ExpressionNode';
|
|
9
9
|
import FunctionCallNode from './core/FunctionCallNode';
|
|
10
|
-
import FunctionNode from './core/FunctionNode';
|
|
10
|
+
import FunctionNode, { FunctionNodeArguments } from './core/FunctionNode';
|
|
11
11
|
import InstanceIndexNode from './core/InstanceIndexNode';
|
|
12
12
|
import Node from './core/Node';
|
|
13
13
|
import NodeAttribute from './core/NodeAttribute';
|
|
@@ -18,7 +18,7 @@ import NodeFunctionInput from './core/NodeFunctionInput';
|
|
|
18
18
|
import NodeKeywords from './core/NodeKeywords';
|
|
19
19
|
import NodeUniform from './core/NodeUniform';
|
|
20
20
|
import NodeVar from './core/NodeVar';
|
|
21
|
-
import
|
|
21
|
+
import NodeVarying from './core/NodeVarying';
|
|
22
22
|
import PropertyNode from './core/PropertyNode';
|
|
23
23
|
import TempNode from './core/TempNode';
|
|
24
24
|
import UniformNode from './core/UniformNode';
|
|
@@ -26,6 +26,7 @@ import VarNode from './core/VarNode';
|
|
|
26
26
|
import VaryNode from './core/VaryNode';
|
|
27
27
|
|
|
28
28
|
// accessors
|
|
29
|
+
import BitangentNode, { BitangentNodeScope } from './accessors/BitangentNode';
|
|
29
30
|
import BufferNode from './accessors/BufferNode';
|
|
30
31
|
import CameraNode, { CameraNodeScope } from './accessors/CameraNode';
|
|
31
32
|
import CubeTextureNode from './accessors/CubeTextureNode';
|
|
@@ -41,6 +42,7 @@ import PositionNode, { PositionNodeScope } from './accessors/PositionNode';
|
|
|
41
42
|
import ReferenceNode from './accessors/ReferenceNode';
|
|
42
43
|
import ReflectVectorNode from './accessors/ReflectVectorNode';
|
|
43
44
|
import SkinningNode from './accessors/SkinningNode';
|
|
45
|
+
import TangentNode, { TangentNodeScope } from './accessors/TangentNode';
|
|
44
46
|
import TextureNode from './accessors/TextureNode';
|
|
45
47
|
import UVNode from './accessors/UVNode';
|
|
46
48
|
import UserDataNode from './accessors/UserDataNode';
|
|
@@ -52,10 +54,12 @@ import RangeNode, { RangeModeBound } from './geometry/RangeNode';
|
|
|
52
54
|
import ComputeNode from './gpgpu/ComputeNode';
|
|
53
55
|
|
|
54
56
|
// display
|
|
57
|
+
import BlendModeNode, { BlendMode } from './display/BlendModeNode';
|
|
55
58
|
import ColorAdjustmentNode, { ColorAdjustmentMethod } from './display/ColorAdjustmentNode';
|
|
56
59
|
import ColorSpaceNode, { ColorSpaceNodeMethod } from './display/ColorSpaceNode';
|
|
57
60
|
import FrontFacingNode from './display/FrontFacingNode';
|
|
58
61
|
import NormalMapNode from './display/NormalMapNode';
|
|
62
|
+
import PosterizeNode from './display/PosterizeNode';
|
|
59
63
|
import ToneMappingNode from './display/ToneMappingNode';
|
|
60
64
|
|
|
61
65
|
// math
|
|
@@ -77,14 +81,17 @@ import AnalyticLightNode from './lighting/AnalyticLightNode';
|
|
|
77
81
|
|
|
78
82
|
import ArrayElementNode from './utils/ArrayElementNode';
|
|
79
83
|
import ConvertNode from './utils/ConvertNode';
|
|
84
|
+
import EquirectUVNode from './utils/EquirectUVNode';
|
|
80
85
|
import JoinNode from './utils/JoinNode';
|
|
81
86
|
import MatcapUVNode from './utils/MatcapUVNode';
|
|
82
87
|
import MaxMipLevelNode from './utils/MaxMipLevelNode';
|
|
83
88
|
import OscNode, { OscNodeMethod } from './utils/OscNode';
|
|
89
|
+
import RemapNode from './utils/RemapNode';
|
|
84
90
|
import RotateUVNode from './utils/RotateUVNode';
|
|
85
91
|
import SplitNode from './utils/SplitNode';
|
|
86
92
|
import SpriteSheetUVNode from './utils/SpriteSheetUVNode';
|
|
87
93
|
import TimerNode, { TimerNodeScope } from './utils/TimerNode';
|
|
94
|
+
import TriplanarTexturesNode from './utils/TriplanarTexturesNode';
|
|
88
95
|
|
|
89
96
|
// loaders
|
|
90
97
|
import NodeLoader from './loaders/NodeLoader';
|
|
@@ -118,6 +125,7 @@ export {
|
|
|
118
125
|
ExpressionNode,
|
|
119
126
|
FunctionCallNode,
|
|
120
127
|
FunctionNode,
|
|
128
|
+
FunctionNodeArguments,
|
|
121
129
|
InstanceIndexNode,
|
|
122
130
|
Node,
|
|
123
131
|
NodeAttribute,
|
|
@@ -128,7 +136,7 @@ export {
|
|
|
128
136
|
NodeKeywords,
|
|
129
137
|
NodeUniform,
|
|
130
138
|
NodeVar,
|
|
131
|
-
|
|
139
|
+
NodeVarying,
|
|
132
140
|
PropertyNode,
|
|
133
141
|
TempNode,
|
|
134
142
|
UniformNode,
|
|
@@ -140,6 +148,8 @@ export {
|
|
|
140
148
|
// gpgpu
|
|
141
149
|
ComputeNode,
|
|
142
150
|
// accessors
|
|
151
|
+
BitangentNode,
|
|
152
|
+
BitangentNodeScope,
|
|
143
153
|
BufferNode,
|
|
144
154
|
CameraNode,
|
|
145
155
|
CameraNodeScope,
|
|
@@ -160,16 +170,21 @@ export {
|
|
|
160
170
|
ReferenceNode,
|
|
161
171
|
ReflectVectorNode,
|
|
162
172
|
SkinningNode,
|
|
173
|
+
TangentNode,
|
|
174
|
+
TangentNodeScope,
|
|
163
175
|
TextureNode,
|
|
164
176
|
UVNode,
|
|
165
177
|
UserDataNode,
|
|
166
178
|
// display
|
|
179
|
+
BlendModeNode,
|
|
180
|
+
BlendMode,
|
|
167
181
|
ColorAdjustmentNode,
|
|
168
182
|
ColorAdjustmentMethod,
|
|
169
183
|
ColorSpaceNode,
|
|
170
184
|
ColorSpaceNodeMethod,
|
|
171
185
|
FrontFacingNode,
|
|
172
186
|
NormalMapNode,
|
|
187
|
+
PosterizeNode,
|
|
173
188
|
ToneMappingNode,
|
|
174
189
|
// math
|
|
175
190
|
MathNode,
|
|
@@ -193,16 +208,19 @@ export {
|
|
|
193
208
|
// utils
|
|
194
209
|
ArrayElementNode,
|
|
195
210
|
ConvertNode,
|
|
211
|
+
EquirectUVNode,
|
|
196
212
|
JoinNode,
|
|
197
213
|
MatcapUVNode,
|
|
198
214
|
MaxMipLevelNode,
|
|
199
215
|
OscNode,
|
|
200
216
|
OscNodeMethod,
|
|
217
|
+
RemapNode,
|
|
201
218
|
RotateUVNode,
|
|
202
219
|
SplitNode,
|
|
203
220
|
SpriteSheetUVNode,
|
|
204
221
|
TimerNode,
|
|
205
222
|
TimerNodeScope,
|
|
223
|
+
TriplanarTexturesNode,
|
|
206
224
|
// procedural
|
|
207
225
|
CheckerNode,
|
|
208
226
|
// fog
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Node from '../core/Node';
|
|
2
|
+
|
|
3
|
+
export type BitangentNodeScope =
|
|
4
|
+
| typeof BitangentNode.LOCAL
|
|
5
|
+
| typeof BitangentNode.VIEW
|
|
6
|
+
| typeof BitangentNode.WORLD
|
|
7
|
+
| typeof BitangentNode.GEOMETRY;
|
|
8
|
+
|
|
9
|
+
export default class BitangentNode extends Node {
|
|
10
|
+
static GEOMETRY: 'geometry';
|
|
11
|
+
static LOCAL: 'local';
|
|
12
|
+
static VIEW: 'view';
|
|
13
|
+
static WORLD: 'world';
|
|
14
|
+
|
|
15
|
+
scope: BitangentNodeScope;
|
|
16
|
+
|
|
17
|
+
constructor(scope?: BitangentNodeScope);
|
|
18
|
+
}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import Node from '../core/Node';
|
|
2
2
|
|
|
3
|
-
export type NormalNodeScope =
|
|
4
|
-
| typeof NormalNode.GEOMETRY
|
|
5
|
-
| typeof NormalNode.LOCAL
|
|
6
|
-
| typeof NormalNode.WORLD
|
|
7
|
-
| typeof NormalNode.VIEW;
|
|
3
|
+
export type NormalNodeScope = typeof NormalNode.GEOMETRY | typeof NormalNode.LOCAL | typeof NormalNode.VIEW;
|
|
8
4
|
|
|
9
5
|
export default class NormalNode extends Node {
|
|
10
6
|
static GEOMETRY: 'geometry';
|
|
11
7
|
static LOCAL: 'local';
|
|
12
|
-
static WORLD: 'world';
|
|
13
8
|
static VIEW: 'view';
|
|
14
9
|
scope: NormalNodeScope;
|
|
15
10
|
|
|
@@ -4,6 +4,7 @@ export type PositionNodeScope =
|
|
|
4
4
|
| typeof PositionNode.GEOMETRY
|
|
5
5
|
| typeof PositionNode.LOCAL
|
|
6
6
|
| typeof PositionNode.WORLD
|
|
7
|
+
| typeof PositionNode.WORLD_DIRECTION
|
|
7
8
|
| typeof PositionNode.VIEW
|
|
8
9
|
| typeof PositionNode.VIEW_DIRECTION;
|
|
9
10
|
|
|
@@ -11,6 +12,7 @@ export default class PositionNode extends Node {
|
|
|
11
12
|
static GEOMETRY: 'geometry';
|
|
12
13
|
static LOCAL: 'local';
|
|
13
14
|
static WORLD: 'world';
|
|
15
|
+
static WORLD_DIRECTION: 'worldDirection';
|
|
14
16
|
static VIEW: 'view';
|
|
15
17
|
static VIEW_DIRECTION: 'viewDirection';
|
|
16
18
|
scope: PositionNodeScope;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Node from '../core/Node.js';
|
|
2
|
+
|
|
3
|
+
export type TangentNodeScope =
|
|
4
|
+
| typeof TangentNode.LOCAL
|
|
5
|
+
| typeof TangentNode.VIEW
|
|
6
|
+
| typeof TangentNode.WORLD
|
|
7
|
+
| typeof TangentNode.GEOMETRY;
|
|
8
|
+
|
|
9
|
+
export default class TangentNode extends Node {
|
|
10
|
+
static GEOMETRY: 'geometry';
|
|
11
|
+
static LOCAL: 'local';
|
|
12
|
+
static VIEW: 'view';
|
|
13
|
+
static WORLD: 'world';
|
|
14
|
+
|
|
15
|
+
scope: TangentNodeScope;
|
|
16
|
+
|
|
17
|
+
constructor(scope?: TangentNodeScope);
|
|
18
|
+
}
|
|
@@ -3,13 +3,13 @@ import Node from './Node';
|
|
|
3
3
|
import NodeBuilder from './NodeBuilder';
|
|
4
4
|
|
|
5
5
|
export interface CodeNodeInclude {
|
|
6
|
-
build(): void;
|
|
6
|
+
build(builder: NodeBuilder): void;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export default class CodeNode extends Node {
|
|
10
10
|
isCodeNode: true;
|
|
11
11
|
code: string;
|
|
12
|
-
constructor(code
|
|
12
|
+
constructor(code?: string, includes?: CodeNodeInclude[]);
|
|
13
13
|
|
|
14
14
|
setIncludes(includes: CodeNodeInclude[]): this;
|
|
15
15
|
getIncludes(builder: NodeBuilder): CodeNodeInclude[];
|
|
@@ -2,12 +2,12 @@ import FunctionNode from './FunctionNode';
|
|
|
2
2
|
import TempNode from './TempNode';
|
|
3
3
|
import Node from './Node';
|
|
4
4
|
|
|
5
|
-
export default class FunctionCallNode extends TempNode {
|
|
6
|
-
functionNode: FunctionNode
|
|
5
|
+
export default class FunctionCallNode<P extends Node[] | { [name: string]: Node }> extends TempNode {
|
|
6
|
+
functionNode: FunctionNode<P>;
|
|
7
7
|
parameters: { [name: string]: Node };
|
|
8
8
|
|
|
9
|
-
constructor(functionNode?: FunctionNode
|
|
9
|
+
constructor(functionNode?: FunctionNode<P>, parameters?: P);
|
|
10
10
|
|
|
11
|
-
setParameters(parameters:
|
|
12
|
-
getParameters():
|
|
11
|
+
setParameters(parameters: P): this;
|
|
12
|
+
getParameters(): P;
|
|
13
13
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import CodeNode from './CodeNode';
|
|
1
|
+
import CodeNode, { CodeNodeInclude } from './CodeNode';
|
|
2
2
|
import FunctionCallNode from './FunctionCallNode';
|
|
3
3
|
import NodeBuilder from './NodeBuilder';
|
|
4
4
|
import NodeFunction from './NodeFunction';
|
|
5
5
|
import NodeFunctionInput from './NodeFunctionInput';
|
|
6
6
|
import Node from './Node';
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export type FunctionNodeArguments = Node[] | { [name: string]: Node };
|
|
9
|
+
|
|
10
|
+
export default class FunctionNode<P extends Node[] | { [name: string]: Node }> extends CodeNode {
|
|
9
11
|
keywords: { [key: string]: Node };
|
|
10
|
-
constructor(code?: string);
|
|
12
|
+
constructor(code?: string, includes?: CodeNodeInclude[]);
|
|
11
13
|
|
|
12
14
|
getInputs(builder: NodeBuilder): NodeFunctionInput[];
|
|
13
15
|
getNodeFunction(builder: NodeBuilder): NodeFunction;
|
|
14
|
-
call(parameters:
|
|
16
|
+
call(parameters: P): FunctionCallNode<P>;
|
|
15
17
|
}
|
|
@@ -17,7 +17,7 @@ import NodeAttribute from './NodeAttribute';
|
|
|
17
17
|
import NodeParser from './NodeParser';
|
|
18
18
|
import NodeUniform from './NodeUniform';
|
|
19
19
|
import NodeVar from './NodeVar';
|
|
20
|
-
import
|
|
20
|
+
import NodeVarying from './NodeVarying';
|
|
21
21
|
|
|
22
22
|
export type BuildStageOption = 'construct' | 'analyze' | 'generate';
|
|
23
23
|
|
|
@@ -82,7 +82,7 @@ export default abstract class NodeBuilder {
|
|
|
82
82
|
abstract getCubeTextureLevel(textureProperty: string, uvSnippet: string, levelSnippet: string): string;
|
|
83
83
|
|
|
84
84
|
// @TODO: rename to .generateConst()
|
|
85
|
-
getConst(type: NodeTypeOption, value
|
|
85
|
+
getConst(type: NodeTypeOption, value?: unknown): Node;
|
|
86
86
|
getType(type: NodeTypeOption): NodeTypeOption;
|
|
87
87
|
|
|
88
88
|
generateMethod(method: string): string;
|
|
@@ -105,7 +105,7 @@ export default abstract class NodeBuilder {
|
|
|
105
105
|
getNodeProperties(node: Node, shaderStage?: NodeShaderStageOption): AnyObject;
|
|
106
106
|
getUniformFromNode(node: Node, shaderStage: NodeShaderStageOption, type: NodeTypeOption): NodeUniform;
|
|
107
107
|
getVarFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): NodeVar;
|
|
108
|
-
getVaryFromNode(node: Node, type: NodeTypeOption):
|
|
108
|
+
getVaryFromNode(node: Node, type: NodeTypeOption): NodeVarying;
|
|
109
109
|
getCodeFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): string;
|
|
110
110
|
addFlowCode(code: string): void;
|
|
111
111
|
getFlowData(node: Node, shaderStage: NodeShaderStageOption): FlowData;
|
|
@@ -117,6 +117,7 @@ export default abstract class NodeBuilder {
|
|
|
117
117
|
output?: string | null,
|
|
118
118
|
propertyName?: string,
|
|
119
119
|
): FlowData;
|
|
120
|
+
hasGeometryAttribute(name: string): boolean;
|
|
120
121
|
abstract getAttributes(shaderStage: NodeShaderStageOption): string;
|
|
121
122
|
abstract getVarys(shaderStage: NodeShaderStageOption): string;
|
|
122
123
|
getVars(shaderStage: NodeShaderStageOption): string;
|
|
@@ -4,3 +4,4 @@ import Node from './Node';
|
|
|
4
4
|
export function getNodesKeys(object: Node): string[];
|
|
5
5
|
export function getValueType(value: NodeValueOption): string | null;
|
|
6
6
|
export function getValueFromType(type: string, ...params: number[]): NodeValueOption | null;
|
|
7
|
+
export function getCacheKey(object: Node): string;
|
|
@@ -2,14 +2,14 @@ import { Color, Matrix3, Matrix4, Vector2, Vector3, Vector4 } from '../../../../
|
|
|
2
2
|
|
|
3
3
|
// disable automatic export, we have some private declarations
|
|
4
4
|
export const NodeShaderStage: {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
VERTEX: 'vertex';
|
|
6
|
+
FRAGMENT: 'fragment';
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export const NodeUpdateType: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
NONE: 'none';
|
|
11
|
+
FRAME: 'frame';
|
|
12
|
+
OBJECT: 'object';
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export type NodeValueOption = Color | Vector2 | Vector3 | Vector4 | Matrix3 | Matrix4 | boolean | number;
|
|
@@ -66,12 +66,12 @@ export interface AnyObject {
|
|
|
66
66
|
export type AnyJson = any;
|
|
67
67
|
|
|
68
68
|
export const NodeType: {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
BOOLEAN: 'bool';
|
|
70
|
+
INTEGER: 'int';
|
|
71
|
+
FLOAT: 'float';
|
|
72
|
+
VECTOR2: 'vec2';
|
|
73
|
+
VECTOR3: 'vec3';
|
|
74
|
+
VECTOR4: 'vec4';
|
|
75
|
+
MATRIX3: 'mat3';
|
|
76
|
+
MATRIX4: 'mat4';
|
|
77
77
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import TempNode from '../core/TempNode';
|
|
2
|
+
import { ShaderNode } from '../shadernode/ShaderNodeBaseElements';
|
|
3
|
+
import { Node } from '../Nodes';
|
|
4
|
+
|
|
5
|
+
export const BurnNode: ShaderNode<{ base: Node; blendNode: Node }>;
|
|
6
|
+
|
|
7
|
+
export const DodgeNode: ShaderNode<{ base: Node; blendNode: Node }>;
|
|
8
|
+
|
|
9
|
+
export const ScreenNode: ShaderNode<{ base: Node; blendNode: Node }>;
|
|
10
|
+
|
|
11
|
+
export const OverlayNode: ShaderNode<{ base: Node; blendNode: Node }>;
|
|
12
|
+
|
|
13
|
+
export type BlendMode =
|
|
14
|
+
| typeof BlendModeNode.BURN
|
|
15
|
+
| typeof BlendModeNode.DODGE
|
|
16
|
+
| typeof BlendModeNode.SCREEN
|
|
17
|
+
| typeof BlendModeNode.OVERLAY;
|
|
18
|
+
|
|
19
|
+
export default class BlendModeNode extends TempNode {
|
|
20
|
+
static BURN: 'burn';
|
|
21
|
+
static DODGE: 'dodge';
|
|
22
|
+
static SCREEN: 'screen';
|
|
23
|
+
static OVERLAY: 'overlay';
|
|
24
|
+
|
|
25
|
+
baseNode: Node;
|
|
26
|
+
blendMode: BlendMode;
|
|
27
|
+
blendNode: Node;
|
|
28
|
+
|
|
29
|
+
constructor(blendMode: BlendMode, baseNode: Node, blendNode: Node);
|
|
30
|
+
|
|
31
|
+
construct(): Node;
|
|
32
|
+
}
|