How does Babylon do: GLSL -> WebGL

Hi everyone,

I came across this:

Do you have a GLSL shader running inside a ShaderMaterial, but your engine is a WebGPUEngine? No problem. We will download a 2MB WASM compiler to transpile from GLSL to WGSL.

Is this exposed somewhere? If not, where can I find the function/workflow(?) in the repo?

Best wishes
Joe

The translation from spirV to WGSL is done by the WebGPUTintWASM class:

And the translation from GLSL to spirV is done by glsLang:

3 Likes

Thank you :slight_smile: