Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/three

Package Overview
Dependencies
Maintainers
1
Versions
231
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/three - npm Package Compare versions

Comparing version 0.159.0 to 0.160.0

three/examples/jsm/loaders/MaterialXLoader.d.ts

10

three/examples/jsm/loaders/KTX2Loader.d.ts

@@ -1,5 +0,5 @@

import { LoadingManager, CompressedTextureLoader, CompressedTexture, WebGLRenderer } from '../../../src/Three.js';
import { LoadingManager, Loader, CompressedTexture, WebGLRenderer } from '../../../src/Three.js';
import WebGPURenderer from '../renderers/webgpu/WebGPURenderer.js';
export class KTX2Loader extends CompressedTextureLoader {
export class KTX2Loader extends Loader<CompressedTexture> {
constructor(manager?: LoadingManager);

@@ -11,8 +11,2 @@

dispose(): KTX2Loader;
parse(
buffer: ArrayBuffer,
onLoad: (texture: CompressedTexture) => void,
onError?: (event: ErrorEvent) => void,
): KTX2Loader;
}
import Node from '../core/Node.js';
import MathNode from '../math/MathNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -19,1 +21,8 @@ export type BitangentNodeScope =

}
export const bitangentGeometry: ShaderNodeObject<BitangentNode>;
export const bitangentLocal: ShaderNodeObject<BitangentNode>;
export const bitangentView: ShaderNodeObject<BitangentNode>;
export const bitangentWorld: ShaderNodeObject<BitangentNode>;
export const transformedBitangentView: ShaderNodeObject<MathNode>;
export const transformedBitangentWorld: ShaderNodeObject<MathNode>;
import { NodeTypeOption } from '../core/constants.js';
import UniformNode from '../core/UniformNode.js';
import { NodeOrType, ShaderNodeObject } from '../shadernode/ShaderNode.js';
export default class BufferNode extends UniformNode {
export default class BufferNode extends UniformNode<ArrayLike<number>> {
isBufferNode: true;

@@ -12,1 +13,3 @@

}
export const buffer: (value: ArrayLike<number>, nodeOrType: NodeOrType, count: number) => ShaderNodeObject<BufferNode>;
import Object3DNode, { Object3DNodeScope } from './Object3DNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -13,1 +14,7 @@ export type CameraNodeScope = Object3DNodeScope | typeof CameraNode.PROJECTION_MATRIX;

}
export const cameraProjectionMatrix: ShaderNodeObject<CameraNode>;
export const cameraViewMatrix: ShaderNodeObject<CameraNode>;
export const cameraNormalMatrix: ShaderNodeObject<CameraNode>;
export const cameraWorldMatrix: ShaderNodeObject<CameraNode>;
export const cameraPosition: ShaderNodeObject<CameraNode>;

11

three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts

@@ -0,4 +1,5 @@

import { CubeTexture } from '../../../../src/Three.js';
import TextureNode from './TextureNode.js';
import { Node } from '../Nodes.js';
import { CubeTexture } from '../../../../src/Three.js';
import Node from '../core/Node.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -14,1 +15,7 @@ export default class CubeTextureNode extends TextureNode {

}
export const cubeTexture: (
value: CubeTexture,
uvNode?: NodeRepresentation,
levelNode?: NodeRepresentation,
) => ShaderNodeObject<CubeTextureNode>;
import { InstancedMesh } from '../../../../src/Three.js';
import Node from '../core/Node.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -10,1 +11,3 @@ export default class InstanceNode extends Node {

}
export const instance: (instanceMesh: InstancedMesh) => ShaderNodeObject<InstanceNode>;
import Node from '../core/Node.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -24,1 +25,12 @@ export type MaterialNodeScope =

}
export const materialAlphaTest: ShaderNodeObject<MaterialNode>;
export const materialColor: ShaderNodeObject<MaterialNode>;
export const materialShininess: ShaderNodeObject<MaterialNode>;
export const materialEmissive: ShaderNodeObject<MaterialNode>;
export const materialOpacity: ShaderNodeObject<MaterialNode>;
export const materialSpecularColor: ShaderNodeObject<MaterialNode>;
export const materialReflectivity: ShaderNodeObject<MaterialNode>;
export const materialRoughness: ShaderNodeObject<MaterialNode>;
export const materialMetalness: ShaderNodeObject<MaterialNode>;
export const materialRotation: ShaderNodeObject<MaterialNode>;
import { Material } from '../../../../src/Three.js';
import ReferenceNode from './ReferenceNode.js';
import { NodeOrType, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -7,1 +8,7 @@ export default class MaterialReferenceNode extends ReferenceNode<Material | null> {

}
export const materialReference: (
name: string,
nodeOrType: NodeOrType,
material: Material,
) => ShaderNodeObject<MaterialReferenceNode>;

@@ -1,3 +0,3 @@

import { NodeFrame } from '../Nodes.js';
import Object3DNode, { Object3DNodeScope } from './Object3DNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -10,1 +10,7 @@ /**

}
export const modelViewMatrix: ShaderNodeObject<ModelNode>;
export const modelNormalMatrix: ShaderNodeObject<ModelNode>;
export const modelWorldMatrix: ShaderNodeObject<ModelNode>;
export const modelPosition: ShaderNodeObject<ModelNode>;
export const modelViewPosition: ShaderNodeObject<ModelNode>;
import Node from '../core/Node.js';
import PositionNode from './PositionNode.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -7,1 +8,3 @@ export default class ModelViewProjectionNode extends Node {

}
export const modelViewProjection: (position?: NodeRepresentation) => ShaderNodeObject<ModelViewProjectionNode>;
import Node from '../core/Node.js';
import VarNode from '../core/VarNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -13,1 +15,7 @@ export type NormalNodeScope = typeof NormalNode.GEOMETRY | typeof NormalNode.LOCAL | typeof NormalNode.VIEW;

}
export const normalGeometry: ShaderNodeObject<NormalNode>;
export const normalLocal: ShaderNodeObject<NormalNode>;
export const normalView: ShaderNodeObject<NormalNode>;
export const normalWorld: ShaderNodeObject<NormalNode>;
export const transformedNormalView: ShaderNodeObject<VarNode>;
import Node from '../core/Node.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -8,1 +9,3 @@ export default class PointUVNode extends Node {

}
export const pointUV: ShaderNodeObject<PointUVNode>;
import Node from '../core/Node.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -22,1 +23,8 @@ export type PositionNodeScope =

}
export const positionGeometry: ShaderNodeObject<PositionNode>;
export const positionLocal: ShaderNodeObject<PositionNode>;
export const positionWorld: ShaderNodeObject<PositionNode>;
export const positionWorldDirection: ShaderNodeObject<PositionNode>;
export const positionView: ShaderNodeObject<PositionNode>;
export const positionViewDirection: ShaderNodeObject<PositionNode>;
import Node from '../core/Node.js';
import { NodeTypeOption } from '../Nodes.js';
import { NodeTypeOption } from '../core/constants.js';
import { NodeOrType, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -14,1 +15,3 @@ export default class ReferenceNode<T> extends Node {

}
export const reference: <T>(name: string, nodeOrType: NodeOrType, object: T) => ShaderNodeObject<ReferenceNode<T>>;
import Node from '../core/Node.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -9,1 +10,3 @@ export default class ReflectVectorNode extends Node {

}
export const reflectVector: ShaderNodeObject<ReflectVectorNode>;
import { SkinnedMesh } from '../../../../src/Three.js';
import Node from '../core/Node.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -14,1 +15,3 @@ export default class SkinningNode extends Node {

}
export function skinning(skinnedMesh: SkinnedMesh): ShaderNodeObject<SkinningNode>;

@@ -1,3 +0,4 @@

import { NodeTypeOption } from '../Nodes.js';
import BufferNode from './BufferNode.js';
import { NodeTypeOption } from '../core/constants.js';
import { NodeOrType, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -7,1 +8,7 @@ export default class StorageBufferNode extends BufferNode {

}
export const storage: (
value: ArrayLike<number>,
nodeOrType: NodeOrType,
count: number,
) => ShaderNodeObject<StorageBufferNode>;
import Node from '../core/Node.js';
import MathNode from '../math/MathNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -19,1 +21,8 @@ export type TangentNodeScope =

}
export const tangentGeometry: ShaderNodeObject<TangentNode>;
export const tangentLocal: ShaderNodeObject<TangentNode>;
export const tangentView: ShaderNodeObject<TangentNode>;
export const tangentWorld: ShaderNodeObject<TangentNode>;
export const transformedTangentView: ShaderNodeObject<MathNode>;
export const transformedTangentWorld: ShaderNodeObject<MathNode>;
import { Texture } from '../../../../src/Three.js';
import UniformNode from '../core/UniformNode.js';
import { Node } from '../Nodes.js';
import Node from '../core/Node.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
export default class TextureNode extends UniformNode {
export default class TextureNode extends UniformNode<Texture> {
isTextureNode: true;

@@ -15,1 +16,8 @@

}
export const texture: (
value: Texture,
uvNode?: NodeRepresentation,
levelNode?: NodeRepresentation,
) => ShaderNodeObject<TextureNode>;
export const sampler: (aTexture: Texture | TextureNode) => ShaderNodeObject<Node>;
import { NodeTypeOption, NodeUserData } from '../core/constants.js';
import ReferenceNode from './ReferenceNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -8,1 +9,7 @@ export default class UserDataNode extends ReferenceNode<NodeUserData> {

}
export const userData: (
name: string,
inputType: NodeTypeOption,
userData?: NodeUserData,
) => ShaderNodeObject<UserDataNode>;
import AttributeNode from '../core/AttributeNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -9,1 +10,3 @@ export default class UVNode extends AttributeNode {

}
export const uv: (index?: number) => ShaderNodeObject<UVNode>;
import Node from '../core/Node.js';
import NodeBuilder from '../core/NodeBuilder.js';
import { NodeTypeOption } from '../core/constants.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -16,1 +18,3 @@ export interface CodeNodeInclude {

}
export const code: (code: string, nodeType?: NodeTypeOption) => ShaderNodeObject<CodeNode>;
import { NodeTypeOption } from '../core/constants.js';
import TempNode from '../core/TempNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -8,1 +9,3 @@ export default class ExpressionNode extends TempNode {

}
export const expression: (snipped?: string, nodeType?: NodeTypeOption) => ShaderNodeObject<ExpressionNode>;

@@ -1,4 +0,5 @@

import FunctionNode from './FunctionNode.js';
import FunctionNode, { FunctionNodeArguments } from './FunctionNode.js';
import TempNode from '../core/TempNode.js';
import Node from '../core/Node.js';
import { ProxiedObject, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -14,1 +15,6 @@ export default class FunctionCallNode<P extends Node[] | { [name: string]: Node }> extends TempNode {

}
export const call: <P extends FunctionNodeArguments>(
functionNode?: FunctionNode<P>,
parameters?: ProxiedObject<P>,
) => ShaderNodeObject<FunctionCallNode<P>>;

@@ -7,2 +7,3 @@ import CodeNode, { CodeNodeInclude } from './CodeNode.js';

import Node from '../core/Node.js';
import { ProxiedObject, ProxiedTuple, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -19,1 +20,17 @@ export type FunctionNodeArguments = Node[] | { [name: string]: Node };

}
export type Fn<P extends FunctionNodeArguments> = P extends readonly [...unknown[]]
? ProxiedTuple<P>
: readonly [ProxiedObject<P>];
export const func: <P extends FunctionNodeArguments>(
code: string,
includes?: CodeNodeInclude[],
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
) => { call: (...params: Fn<P>) => ShaderNodeObject<Node> };
export const fn: <P extends FunctionNodeArguments>(
code: string,
includes?: CodeNodeInclude[],
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
) => (...params: Fn<P>) => ShaderNodeObject<Node>;
import UniformNode from './UniformNode.js';
import Node from './Node.js';
export default class ArrayUniformNode extends UniformNode {
export default class ArrayUniformNode extends UniformNode<undefined> {
isArrayUniformNode: true;

@@ -6,0 +6,0 @@ nodes: Node[];

import { NodeTypeOption } from './constants.js';
import Node from './Node.js';
import NodeBuilder from './NodeBuilder.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -10,1 +11,3 @@ export default class AttributeNode extends Node {

}
export const attribute: (name: string, nodeType: NodeTypeOption) => ShaderNodeObject<Node>;
import Node from './Node.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -10,1 +11,3 @@ export default class BypassNode extends Node {

}
export const bypass: (returnNode: NodeRepresentation, callNode: NodeRepresentation) => ShaderNodeObject<BypassNode>;
import Node from './Node.js';
import NodeCache from './NodeCache.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -11,1 +12,3 @@ export default class CacheNode extends Node {

}
export const cache: (node: Node, cache?: NodeCache) => ShaderNodeObject<CacheNode>;

