Overview of the Viewport 2.0 API

Maya 2012 introduced a new set of API classes for defining custom drawing, shading and effects in both Viewport 2.0 and Hardware Renderer 2.0 (the new batch/render view version of Viewport 2.0).

Maya’s Viewport 2.0 represents a brand-new rendering architecture in Maya that has been written from the ground up to deliver high-performance on large scenes on top of a programmable shader system offering high-quality per-pixel lighting and effects. This, unfortunately, makes it incompatible with many of the existing Maya API classes, due to their dependence on system memory geometry data, C++ driven rendering, and high state switching overheads. As a result, most existing plug-ins will need to be updated to support the new API classes in order to work correctly in Viewport 2.0.

This section introduces the new classes and highlights the migration paths from the old API to the new one. In most cases, it should be possible to write plug-in nodes that simultaneously implement both the new and old APIs where required, thus maintaining a single plug-in that will work in both viewports while artists, tools and pipelines are migrated to Viewport 2.0.

This discussion of the new API is broken down into the following subsections:

Following this, there are two subsections to help accelerate your transition to the new API:

All of the new classes reside in a new namespace within the Maya API called MHWRender (all references to class names in this document assume the namespace). This makes it easy to locate all the classes related to viewport and batch hardware rendering and also makes it easy to differentiate them from the older hardware API classes which are not supported in Viewport 2.0 and Hardware Renderer 2.0.