A bug in XR Mode

The first one is related to alpha in custom materials, if you have an alpha different than 1.0 when you switch to XR mode everything becomes “broken”.

Sample: Babylon.js Playground


ORIGINALLY I REPORTED TWO BUGS BUT ONE WAS ON MY SIDE, I KEEP THE ISSUE AND SOLUTION FOR FUTURE READERS:

For the second one, I’m not sure if it is a bug or it is intentional, it seems that PostProcess is not used on XR mode:

Sample Babylon.js Playground

EDIT the second one was not a but it was my fault you need to add the PostProcess to each camera https://playground.babylonjs.com/#69UNHV#1
or even cleaner solution
https://playground.babylonjs.com/#69UNHV#2


Thank you in advance!

Hi @Escobar ,

i’ll look into the first issue and will let you know. thanks a lot for reporting :slight_smile:

1 Like

Took some time, sorry. Just had some time today to debug this.

If you want it to work you will need to enable alpha blending in yourshader material:

Issue with XR and alpha | Babylon.js Playground (babylonjs.com)

Otherwise it blends the background color of the canvas (try changing the background color of the canvas or the div behind the canvas to understand what I mean).