In various scenes I have areas that could be isolated using cryptomatte or material id or view layer and I want to effect that area only. With colorramp, the result applies color to the entire output rather than the isolated area. On a case by case basis, I can fiddle with the result using color key, alpha over, mix etc. and get an acceptable result. But, what I really want is a way to do this simply every time.

I tried using holdout shaders and view layers. For example, from back to front is:

  1. background
  2. torus
  3. plane
  4. sphere

So, I created view layers:

Background collection:

background + torus holdout + plane holdout + sphere holdout

Torus collection:

Torus + plane holdout + sphere holdout

Plane collection:

Plane + sphere holdout

Sphere collection:


But this didn't work. Combining them, in compositor with Mix blend mode, the result does not show the background behind semi-transparent areas of the sphere. Plane does not show the torus in transparent areas, etc.

It seems to me like such an obviously needed thing, that I'm hoping there is a formula to achieve this in compositor. Is there?

  • $\begingroup$ Please share your screens of setup or simplified file blend-exchange.com (given code paste into our Q via edit). Thank you $\endgroup$
    – vklidu
    Apr 22 '21 at 8:09
  • $\begingroup$ Thanks @vklidu I uploaded a blend file that shows one of the approaches I've tried to take. If you attach the "all" render layer to a viewer, you can see what the unaltered scene looks like. The combination of other render layers, with colorramp muted shows roughly the view layers combined. Unmuted, colorramp affects the entire view. My goal is to have a repeated method to mask areas and replace them with an altered rendition. $\endgroup$
    – kswebdev
    Apr 22 '21 at 19:19

Sorry long day ... I'm not sure if I catch the point ... if your issue is lost alpha after Colorramp add Set Aplha node behind. Colorramp is black&white node only.

enter image description here

  • $\begingroup$ Thanks @vklidu That almost works. It fixes the issue with the colorramp extending outside of the render layer. But, the torus ends up with transparency where, in the "all" render layer it looks opaque (perhaps it's showing the background there). My issue is not these specific things. I am hoping to find a general method of separating areas, processing them and composing them in compositor, similarly to how someone would use layers and transparency in photoshop/gimp. $\endgroup$
    – kswebdev
    Apr 23 '21 at 2:10
  • $\begingroup$ Actually, I guess it's doing exactly what it should. So, I'll just call that the answer and try to learn how blend modes work. $\endgroup$
    – kswebdev
    Apr 23 '21 at 3:22

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.