I'm trying to make a group of foreground objects transparent as a single entity, where they occlude each other like solid objects and then have transparency applied after, instead of each individual one having its own transparency.

There is an option in the material settings called Show Backface, but that only works for single objects. Is there a way to apply this effect for a group of objects? Merging shouldn't be an option as the foreground may also contain rigged characters and such. The objects in the screenshots below are only to demonstrate what I mean.

I also thought about compositing the foreground and background together as separate layers, but then I run into a problem of the background not containing shadows of the foreground (and vice versa), or if I render foreground + background as one layer and only background as second layer, then the shadows occluded by the foreground will start fading out too. Another thing I thought about was duplicating the whole foreground and giving everything a fully transparent material to render the background with shadows, but I'd rather avoid duplicating anything.

Is something like this possible? Compositor solutions are also welcome.

Transparency of each individual objects, not what I want. Transparency of each individual objects, not what I want.

Transparency of a group as a whole, I want this. Transparency of a group as a whole, I want this.

  • $\begingroup$ I'm afraid it does come down to duplicating your objects, because you need one set of them being transparent and casting shadows, and another set to actually render. Been trying some setups, and that's the best I could do, too. Also, just curios why the top result is undesired? It looks more realistic to be honest. $\endgroup$
    – Geri
    Oct 2 at 18:17
  • $\begingroup$ It's for a scene where a character is very close to a camera and you still need to see what's behind him. The problem is, my characters are modular, being composed of various parts like body, face, hair, clothing and accessories, like in a game with deep character customization, and it just looks wrong seeing every object being transparent individually. $\endgroup$
    – Jack
    Oct 3 at 10:34
  • $\begingroup$ I see. I think the best you can do with eevee is after you deem your scene ready for rendering, duplicate your character's objects, and have one view layer where they're invisible to the camera so they're still casting shadows, and another layer where the background is disabled and your character is opaque, and comp them together. $\endgroup$
    – Geri
    Oct 3 at 11:16

Compositing Eevee

  • enable Shadow pass
  • change Cubes material setup of Alpha mode to Blend.
  • create View Layer for
    • Foreground objects
    • Background object
    • and one for all objects to composit Shadow pass

enter image description here

The trick here is Alpha Blend mode in material. Objects with Alpha Blend are not visible for Shadow pass ... technically Im not advanced in this area to explane WHY ... I dont even know if it is bug, missing feature or intended ... it just works like that. So if someone has an explanation for it - please dont hasitate to edit my answer (or create a new one).

enter image description here

It is still a mistery how this result can be helpful, but I guess that is what you asked for :)

Compositing Cycles

Under Outliner > Filter enable Holdout and Indirect Only
and use them in a way as shown on screenshots for each View Layer ...

enter image description here

enter image description here

  • $\begingroup$ Does this work with eevee though? I tried it and the Indirect Only features seems to not work with it. OP tagged eevee that's why I'm asking. $\endgroup$
    – Geri
    Oct 3 at 8:51
  • $\begingroup$ Yep, I thought about this, but sadly it doesn't work in Eeevee. Hopefully they'll make it work at least for shadows one day, like they did with holdout. $\endgroup$
    – Jack
    Oct 3 at 10:23
  • $\begingroup$ @Jack check the edit ... it should cover your Q now. $\endgroup$
    – vklidu
    Oct 3 at 13:12
  • 1
    $\begingroup$ Wow, that's a very nice trick. Thanks! Anyway, you can read what it's intended for in a comment to the OP. $\endgroup$
    – Jack
    Oct 3 at 19:52

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.