Hi,
I’m working on an environment probe system that renders 4 tetrahedral cameras to textures, then uses a compute shader to reproject them into an octahedral map.
The problem: When MSAA is enabled (samples > 1), the compute shader reads corrupted data (black squares at geometry edges), even though the textures appear correct when displayed via app.drawTexture().
Setup:
- PlayCanvas 2.13.6
- WebGPU (Chrome 131)
- Windows
Code structure:
// Create render target with MSAA
const texture = new Texture(device, { ... });
const rt = new RenderTarget({
colorBuffer: texture,
samples: 4,
depth: true
});
// Camera renders to rt...
// Later, in compute shader:
// textureSampleLevel(uTetra0, uTetra0Sampler, uv, 0.0) → black squares
Observations:
app.drawTexture(texture)in debug preview shows clean image (no artifacts)- Compute shader reading same texture via
textureSampleLevelshows black squares - With
samples: 1(no MSAA) — everything works perfectly - Delaying compute dispatch by 1-2 frames doesn’t help
rt.resolve()appears to be WebGL2-only
Question: Is there a way to read MSAA-resolved textures in a compute shader on WebGPU? Or is this a known limitation?
I’ve tried:
- Manual resolve via
drawQuadWithShaderblit (but GLSL shader doesn’t work in WebGPU) - Creating separate texture and copying data
- Various frame delays
Any guidance would be appreciated. Happy to provide a minimal repro project if helpful.
Thanks!