Joshua Newman.

in 3D.

RGB masks using MR labeled shader.

This is a quick introduction to show how you can use the MR labeled render element in max 2010 to created masks for compositing with a mask on each channel (RGB) per image.

A 3D comoputer illustration of the lobby for DOS Architects Hotel Gabon.

I use this in conjunction with Slide Shaders which you can read about here to output the masks as layers within an exr file.

- Introduction.
- Selecting material map slots.
- Assigning the MR labeled Element shader.
- Adding the MR labeled element.
- Conclusion.


The labeled element shader outputs a shader tree to a render element. We’re going to combine three materials together and export them as RGB components of a image. Each channel of this image can then be used as a selection set to edit part of the final rendering in post production.

Selecting material map slots.

First, we need to add the shader to the materials we want to output.  We need to use a material slot that will export the shader but not effect our material. The slot we use is different depending on the materials characteristics.

- if the material is not refractive (ie, doesn’t have any transparency) we can use the transparency colour map slot.
- if the material is refractive, then we can use the anisotropy rotation map slot.
- if the material is refractive and anisotropic then we need to find a new slot to use!

I’m hoping that in the future we might get a ‘spare’ slot in the A&D mi material to use for this purpose.

Adding the MR labeled Element shader.

We need to group our materials into threes, one for each channel in the image (RGB).

- In the first material select the slot using the procedure above and add a MR labeled shader.
- Change the shader/ map to store (passthrough) colour to pure red.
- Name the label ‘m1′

A screengrab showing the MR labelled element settings.

- Repeat this for the next material except for the second step change the colour to pure green.
- Repeat this one more time for the third material but change the colour to pure blue.

Now the three MR labeled shaders will have the same label ‘m1′, but they will have different colours. I’ve used the new max 2010 material explorer to help illustrate.

A screengrab of the material browser showing the RGB colours applied to materials.

- make sure you have selected your render output file (this will allow max to link the output files of elements to the render output, so if you change the render output file later the elements will also update ).
- open the render dialog and add a MR labeled element on the render element tab.
- change the label of the element to the same as the MR label shader above, in this case, ‘m1′.

A screengrab of the 3Ds Max render dialog show the MR labelled render elements.

Now repeat this but with a new label name ‘m2′ and so on until you have created enough masks for your scene.

When you render images will be created for each MR labeled render element. These images will contain a different mask in each channel (RGB) of the image. These can then be used in photoshop or your favorite post production program for compositing your image.

You’re only limited by your memory as to how many elements you have . Of course, using many render elements can have a detrimental effect on your render times and the use of system memory.


This is a very handy way of creating masks. It can be a little tricky to set-up (thinking about writing a script here…) but I really like this techniques ability to create masks at render time. By using this with slide shades (follow link at the top) you can save the elements into a 32bit exp file with the final rendering.

A screengrab of the exported RGB channels as layers in photoshop form the EXR file.

Post a Comment

You must be logged in to post a comment.