@@ -1,3 +0,1 @@

import { Color, Matrix3, Matrix4, Vector2, Vector3, Vector4 } from '../../../../src/Three.js';
// disable automatic export, we have some private declarations

@@ -16,3 +14,2 @@ export const NodeShaderStage: {

export type NodeValueOption = Color | Vector2 | Vector3 | Vector4 | Matrix3 | Matrix4 | boolean | number;
export type NodeUpdateTypeOption = 'none' | 'frame' | 'object';

@@ -54,5 +51,12 @@ export type NodeShaderStageOption = 'vertex' | 'fragment' | 'compute';

// can be defined with string template type in Typescript 4.1
export type SwizzleOption = string;
export type SwizzleCharacter = 'x' | 'y' | 'z' | 'w' | 'r' | 'g' | 'b' | 'a' | 's' | 't' | 'p' | 'q';
export type SwizzleOption = Exclude<
| `${SwizzleCharacter}`
| `${SwizzleCharacter}${SwizzleCharacter}`
| `${SwizzleCharacter}${SwizzleCharacter}${SwizzleCharacter}`
| `${SwizzleCharacter}${SwizzleCharacter}${SwizzleCharacter}${SwizzleCharacter}`,
'abs' | 'sqrt'
>;
/** Should be the same type as Object3D.userData */

@@ -59,0 +63,0 @@ export type NodeUserData = Record<string, any>;

@@ -1,10 +0,10 @@

import { NodeTypeOption, NodeValueOption } from './constants.js';
import { NodeTypeOption } from './constants.js';
import InputNode from './InputNode.js';
import NodeBuilder from './NodeBuilder.js';
export default class ConstNode extends InputNode {
export default class ConstNode<Value> extends InputNode<Value> {
isConstNode: true;
constructor(value: NodeValueOption, nodeType?: NodeTypeOption | null);
constructor(value: Value, nodeType?: NodeTypeOption | null);
generateConst(builder: NodeBuilder): string;
}
import Node from './Node.js';
import { NodeBuilderContext } from './NodeBuilder.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -11,1 +12,3 @@ export default class ContextNode extends Node {

}
export const context: (node: NodeRepresentation, context: NodeBuilderContext) => ShaderNodeObject<ContextNode>;

@@ -1,2 +0,2 @@

import { NodeTypeOption, NodeValueOption } from './constants.js';
import { NodeTypeOption } from './constants.js';
import Node from './Node.js';

@@ -7,8 +7,8 @@ import NodeBuilder from './NodeBuilder.js';

export default abstract class InputNode extends Node {
export default abstract class InputNode<Value> extends Node {
isInputNode: true;
value: NodeValueOption;
value: Value;
precision: Precision | null;
constructor(value: NodeValueOption, nodeType?: NodeTypeOption | null);
constructor(value: Value, nodeType?: NodeTypeOption | null);

@@ -15,0 +15,0 @@ getInputType(builder: NodeBuilder): string | null;

@@ -6,3 +6,2 @@ import {

Renderer,
Scene,
Texture,

@@ -14,3 +13,2 @@ TextureEncoding,

import LightsNode from '../lighting/LightsNode.js';
import { nodeObject } from '../Nodes.js';
import { AnyObject, NodeShaderStageOption, NodeTypeOption } from './constants.js';

@@ -111,3 +109,8 @@ import Node from './Node.js';

getNodeProperties(node: Node, shaderStage?: NodeShaderStageOption): AnyObject;
getUniformFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): NodeUniform;
getUniformFromNode(
node: Node,
type: NodeTypeOption,
shaderStage?: NodeShaderStageOption,
name?: string | null,
): NodeUniform<string>;
getVarFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): NodeVar;

@@ -114,0 +117,0 @@ getVaryFromNode(node: Node, type: NodeTypeOption): NodeVarying;

@@ -1,13 +0,17 @@

import { NodeValueOption } from './constants.js';
import InputNode from './InputNode.js';
import UniformNode from './UniformNode.js';
export default class NodeUniform {
isNodeUniform: true;
export default class NodeUniform<Value> {
readonly isNodeUniform: true;
name: string;
type: string;
node: InputNode;
needsUpdate: boolean;
value: NodeValueOption;
node: UniformNode<Value>;
needsUpdate: boolean | undefined;
constructor(name: string, type: string, node: InputNode, needsUpdate?: boolean);
constructor(name: string, type: string, node: UniformNode<Value>, needsUpdate?: boolean);
get(): Value;
set value(val: Value);
get id(): number;
}

@@ -1,2 +0,2 @@

import { NodeValueOption } from './constants.js';
import { Color, Vector2, Vector3, Vector4, Matrix3, Matrix4 } from '../../../../src/Three.js';
import Node from './Node.js';

@@ -12,3 +12,6 @@

export function getNodeChildren(object: Node): Generator<NodeChild, void>;
export function getValueType(value: NodeValueOption): string | null;
export function getValueFromType(type: string, ...params: number[]): NodeValueOption | null;
export function getValueType(value: unknown): string | null;
export function getValueFromType(
type: string,
...params: number[]
): Color | Vector2 | Vector3 | Vector4 | Matrix3 | Matrix4 | boolean | number | string | ArrayBufferLike | null;
import { NodeTypeOption } from './constants.js';
import Node from './Node.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -7,1 +8,9 @@ export default class PropertyNode extends Node {

}
export const property: (name: string, nodeOrType: Node | NodeTypeOption) => ShaderNodeObject<Node>;
export const diffuseColor: ShaderNodeObject<PropertyNode>;
export const roughness: ShaderNodeObject<PropertyNode>;
export const metalness: ShaderNodeObject<PropertyNode>;
export const specularColor: ShaderNodeObject<PropertyNode>;
export const shininess: ShaderNodeObject<PropertyNode>;

@@ -1,10 +0,18 @@

import { NodeTypeOption, NodeValueOption } from './constants.js';
import { NodeTypeOption } from './constants.js';
import InputNode from './InputNode.js';
import NodeBuilder from './NodeBuilder.js';
import Node from './Node.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
export default class UniformNode extends InputNode {
isUniformNode: true;
export default class UniformNode<Value> extends InputNode<Value> {
readonly isUniformNode: true;
constructor(value: NodeValueOption, nodeType?: NodeTypeOption | null);
constructor(value: Value, nodeType?: NodeTypeOption | null);
getUniformHash(builder: NodeBuilder): string;
}
export const uniform: <Value>(
arg1: InputNode<Value> | Value,
arg2?: Node | string,
) => ShaderNodeObject<UniformNode<Value>>;
import { OperatorNodeOp } from '../math/OperatorNode.js';
import Node from './Node.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -17,1 +18,4 @@ export default class VarNode extends Node {

}
export const label: (node: NodeRepresentation, name?: string) => ShaderNodeObject<VarNode>;
export const temp: (node: NodeRepresentation, name?: string) => ShaderNodeObject<VarNode>;
import Node from './Node.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -9,1 +10,3 @@ export default class VaryingNode extends Node {

}
export const varying: (node: NodeRepresentation, name?: string) => ShaderNodeObject<VaryingNode>;
import TempNode from '../core/TempNode.js';
import { ShaderNode } from '../shadernode/ShaderNodeBaseElements.js';
import { Node } from '../Nodes.js';
import Node from '../core/Node.js';
import { NodeRepresentation, ShaderNode, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -33,1 +33,6 @@ export const BurnNode: ShaderNode<{ base: Node; blendNode: Node }>;

}
export const burn: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
export const dodge: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
export const overlay: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
export const screen: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
import TempNode from '../core/TempNode.js';
import { Node } from '../Nodes.js';
import MathNode from '../math/MathNode.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -21,1 +22,17 @@ export type ColorAdjustmentMethod =

}
export const saturation: (
colorNode: NodeRepresentation,
adjustmentNode?: NodeRepresentation,
) => ShaderNodeObject<ColorAdjustmentNode>;
export const vibrance: (
colorNode: NodeRepresentation,
adjustmentNode?: NodeRepresentation,
) => ShaderNodeObject<ColorAdjustmentNode>;
export const hue: (
colorNode: NodeRepresentation,
adjustmentNode?: NodeRepresentation,
) => ShaderNodeObject<ColorAdjustmentNode>;
export const lumaCoeffs: ShaderNodeObject<MathNode>;
export const luminance: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<MathNode>;

@@ -0,3 +1,5 @@

import { TextureEncoding } from '../../../../src/Three.js';
import TempNode from '../core/TempNode.js';
import Node from '../core/Node.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -19,1 +21,3 @@ export type ColorSpaceNodeMethod =

}
export const colorSpace: (node: NodeRepresentation, encoding: TextureEncoding) => ShaderNodeObject<ColorSpaceNode>;
import Node from '../core/Node.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -7,1 +8,4 @@ export default class FrontFacingNode extends Node {

}
export const frontFacing: ShaderNodeObject<FrontFacingNode>;
export const faceDirection: ShaderNodeObject<Node>;

@@ -0,4 +1,6 @@

import { NormalMapTypes } from '../../../../src/Three.js';
import TempNode from '../core/TempNode.js';
import { NormalMapTypes } from '../../../../src/Three.js';
import Node from '../core/Node.js';
import MathNode from '../math/MathNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -13,1 +15,5 @@ export default class NormalMapNode extends TempNode {

}
export const normalMap: (node: Node, scaleNode?: Node) => ShaderNodeObject<NormalMapNode>;
export const TBNViewMatrix: ShaderNodeObject<MathNode>;
import Node from '../core/Node.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -9,1 +10,6 @@ export default class PosterizeNode extends Node {

}
export const posterize: (
sourceNode: NodeRepresentation,
stepsNode: NodeRepresentation,
) => ShaderNodeObject<PosterizeNode>;

@@ -0,4 +1,5 @@

import { ToneMapping } from '../../../../src/Three.js';
import TempNode from '../core/TempNode.js';
import Node from '../core/Node.js';
import { ToneMapping } from '../../../../src/Three.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -15,1 +16,7 @@ // exposure only

}
export const toneMapping: (
mapping: ToneMapping,
exposure: NodeRepresentation,
color?: NodeRepresentation,
) => ShaderNodeObject<ToneMappingNode>;
import Node from '../core/Node.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -24,1 +25,8 @@ export type ViewportNodeScope =

}
export const viewportCoordinate: ShaderNodeObject<ViewportNode>;
export const viewportResolution: ShaderNodeObject<ViewportNode>;
export const viewportTopLeft: ShaderNodeObject<ViewportNode>;
export const viewportBottomLeft: ShaderNodeObject<ViewportNode>;
export const viewportTopRight: ShaderNodeObject<ViewportNode>;
export const viewportBottomRight: ShaderNodeObject<ViewportNode>;
import Node from '../core/Node.js';
import FogNode from './FogNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -10,1 +11,3 @@ export default class FogExp2Node extends FogNode {

}
export const densityFog: (colorNode: Node, densityNode: Node) => ShaderNodeObject<FogExp2Node>;
import Node from '../core/Node.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -11,1 +12,3 @@ export default class FogNode extends Node {

}
export const fog: (colorNode: NodeRepresentation, factorNode: NodeRepresentation) => ShaderNodeObject<FogNode>;
import FogNode from './FogNode.js';
import Node from '../core/Node.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -11,1 +12,3 @@ export default class FogRangeNode extends FogNode {

}
export const rangeFog: (colorNode: Node, nearNode: Node, farNode: Node) => ShaderNodeObject<FogRangeNode>;

@@ -1,2 +0,2 @@

import { ShaderNode } from '../../shadernode/ShaderNodeBaseElements.js';
import { ShaderNode } from '../../shadernode/ShaderNode.js';
import Node from '../../core/Node.js';

@@ -3,0 +3,0 @@

@@ -1,2 +0,2 @@

import { ShaderNode } from '../../shadernode/ShaderNodeBaseElements.js';
import { ShaderNode } from '../../shadernode/ShaderNode.js';
import Node from '../../core/Node.js';

