How to make the onBeforeCompile of the previous WebGL version compatible in the webgpu version of three.js?

In the previous version of three.js, I used WebGL rendering and modified the strings of the vertex shader and fragment shader in the onBeforeCompile callback. Now I have upgraded three.js to the latest version and I want to use the WebGPU feature. How can I make my previous code compatible?

I’m not sure if you can, the idea is to do these type of modifications via TSL I believe.

1 Like