3
$\begingroup$

I'm trying to get a render pass that splits all different materials into flat shaded objects (like material id in 3ds max) with anti aliasing.

The output colors aren't important. (random colors are just fine as they will be used as masks)
Render engine: cycles
NOTE: I do NOT want to use python for this.

What is the simplest way to achieve a result like this?
And...should I use seperate render layers to get the best render time? material id

$\endgroup$
1
  • $\begingroup$ I was looking for a solution to this problem from the very first day since I have switched to Blender 4 years ago. I understand the benefits of Cryptomatte and different ways of usage. But I wanted just one easy pass with material ID with every render, which I can save to PNG and use in Photoshop. In the end, I have made my own addon. If it could help anybody, please enjoy it. blendermarket.com/products/cid $\endgroup$ Commented Jan 30, 2022 at 16:46

2 Answers 2

8
$\begingroup$

You ask a question to which there is no simple answer based on your requirements:

  • no python - this limits any automation and implies a lot of work
  • with anti aliasing - this is something cycles cannot do yet on masks

The anti-aliasing issue of ID masks (first render, second without, last with):

enter image description here

The perfect solution would be to render the scene with each material being a different color emission shader of strength 1.0 - without python this is time consuming to set up. Low samples would be enough for this and you would get the exact anti-aliasing like in your final render.

Another solution is to give each material a different ID and render the MaterialID pass in ridiculously high resolution and then down-scale. The good news is you will get the pass with just 1 render sample!

In compositor you will get all the colored ID masks (but aliased) like this easily:

enter image description here

The anti-aliasing after down-scaling will not be pixel-perfect with your final render and will depend on your downscaling algorithm.

$\endgroup$
1
$\begingroup$

You can actually do exactly what Jaroslav Jerryno Novotny suggested (except normalize, just divide by your highest index there) in the material itself. Create an override material for a 2. RenderLayer, use the node setup above and you can RGB split, or put your tint colors in the material directly. That way it's anti-aliased and will actually take DoF and MB into account.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .