WebGPU Post Processing

Hey! I’ve been trying to create a PostProcess shader for the WebGPU engine but I haven’t had any luck.

Any time I define the PostProcess language to be WGSL it keeps trying to grab a non-existent file in (host)/src/ShadersWGSL/postprocess.vertex.fx, completely disregarding the fragmentUrl parameter.
When I don’t do that and instead make it use the default GLSL, it finds that shader just fine but nothing is applied on-screen.

This is a playground with the default PostProcess GLSL. Right now I’m just trying to make the entire screen white.

Welcome aboard!

The post processes must be declared in the shader store:

There is a specific store for WGSL:

However, this PG won’t work because the post process vertex shader has no WGSL counter part.

This PR will make it work:

In the meantime, here’s an updated PG that has the WGSL post process vertex shader embedded:

2 Likes

That worked, thank you!

It took me a while to respond because while it worked in playground it didn’t work in my actual code. I had to visit this answer in order to get my scene to render; I was missing engine.startFrame() and engine.endFrame().