# The design of webgpu backend and node-material

**URL:** <https://discourse.threejs.org/t/the-design-of-webgpu-backend-and-node-material/55578>\
**Category:** Questions\
**Tags:** node-material, webgpu\
**Created:** [September 1, 2023, 2:46am UTC](https://discourse.threejs.org/t/the-design-of-webgpu-backend-and-node-material/55578 "2023-09-01T02:46:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fsafasg](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fsafasg/32/39580_2.png) [@fsafasg](https://discourse.threejs.org/u/fsafasg)\
**Post date:** [September 1, 2023, 2:46am UTC](https://discourse.threejs.org/t/the-design-of-webgpu-backend-and-node-material/55578/1 "2023-09-01T02:46:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Attila\_Schroeder](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/attila_schroeder/32/36097_2.png) [@Attila\_Schroeder](https://discourse.threejs.org/u/Attila_Schroeder)\
**Post date:** [September 1, 2023, 4:14am UTC](https://discourse.threejs.org/t/the-design-of-webgpu-backend-and-node-material/55578/2 "2023-09-01T04:14:27Z")

</div>

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:

https://codepen.io/Spiri0/embed/preview/vYQzMpL?default-tabs=js%2Cresult&height=300&host=https%3A%2F%2Fcodepen.io&slug-hash=vYQzMpL

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.