@@ -3,0 +3,0 @@

@@ -1,2 +0,2 @@

import { ShaderNode } from '../../shadernode/ShaderNodeBaseElements.js';
import { ShaderNode } from '../../shadernode/ShaderNode.js';
import Node from '../../core/Node.js';

@@ -3,0 +3,0 @@

@@ -1,2 +0,2 @@

import { ShaderNode } from '../../shadernode/ShaderNodeElements.js';
import { ShaderNode } from '../../shadernode/ShaderNode.js';
import Node from '../../core/Node.js';

@@ -3,0 +3,0 @@

@@ -1,2 +0,2 @@

import { ShaderNode } from '../../shadernode/ShaderNodeBaseElements.js';
import { ShaderNode } from '../../shadernode/ShaderNode.js';
import Node from '../../core/Node.js';

@@ -3,0 +3,0 @@

@@ -1,2 +0,2 @@

import { ShaderNode } from '../../shadernode/ShaderNodeBaseElements.js';
import { ShaderNode } from '../../shadernode/ShaderNode.js';
import Node from '../../core/Node.js';

@@ -3,0 +3,0 @@

@@ -1,2 +0,2 @@

import { ShaderNode } from '../../shadernode/ShaderNodeBaseElements.js';
import { ShaderNode } from '../../shadernode/ShaderNode.js';

@@ -3,0 +3,0 @@ declare const getGeometryRoughness: ShaderNode;

@@ -1,2 +0,2 @@

import { ShaderNode } from '../../shadernode/ShaderNodeElements.js';
import { ShaderNode } from '../../shadernode/ShaderNode.js';
import Node from '../../core/Node.js';

@@ -3,0 +3,0 @@

@@ -1,2 +0,2 @@

import { ShaderNode } from '../shadernode/ShaderNodeElements.js';
import { ShaderNode } from '../shadernode/ShaderNode.js';
import Node from '../core/Node.js';

@@ -3,0 +3,0 @@

import { Color, Vector2, Vector3, Vector4 } from '../../../../src/Three.js';
import Node from '../core/Node.js';
import NodeBuilder from '../core/NodeBuilder.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -14,1 +15,3 @@ export type RangeModeBound = number | Color | Vector2 | Vector3 | Vector4;

}
export const range: (min: RangeModeBound, max: RangeModeBound) => ShaderNodeObject<RangeNode>;
import Node from '../core/Node.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -12,1 +13,7 @@ export default class ComputeNode extends Node {

}
export const compute: (
node: NodeRepresentation,
count: number,
workgroupSize: number[],
) => ShaderNodeObject<ComputeNode>;
import ContextNode from '../core/ContextNode.js';
import Node from '../core/Node.js';
import { ShaderNode } from '../Nodes.js';
import { ShaderNode, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -16,1 +16,6 @@ export interface LightingModelNode {

}
export const lightingContext: (
node: Node,
lightingModelNode?: LightingModelNode,
) => ShaderNodeObject<LightingContextNode>;
import { Light } from '../../../../src/Three.js';
import Node from '../core/Node.js';
import LightingNode from './LightingNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -20,1 +21,3 @@ export default class LightsNode extends Node {

}
export const lights: (lights: Light[]) => ShaderNodeObject<LightsNode>;
import { ShaderMaterialParameters } from '../../../../src/Three.js';
import { Swizzable, CheckerNode, Node } from '../Nodes.js';
import MeshStandardNodeMaterial from './MeshStandardNodeMaterial.js';
import Node from '../core/Node.js';
import CheckerNode from '../procedural/CheckerNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
export default class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
iridescenceNode: null | Swizzable<CheckerNode>;
iridescenceIORNode: null | Swizzable;
iridescenceThicknessNode: null | Swizzable;
readonly isMeshPhysicalNodeMaterial: true;
clearcoatNode: Node | null;
clearcoatRoughnessNode: Node | null;
clearcoatNormalNode: Node | null;
sheenNode: Node | null;
sheenRoughnessNode: Node | null;
iridescenceNode: null | ShaderNodeObject<CheckerNode>;
iridescenceIORNode: null | ShaderNodeObject<Node>;
iridescenceThicknessNode: null | ShaderNodeObject<Node>;
iorNode?: Node | null;
specularIntensityNode: Node | null;

@@ -19,5 +32,5 @@ specularColorNode: Node | null;

constructor(parameters: ShaderMaterialParameters);
constructor(parameters?: ShaderMaterialParameters);
copy(source: MeshPhysicalNodeMaterial): this;
}

@@ -13,7 +13,4 @@ import { ShaderMaterialParameters } from '../../../../src/Three.js';

clearcoatNode: Node | null;
clearcoatRoughnessNode: Node | null;
constructor(paramters?: ShaderMaterialParameters);
copy(source: MeshStandardNodeMaterial): this;
}

@@ -1,5 +0,20 @@

import { Material, ShaderMaterial } from '../../../../src/Three.js';
import {
LineBasicMaterial,
Material,
MeshBasicMaterial,
MeshPhysicalMaterial,
MeshStandardMaterial,
PointsMaterial,
ShaderMaterial,
SpriteMaterial,
} from '../../../../src/Three.js';
import NodeBuilder from '../core/NodeBuilder.js';
import Node from '../core/Node.js';
import { LightingModelNode } from '../lighting/LightingContextNode.js';
import LineBasicNodeMaterial from './LineBasicNodeMaterial.js';
import MeshBasicNodeMaterial from './MeshBasicNodeMaterial.js';
import MeshPhysicalNodeMaterial from './MeshPhysicalNodeMaterial.js';
import MeshStandardNodeMaterial from './MeshStandardNodeMaterial.js';
import PointsNodeMaterial from './PointsNodeMaterial.js';
import SpriteNodeMaterial from './SpriteNodeMaterial.js';

@@ -37,3 +52,11 @@ export default class NodeMaterial extends ShaderMaterial {

generateOutput(builder: NodeBuilder, lights: { diffuseColorNode: Node; outgoingLightNode: Node }): void;
static fromMaterial(m: Material): NodeMaterial;
static fromMaterial(material: LineBasicMaterial): LineBasicNodeMaterial;
static fromMaterial(material: MeshBasicMaterial): MeshBasicNodeMaterial;
static fromMaterial(material: MeshPhysicalMaterial): MeshPhysicalNodeMaterial;
static fromMaterial(material: MeshStandardMaterial): MeshStandardNodeMaterial;
static fromMaterial(material: PointsMaterial): PointsNodeMaterial;
static fromMaterial(material: SpriteMaterial): SpriteNodeMaterial;
static fromMaterial(material: NodeMaterial): NodeMaterial;
static fromMaterial(material: Material): NodeMaterial;
}

@@ -1,4 +0,6 @@

import { Fn, Node, Swizzable } from '../../Nodes.js';
import Node from '../../core/Node.js';
import { Fn } from '../../code/FunctionNode.js';
import { ShaderNodeObject } from '../../shadernode/ShaderNode.js';
export function mx_hsvtorgb(...params: Fn<[Node]>): Swizzable;
export function mx_rgbtohsv(...params: Fn<[Node]>): Swizzable;
export function mx_hsvtorgb(...params: Fn<[Node]>): ShaderNodeObject<Node>;
export function mx_rgbtohsv(...params: Fn<[Node]>): ShaderNodeObject<Node>;

@@ -1,6 +0,8 @@

import { Fn, Node, Swizzable } from '../../Nodes.js';
import Node from '../../core/Node.js';
import { Fn } from '../../code/FunctionNode.js';
import { ShaderNodeObject } from '../../shadernode/ShaderNode.js';
export function mx_perlin_noise_float(...params: Fn<[Node]>): Swizzable;
export function mx_cell_noise_float(...params: Fn<[Node]>): Swizzable;
export function mx_worley_noise_float(...params: Fn<[Node]>): Swizzable;
export function mx_fractal_noise_float(...params: Fn<[Node, Node, Node, Node]>): Swizzable;
export function mx_perlin_noise_float(...params: Fn<[Node]>): ShaderNodeObject<Node>;
export function mx_cell_noise_float(...params: Fn<[Node]>): ShaderNodeObject<Node>;
export function mx_worley_noise_float(...params: Fn<[Node]>): ShaderNodeObject<Node>;
export function mx_fractal_noise_float(...params: Fn<[Node, Node, Node, Node]>): ShaderNodeObject<Node>;
import { mx_hsvtorgb, mx_rgbtohsv } from './lib/mx_hsv.js';
import { Swizzable } from '../shadernode/ShaderNodeElements.js';
import { UVNode, MathNode } from '../Nodes.js';
import { NodeRepresentation } from '../shadernode/ShaderNode.js';
import Node from '../core/Node.js';
import MathNode from '../math/MathNode.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
export function mx_aastep(threshold?: NodeRepresentation, value?: NodeRepresentation): Swizzable<MathNode>;
export function mx_aastep(threshold?: NodeRepresentation, value?: NodeRepresentation): ShaderNodeObject<MathNode>;

@@ -11,9 +11,9 @@ export function mx_ramplr(

valuer?: NodeRepresentation,
texcoord?: Swizzable<UVNode>,
): Swizzable<MathNode>;
texcoord?: ShaderNodeObject<Node>,
): ShaderNodeObject<MathNode>;
export function mx_ramptb(
valuet?: NodeRepresentation,
valueb?: NodeRepresentation,
texcoord?: Swizzable<UVNode>,
): Swizzable<MathNode>;
texcoord?: ShaderNodeObject<Node>,
): ShaderNodeObject<MathNode>;

@@ -24,4 +24,4 @@ export function mx_splitlr(

center?: NodeRepresentation,
texcoord?: Swizzable<UVNode>,
): Swizzable<MathNode>;
texcoord?: ShaderNodeObject<Node>,
): ShaderNodeObject<MathNode>;
export function mx_splittb(

@@ -31,4 +31,4 @@ valuet?: NodeRepresentation,

center?: NodeRepresentation,
texcoord?: Swizzable<UVNode>,
): Swizzable<MathNode>;
texcoord?: ShaderNodeObject<Node>,
): ShaderNodeObject<MathNode>;

@@ -38,34 +38,43 @@ export function mx_transform_uv(

uv_offset?: NodeRepresentation,
uv_geo?: Swizzable<UVNode>,
): Swizzable;
uv_geo?: ShaderNodeObject<Node>,
): ShaderNodeObject<Node>;
export function mx_noise_float(
texcoord?: Swizzable<UVNode>,
texcoord?: ShaderNodeObject<Node>,
amplitude?: NodeRepresentation,
pivot?: NodeRepresentation,
): Swizzable;
): ShaderNodeObject<Node>;
export function mx_noise_vec2(
texcoord?: Swizzable<UVNode>,
texcoord?: ShaderNodeObject<Node>,
amplitude?: NodeRepresentation,
pivot?: NodeRepresentation,
): Swizzable;
): ShaderNodeObject<Node>;
export function mx_noise_vec3(
texcoord?: Swizzable<UVNode>,
texcoord?: ShaderNodeObject<Node>,
amplitude?: NodeRepresentation,
pivot?: NodeRepresentation,
): Swizzable;
): ShaderNodeObject<Node>;
export function mx_noise_vec4(
texcoord?: Swizzable<UVNode>,
texcoord?: ShaderNodeObject<Node>,
amplitude?: NodeRepresentation,
pivot?: NodeRepresentation,
): Swizzable;
): ShaderNodeObject<Node>;
export function mx_worley_noise_float(texcoord?: Swizzable<UVNode>, jitter?: NodeRepresentation): Swizzable;
export function mx_worley_noise_vec2(texcoord?: Swizzable<UVNode>, jitter?: NodeRepresentation): Swizzable;
export function mx_worley_noise_vec3(texcoord?: Swizzable<UVNode>, jitter?: NodeRepresentation): Swizzable;
export function mx_worley_noise_float(
texcoord?: ShaderNodeObject<Node>,
jitter?: NodeRepresentation,
): ShaderNodeObject<Node>;
export function mx_worley_noise_vec2(
texcoord?: ShaderNodeObject<Node>,
jitter?: NodeRepresentation,
): ShaderNodeObject<Node>;
export function mx_worley_noise_vec3(
texcoord?: ShaderNodeObject<Node>,
jitter?: NodeRepresentation,
): ShaderNodeObject<Node>;
export function mx_cell_noise_float(texcoord?: Swizzable<UVNode>): Swizzable;
export function mx_cell_noise_float(texcoord?: ShaderNodeObject<Node>): ShaderNodeObject<Node>;
export function mx_fractal_noise_float(
position?: Swizzable<UVNode>,
position?: ShaderNodeObject<Node>,
octaves?: NodeRepresentation,

@@ -75,5 +84,5 @@ lacunarity?: NodeRepresentation,

amplitude?: NodeRepresentation,
): Swizzable;
): ShaderNodeObject<Node>;
export function mx_fractal_noise_vec2(
position?: Swizzable<UVNode>,
position?: ShaderNodeObject<Node>,
octaves?: NodeRepresentation,

@@ -83,5 +92,5 @@ lacunarity?: NodeRepresentation,

amplitude?: NodeRepresentation,
): Swizzable;
): ShaderNodeObject<Node>;
export function mx_fractal_noise_vec3(
position?: Swizzable<UVNode>,
position?: ShaderNodeObject<Node>,
octaves?: NodeRepresentation,

@@ -91,5 +100,5 @@ lacunarity?: NodeRepresentation,

amplitude?: NodeRepresentation,
): Swizzable;
): ShaderNodeObject<Node>;
export function mx_fractal_noise_vec4(
position?: Swizzable<UVNode>,
position?: ShaderNodeObject<Node>,
octaves?: NodeRepresentation,

@@ -99,4 +108,4 @@ lacunarity?: NodeRepresentation,

amplitude?: NodeRepresentation,
): Swizzable;
): ShaderNodeObject<Node>;
export { mx_hsvtorgb, mx_rgbtohsv };
import Node from '../core/Node.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -10,1 +11,7 @@ export default class CondNode extends Node {

}
export function cond(
condNode: NodeRepresentation,
ifNode: NodeRepresentation,
elseNode: NodeRepresentation,
): ShaderNodeObject<Node>;
import Node from '../core/Node.js';
import TempNode from '../core/TempNode.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -30,3 +31,7 @@ export type MathNodeMethod1 =

