I want to apply an outline effect for several objects on the scene. Nope, the standard outline shader from the toon-shader package don't met my criteria. I want to create an effect like this:
To implement this effect I want to:
1) Render all my selected objects into a texture, taking the depth into attention. So if my selected object is occluded by another objects it must be displayed in my render texture, like this:
2) Render the scene.
3) Blur my render texture and then copy all non-null (null is empty scene) and non-one (1 is the object itself) to the screen to make it look like this:
So, I have the question: How can I render the separate objects to the texture, taking care about occluders (depth)? Yep, I know about
Graphics.DrawMeshNow, but I also need to take care about the depth, because without it, it will look like this:
Please help, I feel stuck.