Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodes: Fixes and improvements for reflector and gaussianBlur #1337

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions types/three/src/nodes/utils/ReflectorNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Camera } from "../../cameras/Camera.js";
import { Object3D } from "../../core/Object3D.js";
import { RenderTarget } from "../../core/RenderTarget.js";
import TextureNode from "../accessors/TextureNode.js";
import Node from "../core/Node.js";
import { ShaderNodeObject } from "../tsl/TSLCore.js";

export interface ReflectorNodeParameters {
Expand All @@ -11,7 +12,17 @@ export interface ReflectorNodeParameters {
bounces?: boolean | undefined;
}

export default class ReflectorNode extends TextureNode {
declare class ReflectorNode extends TextureNode {
constructor(parameters?: ReflectorNodeParameters);

get reflector(): ReflectorBaseNode;

get target(): Object3D;
}

declare class ReflectorBaseNode extends Node {
textureNode: TextureNode;

target: Object3D;
resolution: number;
generateMipmaps: boolean;
Expand All @@ -20,11 +31,13 @@ export default class ReflectorNode extends TextureNode {
virtualCameras: WeakMap<Camera, Camera>;
renderTargets: WeakMap<Camera, RenderTarget>;

constructor(parameters?: ReflectorNodeParameters);
constructor(textureNode: TextureNode, parameters?: ReflectorNodeParameters);

getVirtualCamera(camera: Camera): Camera;

getRenderTarget(camera: Camera): RenderTarget;
}

export const reflector: (parameters?: ReflectorNodeParameters) => ShaderNodeObject<ReflectorNode>;

export default ReflectorNode;
Loading