The footPrintNode plug-in is an example of using MPxLocatorNode. It has been updated to provide a simple Viewport 2.0 implementation as well as an example of using MPxDrawOverride. Not all draw modes are supported, but it shows how MPxDrawOverride is meant to be used.
The apiMeshShape plug-in is an example of how to implement a custom Maya shape using MPxSurfaceShape. It has been updated to include how to use MPxGeometryOverride in order to provide vertex data, index data, and custom render items to Viewport 2.0 for drawing a custom Maya shape with arbitrary shader assignments.
The apiMeshShape plug-in also has an example implementation of the MPxSubSceneOverride interface. This implementation is disabled by default but can be activated by modifying and rebuilding the plug-in.
The gpuCache plug-in uses the MPxSurfaceShape interface to implement an opaque scene caching node. The node can efficiently store and display a complex sub-scene rooted at the node which is unknown to the rest of Maya. The plug-in defines two different Viewport 2.0 implementations that are selectable by the environment variable MAYA_GPUCACHE_VP2_OVERRIDE_API. There is one implementation for each interface, MPxDrawOverride, and MPxSubSceneOverride. See Rendering variables in the Maya User's Guide for more information about this environment variable.
hwPhongShader is an example of how to implement a custom hardware shader using MPxHwShaderNode. It has been updated to include how to use MPxShaderOverride to implement a complete custom shading effect for Viewport 2.0. In its primary mode, it uses the simple drawGeometry interface to allow Viewport 2.0 to handle geometry drawing after it sets up the shader. However, it also has an alternate implementation that shows how to query the actual geometry resource handles through the MGeometry interface in order to do custom binding and drawing.
Maya’s CgFX plug-in has been updated to support Viewport 2.0 through the MPxShaderOverride interface. Unlike hwPhongShader above, this is a non-trivial example of using the new API to produce fast and interesting custom shading. The plug-in makes extensive use of MDrawContext in order to set and maintain state as the plug-in renders the custom CgFX file shaders.
This plug-in defines a Maya shading node using the MPxHardwareShader interface to support DirectX 11 in Viewport 2.0. Like the CgFX plug-in, the attributes of the node are dynamically created based on a shader effect file (except in this case, it is an HLSL effect instead of a Cg effect). Also, like the CgFX plug-in, this node is supported in Viewport 2.0 using the MPxShaderOverride interface and is another very good, non-trivial example of the full capabilities of this interface. This plug-in also shows examples of advanced shading and geometry manipulation to achieve effects like hardware displacement and tessellation.
The following plug-ins all implement MPxShadingNodeOverride to provide Viewport 2.0 support for the software shading nodes defined by the plug-ins: brickShader, checkerShader, fileTexture, contrastShader, gammaShader and mixtureShader. These six plug-ins together provide a good overview of the functionality of this interface.
The following plug-ins all implement MPxSurfaceShadingNodeOverride in order to provide Viewport 2.0 support for the software surface shading nodes defined by the plug-ins: lambertShader, phongShader and depthShader. These three plug-ins together provide a good overview of all the functionality of this interface and also provide good examples of some of the features of the base class, MPxShadingNodeOverride.
The viewRenderOverride plug-in is an example of how to override the viewport drawing to produce various effects on top of the standard draw. This makes use of many new API classes including: MRenderer, MRenderOverride, MRenderOperation (and several of its derived classes), MCameraOverride and MRenderTarget.