@types/three 0.158.3 → 0.160.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- three/README.md +1 -1
- three/examples/jsm/Addons.d.ts +2 -1
- three/examples/jsm/cameras/CinematicCamera.d.ts +1 -1
- three/examples/jsm/helpers/TextureHelper.d.ts +10 -0
- three/examples/jsm/lines/LineMaterial.d.ts +2 -2
- three/examples/jsm/loaders/ColladaLoader.d.ts +1 -3
- three/examples/jsm/loaders/GLTFLoader.d.ts +1 -1
- three/examples/jsm/loaders/KTX2Loader.d.ts +2 -8
- three/examples/jsm/loaders/MaterialXLoader.d.ts +6 -0
- three/examples/jsm/loaders/SVGLoader.d.ts +1 -5
- three/examples/jsm/math/Octree.d.ts +7 -3
- three/examples/jsm/misc/ProgressiveLightMap.d.ts +1 -1
- three/examples/jsm/misc/Timer.d.ts +80 -0
- three/examples/jsm/nodes/Nodes.d.ts +238 -60
- three/examples/jsm/nodes/accessors/BitangentNode.d.ts +9 -0
- three/examples/jsm/nodes/accessors/BufferNode.d.ts +4 -1
- three/examples/jsm/nodes/accessors/CameraNode.d.ts +7 -0
- three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +9 -2
- three/examples/jsm/nodes/accessors/InstanceNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/MaterialNode.d.ts +12 -0
- three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +7 -0
- three/examples/jsm/nodes/accessors/ModelNode.d.ts +7 -1
- three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/NormalNode.d.ts +8 -0
- three/examples/jsm/nodes/accessors/PointUVNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/PositionNode.d.ts +8 -0
- three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +4 -1
- three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/SkinningNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +8 -1
- three/examples/jsm/nodes/accessors/TangentNode.d.ts +9 -0
- three/examples/jsm/nodes/accessors/TextureNode.d.ts +10 -2
- three/examples/jsm/nodes/accessors/UVNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/UserDataNode.d.ts +7 -0
- three/examples/jsm/nodes/code/CodeNode.d.ts +4 -0
- three/examples/jsm/nodes/code/ExpressionNode.d.ts +3 -0
- three/examples/jsm/nodes/code/FunctionCallNode.d.ts +7 -1
- three/examples/jsm/nodes/code/FunctionNode.d.ts +17 -0
- three/examples/jsm/nodes/core/ArrayUniformNode.d.ts +1 -1
- three/examples/jsm/nodes/core/AttributeNode.d.ts +3 -0
- three/examples/jsm/nodes/core/BypassNode.d.ts +3 -0
- three/examples/jsm/nodes/core/CacheNode.d.ts +3 -0
- three/examples/jsm/nodes/core/ConstNode.d.ts +3 -3
- three/examples/jsm/nodes/core/ContextNode.d.ts +3 -0
- three/examples/jsm/nodes/core/InputNode.d.ts +4 -4
- three/examples/jsm/nodes/core/NodeBuilder.d.ts +6 -3
- three/examples/jsm/nodes/core/NodeUniform.d.ts +12 -8
- three/examples/jsm/nodes/core/NodeUtils.d.ts +6 -3
- three/examples/jsm/nodes/core/PropertyNode.d.ts +9 -0
- three/examples/jsm/nodes/core/UniformNode.d.ts +12 -4
- three/examples/jsm/nodes/core/VarNode.d.ts +4 -0
- three/examples/jsm/nodes/core/VaryingNode.d.ts +3 -0
- three/examples/jsm/nodes/core/constants.d.ts +10 -8
- three/examples/jsm/nodes/display/BlendModeNode.d.ts +7 -2
- three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +18 -1
- three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +4 -0
- three/examples/jsm/nodes/display/FrontFacingNode.d.ts +4 -0
- three/examples/jsm/nodes/display/NormalMapNode.d.ts +7 -1
- three/examples/jsm/nodes/display/PosterizeNode.d.ts +6 -0
- three/examples/jsm/nodes/display/ToneMappingNode.d.ts +8 -1
- three/examples/jsm/nodes/display/ViewportNode.d.ts +8 -0
- three/examples/jsm/nodes/fog/FogExp2Node.d.ts +3 -0
- three/examples/jsm/nodes/fog/FogNode.d.ts +3 -0
- three/examples/jsm/nodes/fog/FogRangeNode.d.ts +3 -0
- three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +1 -1
- three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +1 -1
- three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +1 -1
- three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +1 -1
- three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +1 -1
- three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +1 -1
- three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +1 -1
- three/examples/jsm/nodes/functions/material/getGeometryRoughness.d.ts +1 -1
- three/examples/jsm/nodes/functions/material/getRoughness.d.ts +1 -1
- three/examples/jsm/nodes/geometry/RangeNode.d.ts +3 -0
- three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +7 -0
- three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +6 -1
- three/examples/jsm/nodes/lighting/LightsNode.d.ts +3 -0
- three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +18 -5
- three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +0 -3
- three/examples/jsm/nodes/materials/NodeMaterial.d.ts +25 -2
- three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +43 -34
- three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +5 -3
- three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +7 -5
- three/examples/jsm/nodes/math/CondNode.d.ts +7 -0
- three/examples/jsm/nodes/math/MathNode.d.ts +134 -1
- three/examples/jsm/nodes/math/OperatorNode.d.ts +51 -0
- three/examples/jsm/nodes/procedural/CheckerNode.d.ts +3 -0
- three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +75 -33
- three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +4 -2
- three/examples/jsm/nodes/utils/MatcapUVNode.d.ts +3 -0
- three/examples/jsm/nodes/utils/MaxMipLevelNode.d.ts +6 -3
- three/examples/jsm/nodes/utils/OscNode.d.ts +6 -0
- three/examples/jsm/nodes/utils/RemapNode.d.ts +4 -0
- three/examples/jsm/nodes/utils/RotateUVNode.d.ts +3 -0
- three/examples/jsm/nodes/utils/SpecularMIPLevelNode.d.ts +5 -1
- three/examples/jsm/nodes/utils/SpriteSheetUVNode.d.ts +7 -0
- three/examples/jsm/nodes/utils/TimerNode.d.ts +7 -1
- three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +22 -7
- three/examples/jsm/objects/QuadMesh.d.ts +13 -0
- three/examples/jsm/postprocessing/GTAOPass.d.ts +118 -0
- three/examples/jsm/renderers/common/Info.d.ts +7 -2
- three/examples/jsm/renderers/common/Renderer.d.ts +2 -2
- three/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.d.ts +3 -0
- three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +1 -0
- three/examples/jsm/shaders/GTAOShader.d.ts +59 -0
- three/examples/jsm/shaders/PoissonDenoiseShader.d.ts +28 -0
- three/examples/jsm/utils/SortUtils.d.ts +7 -0
- three/package.json +3 -3
- three/src/Three.d.ts +2 -0
- three/src/animation/AnimationClip.d.ts +2 -2
- three/src/animation/AnimationMixer.d.ts +1 -1
- three/src/animation/KeyframeTrack.d.ts +3 -3
- three/src/animation/tracks/BooleanKeyframeTrack.d.ts +1 -1
- three/src/animation/tracks/ColorKeyframeTrack.d.ts +1 -1
- three/src/animation/tracks/NumberKeyframeTrack.d.ts +1 -1
- three/src/animation/tracks/QuaternionKeyframeTrack.d.ts +1 -1
- three/src/animation/tracks/StringKeyframeTrack.d.ts +1 -1
- three/src/animation/tracks/VectorKeyframeTrack.d.ts +1 -1
- three/src/audio/Audio.d.ts +1 -1
- three/src/audio/AudioListener.d.ts +1 -1
- three/src/constants.d.ts +3 -1
- three/src/core/BufferAttribute.d.ts +27 -0
- three/src/core/BufferGeometry.d.ts +1 -1
- three/src/core/InterleavedBuffer.d.ts +27 -0
- three/src/core/InterleavedBufferAttribute.d.ts +2 -2
- three/src/core/Object3D.d.ts +48 -14
- three/src/core/Raycaster.d.ts +1 -0
- three/src/core/UniformsGroup.d.ts +3 -3
- three/src/extras/core/Curve.d.ts +2 -2
- three/src/extras/core/Path.d.ts +1 -1
- three/src/extras/core/Shape.d.ts +1 -1
- three/src/extras/core/ShapePath.d.ts +1 -1
- three/src/extras/curves/CatmullRomCurve3.d.ts +2 -2
- three/src/extras/curves/CubicBezierCurve.d.ts +2 -2
- three/src/extras/curves/CubicBezierCurve3.d.ts +2 -2
- three/src/extras/curves/EllipseCurve.d.ts +1 -1
- three/src/extras/curves/LineCurve.d.ts +2 -2
- three/src/extras/curves/LineCurve3.d.ts +2 -2
- three/src/extras/curves/QuadraticBezierCurve.d.ts +2 -2
- three/src/extras/curves/QuadraticBezierCurve3.d.ts +2 -2
- three/src/extras/curves/SplineCurve.d.ts +2 -2
- three/src/geometries/ExtrudeGeometry.d.ts +5 -5
- three/src/geometries/LatheGeometry.d.ts +2 -2
- three/src/geometries/PlaneGeometry.d.ts +1 -1
- three/src/geometries/PolyhedronGeometry.d.ts +1 -1
- three/src/geometries/RingGeometry.d.ts +1 -1
- three/src/geometries/ShapeGeometry.d.ts +2 -2
- three/src/geometries/SphereGeometry.d.ts +1 -1
- three/src/geometries/TorusGeometry.d.ts +1 -1
- three/src/geometries/TorusKnotGeometry.d.ts +1 -1
- three/src/geometries/TubeGeometry.d.ts +3 -3
- three/src/geometries/WireframeGeometry.d.ts +1 -1
- three/src/helpers/ArrowHelper.d.ts +4 -4
- three/src/helpers/AxesHelper.d.ts +1 -1
- three/src/helpers/Box3Helper.d.ts +3 -3
- three/src/helpers/CameraHelper.d.ts +2 -2
- three/src/helpers/DirectionalLightHelper.d.ts +6 -4
- three/src/helpers/GridHelper.d.ts +1 -1
- three/src/helpers/HemisphereLightHelper.d.ts +4 -4
- three/src/helpers/PlaneHelper.d.ts +2 -2
- three/src/helpers/PointLightHelper.d.ts +3 -3
- three/src/helpers/SkeletonHelper.d.ts +4 -4
- three/src/helpers/SpotLightHelper.d.ts +3 -3
- three/src/lights/DirectionalLight.d.ts +1 -1
- three/src/lights/DirectionalLightShadow.d.ts +1 -1
- three/src/lights/HemisphereLight.d.ts +1 -1
- three/src/lights/LightProbe.d.ts +1 -1
- three/src/lights/LightShadow.d.ts +5 -5
- three/src/lights/PointLight.d.ts +7 -0
- three/src/lights/PointLightShadow.d.ts +1 -1
- three/src/lights/SpotLight.d.ts +1 -1
- three/src/lights/SpotLightShadow.d.ts +1 -1
- three/src/loaders/MaterialLoader.d.ts +6 -3
- three/src/materials/LineBasicMaterial.d.ts +7 -0
- three/src/materials/LineDashedMaterial.d.ts +7 -1
- three/src/materials/Material.d.ts +16 -16
- three/src/materials/MeshBasicMaterial.d.ts +9 -2
- three/src/materials/MeshDepthMaterial.d.ts +7 -1
- three/src/materials/MeshDistanceMaterial.d.ts +9 -2
- three/src/materials/MeshLambertMaterial.d.ts +9 -2
- three/src/materials/MeshMatcapMaterial.d.ts +10 -3
- three/src/materials/MeshNormalMaterial.d.ts +9 -2
- three/src/materials/MeshPhongMaterial.d.ts +10 -3
- three/src/materials/MeshPhysicalMaterial.d.ts +6 -1
- three/src/materials/MeshStandardMaterial.d.ts +10 -5
- three/src/materials/MeshToonMaterial.d.ts +10 -3
- three/src/materials/PointsMaterial.d.ts +9 -2
- three/src/materials/RawShaderMaterial.d.ts +9 -0
- three/src/materials/ShaderMaterial.d.ts +9 -3
- three/src/materials/ShadowMaterial.d.ts +8 -1
- three/src/materials/SpriteMaterial.d.ts +9 -4
- three/src/math/Box3.d.ts +2 -2
- three/src/math/Frustum.d.ts +2 -2
- three/src/math/Matrix4.d.ts +30 -30
- three/src/math/Sphere.d.ts +5 -0
- three/src/math/Triangle.d.ts +8 -8
- three/src/math/Vector2.d.ts +1 -1
- three/src/math/Vector4.d.ts +1 -1
- three/src/objects/BatchedMesh.d.ts +169 -0
- three/src/objects/Bone.d.ts +1 -1
- three/src/objects/LOD.d.ts +2 -4
- three/src/objects/Line.d.ts +2 -4
- three/src/objects/LineLoop.d.ts +1 -1
- three/src/objects/LineSegments.d.ts +1 -1
- three/src/objects/Skeleton.d.ts +2 -8
- three/src/objects/SkinnedMesh.d.ts +1 -2
- three/src/renderers/WebGL3DRenderTarget.d.ts +7 -5
- three/src/renderers/WebGLArrayRenderTarget.d.ts +7 -5
- three/src/renderers/WebGLCubeRenderTarget.d.ts +2 -2
- three/src/renderers/WebGLRenderTarget.d.ts +1 -1
- three/src/renderers/shaders/ShaderChunk.d.ts +1 -0
- three/src/renderers/shaders/ShaderLib.d.ts +18 -18
- three/src/renderers/shaders/UniformsUtils.d.ts +3 -2
- three/src/renderers/webgl/WebGLAttributes.d.ts +1 -0
- three/src/renderers/webgl/WebGLBindingStates.d.ts +4 -4
- three/src/renderers/webgl/WebGLBufferRenderer.d.ts +4 -3
- three/src/renderers/webgl/WebGLClipping.d.ts +2 -2
- three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +5 -4
- three/src/renderers/webgl/WebGLLights.d.ts +39 -37
- three/src/renderers/webgl/WebGLPrograms.d.ts +225 -10
- three/src/renderers/webgl/WebGLRenderLists.d.ts +5 -5
- three/src/renderers/webgl/WebGLShadowMap.d.ts +2 -2
- three/src/scenes/Fog.d.ts +1 -1
- three/src/scenes/FogExp2.d.ts +1 -1
- three/src/textures/CompressedCubeTexture.d.ts +13 -0
- three/src/textures/Texture.d.ts +1 -1
- three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +0 -310
- three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +0 -166
- three/examples/jsm/objects/BatchedMesh.d.ts +0 -57
- three/examples/jsm/renderers/common/Animation.d.ts +0 -16
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import TextureNode from './TextureNode.js';
|
|
2
|
-
import { Node } from '../Nodes.js';
|
|
3
1
|
import { CubeTexture } from '../../../../src/Three.js';
|
|
2
|
+
import TextureNode from './TextureNode.js';
|
|
3
|
+
import Node from '../core/Node.js';
|
|
4
|
+
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
4
5
|
|
|
5
6
|
export default class CubeTextureNode extends TextureNode {
|
|
6
7
|
isCubeTextureNode: boolean;
|
|
@@ -11,3 +12,9 @@ export default class CubeTextureNode extends TextureNode {
|
|
|
11
12
|
|
|
12
13
|
getDefaultUV(): Node;
|
|
13
14
|
}
|
|
15
|
+
|
|
16
|
+
export const cubeTexture: (
|
|
17
|
+
value: CubeTexture,
|
|
18
|
+
uvNode?: NodeRepresentation,
|
|
19
|
+
levelNode?: NodeRepresentation,
|
|
20
|
+
) => ShaderNodeObject<CubeTextureNode>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InstancedMesh } from '../../../../src/Three.js';
|
|
2
2
|
import Node from '../core/Node.js';
|
|
3
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
4
|
|
|
4
5
|
export default class InstanceNode extends Node {
|
|
5
6
|
instanceMesh: InstancedMesh;
|
|
@@ -7,3 +8,5 @@ export default class InstanceNode extends Node {
|
|
|
7
8
|
|
|
8
9
|
constructor(instanceMesh: InstancedMesh);
|
|
9
10
|
}
|
|
11
|
+
|
|
12
|
+
export const instance: (instanceMesh: InstancedMesh) => ShaderNodeObject<InstanceNode>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Node from '../core/Node.js';
|
|
2
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
2
3
|
|
|
3
4
|
export type MaterialNodeScope =
|
|
4
5
|
| typeof MaterialNode.ALPHA_TEST
|
|
@@ -21,3 +22,14 @@ export default class MaterialNode extends Node {
|
|
|
21
22
|
scope: MaterialNodeScope;
|
|
22
23
|
constructor(scope?: MaterialNodeScope);
|
|
23
24
|
}
|
|
25
|
+
|
|
26
|
+
export const materialAlphaTest: ShaderNodeObject<MaterialNode>;
|
|
27
|
+
export const materialColor: ShaderNodeObject<MaterialNode>;
|
|
28
|
+
export const materialShininess: ShaderNodeObject<MaterialNode>;
|
|
29
|
+
export const materialEmissive: ShaderNodeObject<MaterialNode>;
|
|
30
|
+
export const materialOpacity: ShaderNodeObject<MaterialNode>;
|
|
31
|
+
export const materialSpecularColor: ShaderNodeObject<MaterialNode>;
|
|
32
|
+
export const materialReflectivity: ShaderNodeObject<MaterialNode>;
|
|
33
|
+
export const materialRoughness: ShaderNodeObject<MaterialNode>;
|
|
34
|
+
export const materialMetalness: ShaderNodeObject<MaterialNode>;
|
|
35
|
+
export const materialRotation: ShaderNodeObject<MaterialNode>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { Material } from '../../../../src/Three.js';
|
|
2
2
|
import ReferenceNode from './ReferenceNode.js';
|
|
3
|
+
import { NodeOrType, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
4
|
|
|
4
5
|
export default class MaterialReferenceNode extends ReferenceNode<Material | null> {
|
|
5
6
|
constructor(property: string, inputType: string, material?: Material | null);
|
|
6
7
|
}
|
|
8
|
+
|
|
9
|
+
export const materialReference: (
|
|
10
|
+
name: string,
|
|
11
|
+
nodeOrType: NodeOrType,
|
|
12
|
+
material: Material,
|
|
13
|
+
) => ShaderNodeObject<MaterialReferenceNode>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NodeFrame } from '../Nodes.js';
|
|
2
1
|
import Object3DNode, { Object3DNodeScope } from './Object3DNode.js';
|
|
2
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Similar to {@link Object3DNode} but the object comes from {@link NodeFrame}
|
|
@@ -7,3 +7,9 @@ import Object3DNode, { Object3DNodeScope } from './Object3DNode.js';
|
|
|
7
7
|
export default class ModelNode extends Object3DNode {
|
|
8
8
|
constructor(scope?: Object3DNodeScope);
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
export const modelViewMatrix: ShaderNodeObject<ModelNode>;
|
|
12
|
+
export const modelNormalMatrix: ShaderNodeObject<ModelNode>;
|
|
13
|
+
export const modelWorldMatrix: ShaderNodeObject<ModelNode>;
|
|
14
|
+
export const modelPosition: ShaderNodeObject<ModelNode>;
|
|
15
|
+
export const modelViewPosition: ShaderNodeObject<ModelNode>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import Node from '../core/Node.js';
|
|
2
2
|
import PositionNode from './PositionNode.js';
|
|
3
|
+
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
4
|
|
|
4
5
|
export default class ModelViewProjectionNode extends Node {
|
|
5
6
|
constructor(positionNode?: PositionNode);
|
|
6
7
|
}
|
|
8
|
+
|
|
9
|
+
export const modelViewProjection: (position?: NodeRepresentation) => ShaderNodeObject<ModelViewProjectionNode>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import Node from '../core/Node.js';
|
|
2
|
+
import VarNode from '../core/VarNode.js';
|
|
3
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
2
4
|
|
|
3
5
|
export type NormalNodeScope = typeof NormalNode.GEOMETRY | typeof NormalNode.LOCAL | typeof NormalNode.VIEW;
|
|
4
6
|
|
|
@@ -10,3 +12,9 @@ export default class NormalNode extends Node {
|
|
|
10
12
|
|
|
11
13
|
constructor(scope?: NormalNodeScope);
|
|
12
14
|
}
|
|
15
|
+
|
|
16
|
+
export const normalGeometry: ShaderNodeObject<NormalNode>;
|
|
17
|
+
export const normalLocal: ShaderNodeObject<NormalNode>;
|
|
18
|
+
export const normalView: ShaderNodeObject<NormalNode>;
|
|
19
|
+
export const normalWorld: ShaderNodeObject<NormalNode>;
|
|
20
|
+
export const transformedNormalView: ShaderNodeObject<VarNode>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Node from '../core/Node.js';
|
|
2
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
2
3
|
|
|
3
4
|
export type PositionNodeScope =
|
|
4
5
|
| typeof PositionNode.GEOMETRY
|
|
@@ -19,3 +20,10 @@ export default class PositionNode extends Node {
|
|
|
19
20
|
|
|
20
21
|
constructor(scope?: PositionNodeScope);
|
|
21
22
|
}
|
|
23
|
+
|
|
24
|
+
export const positionGeometry: ShaderNodeObject<PositionNode>;
|
|
25
|
+
export const positionLocal: ShaderNodeObject<PositionNode>;
|
|
26
|
+
export const positionWorld: ShaderNodeObject<PositionNode>;
|
|
27
|
+
export const positionWorldDirection: ShaderNodeObject<PositionNode>;
|
|
28
|
+
export const positionView: ShaderNodeObject<PositionNode>;
|
|
29
|
+
export const positionViewDirection: ShaderNodeObject<PositionNode>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Node from '../core/Node.js';
|
|
2
|
-
import { NodeTypeOption } from '../
|
|
2
|
+
import { NodeTypeOption } from '../core/constants.js';
|
|
3
|
+
import { NodeOrType, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
4
|
|
|
4
5
|
export default class ReferenceNode<T> extends Node {
|
|
5
6
|
object: T;
|
|
@@ -11,3 +12,5 @@ export default class ReferenceNode<T> extends Node {
|
|
|
11
12
|
|
|
12
13
|
setNodeType(uniformType: NodeTypeOption): void;
|
|
13
14
|
}
|
|
15
|
+
|
|
16
|
+
export const reference: <T>(name: string, nodeOrType: NodeOrType, object: T) => ShaderNodeObject<ReferenceNode<T>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Node from '../core/Node.js';
|
|
2
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
2
3
|
|
|
3
4
|
export default class ReflectVectorNode extends Node {
|
|
4
5
|
constructor();
|
|
@@ -6,3 +7,5 @@ export default class ReflectVectorNode extends Node {
|
|
|
6
7
|
getHash(): 'reflectVector';
|
|
7
8
|
setup(): Node;
|
|
8
9
|
}
|
|
10
|
+
|
|
11
|
+
export const reflectVector: ShaderNodeObject<ReflectVectorNode>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SkinnedMesh } from '../../../../src/Three.js';
|
|
2
2
|
import Node from '../core/Node.js';
|
|
3
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
4
|
|
|
4
5
|
export default class SkinningNode extends Node {
|
|
5
6
|
skinIndexNode: Node;
|
|
@@ -11,3 +12,5 @@ export default class SkinningNode extends Node {
|
|
|
11
12
|
|
|
12
13
|
constructor(skinnedMesh: SkinnedMesh);
|
|
13
14
|
}
|
|
15
|
+
|
|
16
|
+
export function skinning(skinnedMesh: SkinnedMesh): ShaderNodeObject<SkinningNode>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import { NodeTypeOption } from '../Nodes.js';
|
|
2
1
|
import BufferNode from './BufferNode.js';
|
|
2
|
+
import { NodeTypeOption } from '../core/constants.js';
|
|
3
|
+
import { NodeOrType, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
4
|
|
|
4
5
|
export default class StorageBufferNode extends BufferNode {
|
|
5
6
|
constructor(value: ArrayLike<number>, bufferType: NodeTypeOption, bufferCount?: number);
|
|
6
7
|
}
|
|
8
|
+
|
|
9
|
+
export const storage: (
|
|
10
|
+
value: ArrayLike<number>,
|
|
11
|
+
nodeOrType: NodeOrType,
|
|
12
|
+
count: number,
|
|
13
|
+
) => ShaderNodeObject<StorageBufferNode>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import Node from '../core/Node.js';
|
|
2
|
+
import MathNode from '../math/MathNode.js';
|
|
3
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
2
4
|
|
|
3
5
|
export type TangentNodeScope =
|
|
4
6
|
| typeof TangentNode.LOCAL
|
|
@@ -16,3 +18,10 @@ export default class TangentNode extends Node {
|
|
|
16
18
|
|
|
17
19
|
constructor(scope?: TangentNodeScope);
|
|
18
20
|
}
|
|
21
|
+
|
|
22
|
+
export const tangentGeometry: ShaderNodeObject<TangentNode>;
|
|
23
|
+
export const tangentLocal: ShaderNodeObject<TangentNode>;
|
|
24
|
+
export const tangentView: ShaderNodeObject<TangentNode>;
|
|
25
|
+
export const tangentWorld: ShaderNodeObject<TangentNode>;
|
|
26
|
+
export const transformedTangentView: ShaderNodeObject<MathNode>;
|
|
27
|
+
export const transformedTangentWorld: ShaderNodeObject<MathNode>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Texture } from '../../../../src/Three.js';
|
|
2
2
|
import UniformNode from '../core/UniformNode.js';
|
|
3
|
-
import
|
|
3
|
+
import Node from '../core/Node.js';
|
|
4
|
+
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
4
5
|
|
|
5
|
-
export default class TextureNode extends UniformNode {
|
|
6
|
+
export default class TextureNode extends UniformNode<Texture> {
|
|
6
7
|
isTextureNode: true;
|
|
7
8
|
|
|
8
9
|
uvNode: Node | null;
|
|
@@ -12,3 +13,10 @@ export default class TextureNode extends UniformNode {
|
|
|
12
13
|
|
|
13
14
|
getDefaultUV(): Node;
|
|
14
15
|
}
|
|
16
|
+
|
|
17
|
+
export const texture: (
|
|
18
|
+
value: Texture,
|
|
19
|
+
uvNode?: NodeRepresentation,
|
|
20
|
+
levelNode?: NodeRepresentation,
|
|
21
|
+
) => ShaderNodeObject<TextureNode>;
|
|
22
|
+
export const sampler: (aTexture: Texture | TextureNode) => ShaderNodeObject<Node>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import AttributeNode from '../core/AttributeNode.js';
|
|
2
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
2
3
|
|
|
3
4
|
export default class UVNode extends AttributeNode {
|
|
4
5
|
isUVNode: true;
|
|
@@ -6,3 +7,5 @@ export default class UVNode extends AttributeNode {
|
|
|
6
7
|
|
|
7
8
|
constructor(index?: number);
|
|
8
9
|
}
|
|
10
|
+
|
|
11
|
+
export const uv: (index?: number) => ShaderNodeObject<UVNode>;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { NodeTypeOption, NodeUserData } from '../core/constants.js';
|
|
2
2
|
import ReferenceNode from './ReferenceNode.js';
|
|
3
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
4
|
|
|
4
5
|
export default class UserDataNode extends ReferenceNode<NodeUserData> {
|
|
5
6
|
userData: NodeUserData | null;
|
|
6
7
|
constructor(property: string, inputType: NodeTypeOption, userData?: NodeUserData | null);
|
|
7
8
|
}
|
|
9
|
+
|
|
10
|
+
export const userData: (
|
|
11
|
+
name: string,
|
|
12
|
+
inputType: NodeTypeOption,
|
|
13
|
+
userData?: NodeUserData,
|
|
14
|
+
) => ShaderNodeObject<UserDataNode>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import Node from '../core/Node.js';
|
|
2
2
|
import NodeBuilder from '../core/NodeBuilder.js';
|
|
3
|
+
import { NodeTypeOption } from '../core/constants.js';
|
|
4
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
5
|
|
|
4
6
|
export interface CodeNodeInclude {
|
|
5
7
|
build(builder: NodeBuilder): void;
|
|
@@ -13,3 +15,5 @@ export default class CodeNode extends Node {
|
|
|
13
15
|
setIncludes(includes: CodeNodeInclude[]): this;
|
|
14
16
|
getIncludes(builder: NodeBuilder): CodeNodeInclude[];
|
|
15
17
|
}
|
|
18
|
+
|
|
19
|
+
export const code: (code: string, nodeType?: NodeTypeOption) => ShaderNodeObject<CodeNode>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { NodeTypeOption } from '../core/constants.js';
|
|
2
2
|
import TempNode from '../core/TempNode.js';
|
|
3
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
4
|
|
|
4
5
|
export default class ExpressionNode extends TempNode {
|
|
5
6
|
snipped: string; /* sic */
|
|
6
7
|
constructor(snipped?: string, nodeType?: NodeTypeOption);
|
|
7
8
|
}
|
|
9
|
+
|
|
10
|
+
export const expression: (snipped?: string, nodeType?: NodeTypeOption) => ShaderNodeObject<ExpressionNode>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import FunctionNode from './FunctionNode.js';
|
|
1
|
+
import FunctionNode, { FunctionNodeArguments } from './FunctionNode.js';
|
|
2
2
|
import TempNode from '../core/TempNode.js';
|
|
3
3
|
import Node from '../core/Node.js';
|
|
4
|
+
import { ProxiedObject, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
4
5
|
|
|
5
6
|
export default class FunctionCallNode<P extends Node[] | { [name: string]: Node }> extends TempNode {
|
|
6
7
|
functionNode: FunctionNode<P>;
|
|
@@ -11,3 +12,8 @@ export default class FunctionCallNode<P extends Node[] | { [name: string]: Node
|
|
|
11
12
|
setParameters(parameters: P): this;
|
|
12
13
|
getParameters(): P;
|
|
13
14
|
}
|
|
15
|
+
|
|
16
|
+
export const call: <P extends FunctionNodeArguments>(
|
|
17
|
+
functionNode?: FunctionNode<P>,
|
|
18
|
+
parameters?: ProxiedObject<P>,
|
|
19
|
+
) => ShaderNodeObject<FunctionCallNode<P>>;
|
|
@@ -4,6 +4,7 @@ import NodeBuilder from '../core/NodeBuilder.js';
|
|
|
4
4
|
import NodeFunction from '../core/NodeFunction.js';
|
|
5
5
|
import NodeFunctionInput from '../core/NodeFunctionInput.js';
|
|
6
6
|
import Node from '../core/Node.js';
|
|
7
|
+
import { ProxiedObject, ProxiedTuple, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
7
8
|
|
|
8
9
|
export type FunctionNodeArguments = Node[] | { [name: string]: Node };
|
|
9
10
|
|
|
@@ -15,3 +16,19 @@ export default class FunctionNode<P extends Node[] | { [name: string]: Node }> e
|
|
|
15
16
|
getNodeFunction(builder: NodeBuilder): NodeFunction;
|
|
16
17
|
call(parameters: P): FunctionCallNode<P>;
|
|
17
18
|
}
|
|
19
|
+
|
|
20
|
+
export type Fn<P extends FunctionNodeArguments> = P extends readonly [...unknown[]]
|
|
21
|
+
? ProxiedTuple<P>
|
|
22
|
+
: readonly [ProxiedObject<P>];
|
|
23
|
+
|
|
24
|
+
export const func: <P extends FunctionNodeArguments>(
|
|
25
|
+
code: string,
|
|
26
|
+
includes?: CodeNodeInclude[],
|
|
27
|
+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
28
|
+
) => { call: (...params: Fn<P>) => ShaderNodeObject<Node> };
|
|
29
|
+
|
|
30
|
+
export const fn: <P extends FunctionNodeArguments>(
|
|
31
|
+
code: string,
|
|
32
|
+
includes?: CodeNodeInclude[],
|
|
33
|
+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
34
|
+
) => (...params: Fn<P>) => ShaderNodeObject<Node>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import UniformNode from './UniformNode.js';
|
|
2
2
|
import Node from './Node.js';
|
|
3
3
|
|
|
4
|
-
export default class ArrayUniformNode extends UniformNode {
|
|
4
|
+
export default class ArrayUniformNode extends UniformNode<undefined> {
|
|
5
5
|
isArrayUniformNode: true;
|
|
6
6
|
nodes: Node[];
|
|
7
7
|
constructor(nodes?: Node[]);
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { NodeTypeOption } from './constants.js';
|
|
2
2
|
import Node from './Node.js';
|
|
3
3
|
import NodeBuilder from './NodeBuilder.js';
|
|
4
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
4
5
|
|
|
5
6
|
export default class AttributeNode extends Node {
|
|
6
7
|
constructor(attributeName: string, nodeType?: NodeTypeOption | null);
|
|
7
8
|
setAttributeName(attributeName: string): this;
|
|
8
9
|
getAttributeName(builder: NodeBuilder): string;
|
|
9
10
|
}
|
|
11
|
+
|
|
12
|
+
export const attribute: (name: string, nodeType: NodeTypeOption) => ShaderNodeObject<Node>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Node from './Node.js';
|
|
2
|
+
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
2
3
|
|
|
3
4
|
export default class BypassNode extends Node {
|
|
4
5
|
isBypassNode: true;
|
|
@@ -7,3 +8,5 @@ export default class BypassNode extends Node {
|
|
|
7
8
|
|
|
8
9
|
constructor(returnNode: Node, callNode: Node);
|
|
9
10
|
}
|
|
11
|
+
|
|
12
|
+
export const bypass: (returnNode: NodeRepresentation, callNode: NodeRepresentation) => ShaderNodeObject<BypassNode>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Node from './Node.js';
|
|
2
2
|
import NodeCache from './NodeCache.js';
|
|
3
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
4
|
|
|
4
5
|
export default class CacheNode extends Node {
|
|
5
6
|
isCacheNode: true;
|
|
@@ -8,3 +9,5 @@ export default class CacheNode extends Node {
|
|
|
8
9
|
|
|
9
10
|
constructor(node: Node, cache?: NodeCache);
|
|
10
11
|
}
|
|
12
|
+
|
|
13
|
+
export const cache: (node: Node, cache?: NodeCache) => ShaderNodeObject<CacheNode>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { NodeTypeOption
|
|
1
|
+
import { NodeTypeOption } from './constants.js';
|
|
2
2
|
import InputNode from './InputNode.js';
|
|
3
3
|
import NodeBuilder from './NodeBuilder.js';
|
|
4
4
|
|
|
5
|
-
export default class ConstNode extends InputNode {
|
|
5
|
+
export default class ConstNode<Value> extends InputNode<Value> {
|
|
6
6
|
isConstNode: true;
|
|
7
|
-
constructor(value:
|
|
7
|
+
constructor(value: Value, nodeType?: NodeTypeOption | null);
|
|
8
8
|
|
|
9
9
|
generateConst(builder: NodeBuilder): string;
|
|
10
10
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Node from './Node.js';
|
|
2
2
|
import { NodeBuilderContext } from './NodeBuilder.js';
|
|
3
|
+
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
4
|
|
|
4
5
|
export default class ContextNode extends Node {
|
|
5
6
|
isContextNode: true;
|
|
@@ -8,3 +9,5 @@ export default class ContextNode extends Node {
|
|
|
8
9
|
|
|
9
10
|
constructor(node: Node, context: NodeBuilderContext);
|
|
10
11
|
}
|
|
12
|
+
|
|
13
|
+
export const context: (node: NodeRepresentation, context: NodeBuilderContext) => ShaderNodeObject<ContextNode>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { NodeTypeOption
|
|
1
|
+
import { NodeTypeOption } from './constants.js';
|
|
2
2
|
import Node from './Node.js';
|
|
3
3
|
import NodeBuilder from './NodeBuilder.js';
|
|
4
4
|
|
|
5
5
|
export type Precision = 'low' | 'medium' | 'high';
|
|
6
6
|
|
|
7
|
-
export default abstract class InputNode extends Node {
|
|
7
|
+
export default abstract class InputNode<Value> extends Node {
|
|
8
8
|
isInputNode: true;
|
|
9
|
-
value:
|
|
9
|
+
value: Value;
|
|
10
10
|
precision: Precision | null;
|
|
11
11
|
|
|
12
|
-
constructor(value:
|
|
12
|
+
constructor(value: Value, nodeType?: NodeTypeOption | null);
|
|
13
13
|
|
|
14
14
|
getInputType(builder: NodeBuilder): string | null;
|
|
15
15
|
setPrecision(precision: Precision): this;
|
|
@@ -3,14 +3,12 @@ import {
|
|
|
3
3
|
Material,
|
|
4
4
|
Object3D,
|
|
5
5
|
Renderer,
|
|
6
|
-
Scene,
|
|
7
6
|
Texture,
|
|
8
7
|
TextureEncoding,
|
|
9
8
|
WebGLRenderTarget,
|
|
10
9
|
} from '../../../../src/Three.js';
|
|
11
10
|
import FogNode from '../fog/FogNode.js';
|
|
12
11
|
import LightsNode from '../lighting/LightsNode.js';
|
|
13
|
-
import { nodeObject } from '../Nodes.js';
|
|
14
12
|
import { AnyObject, NodeShaderStageOption, NodeTypeOption } from './constants.js';
|
|
15
13
|
import Node from './Node.js';
|
|
16
14
|
import NodeAttribute from './NodeAttribute.js';
|
|
@@ -106,7 +104,12 @@ export default abstract class NodeBuilder {
|
|
|
106
104
|
getVectorFromMatrix(type: NodeTypeOption): NodeTypeOption;
|
|
107
105
|
getDataFromNode(node: Node, shaderStage?: NodeShaderStageOption): NodeData;
|
|
108
106
|
getNodeProperties(node: Node, shaderStage?: NodeShaderStageOption): AnyObject;
|
|
109
|
-
getUniformFromNode(
|
|
107
|
+
getUniformFromNode(
|
|
108
|
+
node: Node,
|
|
109
|
+
type: NodeTypeOption,
|
|
110
|
+
shaderStage?: NodeShaderStageOption,
|
|
111
|
+
name?: string | null,
|
|
112
|
+
): NodeUniform<string>;
|
|
110
113
|
getVarFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): NodeVar;
|
|
111
114
|
getVaryFromNode(node: Node, type: NodeTypeOption): NodeVarying;
|
|
112
115
|
getCodeFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): string;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import UniformNode from './UniformNode.js';
|
|
2
|
+
|
|
3
|
+
export default class NodeUniform<Value> {
|
|
4
|
+
readonly isNodeUniform: true;
|
|
3
5
|
|
|
4
|
-
export default class NodeUniform {
|
|
5
|
-
isNodeUniform: true;
|
|
6
6
|
name: string;
|
|
7
7
|
type: string;
|
|
8
|
-
node:
|
|
9
|
-
needsUpdate: boolean;
|
|
10
|
-
|
|
8
|
+
node: UniformNode<Value>;
|
|
9
|
+
needsUpdate: boolean | undefined;
|
|
10
|
+
|
|
11
|
+
constructor(name: string, type: string, node: UniformNode<Value>, needsUpdate?: boolean);
|
|
12
|
+
|
|
13
|
+
get(): Value;
|
|
14
|
+
set value(val: Value);
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
get id(): number;
|
|
13
17
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Color, Vector2, Vector3, Vector4, Matrix3, Matrix4 } from '../../../../src/Three.js';
|
|
2
2
|
import Node from './Node.js';
|
|
3
3
|
|
|
4
4
|
export interface NodeChild {
|
|
@@ -9,5 +9,8 @@ export interface NodeChild {
|
|
|
9
9
|
|
|
10
10
|
export function getCacheKey(object: Node): string;
|
|
11
11
|
export function getNodeChildren(object: Node): Generator<NodeChild, void>;
|
|
12
|
-
export function getValueType(value:
|
|
13
|
-
export function getValueFromType(
|
|
12
|
+
export function getValueType(value: unknown): string | null;
|
|
13
|
+
export function getValueFromType(
|
|
14
|
+
type: string,
|
|
15
|
+
...params: number[]
|
|
16
|
+
): Color | Vector2 | Vector3 | Vector4 | Matrix3 | Matrix4 | boolean | number | string | ArrayBufferLike | null;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { NodeTypeOption } from './constants.js';
|
|
2
2
|
import Node from './Node.js';
|
|
3
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
4
|
|
|
4
5
|
export default class PropertyNode extends Node {
|
|
5
6
|
constructor(name?: string, nodeType?: NodeTypeOption);
|
|
6
7
|
}
|
|
8
|
+
|
|
9
|
+
export const property: (name: string, nodeOrType: Node | NodeTypeOption) => ShaderNodeObject<Node>;
|
|
10
|
+
|
|
11
|
+
export const diffuseColor: ShaderNodeObject<PropertyNode>;
|
|
12
|
+
export const roughness: ShaderNodeObject<PropertyNode>;
|
|
13
|
+
export const metalness: ShaderNodeObject<PropertyNode>;
|
|
14
|
+
export const specularColor: ShaderNodeObject<PropertyNode>;
|
|
15
|
+
export const shininess: ShaderNodeObject<PropertyNode>;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import { NodeTypeOption
|
|
1
|
+
import { NodeTypeOption } from './constants.js';
|
|
2
2
|
import InputNode from './InputNode.js';
|
|
3
3
|
import NodeBuilder from './NodeBuilder.js';
|
|
4
|
+
import Node from './Node.js';
|
|
5
|
+
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
4
6
|
|
|
5
|
-
export default class UniformNode extends InputNode {
|
|
6
|
-
isUniformNode: true;
|
|
7
|
+
export default class UniformNode<Value> extends InputNode<Value> {
|
|
8
|
+
readonly isUniformNode: true;
|
|
9
|
+
|
|
10
|
+
constructor(value: Value, nodeType?: NodeTypeOption | null);
|
|
7
11
|
|
|
8
|
-
constructor(value: NodeValueOption, nodeType?: NodeTypeOption | null);
|
|
9
12
|
getUniformHash(builder: NodeBuilder): string;
|
|
10
13
|
}
|
|
14
|
+
|
|
15
|
+
export const uniform: <Value>(
|
|
16
|
+
arg1: InputNode<Value> | Value,
|
|
17
|
+
arg2?: Node | string,
|
|
18
|
+
) => ShaderNodeObject<UniformNode<Value>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OperatorNodeOp } from '../math/OperatorNode.js';
|
|
2
2
|
import Node from './Node.js';
|
|
3
|
+
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
4
|
|
|
4
5
|
export default class VarNode extends Node {
|
|
5
6
|
node: Node;
|
|
@@ -14,3 +15,6 @@ export default class VarNode extends Node {
|
|
|
14
15
|
mul(...params: Node[]): this;
|
|
15
16
|
div(...params: Node[]): this;
|
|
16
17
|
}
|
|
18
|
+
|
|
19
|
+
export const label: (node: NodeRepresentation, name?: string) => ShaderNodeObject<VarNode>;
|
|
20
|
+
export const temp: (node: NodeRepresentation, name?: string) => ShaderNodeObject<VarNode>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Node from './Node.js';
|
|
2
|
+
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
2
3
|
|
|
3
4
|
export default class VaryingNode extends Node {
|
|
4
5
|
node: Node;
|
|
@@ -6,3 +7,5 @@ export default class VaryingNode extends Node {
|
|
|
6
7
|
|
|
7
8
|
constructor(node: Node, name?: string | null);
|
|
8
9
|
}
|
|
10
|
+
|
|
11
|
+
export const varying: (node: NodeRepresentation, name?: string) => ShaderNodeObject<VaryingNode>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Color, Matrix3, Matrix4, Vector2, Vector3, Vector4 } from '../../../../src/Three.js';
|
|
2
|
-
|
|
3
1
|
// disable automatic export, we have some private declarations
|
|
4
2
|
export const NodeShaderStage: {
|
|
5
3
|
VERTEX: 'vertex';
|
|
@@ -13,7 +11,6 @@ export const NodeUpdateType: {
|
|
|
13
11
|
OBJECT: 'object';
|
|
14
12
|
};
|
|
15
13
|
|
|
16
|
-
export type NodeValueOption = Color | Vector2 | Vector3 | Vector4 | Matrix3 | Matrix4 | boolean | number;
|
|
17
14
|
export type NodeUpdateTypeOption = 'none' | 'frame' | 'object';
|
|
18
15
|
export type NodeShaderStageOption = 'vertex' | 'fragment' | 'compute';
|
|
19
16
|
export type NodeTypeOption =
|
|
@@ -50,13 +47,18 @@ export type NodeTypeOption =
|
|
|
50
47
|
| 'umat4'
|
|
51
48
|
| 'bmat4';
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
export type SwizzleCharacter = 'x' | 'y' | 'z' | 'w' | 'r' | 'g' | 'b' | 'a' | 's' | 't' | 'p' | 'q';
|
|
51
|
+
|
|
52
|
+
export type SwizzleOption = Exclude<
|
|
53
|
+
| `${SwizzleCharacter}`
|
|
54
|
+
| `${SwizzleCharacter}${SwizzleCharacter}`
|
|
55
|
+
| `${SwizzleCharacter}${SwizzleCharacter}${SwizzleCharacter}`
|
|
56
|
+
| `${SwizzleCharacter}${SwizzleCharacter}${SwizzleCharacter}${SwizzleCharacter}`,
|
|
57
|
+
'abs' | 'sqrt'
|
|
58
|
+
>;
|
|
55
59
|
|
|
56
60
|
/** Should be the same type as Object3D.userData */
|
|
57
|
-
export
|
|
58
|
-
[key: string]: any;
|
|
59
|
-
}
|
|
61
|
+
export type NodeUserData = Record<string, any>;
|
|
60
62
|
|
|
61
63
|
/** generic key value type,curretly used by nodes */
|
|
62
64
|
export interface AnyObject {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TempNode from '../core/TempNode.js';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import Node from '../core/Node.js';
|
|
3
|
+
import { NodeRepresentation, ShaderNode, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
4
4
|
|
|
5
5
|
export const BurnNode: ShaderNode<{ base: Node; blendNode: Node }>;
|
|
6
6
|
|
|
@@ -30,3 +30,8 @@ export default class BlendModeNode extends TempNode {
|
|
|
30
30
|
|
|
31
31
|
setup(): Node;
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
export const burn: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
|
|
35
|
+
export const dodge: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
|
|
36
|
+
export const overlay: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
|
|
37
|
+
export const screen: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
|