@types/three 0.142.0 → 0.143.2

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.
Files changed (118) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/nodes/Nodes.d.ts +215 -0
  3. three/examples/jsm/nodes/accessors/BufferNode.d.ts +11 -0
  4. three/examples/jsm/nodes/accessors/CameraNode.d.ts +12 -0
  5. three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +11 -0
  6. three/examples/jsm/nodes/accessors/InstanceNode.d.ts +9 -0
  7. three/examples/jsm/nodes/accessors/MaterialNode.d.ts +23 -0
  8. three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +6 -0
  9. three/examples/jsm/nodes/accessors/ModelNode.d.ts +9 -0
  10. three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +6 -0
  11. three/examples/jsm/nodes/accessors/NormalNode.d.ts +17 -0
  12. three/examples/jsm/nodes/accessors/Object3DNode.d.ts +22 -0
  13. three/examples/jsm/nodes/accessors/PointUVNode.d.ts +7 -0
  14. three/examples/jsm/nodes/accessors/PositionNode.d.ts +19 -0
  15. three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +13 -0
  16. three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +8 -0
  17. three/examples/jsm/nodes/accessors/SkinningNode.d.ts +13 -0
  18. three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +6 -0
  19. three/examples/jsm/nodes/accessors/TextureNode.d.ts +12 -0
  20. three/examples/jsm/nodes/accessors/UVNode.d.ts +8 -0
  21. three/examples/jsm/nodes/accessors/UserDataNode.d.ts +7 -0
  22. three/examples/jsm/nodes/core/ArrayUniformNode.d.ts +8 -0
  23. three/examples/jsm/nodes/core/AttributeNode.d.ts +9 -0
  24. three/examples/jsm/nodes/core/BypassNode.d.ts +9 -0
  25. three/examples/jsm/nodes/core/CodeNode.d.ts +16 -0
  26. three/examples/jsm/nodes/core/ConstNode.d.ts +10 -0
  27. three/examples/jsm/nodes/core/ContextNode.d.ts +10 -0
  28. three/examples/jsm/nodes/core/ExpressionNode.d.ts +7 -0
  29. three/examples/jsm/nodes/core/FunctionCallNode.d.ts +13 -0
  30. three/examples/jsm/nodes/core/FunctionNode.d.ts +15 -0
  31. three/examples/jsm/nodes/core/InputNode.d.ts +12 -0
  32. three/examples/jsm/nodes/core/InstanceIndexNode.d.ts +6 -0
  33. three/examples/jsm/nodes/core/Node.d.ts +30 -0
  34. three/examples/jsm/nodes/core/NodeAttribute.d.ts +6 -0
  35. three/examples/jsm/nodes/core/NodeBuilder.d.ts +134 -0
  36. three/examples/jsm/nodes/core/NodeCode.d.ts +4 -0
  37. three/examples/jsm/nodes/core/NodeFrame.d.ts +19 -0
  38. three/examples/jsm/nodes/core/NodeFunction.d.ts +13 -0
  39. three/examples/jsm/nodes/core/NodeFunctionInput.d.ts +7 -0
  40. three/examples/jsm/nodes/core/NodeKeywords.d.ts +14 -0
  41. three/examples/jsm/nodes/core/NodeParser.d.ts +5 -0
  42. three/examples/jsm/nodes/core/NodeUniform.d.ts +13 -0
  43. three/examples/jsm/nodes/core/NodeUtils.d.ts +6 -0
  44. three/examples/jsm/nodes/core/NodeVar.d.ts +6 -0
  45. three/examples/jsm/nodes/core/NodeVary.d.ts +6 -0
  46. three/examples/jsm/nodes/core/PropertyNode.d.ts +6 -0
  47. three/examples/jsm/nodes/core/TempNode.d.ts +8 -0
  48. three/examples/jsm/nodes/core/UniformNode.d.ts +10 -0
  49. three/examples/jsm/nodes/core/VarNode.d.ts +16 -0
  50. three/examples/jsm/nodes/core/VaryNode.d.ts +8 -0
  51. three/examples/jsm/nodes/core/constants.d.ts +77 -0
  52. three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +20 -0
  53. three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +15 -0
  54. three/examples/jsm/nodes/display/FrontFacingNode.d.ts +6 -0
  55. three/examples/jsm/nodes/display/NormalMapNode.d.ts +12 -0
  56. three/examples/jsm/nodes/display/ToneMappingNode.d.ts +14 -0
  57. three/examples/jsm/nodes/fog/FogNode.d.ts +10 -0
  58. three/examples/jsm/nodes/fog/FogRangeNode.d.ts +10 -0
  59. three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +6 -0
  60. three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +6 -0
  61. three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +10 -0
  62. three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +9 -0
  63. three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +6 -0
  64. three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +6 -0
  65. three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +11 -0
  66. three/examples/jsm/nodes/functions/light/getDistanceAttenuation.d.ts +5 -0
  67. three/examples/jsm/nodes/functions/material/getGeometryRoughness.d.ts +5 -0
  68. three/examples/jsm/nodes/functions/material/getRoughness.d.ts +6 -0
  69. three/examples/jsm/nodes/geometry/RangeNode.d.ts +12 -0
  70. three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +11 -0
  71. three/examples/jsm/nodes/lighting/AONode.d.ts +8 -0
  72. three/examples/jsm/nodes/lighting/AnalyticLightNode.d.ts +10 -0
  73. three/examples/jsm/nodes/lighting/EnvironmentNode.d.ts +8 -0
  74. three/examples/jsm/nodes/lighting/HemisphereLightNode.d.ts +13 -0
  75. three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +15 -0
  76. three/examples/jsm/nodes/lighting/LightingNode.d.ts +5 -0
  77. three/examples/jsm/nodes/lighting/LightsNode.d.ts +19 -0
  78. three/examples/jsm/nodes/lighting/PunctualLightNode.d.ts +12 -0
  79. three/examples/jsm/nodes/loaders/NodeLoader.d.ts +21 -0
  80. three/examples/jsm/nodes/loaders/NodeMaterialLoader.d.ts +8 -0
  81. three/examples/jsm/nodes/loaders/NodeObjectLoader.d.ts +11 -0
  82. three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +16 -0
  83. three/examples/jsm/nodes/materials/Materials.d.ts +15 -0
  84. three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +19 -0
  85. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +27 -0
  86. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +22 -0
  87. three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +15 -0
  88. three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +23 -0
  89. three/examples/jsm/nodes/math/CondNode.d.ts +9 -0
  90. three/examples/jsm/nodes/math/MathNode.d.ts +116 -0
  91. three/examples/jsm/nodes/math/OperatorNode.d.ts +31 -0
  92. three/examples/jsm/nodes/procedural/CheckerNode.d.ts +6 -0
  93. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +155 -0
  94. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +267 -0
  95. three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +128 -0
  96. three/examples/jsm/nodes/utils/ArrayElementNode.d.ts +9 -0
  97. three/examples/jsm/nodes/utils/ConvertNode.d.ts +8 -0
  98. three/examples/jsm/nodes/utils/JoinNode.d.ts +10 -0
  99. three/examples/jsm/nodes/utils/MatcapUVNode.d.ts +5 -0
  100. three/examples/jsm/nodes/utils/MaxMipLevelNode.d.ts +7 -0
  101. three/examples/jsm/nodes/utils/OscNode.d.ts +19 -0
  102. three/examples/jsm/nodes/utils/RotateUVNode.d.ts +10 -0
  103. three/examples/jsm/nodes/utils/SplitNode.d.ts +16 -0
  104. three/examples/jsm/nodes/utils/SpriteSheetUVNode.d.ts +9 -0
  105. three/examples/jsm/nodes/utils/TimerNode.d.ts +14 -0
  106. three/examples/jsm/objects/GroundProjectedEnv.d.ts +13 -0
  107. three/examples/jsm/renderers/webgl/nodes/SlotNode.d.ts +5 -0
  108. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +56 -0
  109. three/examples/jsm/renderers/webgl/nodes/WebGLNodes.d.ts +3 -0
  110. three/examples/jsm/renderers/webgl/nodes/WebGLPhysicalContextNode.d.ts +13 -0
  111. three/examples/jsm/textures/FlakesTexture.d.ts +3 -0
  112. three/index.d.ts +2 -2
  113. three/package.json +2 -2
  114. three/src/Three.d.ts +4 -1
  115. three/src/animation/AnimationUtils.d.ts +32 -34
  116. three/src/core/UniformsGroup.d.ts +27 -0
  117. three/src/renderers/shaders/UniformsUtils.d.ts +6 -1
  118. three/src/renderers/webgl/WebGLUniformsGroups.d.ts +17 -0
