3 ms·
What do you mean? This is GLSL… a light abstraction on top of it anyway, but not a different shading language or breaking compatibility. The goal is just to wri
by dahart 2y ago
What do you mean? This is GLSL… a light abstraction on top of it anyway, but not a different shading language or breaking compatibility. The goal is just to write the GLSL shaders in JavaScript.
- pjmlp 2y agoWebGPU uses WGSL, completely different shading language, Rust inspired. Naturally ThreeJS has to now take care how to provide shaders that work across both backends.
- rahkiin 2y agoGLSL is pretty bad though. Terrible typing system, terrible inference, terrible archaic requirements. Awful annotations. Metal and HLSL are more modern. Mostly because Metal started as such and HLSL was updated. Both C++ inspired or even using clang. WGSL has a rust-like syntax but Metal-like semantics and structure.
- pjmlp 2y agoWe are all aware of the differences, that wasn't the point.
- 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).