This is very difficult to describe, but I feel like it should be possible to do.
Essentially, this is where I am at:
Since the Earth's material has outer normals, its own material is not displayed on the other side of the globe. However, due to the transparency of the material, I see the markers that exist on the other side of the globe.
How can I stop things from displaying through the material? The background is the skybox and is the only thing that I would like to show through the transparency.
Any help or advice is appreciated.
it's a little tricky to do this:
the only way is:
turn OFF each green skyscraper, when, it is at the "back".
Let's say your world is simply centered on 000.
In that case, if you think about it it is this simple...
If z>0f
, then you want the green skyscraper to be invisible. If it is z<0f
you want it to appear normally.
Since this is Unity you must work in an agent-like manner. So actually it's this simple. Make a script (pseudocode)
Class HideMeIfAwayFromCamera
{
Update()
{
if ( z > 0f ) renderer.enabled = true;
else renderer.enabled = false;
}
}
That's probably your simplest and best solution here. in any event, I would try that first. Let's hear how it works for you.
Consider that you may want to make the on/off point a little ahead or behind the half-way plane, try it.
Note that another approach is. You kind of need to use a cutout shader; use a different layer altogether for the skyscrapers; and use yet another layer for any skyscrapers who's base is beyond the horizon; in this way you can let it show the "tops" of any skyscrapers that are "just behind" the horizon but hide the bases. It does seem way too complicated though. I think the best result will be just turning off the rear ones, as shown above.
(Note too that it's not "physical". If the globe is transparent: you SHOULD be able to see the skyscrapers at the back. So you'd have to try some things to see what feels good.)