| typeof MathNode.DFDY
| typeof MathNode.ROUND;
| typeof MathNode.ROUND
| typeof MathNode.RECIPROCAL
| typeof MathNode.TRUNC
| typeof MathNode.FWIDTH
| typeof MathNode.BITCAST;

@@ -85,2 +90,5 @@ export type MathNodeMethod2 =

static RECIPROCAL: 'reciprocal';
static TRUNC: 'trunc';
static FWIDTH: 'fwidth';
static BITCAST: 'bitcast';

@@ -118,1 +126,126 @@ // 2 inputs

}
export const EPSILON: ShaderNodeObject<Node>;
export const INFINITY: ShaderNodeObject<Node>;
export type Unary = (a: NodeRepresentation) => ShaderNodeObject<MathNode>;
export const radians: Unary;
export const degrees: Unary;
export const exp: Unary;
export const exp2: Unary;
export const log: Unary;
export const log2: Unary;
export const sqrt: Unary;
export const inverseSqrt: Unary;
export const floor: Unary;
export const ceil: Unary;
export const normalize: Unary;
export const fract: Unary;
export const sin: Unary;
export const cos: Unary;
export const tan: Unary;
export const asin: Unary;
export const acos: Unary;
export const atan: Unary;
export const abs: Unary;
export const sign: Unary;
export const length: Unary;
export const negate: Unary;
export const oneMinus: Unary;
export const dFdx: Unary;
export const dFdy: Unary;
export const round: Unary;
export const reciprocal: Unary;
export const trunc: Unary;
export const fwidth: Unary;
export const bitcast: Unary;
export type Binary = (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<MathNode>;
export const atan2: Binary;
export const min: Binary;
export const max: Binary;
export const mod: Binary;
export const step: Binary;
export const reflect: Binary;
export const distance: Binary;
export const difference: Binary;
export const dot: Binary;
export const cross: Binary;
export const pow: Binary;
export const pow2: Binary;
export const pow3: Binary;
export const pow4: Binary;
export const transformDirection: Binary;
export type Ternary = (
a: NodeRepresentation,
b: NodeRepresentation,
c: NodeRepresentation,
) => ShaderNodeObject<MathNode>;
export const mix: Ternary;
export const clamp: Ternary;
export const saturate: Ternary;
export const refract: Ternary;
export const smoothstep: Ternary;
export const faceForward: Ternary;
export const mixElement: Ternary;
export const smoothstepElement: Ternary;
declare module '../shadernode/ShaderNode.js' {
interface NodeElements {
radians: typeof radians;
degrees: typeof degrees;
exp: typeof exp;
exp2: typeof exp2;
log: typeof log;
log2: typeof log2;
sqrt: typeof sqrt;
inverseSqrt: typeof inverseSqrt;
floor: typeof floor;
ceil: typeof ceil;
normalize: typeof normalize;
fract: typeof fract;
sin: typeof sin;
cos: typeof cos;
tan: typeof tan;
asin: typeof asin;
acos: typeof acos;
atan: typeof atan;
abs: typeof abs;
sign: typeof sign;
length: typeof length;
negate: typeof negate;
oneMinus: typeof oneMinus;
dFdx: typeof dFdx;
dFdy: typeof dFdy;
round: typeof round;
reciprocal: typeof reciprocal;
trunc: typeof trunc;
fwidth: typeof fwidth;
atan2: typeof atan2;
min: typeof min;
max: typeof max;
mod: typeof mod;
step: typeof step;
reflect: typeof reflect;
distance: typeof distance;
dot: typeof dot;
cross: typeof cross;
pow: typeof pow;
pow2: typeof pow2;
pow3: typeof pow3;
pow4: typeof pow4;
transformDirection: typeof transformDirection;
mix: typeof mixElement;
clamp: typeof clamp;
refract: typeof refract;
smoothstep: typeof smoothstepElement;
faceForward: typeof faceForward;
difference: typeof difference;
saturate: typeof saturate;
}
}
import TempNode from '../core/TempNode.js';
import Node from '../core/Node.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -32,1 +33,51 @@ export type OperatorNodeOp =

}
export type Operator = (
a: NodeRepresentation,
b: NodeRepresentation,
...others: NodeRepresentation[]
) => ShaderNodeObject<OperatorNode>;
export const add: Operator;
export const sub: Operator;
export const mul: Operator;
export const div: Operator;
export const remainder: Operator;
export const equal: Operator;
export const assign: Operator;
export const lessThan: Operator;
export const greaterThan: Operator;
export const lessThanEqual: Operator;
export const greaterThanEqual: Operator;
export const and: Operator;
export const or: Operator;
export const xor: Operator;
export const bitAnd: Operator;
export const bitOr: Operator;
export const bitXor: Operator;
export const shiftLeft: Operator;
export const shiftRight: Operator;
declare module '../shadernode/ShaderNode.js' {
interface NodeElements {
add: typeof add;
sub: typeof sub;
mul: typeof mul;
div: typeof div;
remainder: typeof remainder;
equal: typeof equal;
assign: typeof assign;
lessThan: typeof lessThan;
greaterThan: typeof greaterThan;
lessThanEqual: typeof lessThanEqual;
greaterThanEqual: typeof greaterThanEqual;
and: typeof and;
or: typeof or;
xor: typeof xor;
bitAnd: typeof bitAnd;
bitOr: typeof bitOr;
bitXor: typeof bitXor;
shiftLeft: typeof shiftLeft;
shiftRight: typeof shiftRight;
}
}

@@ -6,7 +6,7 @@ // constants

export { default as ArrayUniformNode } from './core/ArrayUniformNode.js';
export { default as AttributeNode } from './core/AttributeNode.js';
export { default as BypassNode } from './core/BypassNode.js';
export { default as CacheNode } from './core/CacheNode.js';
export { default as AttributeNode, attribute } from './core/AttributeNode.js';
export { default as BypassNode, bypass } from './core/BypassNode.js';
export { default as CacheNode, cache } from './core/CacheNode.js';
export { default as ConstNode } from './core/ConstNode.js';
export { default as ContextNode } from './core/ContextNode.js';
export { default as ContextNode, context } from './core/ContextNode.js';
export { default as Node } from './core/Node.js';

@@ -23,8 +23,16 @@ export { default as NodeAttribute } from './core/NodeAttribute.js';

export { default as NodeVarying } from './core/NodeVarying.js';
export { default as PropertyNode } from './core/PropertyNode.js';
export {
default as PropertyNode,
property,
diffuseColor,
roughness,
metalness,
specularColor,
shininess,
} from './core/PropertyNode.js';
export { default as StackNode } from './core/StackNode.js';
export { default as TempNode } from './core/TempNode.js';
export { default as UniformNode } from './core/UniformNode.js';
export { default as VarNode } from './core/VarNode.js';
export { default as VaryingNode } from './core/VaryingNode.js';
export { default as UniformNode, uniform } from './core/UniformNode.js';
export { default as VarNode, label, temp } from './core/VarNode.js';
export { default as VaryingNode, varying } from './core/VaryingNode.js';

@@ -37,2 +45,55 @@ import * as NodeUtils from './core/NodeUtils.js';

default as MathNode,
EPSILON,
INFINITY,
radians,
degrees,
exp,
exp2,
log,
log2,
sqrt,
inverseSqrt,
floor,
ceil,
normalize,
fract,
sin,
cos,
tan,
asin,
acos,
atan,
abs,
sign,
length,
negate,
oneMinus,
dFdx,
dFdy,
round,
reciprocal,
trunc,
fwidth,
bitcast,
atan2,
min,
max,
mod,
step,
reflect,
distance,
difference,
dot,
cross,
pow,
pow2,
pow3,
pow4,
transformDirection,
mix,
clamp,
saturate,
refract,
smoothstep,
faceForward,
MathNodeMethod1,

@@ -42,5 +103,31 @@ MathNodeMethod2,

MathNodeMethod,
Unary,
Binary,
Ternary,
} from './math/MathNode.js';
export { default as OperatorNode, OperatorNodeOp } from './math/OperatorNode.js';
export { default as CondNode } from './math/CondNode.js';
export {
default as OperatorNode,
add,
sub,
mul,
div,
remainder,
equal,
assign,
lessThan,
greaterThan,
lessThanEqual,
greaterThanEqual,
and,
or,
xor,
bitAnd,
bitOr,
bitXor,
shiftLeft,
shiftRight,
OperatorNodeOp,
Operator,
} from './math/OperatorNode.js';
export { default as CondNode, cond } from './math/CondNode.js';

@@ -50,66 +137,157 @@ // utils

export { default as ConvertNode } from './utils/ConvertNode.js';
export { default as EquirectUVNode } from './utils/EquirectUVNode.js';
export { default as EquirectUVNode, equirectUV } from './utils/EquirectUVNode.js';
export { default as JoinNode } from './utils/JoinNode.js';
export { default as MatcapUVNode } from './utils/MatcapUVNode.js';
export { default as MaxMipLevelNode } from './utils/MaxMipLevelNode.js';
export { default as OscNode, OscNodeMethod } from './utils/OscNode.js';
export { default as RemapNode } from './utils/RemapNode.js';
export { default as RotateUVNode } from './utils/RotateUVNode.js';
export { default as SpecularMIPLevelNode } from './utils/SpecularMIPLevelNode.js';
export { default as MatcapUVNode, matcapUV } from './utils/MatcapUVNode.js';
export { default as MaxMipLevelNode, maxMipLevel } from './utils/MaxMipLevelNode.js';
export { default as OscNode, oscSine, oscSquare, oscTriangle, oscSawtooth, OscNodeMethod } from './utils/OscNode.js';
export { default as RemapNode, remap, remapClamp } from './utils/RemapNode.js';
export { default as RotateUVNode, rotateUV } from './utils/RotateUVNode.js';
export { default as SpecularMIPLevelNode, specularMIPLevel } from './utils/SpecularMIPLevelNode.js';
export { default as SplitNode } from './utils/SplitNode.js';
export { default as SpriteSheetUVNode } from './utils/SpriteSheetUVNode.js';
export { default as TimerNode, TimerNodeScope } from './utils/TimerNode.js';
export { default as TriplanarTexturesNode } from './utils/TriplanarTexturesNode.js';
export { default as SpriteSheetUVNode, spritesheetUV } from './utils/SpriteSheetUVNode.js';
export {
default as TimerNode,
timerLocal,
timerGlobal,
timerDelta,
frameId,
TimerNodeScope,
} from './utils/TimerNode.js';
export {
default as TriplanarTexturesNode,
triplanarTextures,
triplanarTexture,
} from './utils/TriplanarTexturesNode.js';
// shader node
export * from './shadernode/ShaderNodeElements.js';
export * from './shadernode/ShaderNode.js';
// accessors
export { default as BitangentNode, BitangentNodeScope } from './accessors/BitangentNode.js';
export { default as BufferNode } from './accessors/BufferNode.js';
export { default as CameraNode, CameraNodeScope } from './accessors/CameraNode.js';
export { default as CubeTextureNode } from './accessors/CubeTextureNode.js';
export { default as InstanceNode } from './accessors/InstanceNode.js';
export { default as MaterialNode, MaterialNodeScope } from './accessors/MaterialNode.js';
export { default as MaterialReferenceNode } from './accessors/MaterialReferenceNode.js';
export { default as ModelNode } from './accessors/ModelNode.js';
export { default as ModelViewProjectionNode } from './accessors/ModelViewProjectionNode.js';
export { default as NormalNode, NormalNodeScope } from './accessors/NormalNode.js';
export {
default as BitangentNode,
bitangentGeometry,
bitangentLocal,
bitangentView,
bitangentWorld,
transformedBitangentView,
transformedBitangentWorld,
BitangentNodeScope,
} from './accessors/BitangentNode.js';
export { default as BufferNode, buffer } from './accessors/BufferNode.js';
export {
default as CameraNode,
cameraProjectionMatrix,
cameraViewMatrix,
cameraNormalMatrix,
cameraWorldMatrix,
cameraPosition,
CameraNodeScope,
} from './accessors/CameraNode.js';
export { default as CubeTextureNode, cubeTexture } from './accessors/CubeTextureNode.js';
export { default as InstanceNode, instance } from './accessors/InstanceNode.js';
export {
default as MaterialNode,
materialAlphaTest,
materialColor,
materialShininess,
materialEmissive,
materialOpacity,
materialSpecularColor,
materialReflectivity,
materialRoughness,
materialMetalness,
materialRotation,
MaterialNodeScope,
} from './accessors/MaterialNode.js';
export { default as MaterialReferenceNode, materialReference } from './accessors/MaterialReferenceNode.js';
export {
default as ModelNode,
modelViewMatrix,
modelNormalMatrix,
modelWorldMatrix,
modelPosition,
modelViewPosition,
} from './accessors/ModelNode.js';
export { default as ModelViewProjectionNode, modelViewProjection } from './accessors/ModelViewProjectionNode.js';
export {
default as NormalNode,
normalGeometry,
normalLocal,
normalView,
normalWorld,
transformedNormalView,
NormalNodeScope,
} from './accessors/NormalNode.js';
export { default as Object3DNode, Object3DNodeScope as OObject3DNodeScope } from './accessors/Object3DNode.js';
export { default as PointUVNode } from './accessors/PointUVNode.js';
export { default as PositionNode, PositionNodeScope } from './accessors/PositionNode.js';
export { default as ReferenceNode } from './accessors/ReferenceNode.js';
export { default as ReflectVectorNode } from './accessors/ReflectVectorNode.js';
export { default as SkinningNode } from './accessors/SkinningNode.js';
export { default as TangentNode, TangentNodeScope } from './accessors/TangentNode.js';
export { default as TextureNode } from './accessors/TextureNode.js';
export { default as UVNode } from './accessors/UVNode.js';
export { default as UserDataNode } from './accessors/UserDataNode.js';
export { default as PointUVNode, pointUV } from './accessors/PointUVNode.js';
export {
default as PositionNode,
positionGeometry,
positionLocal,
positionWorld,
positionWorldDirection,
positionView,
positionViewDirection,
PositionNodeScope,
} from './accessors/PositionNode.js';
export { default as ReferenceNode, reference } from './accessors/ReferenceNode.js';
export { default as ReflectVectorNode, reflectVector } from './accessors/ReflectVectorNode.js';
export { default as SkinningNode, skinning } from './accessors/SkinningNode.js';
export { default as StorageBufferNode, storage } from './accessors/StorageBufferNode.js';
export {
default as TangentNode,
tangentGeometry,
tangentLocal,
tangentView,
tangentWorld,
transformedTangentView,
transformedTangentWorld,
TangentNodeScope,
} from './accessors/TangentNode.js';
export { default as TextureNode, texture, sampler } from './accessors/TextureNode.js';
export { default as UVNode, uv } from './accessors/UVNode.js';
export { default as UserDataNode, userData } from './accessors/UserDataNode.js';
// display
export { default as BlendModeNode, BlendMode } from './display/BlendModeNode.js';
export { default as ColorAdjustmentNode, ColorAdjustmentMethod } from './display/ColorAdjustmentNode.js';
export { default as ColorSpaceNode, ColorSpaceNodeMethod } from './display/ColorSpaceNode.js';
export { default as FrontFacingNode } from './display/FrontFacingNode.js';
export { default as NormalMapNode } from './display/NormalMapNode.js';
export { default as PosterizeNode } from './display/PosterizeNode.js';
export { default as ToneMappingNode } from './display/ToneMappingNode.js';
export { default as ViewportNode } from './display/ViewportNode.js';
export { default as BlendModeNode, burn, dodge, overlay, screen, BlendMode } from './display/BlendModeNode.js';
export {
default as ColorAdjustmentNode,
saturation,
vibrance,
hue,
lumaCoeffs,
luminance,
ColorAdjustmentMethod,
} from './display/ColorAdjustmentNode.js';
export { default as ColorSpaceNode, colorSpace, ColorSpaceNodeMethod } from './display/ColorSpaceNode.js';
export { default as FrontFacingNode, frontFacing, faceDirection } from './display/FrontFacingNode.js';
export { default as NormalMapNode, normalMap, TBNViewMatrix } from './display/NormalMapNode.js';
export { default as PosterizeNode, posterize } from './display/PosterizeNode.js';
export { default as ToneMappingNode, toneMapping } from './display/ToneMappingNode.js';
export {
default as ViewportNode,
viewportCoordinate,
viewportResolution,
viewportTopLeft,
viewportBottomLeft,
viewportTopRight,
viewportBottomRight,
} from './display/ViewportNode.js';
// code
export { default as ExpressionNode } from './code/ExpressionNode.js';
export { default as CodeNode, CodeNodeInclude } from './code/CodeNode.js';
export { default as FunctionCallNode } from './code/FunctionCallNode.js';
export { default as FunctionNode, FunctionNodeArguments } from './code/FunctionNode.js';
export { default as ExpressionNode, expression } from './code/ExpressionNode.js';
export { default as CodeNode, code, CodeNodeInclude } from './code/CodeNode.js';
export { default as FunctionCallNode, call } from './code/FunctionCallNode.js';
export { default as FunctionNode, func, fn, FunctionNodeArguments, Fn } from './code/FunctionNode.js';
// fog
export { default as FogNode } from './fog/FogNode.js';
export { default as FogRangeNode } from './fog/FogRangeNode.js';
export { default as FogExp2Node } from './fog/FogExp2Node.js';
export { default as FogNode, fog } from './fog/FogNode.js';
export { default as FogRangeNode, rangeFog } from './fog/FogRangeNode.js';
export { default as FogExp2Node, densityFog } from './fog/FogExp2Node.js';
// geometry
export { default as RangeNode, RangeModeBound } from './geometry/RangeNode.js';
export { default as RangeNode, range, RangeModeBound } from './geometry/RangeNode.js';
// gpgpu
export { default as ComputeNode } from './gpgpu/ComputeNode.js';
export { default as ComputeNode, compute } from './gpgpu/ComputeNode.js';

@@ -119,5 +297,5 @@ // lighting

export { default as SpotLightNode } from './lighting/SpotLightNode.js';
export { default as LightsNode } from './lighting/LightsNode.js';
export { default as LightsNode, lights } from './lighting/LightsNode.js';
export { default as LightingNode } from './lighting/LightingNode.js';
export { default as LightingContextNode, LightingModelNode } from './lighting/LightingContextNode.js';
export { default as LightingContextNode, lightingContext, LightingModelNode } from './lighting/LightingContextNode.js';
export { default as HemisphereLightNode } from './lighting/HemisphereLightNode.js';

@@ -129,3 +307,3 @@ export { default as EnvironmentNode } from './lighting/EnvironmentNode.js';

// procedural
export { default as CheckerNode } from './procedural/CheckerNode.js';
export { default as CheckerNode, checker } from './procedural/CheckerNode.js';

@@ -132,0 +310,0 @@ // loaders

import TempNode from '../core/TempNode.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -7,1 +8,3 @@ export default class CheckerNode extends TempNode {

}
export const checker: (uvNode?: NodeRepresentation) => ShaderNodeObject<CheckerNode>;

@@ -1,10 +0,23 @@

import { ConstNode, Node, NodeBuilder, NodeTypeOption, SwizzleOption } from '../Nodes.js';
// lot of private typescript magic here
export {};
import Node from '../core/Node.js';
import { NodeTypeOption, SwizzleOption } from '../core/constants.js';
import ConstNode from '../core/ConstNode.js';
import NodeBuilder from '../core/NodeBuilder.js';
import SplitNode from '../utils/SplitNode.js';
export interface NodeElements {}
export function addNodeElement(name: string, nodeElement: unknown): void;
export type Swizzable<T extends Node = Node> = T & {
[key in SwizzleOption | number]: Swizzable;
[key in SwizzleOption | number]: ShaderNodeObject<SplitNode>;
};
export type ShaderNodeObject<T extends Node> = T & {
[Key in keyof NodeElements]: NodeElements[Key] extends (node: T, ...args: infer Args) => infer R
? (...args: Args) => R
: never;
} & Swizzable<T>;
/** anything that can be passed to {@link nodeObject} and returns a proxy */
export type NodeRepresentation<T extends Node = Node> = number | boolean | Node | Swizzable<T>;
export type NodeRepresentation<T extends Node = Node> = number | boolean | Node | ShaderNodeObject<T>;

@@ -14,6 +27,10 @@ /** anything that can be passed to {@link nodeObject} */

// same logic as in ShaderNodeObject: number,boolean,node->swizzable, otherwise do nothing
export type NodeObject<T> = T extends Node ? Swizzable<T> : T extends number | boolean ? Swizzable<ConstNode> : T;
// same logic as in ShaderNodeObject: number,boolean,node->ShaderNodeObject, otherwise do nothing
export type NodeObject<T> = T extends Node
? ShaderNodeObject<T>
: T extends number | boolean
? ShaderNodeObject<ConstNode<number | boolean>>
: T;
// opposite of NodeObject: node -> node|swizzable|boolean|number, otherwise do nothing
// opposite of NodeObject: node -> node|ShaderNodeObject|boolean|number, otherwise do nothing
type Proxied<T> = T extends Node ? NodeRepresentation<T> : T;

@@ -106,8 +123,4 @@ // https://github.com/microsoft/TypeScript/issues/42435#issuecomment-765557874

export type ConvertType = (...params: unknown[]) => Swizzable;
export type ConvertType = (...params: unknown[]) => ShaderNodeObject<Node>;
export const ConvertType: {
new (type: NodeTypeOption, cacheMap?: Map<unknown, ConstNode>): ConvertType;
};
type NodeArray<T extends NodeObjectOption[]> = { [index in keyof T]: NodeObject<T[index]> };

@@ -119,3 +132,12 @@ type NodeObjects<T> = { [key in keyof T]: T[key] extends NodeObjectOption ? NodeObject<T[key]> : T[key] };

export function getConstNodeType(value: NodeOrType): NodeTypeOption | null;
export const getConstNodeType: (value: NodeOrType) => NodeTypeOption | null;
export class ShaderNode<T = {}, R extends Node = Node> {
constructor(jsFunc: (inputs: NodeObjects<T>, builder: NodeBuilder) => NodeRepresentation);
call: (
inputs: { [key in keyof T]: T[key] extends NodeRepresentation ? ShaderNodeObject<Node> | Node : T[key] },
builder?: NodeBuilder,
) => ShaderNodeObject<R>;
}
export function nodeObject<T extends NodeObjectOption>(obj: T): NodeObject<T>;

