Using the Spotmask Render Elements

Different Frame Buffers

The frame buffer you are using is important for the render results you achieve with Spotmask.

The frame buffer defines the maximum color depth that the files you save can have. It is possible to reduce the depth by saving the image in a file that stores less accurate data but it is not possible to increase the color depth by storing in a format that supports higher color depth than the used frame buffer.

Mental ray supports two different frame buffers. For optimal results you should always use the 32 bit frame buffer to generate your render elements.

_images/framebuffer.png
  • Floating-Point (32 bits per channel)

    This buffer internally represents all channels as a floating point number with a very high accuracy. Colors are by default represented in the range between 0.0 and 1.0.

    A floating point buffer offers a very important advantage for render elements. It is possible to store values beyond the normal color range. These can’t be viewed as colors any more but during image composition compatible software can work with these raw values to achieve results with much higher accuracy.

  • Integer (16 bits per channel)

    When you use this buffer your colors are represented with numbers from 0 to 65535 for each color channel.

    The accuracy of render elements is very limited when you are using this frame buffer.

Anti-Aliasing

Anti-Aliasing is a very important consideration for render elements. While some render elements can work well with anti-aliasing enabled there are many situations in which anti-aliasing cannot be used because you end up with incorrect data.

Consider a small object in the foreground a large object far away in the background. In regions where those two objects overlap in the image anti-aliasing will blur them into each other to smooth the edges between them. This works fine for visual data but creates incorrect information for render pass data. Imagine a blurred position pass. The two objects are adjacent in the image but are very far away from each other in 3d space. The anti aliasing will smooth the edge and generate position data that corresponds to neither of the 2 objects. The resulting data in those anti-aliased border regions ends up being completely wrong.

In most cases it is therefore necessary to render the passes without anti-aliasing. This has of course the disadvantage that the borders between objects will not be smooth in those passes which can lead to reduced quality in the final compositing results.

One common method to generate more accurate passes without resorting to anti-aliasing is to generate render passes in a higher resoltuion, for example twice the width and height of the actual scene. All time consuming effects that don’t affect the desired passes can be turned off to keep render times low. For all Spotmask render elements you can turn off all lights and related effects. You can also turn off all filtering since you’re rendering the passes without anti-aliasing anyway and don’t care about the actual image result. While this requires a separate render job to be prepared the render times will be negligible and you will receive passes that result in much smoother compositing result.

Important Limitations

Please keep the following limitations in mind when working with Spotmask.

Velocity in older versions of mental ray

The Spotmask Velocity render element is only fully supported in 3ds Max 2014 (NVIDIA mental ray 3.11) and later. Older versions of mental ray do not fully support the generation of motion vectors and will only consider absolute object movement while ignoring camera movement.

Using the 3ds Max Scanline Renderer

Spotmask has been created specifically for NVIDIA mental ray and this is consequently the renderer you should use for optimal results.

It is possible to use Spotmask with the Default Scanline Renderer but keep in mind that there are important limitations with this renderer. It is not recommended to use the Scanline Renderer for the creation of render passes.

  • The Scanline Renderer always anti-aliases render elements. The filtering checkbox has no function. This causes serious problems with render elements as described in the anti-aliasing section.

  • When anti-aliasing is completely disabled in the Scanline Renderer settings it will not generate any render elements at all.

  • The Scanline Renderer does not support a 32 bit frame buffer and it will always clamp colors into the visible range. Generating raw vector data instead of colors will not work. Color based render pass data (ie a normal map) will have reduced accuracy.

  • The Spotmask UVW pass only works correctly with Scanline Renderer on objects that have a map assigned to them. It doesn’t matter what kind of map it is and in which material slot it is assigned but when no map at all exists the Scanline Renderer will completely ignore UVW data of the object.

  • Most features of the Spotmask Velocity pass are not possible with the scanline renderer. You get no camera relative motion data. You can only render 2-dimensional velocity maps. When using the Scanline Renderer Spotmask Velocity has no advantages over the default Velocity render element.