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

ShaderNodeFn: improve DX for Layout #1493

Merged
merged 3 commits into from
Jan 31, 2025
Merged
Changes from 2 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
6 changes: 5 additions & 1 deletion types/three/src/nodes/tsl/TSLCore.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@ export function nodeImmutable<T>(
interface Layout {
name: string;
type: string;
inputs: { name: string; type: string }[];
inputs: {
name: string;
type: "bool" | "int" | "float" | "vec2" | "vec3" | "vec4";
Copy link
Contributor

@Methuselah96 Methuselah96 Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't there more possible types than this?

Copy link
Contributor Author

@linbingquan linbingquan Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't there more possible types than this?

I don't remember why I wrote that...

Maybe use the type in the NodeUtils.js -> getValueFromType method, which should be more complete

type: "bool" | "int" | "uint" | "float" | "vec2" | "vec3" | "vec4" | "mat2" | "mat3" | "mat4" | "color" | "string" | "ArrayBuffer";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just going to change it back to string for now until I have time to look into it some more.

qualifier?: "in" | "out" | "inout";
}[];
}

interface ShaderNodeFn<Args extends readonly unknown[]> {
Expand Down
Loading