@Evgeni_Popovhttps://github.com/jeremy-coleman/OceanDemo . Not done with what I’m experimenting with so its pretty messy, but it works. just npm i npm run start. It’s using nightly build of electron, so v16 atm . I was pinning to v14 before, which is the first version of electron that added webgpu, but i found that webgpu/wgsl changes somewhat frequently for arbitrary pedantic bullshit like the name of a variable with no functionality changes , so it’d often work in electron then not in the browser any more , which is enraging. I also swapped out webpack for vite.
@mise do you know if its possible / how to enable spirv shaders in electron? Also, any thoughts on how to make it permanent , because google is gonna take it out / already has. I really really dont want to deal with wgsl shit for the next 2+ years. The glslang wasm compiler isn’t really going to be effective if it compiles glsl to an ever-changing wgsl spec. Also naga is another option now.
Side note: Ofc, I dont think this is ideal for electron, but probably best for the web.
The spec of WebGPU/WGSL is not final yet, so it’s expected to have some changes, but there normally should be less and less as we are gearing to v1 release.
@mise We should not have CORS issues when including these files: are you able to setup a repro? The Playground are linking to those files and it does work as expected.
In Babylon we are currently using glslang + Tint wrapped in a WASM module to convert from glsl to spir-v (glslang) and spir-v to wgsl (Tint). We are evaluating the possibility to use Naga in a WASM module instead of glslang+Tint, mostly to have a lighter dependency (currently, glslang+Tint ASM = around 2Mbytes).
We are also adding support for native WGSL in ShaderMaterial so that you are able to use features specific to WGSL (like external textures).