- Home /
Transparent Shader the Clips other Transparency
This may be a bit hard to explain, but here's a picture of what I have:
The grey/blue and yellow ships, with the larger black circles are intended to be the player's ships, and their vision merges. That works just fine, and I'm using the merge shader detailed here: http://forum.unity3d.com/threads/146173-Merge-shader
I've also included a blue "fog" so that the non-visible areas of the screen are obvious. My problem is the red vision circles of the enemies. I can hide the enemies model when they aren't visible, that's not the issue, but their vision circles, especially when they're at the edge of the player's vision, also go into the "fog" area. I'd like you to only see the portion of the enemy vision circle that overlaps the player's vision.
I've attempted to do all kinds of Zwrite options on the fog shader, hoping that it would overwrite what's below it, but anything that does work, also turns it into a solid color, and I'd still like to see the stars behind there, or other large structures that would not be affected by player vision.
Any clue as to how I can clip those red circles to the bigger grey circles of the player's vision? Is there any way to only overwrite what's the in Transparent render queue, or a specific layer?
Your answer
Follow this Question
Related Questions
shader Transparency 1 Answer
Why does the 3D Text shader show specular at certain angles? 2 Answers