I was wondering if this is possible, and in thinking about it, I’m sure it is, I’m just not a very good shader person at all.
I’m creating a Globe with 2D pins that drop on the globe at various coordinates. The pins are actual game objects that are placed at the Lat / Long with their pivots at the bottom, and they are set to billboard to my camera. When rotating the globe up and down, the pins will obviously begin to intersect with the globe mesh due to billboarding. When rotating the globe side to side, the pins need to keep on billboarding, but be culled appropriately after the globe has spun the coordinate out of view.
What I would like to see happen is the pins never get drawn intersecting the globe, but get culled when they’re supposed to when the globe is rotated accordingly. Any pointers on where to start in terms of a shader?
What I’ve tried up to this point is drawing the pins on a separate camera with a higher depth, and then either doing:
(A) Normalizing a distance value for the items to be hidden ( at the furthest distance when at the edge of vision ) and settings this value against a formula for the far clipping plane of the pin camera.
(B) Pins drawn on own camera, but have an invisible clipping plane that gets billboarded as well that triggers showing of the pins.
Neither of these solutions work predictably for all cases, where as a shader that does what I want would take into account every dynamic rotation and placement of pins. Thanks in advance.