- Home /
Blend transparency effect on objects on a certain layer with background, but not with each other
Hi there!
The problem I have is that I'm trying to figure out the best way to implement a "Hologram Layer" effect with some specific requirements:
Two sorts of object, holographic and non-holographic. Holographic objects are slightly transparent, and non-holographic objects aren't.
Holographic objects should not blend with other holographic objects - that is, they should occlude each other, as if they were rendered to a layer that was separately transparent (not independently transparent).
Near non-holographic objects should occlude holographic objects, but far ones should be seen through holographic objects.
These two images illustrate the effect I'm trying to get.
I've tried a couple of solutions so far, but have not succeeded in getting either one to work.
Transparent fragment shader, but with some kind of stenciling. I'm not that good with shaders, and as far as I know, there's not a way to stencil out fragments in terms of Z order? Please let me know if I'm wrong.
Screen space layers, with two different rendering cameras and post/screen space effects. One renders the holographic layer, and one renders everything else. However, even when set to the same depth level, the holographic camera renders everything over the top, meaning that objects that would have occluded them get rendered behind. I've then tried using depth textures to manually occlude stuff, but I think this could be too involved/waste of time.
This seems like an easy enough effect to achieve. It's been difficult to find solutions and advice online for this specific effect. Thank you in advance for the advice! - Rachel
Answer by Hellothere_1 · May 05, 2019 at 01:09 AM
By far the easiest (though depending on your preferences not the prettiest) way to do this would be a shader using dithering transparency.
Hi! That is a pretty good idea and a simple way to achieve what I'm describing - unfortunately we also want to try out some different blending modes, like additive. If I'm not able to figure out an alternative I will probably go with this though!
Your answer
Follow this Question
Related Questions
Silhouette overlay shader 0 Answers
How to write shader for hard light blend mode in unity 1 Answer
How to make make an object look like an Opaque but still have Alpha fading effect? 1 Answer
TransparencyLM - Colored Shadows 0 Answers
Unity 3d PBR shader graph: replace transparency with color 1 Answer