Using Render Layers to Create an Object Mask

Started by penboack, August 17, 2013, 08:35:22 AM

Previous topic - Next topic

penboack

I am trying to setup a render node to produce a beauty pass and a water mask.
How do I setup the render layers to achieve this?

Matt

#1
It isn't possible to output a water mask as such at the same time as your beauty, but here's what I would do:

You'll have to do two renders, but set it up using render layers. Create two Render Layers. The first one will be a layer that just contains the water (I'll call it "Water Layer"), while the second one contains everything else ("Terrain Layer"). I'll assume that you have a Lake object and it's in the Water group in the node network. On your Water Layer's Objects tab, use the '+' to the right of "Object group 1" to assign the "Water" node group. Now look at the bottom where it says "All other objects". Change that render mode to "Holdout" and enable "Cast shadows and other rays". This will cause everything that's not in the Water group to black out and occlude the water but still be visible in reflections and GI and cast shadows on the water.

At this point you could also set up output paths and such so that you can render all your elements out (rgb, alpha, reflections etc.) or if you just want a beauty and an alpha it's pretty straightforward. Connect the Water Layer to your render node and render the image. You can save this image and its alpha channel from the Render View. (Press 'A' to view the alpha channel and then you can save the alpha channel.)

The Terrain Layer is set up in almost the same way as the Water Layer, but the render modes are reversed. As before, assign the Water group to "Object group 1", but this time change its render mode to "Holdout". You can leave "Cast shadows and other rays" enabled for the water group. For "All other objects" set the render mode to "Visible" and enable "Cast shadows and other rays".

Matt
Just because milk is white doesn't mean that clouds are made of milk.

penboack

Thanks Matt.

That's very helpful. I will try it that way.

Is there any chance of adding the ability to create masks at the same time as the beauty pass or render elements in a future update? Often, particularly when you are compositing stills in Photoshop, having masks to isolate specific objects, whilst not a perfect solution, is sufficient to get the result you want without the need to do multiple renders.

The video on compositing in Nuke (the one on the product page in the Render Elements section) was very useful, even though I'm not currently using Nuke.

Congratulation on a great release.

Matt

I don't have a specific plan to output ID passes or individual masks at the same time as a beauty pass yet.

Matt
Just because milk is white doesn't mean that clouds are made of milk.