Skip to content

Commit

Permalink
WebGPURenderer: Introduced .toConst(), Const(), Var()
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 committed Jan 19, 2025
1 parent b507493 commit 7715729
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions types/three/src/Three.TSL.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export const colorSpaceToWorking: typeof TSL.colorSpaceToWorking;
export const colorToDirection: typeof TSL.colorToDirection;
export const compute: typeof TSL.compute;
export const cond: typeof TSL.cond;
export const Const: typeof TSL.Const;
export const context: typeof TSL.context;
export const convert: typeof TSL.convert;
export const convertColorSpace: typeof TSL.convertColorSpace;
Expand Down Expand Up @@ -219,6 +220,7 @@ export const lights: typeof TSL.lights;
export const linearDepth: typeof TSL.linearDepth;
export const linearToneMapping: typeof TSL.linearToneMapping;
export const localId: typeof TSL.localId;
export const globalId: typeof TSL.globalId;
export const log: typeof TSL.log;
export const log2: typeof TSL.log2;
export const logarithmicDepthToViewZ: typeof TSL.logarithmicDepthToViewZ;
Expand Down Expand Up @@ -496,6 +498,7 @@ export const uv: typeof TSL.uv;
export const uvec2: typeof TSL.uvec2;
export const uvec3: typeof TSL.uvec3;
export const uvec4: typeof TSL.uvec4;
export const Var: typeof TSL.Var;
export const varying: typeof TSL.varying;
export const varyingProperty: typeof TSL.varyingProperty;
export const vec2: typeof TSL.vec2;
Expand Down
9 changes: 8 additions & 1 deletion types/three/src/nodes/core/VarNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ export default class VarNode extends Node {

readonly isVarNode: true;

constructor(node: Node, name?: string | null);
readOnly: boolean;

constructor(node: Node, name?: string | null, readOnly?: boolean);
}

export const Var: (node: Node, name?: string | null) => ShaderNodeObject<VarNode>;

export const Const: (node: Node, name?: string | null) => ShaderNodeObject<VarNode>;

declare module "../tsl/TSLCore.js" {
interface NodeElements {
toVar: (node: NodeRepresentation, name?: string | null) => ShaderNodeObject<VarNode>;
toConst: (node: NodeRepresentation, name?: string | null) => ShaderNodeObject<VarNode>;
}
}

Expand Down
1 change: 1 addition & 0 deletions types/three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ export default ComputeBuiltinNode;

export const numWorkgroups: ShaderNodeObject<ComputeBuiltinNode>;
export const workgroupId: ShaderNodeObject<ComputeBuiltinNode>;
export const globalId: ShaderNodeObject<ComputeBuiltinNode>;
export const localId: ShaderNodeObject<ComputeBuiltinNode>;
export const subgroupSize: ShaderNodeObject<ComputeBuiltinNode>;
2 changes: 2 additions & 0 deletions types/three/src/nodes/math/MathNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ export default class MathNode extends TempNode {
bNode: Node | null;
cNode: Node | null;

readonly isMathNode: true;

constructor(method: MathNodeMethod1, aNode: Node);
constructor(method: MathNodeMethod2, aNode: Node, bNode: Node);
constructor(method: MathNodeMethod3, aNode: Node, bNode: Node, cNode: Node);
Expand Down
2 changes: 2 additions & 0 deletions types/three/src/nodes/math/OperatorNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export default class OperatorNode extends TempNode {
bNode: Node;
op: OperatorNodeOp;

readonly isOperatorNode: true;

constructor(op: OperatorNodeOp, ...params: [Node, Node, ...Node[]]);
}

Expand Down

0 comments on commit 7715729

Please sign in to comment.