I understand that currently a lot of shader code is shared between the WebGL renderer and the WebGPU renderer and for WebGPU it’s converted into wgsl at runtime, will those shaders be rewritten in wgsl? If so, will effects like SSAO and GI that benefit from using compute shaders take advantage of them?
Welcome aboard!
Yes, at some point we will have our shaders written in WGSL, but it’s hard to know when… It probably won’t be possible to maintain both GLSL and WGSL versions of the shaders at the same time, so we will switch to WGSL only when WebGPU is ahead of WebGL, which won’t happen in the near future…
However, nothing stop us to use compute shaders just now if there is some value to it, even if it means some features won’t be available in WebGL.
Glad to hear that!
we will switch to WGSL only when WebGPU is ahead of WebGL
Ahead of WebGPU in what regard? browser share? I doubt that will ever happen.
I find Bevy’s approach to targeting WebGL2 interesting, all shaders are written in wgsl and they use naga to output glsl and shaderdefs to gate features not available on WebGL2 (also naga_oil is pretty nice).
three.js’s tsl for their WebGPU renderer with WebGL2 fallback (including compute) also has potential.
Browser share to ensure optimal usage in the max amount of users.