Skip to content

Commit

Permalink
TSL: PositionNode/ReflectVectorNode - Move to TSL approach (#1000)
Browse files Browse the repository at this point in the history
* TSL: PositionNode/ReflectVectorNode - Move to TSL approach

* Remove references to PositionNode

* Add examples

* Get things to pass

* Delete examples
  • Loading branch information
Methuselah96 authored May 29, 2024
1 parent e4e1af7 commit 3fe7027
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 54 deletions.
13 changes: 2 additions & 11 deletions types/three/examples/jsm/nodes/Nodes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,9 @@ export {
objectWorldMatrix,
} from "./accessors/Object3DNode.js";
export { default as PointUVNode, pointUV } from "./accessors/PointUVNode.js";
export {
default as PositionNode,
positionGeometry,
positionLocal,
PositionNodeScope,
positionView,
positionViewDirection,
positionWorld,
positionWorldDirection,
} from "./accessors/PositionNode.js";
export * from "./accessors/PositionNode.js";
export { default as ReferenceNode, reference, referenceBuffer } from "./accessors/ReferenceNode.js";
export { default as ReflectVectorNode, reflectVector } from "./accessors/ReflectVectorNode.js";
export * from "./accessors/ReflectVectorNode.js";
export { default as RendererReferenceNode, rendererReference } from "./accessors/RendererReferenceNode.js";
export { default as SkinningNode, skinning } from "./accessors/SkinningNode.js";
export { default as StorageBufferNode, storage, storageObject } from "./accessors/StorageBufferNode.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import Node from "../core/Node.js";
import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
import PositionNode from "./PositionNode.js";

export default class ModelViewProjectionNode extends Node {
constructor(positionNode?: PositionNode);
constructor(positionNode?: Node);
}

export const modelViewProjection: (position?: NodeRepresentation) => ShaderNodeObject<ModelViewProjectionNode>;
32 changes: 6 additions & 26 deletions types/three/examples/jsm/nodes/accessors/PositionNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
import Node from "../core/Node.js";
import { ShaderNodeObject } from "../shadernode/ShaderNode.js";

export type PositionNodeScope =
| typeof PositionNode.GEOMETRY
| typeof PositionNode.LOCAL
| typeof PositionNode.WORLD
| typeof PositionNode.WORLD_DIRECTION
| typeof PositionNode.VIEW
| typeof PositionNode.VIEW_DIRECTION;

export default class PositionNode extends Node {
static GEOMETRY: "geometry";
static LOCAL: "local";
static WORLD: "world";
static WORLD_DIRECTION: "worldDirection";
static VIEW: "view";
static VIEW_DIRECTION: "viewDirection";
scope: PositionNodeScope;

constructor(scope?: 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>;
export const positionGeometry: ShaderNodeObject<Node>;
export const positionLocal: ShaderNodeObject<Node>;
export const positionWorld: ShaderNodeObject<Node>;
export const positionWorldDirection: ShaderNodeObject<Node>;
export const positionView: ShaderNodeObject<Node>;
export const positionViewDirection: ShaderNodeObject<Node>;
11 changes: 3 additions & 8 deletions types/three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import Node from "../core/Node.js";
import VarNode from "../core/VarNode.js";
import { ShaderNodeObject } from "../shadernode/ShaderNode.js";

export default class ReflectVectorNode extends Node {
constructor();

getHash(): "reflectVector";
setup(): Node;
}

export const reflectVector: ShaderNodeObject<ReflectVectorNode>;
export const reflectView: ShaderNodeObject<Node>;
export const reflectVector: ShaderNodeObject<VarNode>;
4 changes: 2 additions & 2 deletions types/three/examples/jsm/nodes/utils/EquirectUVNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PositionNode, TempNode } from "../Nodes.js";
import { Node, TempNode } from "../Nodes.js";
import { ShaderNodeObject } from "../shadernode/ShaderNode.js";

export default class EquirectUVNode extends TempNode {
constructor(dirNode?: ShaderNodeObject<PositionNode>);
constructor(dirNode?: ShaderNodeObject<Node>);
}

export const equirectUV: ShaderNodeObject<EquirectUVNode>;
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import PositionNode from "../accessors/PositionNode.js";
import TextureNode from "../accessors/TextureNode.js";
import Node from "../core/Node.js";
import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
Expand All @@ -10,16 +9,16 @@ export default class TriplanarTexturesNode extends Node {

scaleNode: ShaderNodeObject<Node>;

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

constructor(
textureXNode: Node,
textureYNode?: TextureNode | null,
textureZNode?: TextureNode | null,
scaleNode?: ShaderNodeObject<Node>,
positionNode?: ShaderNodeObject<PositionNode>,
normalNode?: ShaderNodeObject<PositionNode>,
positionNode?: ShaderNodeObject<Node>,
normalNode?: ShaderNodeObject<Node>,
);
}

Expand Down

0 comments on commit 3fe7027

Please sign in to comment.