@@ -128,3 +150,3 @@ export function nodeObjects<T>(obj: T): NodeObjects<T>;

nodeClass: T,
): (...params: ProxiedTuple<GetConstructors<T>>) => Swizzable<ConstructedNode<T>>;
): (...params: ProxiedTuple<GetConstructors<T>>) => ShaderNodeObject<ConstructedNode<T>>;

@@ -134,3 +156,3 @@ export function nodeProxy<T, S extends GetPossibleScopes<T>>(

scope: S,
): (...params: ProxiedTuple<RemoveTail<GetConstructorsByScope<T, S>>>) => Swizzable<ConstructedNode<T>>;
): (...params: ProxiedTuple<RemoveTail<GetConstructorsByScope<T, S>>>) => ShaderNodeObject<ConstructedNode<T>>;

@@ -141,3 +163,3 @@ export function nodeProxy<T, S extends GetPossibleScopes<T>>(

factor: NodeObjectOption,
): (...params: ProxiedTuple<RemoveHeadAndTail<GetConstructorsByScope<T, S>>>) => Swizzable<ConstructedNode<T>>;
): (...params: ProxiedTuple<RemoveHeadAndTail<GetConstructorsByScope<T, S>>>) => ShaderNodeObject<ConstructedNode<T>>;

@@ -147,17 +169,37 @@ export function nodeImmutable<T>(

...params: ProxiedTuple<GetConstructors<T>>
): Swizzable<ConstructedNode<T>>;
): ShaderNodeObject<ConstructedNode<T>>;
export class ShaderNode<T = {}, R extends Node = Node> {
constructor(jsFunc: (inputs: NodeObjects<T>, builder: NodeBuilder) => NodeRepresentation);
call: (
inputs: { [key in keyof T]: T[key] extends NodeRepresentation ? Swizzable | Node : T[key] },
builder?: NodeBuilder,
) => Swizzable<R>;
}
export const color: ConvertType;
export const cacheMaps: {
bool: Map<boolean, ConstNode>;
uint: Map<number, ConstNode>;
int: Map<number, ConstNode>;
float: Map<number, ConstNode>;
};
export const float: ConvertType;
export const int: ConvertType;
export const uint: ConvertType;
export const bool: ConvertType;
export const vec2: ConvertType;
export const ivec2: ConvertType;
export const uvec2: ConvertType;
export const bvec2: ConvertType;
export const vec3: ConvertType;
export const ivec3: ConvertType;
export const uvec3: ConvertType;
export const bvec3: ConvertType;
export const vec4: ConvertType;
export const ivec4: ConvertType;
export const uvec4: ConvertType;
export const bvec4: ConvertType;
export const mat3: ConvertType;
export const imat3: ConvertType;
export const umat3: ConvertType;
export const bmat3: ConvertType;
export const mat4: ConvertType;
export const imat4: ConvertType;
export const umat4: ConvertType;
export const bmat4: ConvertType;
export const element: (node: NodeRepresentation, indexNode: NodeRepresentation) => ShaderNodeObject<Node>;
export const convert: (node: NodeRepresentation, types: NodeTypeOption) => ShaderNodeObject<Node>;
import { PositionNode, TempNode } from '../Nodes.js';
import { Swizzable } from '../shadernode/ShaderNodeElements.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
export default class EquirectUVNode extends TempNode {
constructor(dirNode?: Swizzable<PositionNode>);
constructor(dirNode?: ShaderNodeObject<PositionNode>);
}
export const equirectUV: ShaderNodeObject<EquirectUVNode>;
import TempNode from '../core/TempNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -6,1 +7,3 @@ export default class MatcapUVNode extends TempNode {

}
export const matcapUV: ShaderNodeObject<MatcapUVNode>;

@@ -0,6 +1,7 @@

import { Texture } from '../../../../src/Three.js';
import UniformNode from '../core/UniformNode.js';
import { Texture } from '../../../../src/Three.js';
import { TextureNode } from '../Nodes.js';
import TextureNode from '../accessors/TextureNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
export default class MaxMipLevelNode extends UniformNode {
export default class MaxMipLevelNode extends UniformNode<0> {
textureNode: TextureNode;

@@ -12,1 +13,3 @@

}
export const maxMipLevel: (texture: Texture) => ShaderNodeObject<MaxMipLevelNode>;
import Node from '../core/Node.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -20,1 +21,6 @@ export type OscNodeMethod =

}
export const oscSine: (timeNode?: NodeRepresentation) => ShaderNodeObject<OscNode>;
export const oscSquare: (timeNode?: NodeRepresentation) => ShaderNodeObject<OscNode>;
export const oscTriangle: (timeNode?: NodeRepresentation) => ShaderNodeObject<OscNode>;
export const oscSawtooth: (timeNode?: NodeRepresentation) => ShaderNodeObject<OscNode>;
import Node from '../core/Node.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -14,1 +15,4 @@ export default class RemapNode extends Node {

}
export const remap: (node: Node, inLowNode: Node) => ShaderNodeObject<RemapNode>;
export const remapClamp: (node: Node, inLowNode: Node) => ShaderNodeObject<RemapNode>;
import TempNode from '../core/TempNode.js';
import Node from '../core/Node.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -11,1 +12,3 @@ export default class RotateUVNode extends TempNode {

}
export const rotateUV: (uvNode: Node, rotationNode: Node, centerNode?: Node) => ShaderNodeObject<RotateUVNode>;

@@ -1,2 +0,4 @@

import { Node, TextureNode } from '../Nodes.js';
import Node from '../core/Node.js';
import TextureNode from '../accessors/TextureNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -9,1 +11,3 @@ export default class SpecularMIPLevelNode extends Node {

}
export const specularMIPLevel: () => ShaderNodeObject<SpecularMIPLevelNode>;
import Node from '../core/Node.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -10,1 +11,7 @@ export default class SpriteSheetUVNode extends Node {

}
export const spritesheetUV: (
countNode: NodeRepresentation,
uvNode?: NodeRepresentation,
frameNode?: NodeRepresentation,
) => ShaderNodeObject<SpriteSheetUVNode>;
import UniformNode from '../core/UniformNode.js';
import { ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -9,3 +10,3 @@ export type TimerNodeScope =

export default class TimerNode extends UniformNode {
export default class TimerNode extends UniformNode<number> {
static LOCAL: 'local';

@@ -21,1 +22,6 @@ static GLOBAL: 'global';

}
export const timerLocal: (timeScale?: number, value?: number) => ShaderNodeObject<TimerNode>;
export const timerGlobal: (timeScale?: number, value?: number) => ShaderNodeObject<TimerNode>;
export const timerDelta: (timeScale?: number, value?: number) => ShaderNodeObject<TimerNode>;
export const frameId: ShaderNodeObject<TimerNode>;
import Node from '../core/Node.js';
import { PositionNode, Swizzable, TextureNode } from '../Nodes.js';
import PositionNode from '../accessors/PositionNode.js';
import TextureNode from '../accessors/TextureNode.js';
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';

@@ -9,6 +11,6 @@ export default class TriplanarTexturesNode extends Node {

scaleNode: Swizzable;
scaleNode: ShaderNodeObject<Node>;
positionNode: Swizzable<PositionNode>;
normalNode: Swizzable<PositionNode>;
positionNode: ShaderNodeObject<PositionNode>;
normalNode: ShaderNodeObject<PositionNode>;

@@ -19,6 +21,19 @@ constructor(

textureZNode?: TextureNode | null,
scaleNode?: Swizzable,
positionNode?: Swizzable<PositionNode>,
normalNode?: Swizzable<PositionNode>,
scaleNode?: ShaderNodeObject<Node>,
positionNode?: ShaderNodeObject<PositionNode>,
normalNode?: ShaderNodeObject<PositionNode>,
);
}
export const triplanarTextures: (
textureXNode: NodeRepresentation,
textureYNode?: NodeRepresentation,
textureZNode?: NodeRepresentation,
scaleNode?: NodeRepresentation,
positionNode?: NodeRepresentation,
normalNode?: NodeRepresentation,
) => ShaderNodeObject<TriplanarTexturesNode>;
export const triplanarTexture: (
texture: NodeRepresentation,
...params: NodeRepresentation[]
) => ShaderNodeObject<TriplanarTexturesNode>;

@@ -28,2 +28,2 @@ import { IUniform, Matrix4, Vector2 } from '../../../src/Three.js';

export function generatePdSamplePointInitializer(samples: number, rings: number): string;
export function generatePdSamplePointInitializer(samples: number, rings: number, radiusExponent: number): string;
{
"name": "@types/three",
"version": "0.159.0",
"version": "0.160.0",
"description": "TypeScript definitions for three",

@@ -47,4 +47,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",

},
"typesPublisherContentHash": "00146f19c0acfa1923520aa89574fd3c011b0b97251b16d57b2bc5999534c2c9",
"typesPublisherContentHash": "7de688c4d074af1d79f7696d827bdd1236ff9e159d0b343b35e0b152202c544e",
"typeScriptVersion": "4.6"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Thu, 30 Nov 2023 20:07:36 GMT
* Last updated: Fri, 22 Dec 2023 23:06:49 GMT
* Dependencies: [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/webxr](https://npmjs.com/package/@types/webxr), [fflate](https://npmjs.com/package/fflate), [meshoptimizer](https://npmjs.com/package/meshoptimizer)

@@ -14,0 +14,0 @@

@@ -143,2 +143,3 @@ export const REVISION: string;

export const CustomToneMapping: 5;
export const AgXToneMapping: 6;
export type ToneMapping =

@@ -150,3 +151,4 @@ | typeof NoToneMapping

| typeof ACESFilmicToneMapping
| typeof CustomToneMapping;
| typeof CustomToneMapping
| typeof AgXToneMapping;

@@ -153,0 +155,0 @@ // Bind modes

@@ -18,7 +18,7 @@ import { EventDispatcher } from './EventDispatcher.js';

uniforms: Uniform[];
uniforms: Array<Uniform | Uniform[]>;
add(uniform: Uniform): this;
add(uniform: Uniform | Uniform[]): this;
remove(uniform: Uniform): this;
remove(uniform: Uniform | Uniform[]): this;

@@ -25,0 +25,0 @@ setName(name: string): this;

@@ -33,2 +33,9 @@ import { ColorRepresentation } from '../math/Color.js';

/**
* Read-only flag to check if a given object is of type {@link PointLight}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isPointLight: true;
/**
* @default 'PointLight'

@@ -35,0 +42,0 @@ */

@@ -7,4 +7,2 @@ import { Loader } from './Loader.js';

export class MaterialLoader extends Loader<Material> {
constructor(manager?: LoadingManager);
/**

@@ -15,4 +13,9 @@ * @default {}

constructor(manager?: LoadingManager);
parse(json: unknown): Material;
setTextures(textures: { [key: string]: Texture }): this;
parse(json: unknown): Material;
static createMaterialFromType(type: string): Material;
}

@@ -17,2 +17,9 @@ import { Color, ColorRepresentation } from '../math/Color.js';

/**
* Read-only flag to check if a given object is of type {@link LineBasicMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isLineBasicMaterial: true;
/**
* @default 'LineBasicMaterial'

@@ -19,0 +26,0 @@ */

@@ -13,2 +13,9 @@ import { LineBasicMaterial, LineBasicMaterialParameters } from './LineBasicMaterial.js';

/**
* Read-only flag to check if a given object is of type {@link LineDashedMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isLineDashedMaterial: true;
/**
* @default 'LineDashedMaterial'

@@ -32,5 +39,4 @@ */

gapSize: number;
readonly isLineDashedMaterial: true;
setValues(parameters: LineDashedMaterialParameters): void;
}
import { Plane } from '../math/Plane.js';
import { EventDispatcher } from '../core/EventDispatcher.js';
import { WebGLProgramParametersWithUniforms } from '../renderers/webgl/WebGLPrograms.js';
import { WebGLRenderer } from '../renderers/WebGLRenderer.js';
import { Shader } from '../renderers/shaders/ShaderLib.js';
import {

@@ -73,2 +73,9 @@ BlendingDstFactor,

/**
* Read-only flag to check if a given object is of type {@link Material}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isMaterial: true;
/**
* Enables alpha hashed transparency, an alternative to {@link .transparent} or {@link .alphaTest}. The material

@@ -261,8 +268,2 @@ * will not be rendered if opacity is lower than a random threshold. Randomization introduces some grain or noise,

/**
* Used to check whether this or derived classes are materials. Default is true.
* You should not change this, as it used internally for optimisation.
*/
readonly isMaterial: true;
/**
* Material name. Default is an empty string.

@@ -343,4 +344,4 @@ * @default ''

/**
* Defines whether this material is tone mapped according to the renderer's toneMapping setting.
* Default is true.
* Defines whether this material is tone mapped according to the renderer's
* {@link WebGLRenderer.toneMapping toneMapping} setting. It is ignored when rendering to a render target.
* @default true

@@ -353,3 +354,2 @@ */

* When set to true, the extent to which the material is transparent is controlled by setting it's .opacity property.
* Default is false.
* @default false

@@ -412,8 +412,8 @@ */

* An optional callback that is executed immediately before the shader program is compiled.
* This function is called with the shader source code as a parameter.
* This function is called with the associated WebGL program parameters and renderer.
* Useful for the modification of built-in materials.
* @param shader Source code of the shader
* @param renderer WebGLRenderer Context that is initializing the material
* @param parameters WebGL program parameters
* @param renderer WebGLRenderer context that is initializing the material
*/
onBeforeCompile(shader: Shader, renderer: WebGLRenderer): void;
onBeforeCompile(parameters: WebGLProgramParametersWithUniforms, renderer: WebGLRenderer): void;

@@ -420,0 +420,0 @@ /**

@@ -33,2 +33,9 @@ import { Color, ColorRepresentation } from '../math/Color.js';

/**
* Read-only flag to check if a given object is of type {@link MeshBasicMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isMeshBasicMaterial: true;
/**
* @default 'MeshBasicMaterial'

@@ -35,0 +42,0 @@ */

@@ -18,2 +18,8 @@ import { DepthPackingStrategies } from '../constants.js';

constructor(parameters?: MeshDepthMaterialParameters);
/**
* Read-only flag to check if a given object is of type {@link MeshDepthMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isMeshDepthMaterial: true;

@@ -20,0 +26,0 @@ /**

@@ -20,2 +20,9 @@ import { MaterialParameters, Material } from './Material.js';

/**
* Read-only flag to check if a given object is of type {@link MeshDistanceMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isMeshDistanceMaterial: true;
/**
* @default 'MeshDistanceMaterial'

@@ -22,0 +29,0 @@ */

@@ -42,2 +42,9 @@ import { Color, ColorRepresentation } from '../math/Color.js';

/**
* Read-only flag to check if a given object is of type {@link MeshLambertMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isMeshLambertMaterial: true;
/**
* @default 'MeshLambertMaterial'

@@ -44,0 +51,0 @@ */

@@ -28,2 +28,9 @@ import { Color, ColorRepresentation } from '../math/Color.js';

/**
* Read-only flag to check if a given object is of type {@link MeshMatcapMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isMeshMatcapMaterial: true;
/**
* @default 'MeshMatcapMaterial'

@@ -30,0 +37,0 @@ */

@@ -25,2 +25,9 @@ import { MaterialParameters, Material } from './Material.js';

/**
* Read-only flag to check if a given object is of type {@link MeshNormalMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isMeshNormalMaterial: true;
/**
* @default 'MeshNormalMaterial'

@@ -27,0 +34,0 @@ */

@@ -47,2 +47,9 @@ import { Color, ColorRepresentation } from '../math/Color.js';

/**
* Read-only flag to check if a given object is of type {@link MeshPhongMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isMeshPhongMaterial: true;
/**
* @default 'MeshNormalMaterial'

@@ -49,0 +56,0 @@ */

@@ -51,3 +51,8 @@ import { Texture } from '../textures/Texture.js';

isMeshPhysicalMaterial: boolean;
/**
* Read-only flag to check if a given object is of type {@link MeshPhysicalMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isMeshPhysicalMaterial: true;

@@ -54,0 +59,0 @@ /**

@@ -42,2 +42,9 @@ import { Color, ColorRepresentation } from '../math/Color.js';

/**
* Read-only flag to check if a given object is of type {@link MeshStandardMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isMeshStandardMaterial: true;
/**
* @default 'MeshStandardMaterial'

@@ -204,5 +211,3 @@ */

isMeshStandardMaterial: boolean;
setValues(parameters: MeshStandardMaterialParameters): void;
}

@@ -40,2 +40,9 @@ import { Color, ColorRepresentation } from '../math/Color.js';

/**
* Read-only flag to check if a given object is of type {@link MeshToonMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isMeshToonMaterial: true;
/**
* @default 'MeshToonMaterial'

@@ -42,0 +49,0 @@ */

@@ -18,2 +18,9 @@ import { Material, MaterialParameters } from './Material.js';

/**
* Read-only flag to check if a given object is of type {@link PointsMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isPointsMaterial: true;
/**
* @default 'PointsMaterial'

@@ -20,0 +27,0 @@ */

@@ -5,2 +5,11 @@ import { ShaderMaterialParameters, ShaderMaterial } from './ShaderMaterial.js';

constructor(parameters?: ShaderMaterialParameters);
/**
* Read-only flag to check if a given object is of type {@link RawShaderMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isRawShaderMaterial: true;
override readonly type: 'RawShaderMaterial';
}

@@ -32,2 +32,9 @@ import { IUniform } from '../renderers/shaders/UniformsLib.js';

/**
* Read-only flag to check if a given object is of type {@link ShaderMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isShaderMaterial: true;
/**
* @default 'ShaderMaterial'

@@ -89,3 +96,3 @@ */

/**
* @default { derivatives: false, fragDepth: false, drawBuffers: false, shaderTextureLOD: false }
* @default { derivatives: false, fragDepth: false, drawBuffers: false, shaderTextureLOD: false, clipCullDistance: false }
*/

@@ -97,2 +104,3 @@ extensions: {

shaderTextureLOD: boolean;
clipCullDistance: boolean;
};

@@ -120,6 +128,4 @@

isShaderMaterial: boolean;
setValues(parameters: ShaderMaterialParameters): void;
toJSON(meta: any): any;
}

@@ -13,2 +13,9 @@ import { Color, ColorRepresentation } from '../math/Color.js';

/**
* Read-only flag to check if a given object is of type {@link ShadowMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isShadowMaterial: true;
/**
* @default 'ShadowMaterial'

@@ -15,0 +22,0 @@ */

@@ -17,2 +17,9 @@ import { Color, ColorRepresentation } from '../math/Color.js';

/**
* Read-only flag to check if a given object is of type {@link SpriteMaterial}.
* @remarks This is a _constant_ value
* @defaultValue `true`
*/
readonly isSpriteMaterial: true;
/**
* @default 'SpriteMaterial'

@@ -58,6 +65,4 @@ */

readonly isSpriteMaterial: true;
setValues(parameters: SpriteMaterialParameters): void;
copy(source: SpriteMaterial): this;
}

@@ -97,3 +97,3 @@ import { Vector3 } from './Vector3.js';

n44: number,
): Matrix4;
): this;

