The design of webgpu backend and node-material

Recently I was learning webgpu in threejs, and I also learned about node materials, but I didn’t find any reference content, is there any relevant content introduction or architecture design drawing?

No, there is no documentation on this yet. But meanwhile I know a bit about it.

This is a very simple example showing how uniforms and attributes can be passed:

You have to be very careful with textures! If a shader is passed to a colorNode you can use textureSample. But if you address such a shader to a positioNode, it crashes because wgsl does not accept sampler textures in vertex shaders, which is understandable. There is nothing between the vertices in a vertex shader. Therefore, only textureLoad works for the positionNode.

It’s best if you take a look at my mini codePen example first and then we can continue chatting.