-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
FunctionNode: Keywords support #23766
Conversation
Couldn't be these keywords be passed just as arguments to the function? |
Yeah! This was my first approach, but it didn't work, I thought it was a limitation of WGSL, but now I think it is related to |
Now it worked! 😅 |
I think that I will keep to support to |
Just describing a little more... /cc @mrdoob const getWGSLTextureSample = new Nodes.FunctionNode( `
fn getWGSLTextureSample( tex: texture_2d<f32>, tex_sampler: sampler, uv:vec2<f32> ) -> vec4<f32> {
return textureSample( tex, tex_sampler, uv ) * vec4<f32>( 0.0, 1.0, 0.0, 1.0 );
}
` );
const textureNode = new Nodes.TextureNode( texture );
material = new Nodes.MeshBasicNodeMaterial();
material.colorNode = getWGSLTextureSample.call( { tex: textureNode, tex_sampler: textureNode, uv: new Nodes.UVNode() } ); |
* add sampler * add FunctionNode.keywords * update WGSL example using keywords * improve example * update * fix WebGPUNodeBuilder.isReference()
Related issue: #23655
Description
This contribution is funded by Google via Igalia.