Does multiple cameras affect decals?

I made a playground here
https://playground.babylonjs.com/#L92PHY#121
to explore multiple cameras and raycasting across multiple cameras for the purposes of navigation. Haven’t implemented the navigation part, but the raycast poc is successful. What’s weird is that in my previous code, the decal code worked fine when raycasting on the ground mesh of the model. But when I added the multiple cameras, it suddenly broke. I have no idea how to remedy this. The decal texture loads into memory and everything, and gets applied to the mesh, but the decal itself doesn’t show up when clicked. Any insight would be appreciated. Thanks in advance!

This is quite a big repro :slight_smile:

Could you create a smaller repro to isolate the issue ?

like only a box or something like this ?

This will help trying to find a solution faster.

I don’t think it can really be stripped down further and have it be nicely testable. The other code sets up the multi-views. There’s just a lot of comments. This playground I believe is babylon playground originally created by @PolygonalSun.

I just added the onPointerObservable code.

I added comments to isolate the decal code and the code that I think may affect it. I’m just wondering if there’s something going on in the babylon side due to the multiviews that is causing the decal not to be rendered.

Here’s the updated playground with the code highlights.
https://playground.babylonjs.com/#L92PHY#122

Actually, a simpler playground is definitely possible to do :slight_smile: as we only need one gltf mesh and 2 camera with layers to repro. I fixed it here but it took longer it could have: https://playground.babylonjs.com/#L92PHY#127

You were not using the camera mask on the decal mesh and you material was not having the right orientation for the decal.

2 Likes

Ah I see, sorry bout that. Wasn’t sure what would affect what. Thanks for taking the time, I’ll try to cut it down more next time. And yes I see now. Thank you very much for pointing that out!

1 Like