@@ -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,4 @@
1
+ export default class NodeCode {
2
+ isNodeCode: true;
3
+ constructor(name: string, type: string, code?: string);
4
+ }
@@ -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,7 @@
1
+ export default class NodeFunctionInput {
2
+ isNodeFunctionInput: true;
3
+ count: null | number;
4
+ qualifier: string;
5
+ isConst: boolean;
6
+ constructor(type: string, name: string, count?: number, qualifier?: string, isConst?: boolean);
7
+ }
@@ -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,5 @@
1
+ import Node from './Node';
2
+
3
+ export default abstract class NodeParser {
4
+ abstract parseFunction(source: string): Node;
5
+ }
@@ -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,6 @@
1
+ export default class NodeVar {
2
+ isNodeVar: true;
3
+ name: string;
4
+ type: string;
5
+ constructor(name: string, type: string);
6
+ }
@@ -0,0 +1,6 @@
1
+ export default class NodeVary {
2
+ name: string;
3
+ type: string;
4
+ isNodeVary: boolean;
5
+ constructor(name: string, type: string);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { NodeTypeOption } from './constants';
2
+ import Node from './Node';
3
+
4
+ export default class PropertyNode extends Node {
5
+ constructor(name?: string, nodeType?: NodeTypeOption);
6
+ }
@@ -0,0 +1,8 @@
1
+ import { NodeTypeOption } from './constants';
2
+ import Node from './Node';
3
+
4
+ export default class TempNode extends Node {
5
+ isTempNode: true;
6
+
7
+ constructor(type: NodeTypeOption | null);
8
+ }
@@ -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,8 @@
1
+ import Node from './Node';
2
+
3
+ export default class VaryNode extends Node {
4
+ node: Node;
5
+ name: string | null;
6
+
7
+ constructor(node: Node, name?: string | null);
8
+ }
@@ -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,6 @@
1
+ import Node from '../core/Node';
2
+
3
+ export default class FrontFacingNode extends Node {
4
+ isFrontFacingNode: true;
5
+ constructor();
6
+ }
@@ -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 Node from '../core/Node';
2
+
3
+ export default class FogNode extends Node {
4
+ isFogNode: true;
5
+ colorNode: Node;
6
+ factorNode: Node;
7
+
8
+ constructor(colorNode: Node, factorNode: Node);
9
+ mix(outputNode: Node): Node;
10
+ }
@@ -0,0 +1,10 @@
1
+ import FogNode from './FogNode';
2
+ import Node from '../core/Node';
3
+
4
+ export default class FogRangeNode extends FogNode {
5
+ isFogRangeNode: true;
6
+ nearNode: Node;
7
+ farNode: Node;
8
+
9
+ constructor(colorNode: Node, nearNode: Node, farNode: Node);
10
+ }
@@ -0,0 +1,6 @@
1
+ import { ShaderNode } from '../../shadernode/ShaderNodeBaseElements';
2
+ import Node from '../../core/Node';
3
+
4
+ declare const BRDF_GGX: ShaderNode<{ lightDirection: Node; f0: Node; f90: Node; roughness: Node }>;
5
+
6
+ export default BRDF_GGX;
@@ -0,0 +1,6 @@
1
+ import { ShaderNode } from '../../shadernode/ShaderNodeBaseElements';
2
+ import Node from '../../core/Node';
3
+
4
+ declare const BRDF_Lambert: ShaderNode<{ diffuseColor: Node }>;
5
+
6
+ export default BRDF_Lambert;
@@ -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,6 @@
1
+ import { ShaderNode } from '../../shadernode/ShaderNodeBaseElements';
2
+ import Node from '../../core/Node';
3
+
4
+ declare const F_Schlick: ShaderNode<{ f0: Node; f90: Node; dotVH: Node }>;
5
+
6
+ export default F_Schlick;
@@ -0,0 +1,6 @@
1
+ import { ShaderNode } from '../../shadernode/ShaderNodeBaseElements';
2
+ import Node from '../../core/Node';
3
+
4
+ declare const V_GGX_SmithCorrelated: ShaderNode<{ alpha: Node; dotNL: Node; dotNV: Node }>;
5
+
6
+ export default V_GGX_SmithCorrelated;
@@ -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;
@@ -0,0 +1,5 @@
1
+ import { ShaderNode } from '../../shadernode/ShaderNodeBaseElements';
2
+ import Node from '../../core/Node';
3
+ declare const getDistanceAttenuation: ShaderNode<{ lightDistance: Node; cutoffDistance: Node; decayExponent: Node }>;
4
+
5
+ export default getDistanceAttenuation;
@@ -0,0 +1,5 @@
1
+ import { ShaderNode } from '../../shadernode/ShaderNodeBaseElements';
2
+
3
+ declare const getGeometryRoughness: ShaderNode;
4
+
5
+ export default getGeometryRoughness;
@@ -0,0 +1,6 @@
1
+ import { ShaderNode } from '../../shadernode/ShaderNodeElements';
2
+ import Node from '../../core/Node';
3
+
4
+ declare const getRoughness: ShaderNode<{ roughness: Node }>;
5
+
6
+ export default getRoughness;
@@ -0,0 +1,12 @@
1
+ import { Color, Vector2, Vector3, Vector4 } from '../../../../src/Three';
2
+ import Node from '../core/Node';
3
+
4
+ export type RangeModeBound = number | Color | Vector2 | Vector3 | Vector4;
5
+
6
+ export default class RangeNode extends Node {
7
+ min: RangeModeBound;
8
+ max: RangeModeBound;
9
+
10
+ constructor(min: RangeModeBound, max: RangeModeBound);
11
+ getVectorLength(): number;
12
+ }
@@ -0,0 +1,11 @@
1
+ import Node from '../core/Node';
2
+
3
+ export default class ComputeNode extends Node {
4
+ isComputeNode: true;
5
+
6
+ count: number;
7
+ workgroupSize: number[];
8
+ dispatchCount: number;
9
+
10
+ constructor(computeNode: Node, count: number, workgroupSize?: number[]);
11
+ }
@@ -0,0 +1,8 @@
1
+ import LightingNode from './LightingNode';
2
+ import Node from '../core/Node';
3
+
4
+ export default class AONode extends LightingNode {
5
+ aoNode: Node | null;
6
+
7
+ constructor(aoNode?: Node | null);
8
+ }
@@ -0,0 +1,10 @@
1
+ import LightingNode from './LightingNode';
2
+ import { Light } from '../../../../src/Three';
3
+ import Node from '../core/Node';
4
+
5
+ export default class AnalyticLightNode<T extends Light> extends LightingNode {
6
+ light: T | null;
7
+ colorNode: Node;
8
+
9
+ constructor(light?: T | null);
10
+ }
@@ -0,0 +1,8 @@
1
+ import LightingNode from './LightingNode';
2
+ import Node from '../core/Node';
3
+
4
+ export default class EnvironmentNode extends LightingNode {
5
+ envNode: Node | null;
6
+
7
+ constructor(envNode?: Node | null);
8
+ }
@@ -0,0 +1,13 @@
1
+ import AnalyticLightNode from './AnalyticLightNode';
2
+ import Object3DNode from '../accessors/Object3DNode';
3
+ import { HemisphereLight } from '../../../../src/Three';
4
+ import Node from '../core/Node';
5
+
6
+ export default class HemisphereLightNode extends AnalyticLightNode<HemisphereLight> {
7
+ lightPositionNode: Object3DNode;
8
+ lightDirectionNode: Node;
9
+
10
+ groundColorNode: Node;
11
+
12
+ constructor(light?: HemisphereLight | null);
13
+ }
@@ -0,0 +1,15 @@
1
+ import ContextNode from '../core/ContextNode';
2
+ import Node from '../core/Node';
3
+ import { ShaderNode } from '../Nodes';
4
+
5
+ export interface LightingModelNode {
6
+ indirectDiffuse?: ShaderNode;
7
+ indirectSpecular?: ShaderNode;
8
+ ambientOcclusion?: ShaderNode;
9
+ }
10
+
11
+ export default class LightingContextNode extends ContextNode {
12
+ lightingModelNode: LightingModelNode | null;
13
+
14
+ constructor(node: Node, lightingModelNode?: LightingModelNode | null);
15
+ }