Webgpu nodeMaterial

open a page https://playground.babylonjs.com/#D8AK3Z#44
switch to webgpu
Replace the node material named node with the node material in the compressed package, and the console reports an error
flow.zip (575.0 KB)

It’s an error in WebGPU to not provide a resource if you use it in the shader. In your material, there’s an empty Texture block: you must provide a texture for it.

Your material in the NME:

The empty Texture block:


This node material supports webGL2 but webGPU should also support it

This only works in WebGL because of a side-effect.

There’s the same problem in WebGL: there’s no texture for the Texture block. In that case, WebGL reuses another texture used by the shader, but you shouldn’t rely on this behavior: as far as I’m concerned, this should also fail in WebGL, it’s simply a mistake to declare and use a texture in your shader and not supply the texture. I’ve seen other cases where a texture wasn’t supplied and the texture used was random, and that makes bugs hard to find…

1 Like

Thank you. I understand