- Home /
Question by
pusheax · Mar 03, 2020 at 04:51 PM ·
transparencyshader programming
How to create custom shader that renders opaque and transparent objects in two passes?
I wanted to create a custom shader based on standard unity shader. Basically I wanted to perform two passes. The first pass renders opaque objects. Then the second pass renders the CLOSEST transparent objects on top of opaque objects. It means that if we have transparent building then everything inside building should be left invisible (depth culled) and only walls of the building should be left visible and transparent.
Please see the screenshot: https://postimg.cc/R6HczY9k As you can see the closest building is transparent but distant buildings are visible through it. Can we achieve the same in Unity3d?
Thanks for your help
Comment