0
\$\begingroup\$

enter image description here

enter image description here

I'm trying to create a sort of "hologram" effect. So far, what I have is an additive, three-pass shader that uses ColorMask for each pass to separate the RGB channels. The problem is that doing so requires ZWrite to be off (first image) so that each pass doesn't intersect the others (second image). However, doing so means that the model geometry overlaps itself, which I don't want.

I've tried the various methods of taking depth into consideration with transparency (This, for example) but they all cause problems when trying to separate the RGB channels. Is there some way to have each pass take depth into consideration within itself, but not with the other passes?

\$\endgroup\$
0
\$\begingroup\$

You should look into Grab Pass (details here). Basically it grabs the scene before you render for pretty much this exact purpose. It's not the cheapest operation, but unless you're going crazy with it I doubt you'll have any real problems.

\$\endgroup\$
  • \$\begingroup\$ I've tried using GrabPass but can't seem to fix anything with it. It doesn't really address the depth problem, unless I'm misunderstanding or overlooking something. What I've tried is drawing the mesh with depth and alpha blending, then added the GrabPass in the frag function. This works with a single pass, but I'm using three passes to draw the mesh three times, offset from each other. The problem is that each of those passes intersect eachother, which GrabPass doesn't seem to help with. \$\endgroup\$ – IanLarson Aug 22 '18 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.