Points visibility

I want to make gui elements alpha low if element is behind camera. You can add sphere and by default it is states as behind camera. https://playground.babylonjs.com/#S0KJUA#39 , any better way to do that?

cc @carolhmj our own GUI Guru :slight_smile:

The GUI texture is drawn on top of the existing scene and doesn’t get any geometry or depth information, so you’ll have to deal with the depth information in some way, like what you are doing already. Other possibility would be to do a ray check from the camera position to the world position.

1 Like

I was attaching the gui element to the sphere (linkwithMesh), and i made the sphere diameter small and made it isVisible to false, could you please give me a playground reference?

A reference of the ray check? Mesh Picking | Babylon.js Documentation (babylonjs.com)

I tried with raycheck didn’t work. could you please make it work? in a playground?

I made it. @carolhmj

1 Like

Congrats! :smiley: