@types/three 0.157.1 → 0.158.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 +290 -0
- three/examples/jsm/animation/CCDIKSolver.d.ts +30 -0
- three/examples/jsm/animation/MMDAnimationHelper.d.ts +105 -0
- three/examples/jsm/animation/MMDPhysics.d.ts +124 -0
- three/examples/jsm/cameras/CinematicCamera.d.ts +41 -0
- three/examples/jsm/capabilities/WebGL.d.ts +9 -0
- three/examples/jsm/controls/OrbitControls.d.ts +304 -0
- three/examples/jsm/controls/TrackballControls.d.ts +58 -0
- three/examples/jsm/effects/OutlineEffect.d.ts +36 -0
- three/examples/jsm/environments/RoomEnvironment.d.ts +6 -0
- three/examples/jsm/exporters/PLYExporter.d.ts +30 -0
- three/examples/jsm/exporters/STLExporter.d.ts +21 -0
- three/examples/jsm/helpers/RectAreaLightHelper.d.ts +10 -0
- three/examples/jsm/helpers/ViewHelper.d.ts +15 -0
- three/examples/jsm/libs/fflate.module.d.ts +1 -0
- three/examples/jsm/libs/lil-gui.module.min.d.ts +609 -0
- three/examples/jsm/libs/tween.module.d.ts +219 -0
- three/examples/jsm/lights/RectAreaLightUniformsLib.d.ts +3 -0
- three/examples/jsm/lines/Line2.d.ts +11 -0
- three/examples/jsm/lines/LineGeometry.d.ts +10 -0
- three/examples/jsm/lines/LineMaterial.d.ts +31 -0
- three/examples/jsm/lines/LineSegments2.d.ts +14 -0
- three/examples/jsm/lines/LineSegmentsGeometry.d.ts +23 -0
- three/examples/jsm/loaders/DDSLoader.d.ts +16 -0
- three/examples/jsm/loaders/DRACOLoader.d.ts +19 -0
- three/examples/jsm/loaders/GLTFLoader.d.ts +147 -0
- three/examples/jsm/loaders/KTX2Loader.d.ts +17 -0
- three/examples/jsm/loaders/LDrawLoader.d.ts +19 -0
- three/examples/jsm/loaders/LogLuvLoader.d.ts +1 -1
- three/examples/jsm/loaders/MMDLoader.d.ts +56 -0
- three/examples/jsm/loaders/MTLLoader.d.ts +104 -0
- three/examples/jsm/loaders/OBJLoader.d.ts +10 -0
- three/examples/jsm/loaders/PCDLoader.d.ts +8 -0
- three/examples/jsm/loaders/RGBELoader.d.ts +19 -0
- three/examples/jsm/loaders/SVGLoader.d.ts +68 -0
- three/examples/jsm/loaders/TGALoader.d.ts +7 -0
- three/examples/jsm/loaders/TTFLoader.d.ts +8 -0
- three/examples/jsm/loaders/USDZLoader.d.ts +11 -0
- three/examples/jsm/materials/MeshGouraudMaterial.d.ts +17 -0
- three/examples/jsm/math/Capsule.d.ts +0 -1
- three/examples/jsm/misc/MD2CharacterComplex.d.ts +9 -1
- three/examples/jsm/nodes/Nodes.d.ts +149 -0
- three/examples/jsm/nodes/accessors/BitangentNode.d.ts +18 -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 +13 -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 +12 -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 +21 -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/TangentNode.d.ts +18 -0
- three/examples/jsm/nodes/accessors/TextureNode.d.ts +14 -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/code/CodeNode.d.ts +15 -0
- three/examples/jsm/nodes/code/ExpressionNode.d.ts +7 -0
- three/examples/jsm/nodes/code/FunctionCallNode.d.ts +13 -0
- three/examples/jsm/nodes/code/FunctionNode.d.ts +17 -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/CacheNode.d.ts +10 -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/InputNode.d.ts +16 -0
- three/examples/jsm/nodes/core/Node.d.ts +31 -0
- three/examples/jsm/nodes/core/NodeAttribute.d.ts +6 -0
- three/examples/jsm/nodes/core/NodeBuilder.d.ts +138 -0
- three/examples/jsm/nodes/core/NodeCache.d.ts +9 -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 +13 -0
- three/examples/jsm/nodes/core/NodeVar.d.ts +6 -0
- three/examples/jsm/nodes/core/NodeVarying.d.ts +8 -0
- three/examples/jsm/nodes/core/PropertyNode.d.ts +6 -0
- three/examples/jsm/nodes/core/StackNode.d.ts +11 -0
- three/examples/jsm/nodes/core/TempNode.d.ts +11 -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/VaryingNode.d.ts +8 -0
- three/examples/jsm/nodes/core/constants.d.ts +78 -0
- three/examples/jsm/nodes/display/BlendModeNode.d.ts +32 -0
- three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +20 -0
- three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +18 -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/PosterizeNode.d.ts +8 -0
- three/examples/jsm/nodes/display/ToneMappingNode.d.ts +14 -0
- three/examples/jsm/nodes/display/ViewportNode.d.ts +23 -0
- three/examples/jsm/nodes/fog/FogExp2Node.d.ts +9 -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/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 +13 -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/LightUtils.d.ts +4 -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/PointLightNode.d.ts +10 -0
- three/examples/jsm/nodes/lighting/SpotLightNode.d.ts +15 -0
- three/examples/jsm/nodes/loaders/NodeLoader.d.ts +14 -0
- three/examples/jsm/nodes/loaders/NodeMaterialLoader.d.ts +8 -0
- three/examples/jsm/nodes/loaders/NodeObjectLoader.d.ts +9 -0
- three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +9 -0
- three/examples/jsm/nodes/materials/Materials.d.ts +17 -0
- three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +10 -0
- three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +22 -0
- three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +18 -0
- three/examples/jsm/nodes/materials/NodeMaterial.d.ts +38 -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/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/CondNode.d.ts +9 -0
- three/examples/jsm/nodes/math/MathNode.d.ts +115 -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 +156 -0
- three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +310 -0
- three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +166 -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/EquirectUVNode.d.ts +6 -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 +11 -0
- three/examples/jsm/nodes/utils/OscNode.d.ts +19 -0
- three/examples/jsm/nodes/utils/RemapNode.d.ts +13 -0
- three/examples/jsm/nodes/utils/RotateUVNode.d.ts +10 -0
- three/examples/jsm/nodes/utils/SpecularMIPLevelNode.d.ts +8 -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 +19 -0
- three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +22 -0
- three/examples/jsm/objects/Reflector.d.ts +29 -0
- three/examples/jsm/objects/ReflectorForSSRPass.d.ts +1 -0
- three/examples/jsm/objects/Refractor.d.ts +2 -1
- three/examples/jsm/physics/AmmoPhysics.d.ts +2 -1
- three/examples/jsm/physics/RapierPhysics.d.ts +2 -1
- three/examples/jsm/postprocessing/EffectComposer.d.ts +31 -0
- three/examples/jsm/postprocessing/Pass.d.ts +31 -0
- three/examples/jsm/postprocessing/SavePass.d.ts +12 -0
- three/examples/jsm/postprocessing/ShaderPass.d.ts +11 -0
- three/examples/jsm/renderers/CSS3DRenderer.d.ts +26 -0
- three/examples/jsm/renderers/SVGRenderer.d.ts +2 -1
- three/examples/jsm/renderers/common/Backend.d.ts +15 -0
- three/examples/jsm/renderers/common/Info.d.ts +15 -0
- three/examples/jsm/renderers/common/Renderer.d.ts +42 -0
- three/examples/jsm/renderers/webgl/nodes/SlotNode.d.ts +17 -0
- three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +37 -0
- three/examples/jsm/renderers/webgl/nodes/WebGLNodes.d.ts +3 -0
- three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +9 -0
- three/examples/jsm/shaders/ACESFilmicToneMappingShader.d.ts +11 -0
- three/examples/jsm/shaders/AfterimageShader.d.ts +1 -0
- three/examples/jsm/shaders/BasicShader.d.ts +1 -0
- three/examples/jsm/shaders/BlendShader.d.ts +1 -0
- three/examples/jsm/shaders/BokehShader.d.ts +1 -0
- three/examples/jsm/shaders/BokehShader2.d.ts +44 -0
- three/examples/jsm/shaders/BrightnessContrastShader.d.ts +1 -0
- three/examples/jsm/shaders/ColorCorrectionShader.d.ts +1 -0
- three/examples/jsm/shaders/DOFMipMapShader.d.ts +1 -0
- three/examples/jsm/shaders/DepthLimitedBlurShader.d.ts +1 -0
- three/examples/jsm/shaders/FXAAShader.d.ts +1 -0
- three/examples/jsm/shaders/FocusShader.d.ts +1 -0
- three/examples/jsm/shaders/FreiChenShader.d.ts +1 -0
- three/examples/jsm/shaders/GodRaysShader.d.ts +4 -0
- three/examples/jsm/shaders/HalftoneShader.d.ts +1 -0
- three/examples/jsm/shaders/HorizontalTiltShiftShader.d.ts +1 -0
- three/examples/jsm/shaders/HueSaturationShader.d.ts +1 -0
- three/examples/jsm/shaders/KaleidoShader.d.ts +1 -0
- three/examples/jsm/shaders/LuminosityHighPassShader.d.ts +1 -0
- three/examples/jsm/shaders/LuminosityShader.d.ts +1 -0
- three/examples/jsm/shaders/MirrorShader.d.ts +1 -0
- three/examples/jsm/shaders/NormalMapShader.d.ts +1 -0
- three/examples/jsm/shaders/OutputShader.d.ts +1 -0
- three/examples/jsm/shaders/SAOShader.d.ts +1 -0
- three/examples/jsm/shaders/SMAAShader.d.ts +3 -0
- three/examples/jsm/shaders/SSAOShader.d.ts +3 -0
- three/examples/jsm/shaders/SSRShader.d.ts +3 -0
- three/examples/jsm/shaders/SobelOperatorShader.d.ts +1 -0
- three/examples/jsm/shaders/SubsurfaceScatteringShader.d.ts +1 -0
- three/examples/jsm/shaders/TechnicolorShader.d.ts +1 -0
- three/examples/jsm/shaders/TriangleBlurShader.d.ts +1 -0
- three/examples/jsm/shaders/UnpackDepthRGBAShader.d.ts +1 -0
- three/examples/jsm/shaders/VelocityShader.d.ts +14 -0
- three/examples/jsm/shaders/VerticalTiltShiftShader.d.ts +1 -0
- three/examples/jsm/shaders/WaterRefractionShader.d.ts +1 -0
- three/examples/jsm/utils/GPUStatsPanel.d.ts +12 -0
- three/examples/jsm/utils/GeometryUtils.d.ts +25 -0
- three/examples/jsm/utils/LDrawUtils.d.ts +5 -0
- three/examples/jsm/webxr/VRButton.d.ts +5 -0
- three/examples/jsm/webxr/XRButton.d.ts +6 -0
- three/examples/jsm/webxr/XRControllerModelFactory.d.ts +21 -0
- three/examples/jsm/webxr/XREstimatedLight.d.ts +32 -0
- three/examples/jsm/webxr/XRHandMeshModel.d.ts +11 -0
- three/examples/jsm/webxr/XRHandModelFactory.d.ts +25 -0
- three/examples/jsm/webxr/XRHandPrimitiveModel.d.ts +24 -0
- three/package.json +3 -2
- three/src/cameras/CubeCamera.d.ts +1 -2
- three/src/constants.d.ts +21 -10
- three/src/core/Object3D.d.ts +4 -4
- three/src/core/Raycaster.d.ts +1 -0
- three/src/extras/Earcut.d.ts +15 -0
- three/src/extras/core/Curve.d.ts +1 -1
- three/src/geometries/CapsuleGeometry.d.ts +1 -1
- three/src/helpers/AxesHelper.d.ts +2 -2
- three/src/helpers/Box3Helper.d.ts +2 -2
- three/src/lights/Light.d.ts +1 -2
- three/src/materials/Material.d.ts +20 -2
- three/src/materials/MeshPhysicalMaterial.d.ts +8 -6
- three/src/math/ColorManagement.d.ts +1 -1
- three/src/math/Matrix4.d.ts +2 -1
- three/src/objects/SkinnedMesh.d.ts +9 -8
- three/src/renderers/WebGLRenderer.d.ts +12 -2
- three/src/scenes/Scene.d.ts +2 -2
- three/src/textures/DepthTexture.d.ts +3 -3
- three/src/textures/Texture.d.ts +2 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SkinnedMesh } from '../../../../src/Three.js';
|
|
2
|
+
import Node from '../core/Node.js';
|
|
3
|
+
|
|
4
|
+
export default class SkinningNode extends Node {
|
|
5
|
+
skinIndexNode: Node;
|
|
6
|
+
skinWeightNode: Node;
|
|
7
|
+
|
|
8
|
+
bindMatrixNode: Node;
|
|
9
|
+
bindMatrixInverseNode: Node;
|
|
10
|
+
boneMatricesNode: Node;
|
|
11
|
+
|
|
12
|
+
constructor(skinnedMesh: SkinnedMesh);
|
|
13
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Texture } from '../../../../src/Three.js';
|
|
2
|
+
import UniformNode from '../core/UniformNode.js';
|
|
3
|
+
import { Node } from '../Nodes.js';
|
|
4
|
+
|
|
5
|
+
export default class TextureNode extends UniformNode {
|
|
6
|
+
isTextureNode: true;
|
|
7
|
+
|
|
8
|
+
uvNode: Node | null;
|
|
9
|
+
levelNode: Node | null;
|
|
10
|
+
|
|
11
|
+
constructor(value: Texture, uvNode?: Node, levelNode?: Node | null);
|
|
12
|
+
|
|
13
|
+
getDefaultUV(): Node;
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NodeTypeOption, NodeUserData } from '../core/constants.js';
|
|
2
|
+
import ReferenceNode from './ReferenceNode.js';
|
|
3
|
+
|
|
4
|
+
export default class UserDataNode extends ReferenceNode<NodeUserData> {
|
|
5
|
+
userData: NodeUserData | null;
|
|
6
|
+
constructor(property: string, inputType: NodeTypeOption, userData?: NodeUserData | null);
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Node from '../core/Node.js';
|
|
2
|
+
import NodeBuilder from '../core/NodeBuilder.js';
|
|
3
|
+
|
|
4
|
+
export interface CodeNodeInclude {
|
|
5
|
+
build(builder: NodeBuilder): void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default class CodeNode extends Node {
|
|
9
|
+
isCodeNode: true;
|
|
10
|
+
code: string;
|
|
11
|
+
constructor(code?: string, includes?: CodeNodeInclude[]);
|
|
12
|
+
|
|
13
|
+
setIncludes(includes: CodeNodeInclude[]): this;
|
|
14
|
+
getIncludes(builder: NodeBuilder): CodeNodeInclude[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import FunctionNode from './FunctionNode.js';
|
|
2
|
+
import TempNode from '../core/TempNode.js';
|
|
3
|
+
import Node from '../core/Node.js';
|
|
4
|
+
|
|
5
|
+
export default class FunctionCallNode<P extends Node[] | { [name: string]: Node }> extends TempNode {
|
|
6
|
+
functionNode: FunctionNode<P>;
|
|
7
|
+
parameters: { [name: string]: Node };
|
|
8
|
+
|
|
9
|
+
constructor(functionNode?: FunctionNode<P>, parameters?: P);
|
|
10
|
+
|
|
11
|
+
setParameters(parameters: P): this;
|
|
12
|
+
getParameters(): P;
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import CodeNode, { CodeNodeInclude } from './CodeNode.js';
|
|
2
|
+
import FunctionCallNode from './FunctionCallNode.js';
|
|
3
|
+
import NodeBuilder from '../core/NodeBuilder.js';
|
|
4
|
+
import NodeFunction from '../core/NodeFunction.js';
|
|
5
|
+
import NodeFunctionInput from '../core/NodeFunctionInput.js';
|
|
6
|
+
import Node from '../core/Node.js';
|
|
7
|
+
|
|
8
|
+
export type FunctionNodeArguments = Node[] | { [name: string]: Node };
|
|
9
|
+
|
|
10
|
+
export default class FunctionNode<P extends Node[] | { [name: string]: Node }> extends CodeNode {
|
|
11
|
+
keywords: { [key: string]: Node };
|
|
12
|
+
constructor(code?: string, includes?: CodeNodeInclude[]);
|
|
13
|
+
|
|
14
|
+
getInputs(builder: NodeBuilder): NodeFunctionInput[];
|
|
15
|
+
getNodeFunction(builder: NodeBuilder): NodeFunction;
|
|
16
|
+
call(parameters: P): FunctionCallNode<P>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NodeTypeOption } from './constants.js';
|
|
2
|
+
import Node from './Node.js';
|
|
3
|
+
import NodeBuilder from './NodeBuilder.js';
|
|
4
|
+
|
|
5
|
+
export default class AttributeNode extends Node {
|
|
6
|
+
constructor(attributeName: string, nodeType?: NodeTypeOption | null);
|
|
7
|
+
setAttributeName(attributeName: string): this;
|
|
8
|
+
getAttributeName(builder: NodeBuilder): string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NodeTypeOption, NodeValueOption } from './constants.js';
|
|
2
|
+
import InputNode from './InputNode.js';
|
|
3
|
+
import NodeBuilder from './NodeBuilder.js';
|
|
4
|
+
|
|
5
|
+
export default class ConstNode extends InputNode {
|
|
6
|
+
isConstNode: true;
|
|
7
|
+
constructor(value: NodeValueOption, nodeType?: NodeTypeOption | null);
|
|
8
|
+
|
|
9
|
+
generateConst(builder: NodeBuilder): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Node from './Node.js';
|
|
2
|
+
import { NodeBuilderContext } from './NodeBuilder.js';
|
|
3
|
+
|
|
4
|
+
export default class ContextNode extends Node {
|
|
5
|
+
isContextNode: true;
|
|
6
|
+
node: Node;
|
|
7
|
+
context: NodeBuilderContext;
|
|
8
|
+
|
|
9
|
+
constructor(node: Node, context: NodeBuilderContext);
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NodeTypeOption, NodeValueOption } from './constants.js';
|
|
2
|
+
import Node from './Node.js';
|
|
3
|
+
import NodeBuilder from './NodeBuilder.js';
|
|
4
|
+
|
|
5
|
+
export type Precision = 'low' | 'medium' | 'high';
|
|
6
|
+
|
|
7
|
+
export default abstract class InputNode extends Node {
|
|
8
|
+
isInputNode: true;
|
|
9
|
+
value: NodeValueOption;
|
|
10
|
+
precision: Precision | null;
|
|
11
|
+
|
|
12
|
+
constructor(value: NodeValueOption, nodeType?: NodeTypeOption | null);
|
|
13
|
+
|
|
14
|
+
getInputType(builder: NodeBuilder): string | null;
|
|
15
|
+
setPrecision(precision: Precision): this;
|
|
16
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AnyJson, NodeTypeOption, NodeUpdateTypeOption } from './constants.js';
|
|
2
|
+
import NodeBuilder from './NodeBuilder.js';
|
|
3
|
+
import NodeFrame from './NodeFrame.js';
|
|
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
|
+
isGlobal(builder: NodeBuilder): boolean;
|
|
16
|
+
getChildren(): Node[];
|
|
17
|
+
getHash(builder: NodeBuilder): string;
|
|
18
|
+
getUpdateType(builder: NodeBuilder): NodeUpdateTypeOption;
|
|
19
|
+
getNodeType(builder: NodeBuilder, output?: string | null): NodeTypeOption | null;
|
|
20
|
+
getReference(builder: NodeBuilder): Node;
|
|
21
|
+
setup(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
|
+
getCacheKey(): string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BufferGeometry,
|
|
3
|
+
Material,
|
|
4
|
+
Object3D,
|
|
5
|
+
Renderer,
|
|
6
|
+
Scene,
|
|
7
|
+
Texture,
|
|
8
|
+
TextureEncoding,
|
|
9
|
+
WebGLRenderTarget,
|
|
10
|
+
} from '../../../../src/Three.js';
|
|
11
|
+
import FogNode from '../fog/FogNode.js';
|
|
12
|
+
import LightsNode from '../lighting/LightsNode.js';
|
|
13
|
+
import { nodeObject } from '../Nodes.js';
|
|
14
|
+
import { AnyObject, NodeShaderStageOption, NodeTypeOption } from './constants.js';
|
|
15
|
+
import Node from './Node.js';
|
|
16
|
+
import NodeAttribute from './NodeAttribute.js';
|
|
17
|
+
import NodeCache from './NodeCache.js';
|
|
18
|
+
import NodeParser from './NodeParser.js';
|
|
19
|
+
import NodeUniform from './NodeUniform.js';
|
|
20
|
+
import NodeVar from './NodeVar.js';
|
|
21
|
+
import NodeVarying from './NodeVarying.js';
|
|
22
|
+
|
|
23
|
+
export type BuildStageOption = 'construct' | 'analyze' | 'generate';
|
|
24
|
+
|
|
25
|
+
export interface FlowData {
|
|
26
|
+
code: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface NodeData {
|
|
30
|
+
vertex: AnyObject;
|
|
31
|
+
fragment: AnyObject;
|
|
32
|
+
compute: AnyObject;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type NodeBuilderContext = AnyObject;
|
|
36
|
+
|
|
37
|
+
export default abstract class NodeBuilder {
|
|
38
|
+
object: Object3D;
|
|
39
|
+
material: Material;
|
|
40
|
+
geometry: BufferGeometry;
|
|
41
|
+
renderer: Renderer;
|
|
42
|
+
parser: NodeParser;
|
|
43
|
+
|
|
44
|
+
nodes: Node[];
|
|
45
|
+
updateNodes: Node[];
|
|
46
|
+
hashNodes: { [hash: string]: Node };
|
|
47
|
+
|
|
48
|
+
lightsNode: LightsNode;
|
|
49
|
+
fogNode: FogNode;
|
|
50
|
+
|
|
51
|
+
vertexShader: string;
|
|
52
|
+
fragmentShader: string;
|
|
53
|
+
computeShader: string;
|
|
54
|
+
|
|
55
|
+
cache: NodeCache;
|
|
56
|
+
globalCache: NodeCache;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @TODO used to be missing. check the actual type later
|
|
60
|
+
*/
|
|
61
|
+
flowsData: any;
|
|
62
|
+
|
|
63
|
+
shaderStage: NodeShaderStageOption | null;
|
|
64
|
+
buildStage: BuildStageOption | null;
|
|
65
|
+
stack: Node[];
|
|
66
|
+
|
|
67
|
+
setHashNode(node: Node, hash: string): void;
|
|
68
|
+
addNode(node: Node): void;
|
|
69
|
+
get currentNode(): Node;
|
|
70
|
+
getMethod(method: string): string;
|
|
71
|
+
getNodeFromHash(hash: string): Node;
|
|
72
|
+
|
|
73
|
+
addFlow(shaderStage: NodeShaderStageOption, node: Node): Node;
|
|
74
|
+
|
|
75
|
+
setContext(context: NodeBuilderContext): void;
|
|
76
|
+
getContext(): NodeBuilderContext;
|
|
77
|
+
isAvailable(name: string): boolean;
|
|
78
|
+
|
|
79
|
+
abstract getInstanceIndex(): string;
|
|
80
|
+
|
|
81
|
+
abstract getFrontFacing(): string;
|
|
82
|
+
|
|
83
|
+
abstract getFragCoord(): string;
|
|
84
|
+
|
|
85
|
+
isFlipY(): boolean;
|
|
86
|
+
|
|
87
|
+
// @TODO: rename to .generateConst()
|
|
88
|
+
getConst(type: NodeTypeOption, value?: unknown): Node;
|
|
89
|
+
getType(type: NodeTypeOption): NodeTypeOption;
|
|
90
|
+
|
|
91
|
+
generateMethod(method: string): string;
|
|
92
|
+
|
|
93
|
+
getAttribute(name: string, type: NodeTypeOption): NodeAttribute;
|
|
94
|
+
|
|
95
|
+
getPropertyName(node: Node, shaderStage: NodeShaderStageOption): string;
|
|
96
|
+
isVector(type: NodeTypeOption): boolean;
|
|
97
|
+
|
|
98
|
+
isMatrix(type: NodeTypeOption): boolean;
|
|
99
|
+
isReference(type: NodeTypeOption): boolean;
|
|
100
|
+
isShaderStage(shaderStage: NodeShaderStageOption): boolean;
|
|
101
|
+
getTextureEncodingFromMap(map: Texture | WebGLRenderTarget | unknown): TextureEncoding;
|
|
102
|
+
getComponentType(type: NodeTypeOption): NodeTypeOption;
|
|
103
|
+
getVectorType(type: NodeTypeOption): NodeTypeOption;
|
|
104
|
+
getTypeFromLength(length: number): NodeTypeOption;
|
|
105
|
+
getTypeLength(type: NodeTypeOption): number;
|
|
106
|
+
getVectorFromMatrix(type: NodeTypeOption): NodeTypeOption;
|
|
107
|
+
getDataFromNode(node: Node, shaderStage?: NodeShaderStageOption): NodeData;
|
|
108
|
+
getNodeProperties(node: Node, shaderStage?: NodeShaderStageOption): AnyObject;
|
|
109
|
+
getUniformFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): NodeUniform;
|
|
110
|
+
getVarFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): NodeVar;
|
|
111
|
+
getVaryFromNode(node: Node, type: NodeTypeOption): NodeVarying;
|
|
112
|
+
getCodeFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): string;
|
|
113
|
+
addFlowCode(code: string): void;
|
|
114
|
+
getFlowData(node: Node, shaderStage: NodeShaderStageOption): FlowData;
|
|
115
|
+
flowNode(node: Node): FlowData;
|
|
116
|
+
flowChildNode(node: Node, output?: string | null): FlowData;
|
|
117
|
+
flowNodeFromShaderStage(
|
|
118
|
+
shaderStage: NodeShaderStageOption,
|
|
119
|
+
node: Node,
|
|
120
|
+
output?: string | null,
|
|
121
|
+
propertyName?: string,
|
|
122
|
+
): FlowData;
|
|
123
|
+
hasGeometryAttribute(name: string): boolean;
|
|
124
|
+
abstract getAttributes(shaderStage: NodeShaderStageOption): string;
|
|
125
|
+
abstract getVarys(shaderStage: NodeShaderStageOption): string;
|
|
126
|
+
getVars(shaderStage: NodeShaderStageOption): string;
|
|
127
|
+
abstract getUniforms(stage: NodeShaderStageOption): string;
|
|
128
|
+
getCodes(shaderStage: NodeShaderStageOption): string;
|
|
129
|
+
getHash(): string;
|
|
130
|
+
setShaderStage(shaderStage: NodeShaderStageOption): void;
|
|
131
|
+
getShaderStage(): NodeShaderStageOption;
|
|
132
|
+
setBuildStage(buildStage: BuildStageOption): void;
|
|
133
|
+
getBuildStage(): BuildStageOption;
|
|
134
|
+
abstract buildCode(): void;
|
|
135
|
+
build(): this;
|
|
136
|
+
format(snippet: string, fromType: NodeTypeOption, toType: NodeTypeOption): string;
|
|
137
|
+
getSignature(): string;
|
|
138
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Camera, Material, Object3D, Renderer } from '../../../../src/Three.js';
|
|
2
|
+
|
|
3
|
+
import Node from './Node.js';
|
|
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.js';
|
|
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.js';
|
|
2
|
+
import Node from './Node.js';
|
|
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.js';
|
|
2
|
+
import InputNode from './InputNode.js';
|
|
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,13 @@
|
|
|
1
|
+
import { NodeValueOption } from './constants.js';
|
|
2
|
+
import Node from './Node.js';
|
|
3
|
+
|
|
4
|
+
export interface NodeChild {
|
|
5
|
+
property: string;
|
|
6
|
+
index?: number | string;
|
|
7
|
+
childNode: Node;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function getCacheKey(object: Node): string;
|
|
11
|
+
export function getNodeChildren(object: Node): Generator<NodeChild, void>;
|
|
12
|
+
export function getValueType(value: NodeValueOption): string | null;
|
|
13
|
+
export function getValueFromType(type: string, ...params: number[]): NodeValueOption | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NodeTypeOption } from './constants.js';
|
|
2
|
+
import Node from './Node.js';
|
|
3
|
+
import NodeBuilder from './NodeBuilder.js';
|
|
4
|
+
|
|
5
|
+
export default class TempNode extends Node {
|
|
6
|
+
isTempNode: true;
|
|
7
|
+
|
|
8
|
+
constructor(type: NodeTypeOption | null);
|
|
9
|
+
|
|
10
|
+
hasDependencies(builder: NodeBuilder): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NodeTypeOption, NodeValueOption } from './constants.js';
|
|
2
|
+
import InputNode from './InputNode.js';
|
|
3
|
+
import NodeBuilder from './NodeBuilder.js';
|
|
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.js';
|
|
2
|
+
import Node from './Node.js';
|
|
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
|
+
}
|