Stencil Buffer not working in WebXR AR Image Tracking

Hey,

I tried using Stencil buffers in an WebXR AR scenario. Am I missing anything or is it just not supported right now as with particles in AR?
Here is an example project:
https://playcanvas.com/project/871331

Best
Paul

What does it look like in AR?

Is it just the particles that are the issue?

Do the particles work with stencil buffers without WebXR?

it could be related to this

we might get depth buffer without stencil

Here is a video from it in AR. The Stencil buffer does not seem to work in general (not just particles). Models will just be displayed as if there would be no stencil buffer used.

Hmm, couldn’t tell you offhand what the issue could be. Does the stencil buffer work if WebXR isn’t part of the project?

Yes, turning off webxr, the camera will render with stencil just fine in the same scene.
Seems to be the same with WebXR VR not just AR:

I amended the scene I posted before to have the model with stencil displayed before entering XR as well.

I’ve created a ticket for this in the engine: https://github.com/playcanvas/engine/issues/3917

I can’t say when if will be looked at but I’ve added it to our next bug blitz next month. If someone tackles it then, hopefully they will find a solution

1 Like

this is now likely fixed by this https://github.com/playcanvas/engine/pull/4038

3 Likes

FYI: This fix does not appear to work in the editor launcher but does when published.

Are you launching the launch tab using engine version 1.52.2+?

I thought I had, but the editor did not save the engine version between sessions. Which is a bug in of itself.

Manually editing the URL parameter worked fine.

It’s ‘as designed’ as it’s meant to be a temporary switcher rather than an engine selection for the project.

It is something we are considering changing though: https://github.com/playcanvas/editor/issues/659

1 Like