The following information pertains to hardware shaders that render in the Legacy Default Viewport. The current recommendation is to create shaders for use with Viewport 2.0. See Maya Viewport 2.0 API Guide.
The MPxHwShaderNode
class contains a method supportsBatching()
which controls whether or not rendering calls for this material are batched together to minimize rendering state transitions. By implementing this method and returning true, the MPxHwShaderNode
’s pre(bind/glBind) and post(unbind/glUnbind) methods will be called once per-frame, rather than once per-shape per-frame. By default, this method returns false to maintain compatibility with previous plug-in implementations. Please refer to the documentation of this method for more details.