Hi guys, first I am sorry for my bad English, I hope you can understand what i want to say
I have a problem with the shields of my space shooter prototype.
One shield consists out of two basic spheres.
One of them is normal, one of them is reversed by code (to make the shield visible from the inside).
Both are rendered with the unity Standard Transperent shader, in blue.
To make some nice graphic effects I set Metallic to 0 and Smoothness to 1 in the shader.
The shields have a variable size, if they get damaged or load, they decrease or increase their scale by code.
I am planning to have maybe 1-100 shields in a normal game, which could change their size more than one time per second each.
Now my Problem:
I want two shields to connect to each other and not to overlap.
All shield surfaces, which is under another shield should be removed, to enable players under the shield to shoot through a neighbor shield, which stands very close to the other one.
I figured out two solutions:
First: Calculate a new Mesh everytime the shields change, which has the shape of the old spheres, without the inner parts. (disadvantage, the shield size can change very often β massive calculations!)
Second: Use some kind of shader or trick to not render the inner parts of the shield and check for all bulletcollisions if they are inside of a shield (then ignoring them). With this approach I would need n (number of shields) comparisons if a shield get hit, for all just check if the distance between hit and center of the shields are smaller than their radius.
I hope you understood what I want, as an attachment I got 2 screenshots, one from the outside of both shields and one from the inside of one of them. In both I have to remove the part inside of the other shield.
Is there an easy way to make such a shader, which could render just parts of the mesh and even the faces based on conditions (I am a totally beginner in shaders), or do you know another solution for my problem?
If I explained something inaccurate feel free to ask me, I am happy with all the answers ;-).
If you know some keywords to google for, I would appreciate it, because I found nothing with the same problem and a solution.