@types/three 0.141.0 → 0.143.1
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/controls/FirstPersonControls.d.ts +1 -1
- three/examples/jsm/controls/FlyControls.d.ts +1 -1
- three/examples/jsm/controls/OrbitControls.d.ts +3 -3
- three/examples/jsm/curves/NURBSUtils.d.ts +18 -20
- three/examples/jsm/loaders/GLTFLoader.d.ts +1 -1
- three/examples/jsm/nodes/Nodes.d.ts +215 -0
- three/examples/jsm/nodes/accessors/BufferNode.d.ts +11 -0
- three/examples/jsm/nodes/accessors/CameraNode.d.ts +12 -0
- three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +11 -0
- three/examples/jsm/nodes/accessors/InstanceNode.d.ts +9 -0
- three/examples/jsm/nodes/accessors/MaterialNode.d.ts +23 -0
- three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +6 -0
- three/examples/jsm/nodes/accessors/ModelNode.d.ts +9 -0
- three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +6 -0
- three/examples/jsm/nodes/accessors/NormalNode.d.ts +17 -0
- three/examples/jsm/nodes/accessors/Object3DNode.d.ts +22 -0
- three/examples/jsm/nodes/accessors/PointUVNode.d.ts +7 -0
- three/examples/jsm/nodes/accessors/PositionNode.d.ts +19 -0
- three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +13 -0
- three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +8 -0
- three/examples/jsm/nodes/accessors/SkinningNode.d.ts +13 -0
- three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +6 -0
- three/examples/jsm/nodes/accessors/TextureNode.d.ts +12 -0
- three/examples/jsm/nodes/accessors/UVNode.d.ts +8 -0
- three/examples/jsm/nodes/accessors/UserDataNode.d.ts +7 -0
- three/examples/jsm/nodes/core/ArrayUniformNode.d.ts +8 -0
- three/examples/jsm/nodes/core/AttributeNode.d.ts +9 -0
- three/examples/jsm/nodes/core/BypassNode.d.ts +9 -0
- three/examples/jsm/nodes/core/CodeNode.d.ts +16 -0
- three/examples/jsm/nodes/core/ConstNode.d.ts +10 -0
- three/examples/jsm/nodes/core/ContextNode.d.ts +10 -0
- three/examples/jsm/nodes/core/ExpressionNode.d.ts +7 -0
- three/examples/jsm/nodes/core/FunctionCallNode.d.ts +13 -0
- three/examples/jsm/nodes/core/FunctionNode.d.ts +15 -0
- three/examples/jsm/nodes/core/InputNode.d.ts +12 -0
- three/examples/jsm/nodes/core/InstanceIndexNode.d.ts +6 -0
- three/examples/jsm/nodes/core/Node.d.ts +30 -0
- three/examples/jsm/nodes/core/NodeAttribute.d.ts +6 -0
- three/examples/jsm/nodes/core/NodeBuilder.d.ts +134 -0
- three/examples/jsm/nodes/core/NodeCode.d.ts +4 -0
- three/examples/jsm/nodes/core/NodeFrame.d.ts +19 -0
- three/examples/jsm/nodes/core/NodeFunction.d.ts +13 -0
- three/examples/jsm/nodes/core/NodeFunctionInput.d.ts +7 -0
- three/examples/jsm/nodes/core/NodeKeywords.d.ts +14 -0
- three/examples/jsm/nodes/core/NodeParser.d.ts +5 -0
- three/examples/jsm/nodes/core/NodeUniform.d.ts +13 -0
- three/examples/jsm/nodes/core/NodeUtils.d.ts +6 -0
- three/examples/jsm/nodes/core/NodeVar.d.ts +6 -0
- three/examples/jsm/nodes/core/NodeVary.d.ts +6 -0
- three/examples/jsm/nodes/core/PropertyNode.d.ts +6 -0
- three/examples/jsm/nodes/core/TempNode.d.ts +8 -0
- three/examples/jsm/nodes/core/UniformNode.d.ts +10 -0
- three/examples/jsm/nodes/core/VarNode.d.ts +16 -0
- three/examples/jsm/nodes/core/VaryNode.d.ts +8 -0
- three/examples/jsm/nodes/core/constants.d.ts +77 -0
- three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +20 -0
- three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +15 -0
- three/examples/jsm/nodes/display/FrontFacingNode.d.ts +6 -0
- three/examples/jsm/nodes/display/NormalMapNode.d.ts +12 -0
- three/examples/jsm/nodes/display/ToneMappingNode.d.ts +14 -0
- three/examples/jsm/nodes/fog/FogNode.d.ts +10 -0
- three/examples/jsm/nodes/fog/FogRangeNode.d.ts +10 -0
- three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +6 -0
- three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +6 -0
- three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +10 -0
- three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +9 -0
- three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +6 -0
- three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +6 -0
- three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +11 -0
- three/examples/jsm/nodes/functions/light/getDistanceAttenuation.d.ts +5 -0
- three/examples/jsm/nodes/functions/material/getGeometryRoughness.d.ts +5 -0
- three/examples/jsm/nodes/functions/material/getRoughness.d.ts +6 -0
- three/examples/jsm/nodes/geometry/RangeNode.d.ts +12 -0
- three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +11 -0
- three/examples/jsm/nodes/lighting/AONode.d.ts +8 -0
- three/examples/jsm/nodes/lighting/AnalyticLightNode.d.ts +10 -0
- three/examples/jsm/nodes/lighting/EnvironmentNode.d.ts +8 -0
- three/examples/jsm/nodes/lighting/HemisphereLightNode.d.ts +13 -0
- three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +15 -0
- three/examples/jsm/nodes/lighting/LightingNode.d.ts +5 -0
- three/examples/jsm/nodes/lighting/LightsNode.d.ts +19 -0
- three/examples/jsm/nodes/lighting/PunctualLightNode.d.ts +12 -0
- three/examples/jsm/nodes/loaders/NodeLoader.d.ts +21 -0
- three/examples/jsm/nodes/loaders/NodeMaterialLoader.d.ts +8 -0
- three/examples/jsm/nodes/loaders/NodeObjectLoader.d.ts +11 -0
- three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +16 -0
- three/examples/jsm/nodes/materials/Materials.d.ts +15 -0
- three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +19 -0
- three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +27 -0
- three/examples/jsm/nodes/materials/NodeMaterial.d.ts +22 -0
- three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +15 -0
- three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +23 -0
- three/examples/jsm/nodes/math/CondNode.d.ts +9 -0
- three/examples/jsm/nodes/math/MathNode.d.ts +116 -0
- three/examples/jsm/nodes/math/OperatorNode.d.ts +31 -0
- three/examples/jsm/nodes/procedural/CheckerNode.d.ts +6 -0
- three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +155 -0
- three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +267 -0
- three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +128 -0
- three/examples/jsm/nodes/utils/ArrayElementNode.d.ts +9 -0
- three/examples/jsm/nodes/utils/ConvertNode.d.ts +8 -0
- three/examples/jsm/nodes/utils/JoinNode.d.ts +10 -0
- three/examples/jsm/nodes/utils/MatcapUVNode.d.ts +5 -0
- three/examples/jsm/nodes/utils/MaxMipLevelNode.d.ts +7 -0
- three/examples/jsm/nodes/utils/OscNode.d.ts +19 -0
- three/examples/jsm/nodes/utils/RotateUVNode.d.ts +10 -0
- three/examples/jsm/nodes/utils/SplitNode.d.ts +16 -0
- three/examples/jsm/nodes/utils/SpriteSheetUVNode.d.ts +9 -0
- three/examples/jsm/nodes/utils/TimerNode.d.ts +14 -0
- three/examples/jsm/objects/GroundProjectedEnv.d.ts +13 -0
- three/examples/jsm/postprocessing/SAOPass.d.ts +1 -1
- three/examples/jsm/renderers/webgl/nodes/SlotNode.d.ts +5 -0
- three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +56 -0
- three/examples/jsm/renderers/webgl/nodes/WebGLNodes.d.ts +3 -0
- three/examples/jsm/renderers/webgl/nodes/WebGLPhysicalContextNode.d.ts +13 -0
- three/examples/jsm/shaders/ACESFilmicToneMappingShader.d.ts +10 -0
- three/examples/jsm/textures/FlakesTexture.d.ts +3 -0
- three/examples/jsm/utils/CameraUtils.d.ts +7 -9
- three/examples/jsm/utils/GeometryCompressionUtils.d.ts +3 -5
- three/examples/jsm/utils/GeometryUtils.d.ts +23 -25
- three/examples/jsm/utils/SkeletonUtils.d.ts +16 -22
- three/index.d.ts +2 -2
- three/package.json +3 -3
- three/src/Three.d.ts +4 -1
- three/src/animation/AnimationUtils.d.ts +32 -34
- three/src/audio/AudioContext.d.ts +1 -1
- three/src/core/UniformsGroup.d.ts +27 -0
- three/src/extras/DataUtils.d.ts +2 -4
- three/src/renderers/WebGLRenderer.d.ts +0 -5
- three/src/renderers/shaders/UniformsUtils.d.ts +6 -1
- three/src/renderers/webgl/WebGLUniformsGroups.d.ts +17 -0
- three/examples/jsm/shaders/SSRrShader.d.ts +0 -48
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import FunctionNode from './FunctionNode';
|
|
2
|
+
import TempNode from './TempNode';
|
|
3
|
+
import Node from './Node';
|
|
4
|
+
|
|
5
|
+
export default class FunctionCallNode extends TempNode {
|
|
6
|
+
functionNode: FunctionNode;
|
|
7
|
+
parameters: { [name: string]: Node };
|
|
8
|
+
|
|
9
|
+
constructor(functionNode?: FunctionNode, parameters?: { [name: string]: Node });
|
|
10
|
+
|
|
11
|
+
setParameters(parameters: { [name: string]: Node }): this;
|
|
12
|
+
getParameters(): { [name: string]: Node };
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import CodeNode from './CodeNode';
|
|
2
|
+
import FunctionCallNode from './FunctionCallNode';
|
|
3
|
+
import NodeBuilder from './NodeBuilder';
|
|
4
|
+
import NodeFunction from './NodeFunction';
|
|
5
|
+
import NodeFunctionInput from './NodeFunctionInput';
|
|
6
|
+
import Node from './Node';
|
|
7
|
+
|
|
8
|
+
export default class FunctionNode extends CodeNode {
|
|
9
|
+
keywords: { [key: string]: Node };
|
|
10
|
+
constructor(code?: string);
|
|
11
|
+
|
|
12
|
+
getInputs(builder: NodeBuilder): NodeFunctionInput[];
|
|
13
|
+
getNodeFunction(builder: NodeBuilder): NodeFunction;
|
|
14
|
+
call(parameters: { [name: string]: Node }): FunctionCallNode;
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NodeTypeOption, NodeValueOption } from './constants';
|
|
2
|
+
import Node from './Node';
|
|
3
|
+
import NodeBuilder from './NodeBuilder';
|
|
4
|
+
|
|
5
|
+
export default abstract class InputNode extends Node {
|
|
6
|
+
isInputNode: true;
|
|
7
|
+
value: NodeValueOption;
|
|
8
|
+
|
|
9
|
+
constructor(value: NodeValueOption, nodeType?: NodeTypeOption | null);
|
|
10
|
+
|
|
11
|
+
getInputType(builder: NodeBuilder): string | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AnyJson, NodeTypeOption, NodeUpdateTypeOption } from './constants';
|
|
2
|
+
import NodeBuilder from './NodeBuilder';
|
|
3
|
+
import NodeFrame from './NodeFrame';
|
|
4
|
+
|
|
5
|
+
export default abstract class Node {
|
|
6
|
+
uuid: string;
|
|
7
|
+
type: string;
|
|
8
|
+
isNode: true;
|
|
9
|
+
nodeType: NodeTypeOption | null;
|
|
10
|
+
updateType: NodeUpdateTypeOption;
|
|
11
|
+
id: number;
|
|
12
|
+
|
|
13
|
+
constructor(nodeType?: NodeTypeOption | null);
|
|
14
|
+
|
|
15
|
+
getChildren(): Node[];
|
|
16
|
+
getHash(builder: NodeBuilder): string;
|
|
17
|
+
getUpdateType(builder: NodeBuilder): NodeUpdateTypeOption;
|
|
18
|
+
getNodeType(builder: NodeBuilder, output?: string | null): NodeTypeOption | null;
|
|
19
|
+
getConstructHash(builder: NodeBuilder): string;
|
|
20
|
+
getReference(builder: NodeBuilder): Node;
|
|
21
|
+
construct(builder: NodeBuilder): Node | null;
|
|
22
|
+
analyze(builder: NodeBuilder): void;
|
|
23
|
+
generate(builder: NodeBuilder, output?: string | null): string;
|
|
24
|
+
/** This method must be overriden when {@link updateType} !== 'none' */
|
|
25
|
+
update(frame: NodeFrame): void;
|
|
26
|
+
build(builder: NodeBuilder, output?: string | null): string;
|
|
27
|
+
serialize(json: AnyJson): void;
|
|
28
|
+
deserialize(json: AnyJson): void;
|
|
29
|
+
toJSON(meta?: string | { textures: {}; images: {}; nodes: {} }): AnyJson;
|
|
30
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BufferGeometry,
|
|
3
|
+
Material,
|
|
4
|
+
Object3D,
|
|
5
|
+
Renderer,
|
|
6
|
+
Scene,
|
|
7
|
+
Texture,
|
|
8
|
+
TextureEncoding,
|
|
9
|
+
WebGLRenderTarget,
|
|
10
|
+
} from '../../../../src/Three';
|
|
11
|
+
import FogNode from '../fog/FogNode';
|
|
12
|
+
import LightsNode from '../lighting/LightsNode';
|
|
13
|
+
import { nodeObject } from '../Nodes';
|
|
14
|
+
import { AnyObject, NodeShaderStageOption, NodeTypeOption } from './constants';
|
|
15
|
+
import Node from './Node';
|
|
16
|
+
import NodeAttribute from './NodeAttribute';
|
|
17
|
+
import NodeParser from './NodeParser';
|
|
18
|
+
import NodeUniform from './NodeUniform';
|
|
19
|
+
import NodeVar from './NodeVar';
|
|
20
|
+
import NodeVary from './NodeVary';
|
|
21
|
+
|
|
22
|
+
export type BuildStageOption = 'construct' | 'analyze' | 'generate';
|
|
23
|
+
|
|
24
|
+
export interface FlowData {
|
|
25
|
+
code: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface NodeData {
|
|
29
|
+
vertex: AnyObject;
|
|
30
|
+
fragment: AnyObject;
|
|
31
|
+
compute: AnyObject;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type NodeBuilderContext = AnyObject;
|
|
35
|
+
|
|
36
|
+
export default abstract class NodeBuilder {
|
|
37
|
+
object: Object3D;
|
|
38
|
+
material: Material;
|
|
39
|
+
geometry: BufferGeometry;
|
|
40
|
+
renderer: Renderer;
|
|
41
|
+
parser: NodeParser;
|
|
42
|
+
|
|
43
|
+
nodes: Node[];
|
|
44
|
+
updateNodes: Node[];
|
|
45
|
+
hashNodes: { [hash: string]: Node };
|
|
46
|
+
|
|
47
|
+
scene: Scene;
|
|
48
|
+
lightsNode: LightsNode;
|
|
49
|
+
fogNode: FogNode;
|
|
50
|
+
|
|
51
|
+
vertexShader: string;
|
|
52
|
+
fragmentShader: string;
|
|
53
|
+
computeShader: string;
|
|
54
|
+
|
|
55
|
+
shaderStage: NodeShaderStageOption | null;
|
|
56
|
+
buildStage: BuildStageOption | null;
|
|
57
|
+
stack: Node[];
|
|
58
|
+
get node(): Node;
|
|
59
|
+
|
|
60
|
+
addStack(node: Node): void;
|
|
61
|
+
removeStack(node: Node): void;
|
|
62
|
+
setHashNode(node: Node, hash: string): void;
|
|
63
|
+
addNode(node: Node): void;
|
|
64
|
+
getMethod(method: string): string;
|
|
65
|
+
getNodeFromHash(hash: string): Node;
|
|
66
|
+
|
|
67
|
+
addFlow(shaderStage: NodeShaderStageOption, node: Node): Node;
|
|
68
|
+
|
|
69
|
+
setContext(context: NodeBuilderContext): void;
|
|
70
|
+
getContext(): NodeBuilderContext;
|
|
71
|
+
isAvailable(name: string): boolean;
|
|
72
|
+
|
|
73
|
+
abstract getInstanceIndex(): string;
|
|
74
|
+
|
|
75
|
+
abstract getFrontFacing(): string;
|
|
76
|
+
|
|
77
|
+
abstract getTexture(textureProperty: string, uvSnippet: string): string;
|
|
78
|
+
|
|
79
|
+
abstract getTextureLevel(textureProperty: string, uvSnippet: string, levelSnippet: string): string;
|
|
80
|
+
|
|
81
|
+
abstract getCubeTexture(textureProperty: string, uvSnippet: string): string;
|
|
82
|
+
abstract getCubeTextureLevel(textureProperty: string, uvSnippet: string, levelSnippet: string): string;
|
|
83
|
+
|
|
84
|
+
// @TODO: rename to .generateConst()
|
|
85
|
+
getConst(type: NodeTypeOption, value: unknown): Node;
|
|
86
|
+
getType(type: NodeTypeOption): NodeTypeOption;
|
|
87
|
+
|
|
88
|
+
generateMethod(method: string): string;
|
|
89
|
+
|
|
90
|
+
getAttribute(name: string, type: NodeTypeOption): NodeAttribute;
|
|
91
|
+
|
|
92
|
+
getPropertyName(node: Node, shaderStage: NodeShaderStageOption): string;
|
|
93
|
+
isVector(type: NodeTypeOption): boolean;
|
|
94
|
+
|
|
95
|
+
isMatrix(type: NodeTypeOption): boolean;
|
|
96
|
+
isReference(type: NodeTypeOption): boolean;
|
|
97
|
+
isShaderStage(shaderStage: NodeShaderStageOption): boolean;
|
|
98
|
+
getTextureEncodingFromMap(map: Texture | WebGLRenderTarget | unknown): TextureEncoding;
|
|
99
|
+
getComponentType(type: NodeTypeOption): NodeTypeOption;
|
|
100
|
+
getVectorType(type: NodeTypeOption): NodeTypeOption;
|
|
101
|
+
getTypeFromLength(length: number): NodeTypeOption;
|
|
102
|
+
getTypeLength(type: NodeTypeOption): number;
|
|
103
|
+
getVectorFromMatrix(type: NodeTypeOption): NodeTypeOption;
|
|
104
|
+
getDataFromNode(node: Node, shaderStage?: NodeShaderStageOption): NodeData;
|
|
105
|
+
getNodeProperties(node: Node, shaderStage?: NodeShaderStageOption): AnyObject;
|
|
106
|
+
getUniformFromNode(node: Node, shaderStage: NodeShaderStageOption, type: NodeTypeOption): NodeUniform;
|
|
107
|
+
getVarFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): NodeVar;
|
|
108
|
+
getVaryFromNode(node: Node, type: NodeTypeOption): NodeVary;
|
|
109
|
+
getCodeFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): string;
|
|
110
|
+
addFlowCode(code: string): void;
|
|
111
|
+
getFlowData(node: Node, shaderStage: NodeShaderStageOption): FlowData;
|
|
112
|
+
flowNode(node: Node): FlowData;
|
|
113
|
+
flowChildNode(node: Node, output?: string | null): FlowData;
|
|
114
|
+
flowNodeFromShaderStage(
|
|
115
|
+
shaderStage: NodeShaderStageOption,
|
|
116
|
+
node: Node,
|
|
117
|
+
output?: string | null,
|
|
118
|
+
propertyName?: string,
|
|
119
|
+
): FlowData;
|
|
120
|
+
abstract getAttributes(shaderStage: NodeShaderStageOption): string;
|
|
121
|
+
abstract getVarys(shaderStage: NodeShaderStageOption): string;
|
|
122
|
+
getVars(shaderStage: NodeShaderStageOption): string;
|
|
123
|
+
abstract getUniforms(stage: NodeShaderStageOption): string;
|
|
124
|
+
getCodes(shaderStage: NodeShaderStageOption): string;
|
|
125
|
+
getHash(): string;
|
|
126
|
+
setShaderStage(shaderStage: NodeShaderStageOption): void;
|
|
127
|
+
getShaderStage(): NodeShaderStageOption;
|
|
128
|
+
setBuildStage(buildStage: BuildStageOption): void;
|
|
129
|
+
getBuildStage(): BuildStageOption;
|
|
130
|
+
abstract buildCode(): void;
|
|
131
|
+
build(): this;
|
|
132
|
+
format(snippet: string, fromType: NodeTypeOption, toType: NodeTypeOption): string;
|
|
133
|
+
getSignature(): string;
|
|
134
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Camera, Material, Object3D, Renderer } from '../../../../src/Three';
|
|
2
|
+
|
|
3
|
+
import Node from './Node';
|
|
4
|
+
|
|
5
|
+
export default class NodeFrame {
|
|
6
|
+
time: number;
|
|
7
|
+
deltaTime: number;
|
|
8
|
+
frameId: number;
|
|
9
|
+
startTime: null | number;
|
|
10
|
+
renderer: null | Renderer;
|
|
11
|
+
material: null | Material;
|
|
12
|
+
camera: null | Camera;
|
|
13
|
+
object: null | Object3D;
|
|
14
|
+
|
|
15
|
+
constructor();
|
|
16
|
+
|
|
17
|
+
updateNode(node: Node): void;
|
|
18
|
+
update(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import NodeFunctionInput from './NodeFunctionInput';
|
|
2
|
+
|
|
3
|
+
export default abstract class NodeFunction {
|
|
4
|
+
isNodeFunction: true;
|
|
5
|
+
type: string;
|
|
6
|
+
inputs: NodeFunctionInput[];
|
|
7
|
+
name: string;
|
|
8
|
+
presicion: string;
|
|
9
|
+
|
|
10
|
+
constructor(type: string, inputs: NodeFunctionInput[], name?: string, presicion?: string);
|
|
11
|
+
|
|
12
|
+
abstract getCode(name?: string): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import NodeBuilder from './NodeBuilder';
|
|
2
|
+
import Node from './Node';
|
|
3
|
+
|
|
4
|
+
export default class NodeKeywords {
|
|
5
|
+
keywords: string[];
|
|
6
|
+
nodes: Node[];
|
|
7
|
+
keywordsCallback: { [name: string]: (name: string) => Node };
|
|
8
|
+
|
|
9
|
+
getNode(name: string): Node;
|
|
10
|
+
addKeyword(name: string, callback: (name: string) => Node): void;
|
|
11
|
+
|
|
12
|
+
parse(code: string): Node[];
|
|
13
|
+
include(builder: NodeBuilder, code: string): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NodeValueOption } from './constants';
|
|
2
|
+
import InputNode from './InputNode';
|
|
3
|
+
|
|
4
|
+
export default class NodeUniform {
|
|
5
|
+
isNodeUniform: true;
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
node: InputNode;
|
|
9
|
+
needsUpdate: boolean;
|
|
10
|
+
value: NodeValueOption;
|
|
11
|
+
|
|
12
|
+
constructor(name: string, type: string, node: InputNode, needsUpdate?: boolean);
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NodeValueOption } from './constants';
|
|
2
|
+
import Node from './Node';
|
|
3
|
+
|
|
4
|
+
export function getNodesKeys(object: Node): string[];
|
|
5
|
+
export function getValueType(value: NodeValueOption): string | null;
|
|
6
|
+
export function getValueFromType(type: string, ...params: number[]): NodeValueOption | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NodeTypeOption, NodeValueOption } from './constants';
|
|
2
|
+
import InputNode from './InputNode';
|
|
3
|
+
import NodeBuilder from './NodeBuilder';
|
|
4
|
+
|
|
5
|
+
export default class UniformNode extends InputNode {
|
|
6
|
+
isUniformNode: true;
|
|
7
|
+
|
|
8
|
+
constructor(value: NodeValueOption, nodeType?: NodeTypeOption | null);
|
|
9
|
+
getUniformHash(builder: NodeBuilder): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OperatorNodeOp } from '../math/OperatorNode';
|
|
2
|
+
import Node from './Node';
|
|
3
|
+
|
|
4
|
+
export default class VarNode extends Node {
|
|
5
|
+
node: Node;
|
|
6
|
+
name: string | null;
|
|
7
|
+
|
|
8
|
+
constructor(node: Node, name?: string | null);
|
|
9
|
+
|
|
10
|
+
op(op: OperatorNodeOp, ...params: Node[]): this;
|
|
11
|
+
assign(...params: Node[]): this;
|
|
12
|
+
add(...params: Node[]): this;
|
|
13
|
+
sub(...params: Node[]): this;
|
|
14
|
+
mul(...params: Node[]): this;
|
|
15
|
+
div(...params: Node[]): this;
|
|
16
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Color, Matrix3, Matrix4, Vector2, Vector3, Vector4 } from '../../../../src/Three';
|
|
2
|
+
|
|
3
|
+
// disable automatic export, we have some private declarations
|
|
4
|
+
export const NodeShaderStage: {
|
|
5
|
+
Vertex: 'vertex';
|
|
6
|
+
Fragment: 'fragment';
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const NodeUpdateType: {
|
|
10
|
+
None: 'none';
|
|
11
|
+
Frame: 'frame';
|
|
12
|
+
Object: 'object';
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type NodeValueOption = Color | Vector2 | Vector3 | Vector4 | Matrix3 | Matrix4 | boolean | number;
|
|
16
|
+
export type NodeUpdateTypeOption = 'none' | 'frame' | 'object';
|
|
17
|
+
export type NodeShaderStageOption = 'vertex' | 'fragment' | 'compute';
|
|
18
|
+
export type NodeTypeOption =
|
|
19
|
+
| 'bool'
|
|
20
|
+
| 'int'
|
|
21
|
+
| 'float'
|
|
22
|
+
| 'vec2'
|
|
23
|
+
| 'vec3'
|
|
24
|
+
| 'vec4'
|
|
25
|
+
| 'mat3'
|
|
26
|
+
| 'mat4'
|
|
27
|
+
| 'code' /* CodeNode */
|
|
28
|
+
| 'color' /* NodeUtis.getValueType */
|
|
29
|
+
| 'uint'
|
|
30
|
+
| 'int' /* NodeBuilder.getComponentType */
|
|
31
|
+
| 'void'
|
|
32
|
+
| 'property'
|
|
33
|
+
| 'sampler'
|
|
34
|
+
| 'texture'
|
|
35
|
+
| 'cubeTexture' /* NodeBuilder.isReference */
|
|
36
|
+
| 'ivec2'
|
|
37
|
+
| 'uvec2'
|
|
38
|
+
| 'bvec2' /* ShaderNodeBaseElements */
|
|
39
|
+
| 'ivec3'
|
|
40
|
+
| 'uvec3'
|
|
41
|
+
| 'bvec3'
|
|
42
|
+
| 'ivec4'
|
|
43
|
+
| 'uvec4'
|
|
44
|
+
| 'bvec4'
|
|
45
|
+
| 'imat3'
|
|
46
|
+
| 'umat3'
|
|
47
|
+
| 'bmat3'
|
|
48
|
+
| 'imat4'
|
|
49
|
+
| 'umat4'
|
|
50
|
+
| 'bmat4';
|
|
51
|
+
|
|
52
|
+
// can be defined with string template type in Typescript 4.1
|
|
53
|
+
export type SwizzleOption = string;
|
|
54
|
+
|
|
55
|
+
/** Should be the same type as Object3D.userData */
|
|
56
|
+
export interface NodeUserData {
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** generic key value type,curretly used by nodes */
|
|
61
|
+
export interface AnyObject {
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** a generic JSON type, used by nodes only */
|
|
66
|
+
export type AnyJson = any;
|
|
67
|
+
|
|
68
|
+
export const NodeType: {
|
|
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
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import TempNode from '../core/TempNode';
|
|
2
|
+
import { Node } from '../Nodes';
|
|
3
|
+
|
|
4
|
+
export type ColorAdjustmentMethod =
|
|
5
|
+
| typeof ColorAdjustmentNode.SATURATION
|
|
6
|
+
| typeof ColorAdjustmentNode.VIBRANCE
|
|
7
|
+
| typeof ColorAdjustmentNode.HUE;
|
|
8
|
+
|
|
9
|
+
export default class ColorAdjustmentNode extends TempNode {
|
|
10
|
+
static SATURATION: 'saturation';
|
|
11
|
+
static VIBRANCE: 'vibrance';
|
|
12
|
+
static HUE: 'hue';
|
|
13
|
+
|
|
14
|
+
method: ColorAdjustmentMethod;
|
|
15
|
+
|
|
16
|
+
colorNode: Node;
|
|
17
|
+
adjustmentNode: Node;
|
|
18
|
+
|
|
19
|
+
constructor(method: ColorAdjustmentMethod, colorNode: Node, adjustmentNode?: Node);
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TextureEncoding } from '../../../../src/Three';
|
|
2
|
+
import TempNode from '../core/TempNode';
|
|
3
|
+
import Node from '../core/Node';
|
|
4
|
+
export type ColorSpaceNodeMethod = typeof ColorSpaceNode.LINEAR_TO_LINEAR | typeof ColorSpaceNode.LINEAR_TO_SRGB;
|
|
5
|
+
|
|
6
|
+
export default class ColorSpaceNode extends TempNode {
|
|
7
|
+
static LINEAR_TO_LINEAR: 'LinearToLinear';
|
|
8
|
+
static LINEAR_TO_SRGB: 'LinearTosRGB';
|
|
9
|
+
|
|
10
|
+
method: ColorSpaceNodeMethod;
|
|
11
|
+
node: Node;
|
|
12
|
+
|
|
13
|
+
constructor(method: ColorSpaceNodeMethod | null, node: Node);
|
|
14
|
+
fromEncoding(encoding: TextureEncoding): this;
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import TempNode from '../core/TempNode';
|
|
2
|
+
import { NormalMapTypes } from '../../../../src/Three';
|
|
3
|
+
import Node from '../core/Node';
|
|
4
|
+
|
|
5
|
+
export default class NormalMapNode extends TempNode {
|
|
6
|
+
node: Node;
|
|
7
|
+
scaleNode: Node | null;
|
|
8
|
+
|
|
9
|
+
normalMapType: NormalMapTypes;
|
|
10
|
+
|
|
11
|
+
constructor(node: Node, scaleNode?: Node | null);
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import TempNode from '../core/TempNode';
|
|
2
|
+
import Node from '../core/Node';
|
|
3
|
+
import { ToneMapping } from '../../../../src/Three';
|
|
4
|
+
|
|
5
|
+
// exposure only
|
|
6
|
+
export const LinearToneMappingNode: Node;
|
|
7
|
+
|
|
8
|
+
export default class ToneMappingNode extends TempNode {
|
|
9
|
+
toneMapping: ToneMapping;
|
|
10
|
+
exposureNode: Node;
|
|
11
|
+
colorNode: Node | null;
|
|
12
|
+
|
|
13
|
+
constructor(toneMapping: ToneMapping, exposureNode?: Node, colorNode?: Node | null);
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ShaderNode } from '../../shadernode/ShaderNodeElements';
|
|
2
|
+
import Node from '../../core/Node';
|
|
3
|
+
|
|
4
|
+
// Analytical approximation of the DFG LUT, one half of the
|
|
5
|
+
// split-sum approximation used in indirect specular lighting.
|
|
6
|
+
// via 'environmentBRDF' from "Physically Based Shading on Mobile"
|
|
7
|
+
// https://www.unrealengine.com/blog/physically-based-shading-on-mobile
|
|
8
|
+
declare const DFGApprox: ShaderNode<{ roughness: Node }>;
|
|
9
|
+
|
|
10
|
+
export default DFGApprox;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ShaderNode } from '../../shadernode/ShaderNodeBaseElements';
|
|
2
|
+
import Node from '../../core/Node';
|
|
3
|
+
|
|
4
|
+
// Microfacet Models for Refraction through Rough Surfaces - equation (33)
|
|
5
|
+
// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html
|
|
6
|
+
// alpha is "roughness squared" in Disney’s reparameterization
|
|
7
|
+
declare const D_GGX: ShaderNode<{ alpha: Node; dotNH: Node }>;
|
|
8
|
+
|
|
9
|
+
export default D_GGX;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ShaderNode } from '../shadernode/ShaderNodeElements';
|
|
2
|
+
import Node from '../core/Node';
|
|
3
|
+
|
|
4
|
+
declare const PhysicalLightingModel: {
|
|
5
|
+
direct: ShaderNode<{ lightDirection: Node; lightColor: Node; reflectedLight: Node }>;
|
|
6
|
+
indirectDiffuse: ShaderNode<{ irradiance: Node; reflectedLight: Node }>;
|
|
7
|
+
indirectSpecular: ShaderNode<{ radiance: Node; iblIrradiance: Node; reflectedLight: Node }>;
|
|
8
|
+
ambientOcclusion: ShaderNode<{ ambientOcclusion: Node; reflectedLight: Node }>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default PhysicalLightingModel;
|