In my game I want to be able to see the player even when something gets in the way of the camera.
This article explains two common approaches:
1. Render the occluded player. The author says, “Here, we use the ZTest Greater syntax to specify that this material should only be drawn if it is occluded by other geometry.”
2. Dithering on camera clipped geometry. The author says, “In the shader’s vertex function, we calculate the amount of dithering applied to the object using its world space distance from the camera.
So then we can smoothly fade out the dithering the closer the camera approaches the occluding object.”
So, I’d like to try 1 and 2 to see what works better for my game. The question is how do I go about each in BJS? Is there equivalent “z test greater”? Or anything already written in BJS for handling this sort of camera occlusion case already? That’d be great, haha
Edit: ooo, this looks relevant: https://doc.babylonjs.com/api/classes/babylon.mesh#isoccluded