@@ -103,8 +103,8 @@ /**

*/
identity(): Matrix4;
identity(): this;
clone(): Matrix4;
copy(m: Matrix4): this;
copyPosition(m: Matrix4): Matrix4;
extractBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): Matrix4;
makeBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): Matrix4;
copyPosition(m: Matrix4): this;
extractBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): this;
makeBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): this;

@@ -114,9 +114,9 @@ /**

*/
extractRotation(m: Matrix4): Matrix4;
makeRotationFromEuler(euler: Euler): Matrix4;
makeRotationFromQuaternion(q: Quaternion): Matrix4;
extractRotation(m: Matrix4): this;
makeRotationFromEuler(euler: Euler): this;
makeRotationFromQuaternion(q: Quaternion): this;
/**
* Constructs a rotation matrix, looking from eye towards center with defined up vector.
*/
lookAt(eye: Vector3, target: Vector3, up: Vector3): Matrix4;
lookAt(eye: Vector3, target: Vector3, up: Vector3): this;

@@ -126,5 +126,5 @@ /**

*/
multiply(m: Matrix4): Matrix4;
multiply(m: Matrix4): this;
premultiply(m: Matrix4): Matrix4;
premultiply(m: Matrix4): this;

@@ -134,3 +134,3 @@ /**

*/
multiplyMatrices(a: Matrix4, b: Matrix4): Matrix4;
multiplyMatrices(a: Matrix4, b: Matrix4): this;

@@ -148,3 +148,3 @@ /**

*/
multiplyScalar(s: number): Matrix4;
multiplyScalar(s: number): this;

@@ -160,3 +160,3 @@ /**

*/
transpose(): Matrix4;
transpose(): this;

@@ -166,4 +166,4 @@ /**

*/
setPosition(v: Vector3): Matrix4;
setPosition(x: number, y: number, z: number): Matrix4;
setPosition(v: Vector3): this;
setPosition(x: number, y: number, z: number): this;

@@ -173,3 +173,3 @@ /**

*/
invert(): Matrix4;
invert(): this;

@@ -179,3 +179,3 @@ /**

*/
scale(v: Vector3): Matrix4;
scale(v: Vector3): this;

@@ -194,3 +194,3 @@ getMaxScaleOnAxis(): number;

*/
makeRotationX(theta: number): Matrix4;
makeRotationX(theta: number): this;

@@ -202,3 +202,3 @@ /**

*/
makeRotationY(theta: number): Matrix4;
makeRotationY(theta: number): this;

@@ -210,3 +210,3 @@ /**

*/
makeRotationZ(theta: number): Matrix4;
makeRotationZ(theta: number): this;

@@ -220,3 +220,3 @@ /**

*/
makeRotationAxis(axis: Vector3, angle: number): Matrix4;
makeRotationAxis(axis: Vector3, angle: number): this;

@@ -226,3 +226,3 @@ /**

*/
makeScale(x: number, y: number, z: number): Matrix4;
makeScale(x: number, y: number, z: number): this;

@@ -232,3 +232,3 @@ /**

*/
makeShear(xy: number, xz: number, yx: number, yz: number, zx: number, zy: number): Matrix4;
makeShear(xy: number, xz: number, yx: number, yz: number, zx: number, zy: number): this;

@@ -238,3 +238,3 @@ /**

*/
compose(translation: Vector3, rotation: Quaternion, scale: Vector3): Matrix4;
compose(translation: Vector3, rotation: Quaternion, scale: Vector3): this;

@@ -244,3 +244,3 @@ /**

*/
decompose(translation: Vector3, rotation: Quaternion, scale: Vector3): Matrix4;
decompose(translation: Vector3, rotation: Quaternion, scale: Vector3): this;

@@ -258,3 +258,3 @@ /**

coordinateSystem?: CoordinateSystem,
): Matrix4;
): this;

@@ -272,3 +272,3 @@ /**

coordinateSystem?: CoordinateSystem,
): Matrix4;
): this;
equals(matrix: Matrix4): boolean;

@@ -281,3 +281,3 @@

*/
fromArray(array: number[] | ArrayLike<number>, offset?: number): Matrix4;
fromArray(array: number[] | ArrayLike<number>, offset?: number): this;

@@ -304,3 +304,3 @@ /**

*/
setFromMatrix3(m: Matrix3): Matrix4;
setFromMatrix3(m: Matrix3): this;

@@ -307,0 +307,0 @@ /**

@@ -10,2 +10,7 @@ import { Vector3 } from './Vector3.js';

/**
* Read-only flag to check if a given object is of type {@link Sphere}.
*/
readonly isSphere: true;
/**
* @default new Vector3()

@@ -12,0 +17,0 @@ */

@@ -42,3 +42,3 @@ import { Vector2 } from './Vector2.js';

getPlane(target: Plane): Plane;
getBarycoord(point: Vector3, target: Vector3): Vector3;
getBarycoord(point: Vector3, target: Vector3): Vector3 | null;
/**

@@ -48,5 +48,5 @@ * @deprecated Triangle.getUV() has been renamed to Triangle.getInterpolation().

getUV(point: Vector3, uv1: Vector2, uv2: Vector2, uv3: Vector2, target: Vector2): Vector2;
getInterpolation(point: Vector3, v1: Vector2, v2: Vector2, v3: Vector2, target: Vector2): Vector2;
getInterpolation(point: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, target: Vector3): Vector3;
getInterpolation(point: Vector3, v1: Vector4, v2: Vector4, v3: Vector4, target: Vector4): Vector4;
getInterpolation(point: Vector3, v1: Vector2, v2: Vector2, v3: Vector2, target: Vector2): Vector2 | null;
getInterpolation(point: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, target: Vector3): Vector3 | null;
getInterpolation(point: Vector3, v1: Vector4, v2: Vector4, v3: Vector4, target: Vector4): Vector4 | null;
containsPoint(point: Vector3): boolean;

@@ -59,3 +59,3 @@ intersectsBox(box: Box3): boolean;

static getNormal(a: Vector3, b: Vector3, c: Vector3, target: Vector3): Vector3;
static getBarycoord(point: Vector3, a: Vector3, b: Vector3, c: Vector3, target: Vector3): Vector3;
static getBarycoord(point: Vector3, a: Vector3, b: Vector3, c: Vector3, target: Vector3): Vector3 | null;
static containsPoint(point: Vector3, a: Vector3, b: Vector3, c: Vector3): boolean;

@@ -84,3 +84,3 @@ /**

target: Vector2,
): Vector2;
): Vector2 | null;
static getInterpolation(

@@ -95,3 +95,3 @@ point: Vector3,

target: Vector3,
): Vector3;
): Vector3 | null;
static getInterpolation(

@@ -106,4 +106,4 @@ point: Vector3,

target: Vector4,
): Vector4;
): Vector4 | null;
static isFrontFacing(a: Vector3, b: Vector3, c: Vector3, direction: Vector3): boolean;
}

@@ -14,4 +14,3 @@ import { Material } from '../materials/Material.js';

* @remarks
* {@link SkinnedMesh} can only be used with WebGL 2 or
* With WebGL 1 `OES_texture_float` and vertex textures support is required.
* {@link SkinnedMesh} can only be used with WebGL 2.
* @example

@@ -18,0 +17,0 @@ * ```typescript

import { IUniform } from './UniformsLib.js';
export interface Shader {
export interface ShaderLibShader {
uniforms: { [uniform: string]: IUniform };

@@ -10,19 +10,19 @@ vertexShader: string;

export let ShaderLib: {
[name: string]: Shader;
basic: Shader;
lambert: Shader;
phong: Shader;
standard: Shader;
matcap: Shader;
points: Shader;
dashed: Shader;
depth: Shader;
normal: Shader;
sprite: Shader;
background: Shader;
cube: Shader;
equirect: Shader;
distanceRGBA: Shader;
shadow: Shader;
physical: Shader;
[name: string]: ShaderLibShader;
basic: ShaderLibShader;
lambert: ShaderLibShader;
phong: ShaderLibShader;
standard: ShaderLibShader;
matcap: ShaderLibShader;
points: ShaderLibShader;
dashed: ShaderLibShader;
depth: ShaderLibShader;
normal: ShaderLibShader;
sprite: ShaderLibShader;
background: ShaderLibShader;
cube: ShaderLibShader;
equirect: ShaderLibShader;
distanceRGBA: ShaderLibShader;
shadow: ShaderLibShader;
physical: ShaderLibShader;
};
import { UniformsGroup } from '../../core/UniformsGroup.js';
import { IUniform } from './UniformsLib.js';
export function cloneUniforms(uniforms_src: any): any;
export function mergeUniforms(uniforms: any): any;
export function cloneUniforms<T extends { [uniform: string]: IUniform }>(uniformsSrc: T): T;
export function mergeUniforms(uniforms: Array<{ [uniform: string]: IUniform }>): { [uniform: string]: IUniform };

@@ -6,0 +7,0 @@ export function cloneUniformsGroups(src: UniformsGroup[]): UniformsGroup[];

import { WebGLExtensions } from './WebGLExtensions.js';
import { WebGLCapabilities } from './WebGLCapabilities.js';
export class WebGLLights {
constructor(extensions: WebGLExtensions, capabilities: WebGLCapabilities);
export interface WebGLLightsState {
version: number;
state: {
version: number;
hash: {
directionalLength: number;
pointLength: number;
spotLength: number;
rectAreaLength: number;
hemiLength: number;
hash: {
directionalLength: number;
pointLength: number;
spotLength: number;
rectAreaLength: number;
hemiLength: number;
numDirectionalShadows: number;
numPointShadows: number;
numSpotShadows: number;
numSpotMaps: number;
numDirectionalShadows: number;
numPointShadows: number;
numSpotShadows: number;
numSpotMaps: number;
numLightProbes: number;
};
ambient: number[];
probe: any[];
directional: any[];
directionalShadow: any[];
directionalShadowMap: any[];
directionalShadowMatrix: any[];
spot: any[];
spotShadow: any[];
spotShadowMap: any[];
spotShadowMatrix: any[];
rectArea: any[];
point: any[];
pointShadow: any[];
pointShadowMap: any[];
pointShadowMatrix: any[];
hemi: any[];
numSpotLightShadowsWithMaps: number;
numLightProbes: number;
};
ambient: number[];
probe: any[];
directional: any[];
directionalShadow: any[];
directionalShadowMap: any[];
directionalShadowMatrix: any[];
spot: any[];
spotShadow: any[];
spotShadowMap: any[];
spotShadowMatrix: any[];
rectArea: any[];
point: any[];
pointShadow: any[];
pointShadowMap: any[];
pointShadowMatrix: any[];
hemi: any[];
numSpotLightShadowsWithMaps: number;
numLightProbes: number;
}
export class WebGLLights {
constructor(extensions: WebGLExtensions, capabilities: WebGLCapabilities);
state: WebGLLightsState;
get(light: any): any;

@@ -46,0 +48,0 @@ setup(lights: any): void;

@@ -0,11 +1,219 @@

import { Material } from '../../materials/Material.js';
import { Object3D } from '../../core/Object3D.js';
import { Light } from '../../lights/Light.js';
import { Scene } from '../../scenes/Scene.js';
import { IUniform } from '../shaders/UniformsLib.js';
import { WebGLRenderer } from '../WebGLRenderer.js';
import { WebGLProgram } from './WebGLProgram.js';
import { WebGLBindingStates } from './WebGLBindingStates.js';
import { WebGLCapabilities } from './WebGLCapabilities.js';
import { WebGLClipping } from './WebGLClipping.js';
import { WebGLCubeMaps } from './WebGLCubeMaps.js';
import { WebGLExtensions } from './WebGLExtensions.js';
import { WebGLClipping } from './WebGLClipping.js';
import { WebGLBindingStates } from './WebGLBindingStates.js';
import { Material } from '../../materials/Material.js';
import { Scene } from '../../scenes/Scene.js';
import { WebGLLightsState } from './WebGLLights.js';
import { WebGLProgram } from './WebGLProgram.js';
import {
ColorSpace,
Combine,
DepthPackingStrategies,
GLSLVersion,
Mapping,
ShadowMapType,
ToneMapping,
} from '../../constants.js';
export interface WebGLProgramParameters {
isWebGL2: boolean;
shaderID: string;
shaderType: string;
shaderName: string;
vertexShader: string;
fragmentShader: string;
defines: { [define: string]: string | number | boolean } | undefined;
customVertexShaderID: string | undefined;
customFragmentShaderID: string | undefined;
isRawShaderMaterial: boolean;
glslVersion: GLSLVersion | null | undefined;
precision: 'lowp' | 'mediump' | 'highp';
batching: boolean;
instancing: boolean;
instancingColor: boolean;
supportsVertexTextures: boolean;
outputColorSpace: ColorSpace;
map: boolean;
matcap: boolean;
envMap: boolean;
envMapMode: Mapping | false;
envMapCubeUVHeight: number | null;
aoMap: boolean;
lightMap: boolean;
bumpMap: boolean;
normalMap: boolean;
displacementMap: boolean;
emissiveMap: boolean;
normalMapObjectSpace: boolean;
normalMapTangentSpace: boolean;
metalnessMap: boolean;
roughnessMap: boolean;
anisotropy: boolean;
anisotropyMap: boolean;
clearcoat: boolean;
clearcoatMap: boolean;
clearcoatNormalMap: boolean;
clearcoatRoughnessMap: boolean;
iridescence: boolean;
iridescenceMap: boolean;
iridescenceThicknessMap: boolean;
sheen: boolean;
sheenColorMap: boolean;
sheenRoughnessMap: boolean;
specularMap: boolean;
specularColorMap: boolean;
specularIntensityMap: boolean;
transmission: boolean;
transmissionMap: boolean;
thicknessMap: boolean;
gradientMap: boolean;
opaque: boolean;
alphaMap: boolean;
alphaTest: boolean;
alphaHash: boolean;
combine: Combine | undefined;
//
mapUv: string | false;
aoMapUv: string | false;
lightMapUv: string | false;
bumpMapUv: string | false;
normalMapUv: string | false;
displacementMapUv: string | false;
emissiveMapUv: string | false;
metalnessMapUv: string | false;
roughnessMapUv: string | false;
anisotropyMapUv: string | false;
clearcoatMapUv: string | false;
clearcoatNormalMapUv: string | false;
clearcoatRoughnessMapUv: string | false;
iridescenceMapUv: string | false;
iridescenceThicknessMapUv: string | false;
sheenColorMapUv: string | false;
sheenRoughnessMapUv: string | false;
specularMapUv: string | false;
specularColorMapUv: string | false;
specularIntensityMapUv: string | false;
transmissionMapUv: string | false;
thicknessMapUv: string | false;
alphaMapUv: string | false;
//
vertexTangents: boolean;
vertexColors: boolean;
vertexAlphas: boolean;
vertexUv1s: boolean;
vertexUv2s: boolean;
vertexUv3s: boolean;
pointsUvs: boolean;
fog: boolean;
useFog: boolean;
fogExp2: boolean | null; // null is possible because of a bug: ( fog && fog.isFogExp2 )
flatShading: boolean;
sizeAttenuation: boolean;
logarithmicDepthBuffer: boolean;
skinning: boolean;
morphTargets: boolean;
morphNormals: boolean;
morphColors: boolean;
morphTargetsCount: number;
morphTextureStride: number;
numDirLights: number;
numPointLights: number;
numSpotLights: number;
numSpotLightMaps: number;
numRectAreaLights: number;
numHemiLights: number;
numDirLightShadows: number;
numPointLightShadows: number;
numSpotLightShadows: number;
numSpotLightShadowsWithMaps: number;
numLightProbes: number;
numClippingPlanes: number;
numClipIntersection: number;
dithering: boolean;
shadowMapEnabled: boolean;
shadowMapType: ShadowMapType;
toneMapping: ToneMapping;
useLegacyLights: boolean;
decodeVideoTexture: boolean;
premultipliedAlpha: boolean;
doubleSided: boolean;
flipSided: boolean;
useDepthPacking: boolean;
depthPacking: DepthPackingStrategies | 0;
index0AttributeName: string | undefined;
extensionDerivatives: boolean;
extensionFragDepth: boolean;
extensionDrawBuffers: boolean;
extensionShaderTextureLOD: boolean;
extensionClipCullDistance: boolean;
rendererExtensionFragDepth: boolean;
rendererExtensionDrawBuffers: boolean;
rendererExtensionShaderTextureLod: boolean;
rendererExtensionParallelShaderCompile: boolean;
customProgramCacheKey: string;
}
export interface WebGLProgramParametersWithUniforms extends WebGLProgramParameters {
uniforms: { [uniform: string]: IUniform };
}
export class WebGLPrograms {

@@ -23,7 +231,14 @@ constructor(

getParameters(material: Material, lights: any, shadows: object[], scene: Scene, object: any): any;
getProgramCacheKey(parameters: any): string;
getUniforms(material: Material): object;
acquireProgram(parameters: any, cacheKey: string): WebGLProgram;
getParameters(
material: Material,
lights: WebGLLightsState,
shadows: Light[],
scene: Scene,
object: Object3D,
): WebGLProgramParameters;
getProgramCacheKey(parameters: WebGLProgramParameters): string;
getUniforms(material: Material): { [uniform: string]: IUniform };
acquireProgram(parameters: WebGLProgramParametersWithUniforms, cacheKey: string): WebGLProgram;
releaseProgram(program: WebGLProgram): void;
}

@@ -226,2 +226,3 @@ /**

export * from './textures/CompressedArrayTexture.js';
export * from './textures/CompressedCubeTexture.js';
export * from './textures/DataTexture.js';

@@ -228,0 +229,0 @@ export * from './textures/CompressedTexture.js';

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc