4 ms·
> The goal is just to write the GLSL shaders in JavaScript. I bet the main goal is generating both GLSL and WGSL shaders depending on the 3D backend. Usually s
by flohofwoe 2y ago
> The goal is just to write the GLSL shaders in JavaScript.
I bet the main goal is generating both GLSL and WGSL shaders depending on the 3D backend. Usually shader language transpilation is done through native libraries like SPIRVCross (C++), Tint (C++) or Naga (Rust), but those are too heavy for being included in a three.js webpage and offline compilation probably doesn't quite fit three.js' spirit (or requirements if they need to stamp out a different shader variation based on runtime parameters).