Blog Archives

The Unified Rasterizer

Skeletons from the TV series Merlin - rendered with the rasterizer

If you read my post on unified sampling you might have heard me talking about using the unified sampling settings to control the rasterizer.  While it is important to note that there is no difference between how the regular rasterizer and unified rasterizer work, it is convenient to be able to control all of mental ray’s primary rendering modes using the same set of controls.  Thus I will explore the rasterizer from a unified point of view.

Why Use the Rasterizer?

With unified sampling, it’s clever error estimation, and it’s fast ray traced motion blur, you may be wondering why care about the rasterizer?  You should care because ray traced motion blur will inherently have a certain about of grain and it will never be super-duper fast.  For those projects with heavy motion blur, render time limitations, and perfectly smooth expectations, I welcome you to the world of scanline-based rasterization.

Technically speaking, the rasterizer achieves motion blur performance improvements over adaptive ray tracing by separating the shading component of sampling from the antialiasing component of sampling.  So, within a given frame, tessellated objects can be shaded, sampled, moved, and sampled again without the need for additional shading.  This resulting faster render time is because of the decreased amount of shading calls.  The resulting smoother motion blur is because the tessellation was essentially slid across the pixel/tile.  Despite these advantages, the result is not as physically correct as ray tracing which shades at every sample point.

You can read more about this in the mental ray documentation that comes with Maya.

It is also important to note that the scanline-based rasterization approach to rendering is not as efficient at tracing rays as a ray traced approach is.  For this reason the rasterizer will suffer with reflections and refractions while unified sampling will shine.

How to Enable the Unified Rasterizer

To enable the unified rasterizer you need to turn on unified sampling (currently implemented with string options) and switch the Primary renderer to “Rasterizer” (Render Settings > Features > Primary Renderer).

Antialiasing Rasterizer Controls

When using the unified rasterizer, you only need to consider one setting to control antialiasing sample quality: “samples max”

“samples max”
  • “samples max” replaces “visibility samples” aka “samples collect”.
  • While “samples max” acts as a limit in regular unified, here it controls the absolute number of antialiasing samples taken per pixel.
  • The value is truncated to the nearest square number of lesser or equal value. i.e. 16.0 → 16, 32.5 → 25, 99.9  → 81, 100.0  → 100, etc…
  • “production quality” lies somewhere around 25.0 or 36.0.  Use lower values for faster previews or higher values for difficult renders.
  • scalar, defaults to 100.0

Shading Rasterizer Controls

The main setting that you need to consider for shading sample quality is “samples quality”.

“samples quality”
  • “samples quality” replaces “shading quality” aka “shading samples”.
  • While “samples quality” controls error allowance between samples and pixels in regular unified, here it approximates the number of shading triangles per pixel.
  • A value of 1.o corresponds to about 1 shader call per pixel per time sample.  2.0 corresponds to 2 shader calls per pixel per time sample. 0.5 corresponds to 1 shader call per 2 pixels per time sample. Etc.
  • scalar, default to 1.0

Additional Shading Optimization

“time samples”
  • “time samples”/”time contrast” is also known as “samples motion”.
  • While “time samples” is ignored in regular unified, here it controls the number of times the tessellated triangles will be shaded over the motion blur shutter interval.
  • While it is beneficial to leave this setting at 1.0, sometimes it is necessary to raise this setting to avoid animation artifacts cause by dragging the shaded tessellations to create blur.
  • This is integrated in the Maya UI under Render Settings > Quality > Motion Blur > Time Samples.  scalar, defaults to 1.0
  • Note: this setting has a different meaning with the rasterizer than it does with AA sampling.  Similar to unified, each sample is QMC jittered in time when using the rasterizer.

“rast motion factor”

  • When enabled, “rast motion factor” allows you to raise or lower the amount of shading samples performed for fast moving geometry.
  • This allows you to limit shading samples where the detail would otherwise be lost in the blur.
  • Shading samples performed scale linearly with “rast motion factor” and the speed of the moving geometry.
  • scalar, defaults to 1.0.  0.0 is disabled.
Note: “samples min” and “samples error cutoff” are ignored when using the unified rasterizer. Jitter, however, is no longer ignored and should be enabled for increased optimization.