Graphics API
This section covers changes and additions to the Graphics API in 3ds Max 2015.
New Fragment System and Basic View System APIs
The fragment system is the largest change in the Graphics API in 3ds Max 2015. It introduces the concepts of a "view fragment" and "fragment graph". A view fragment is a plugin that contributes to the rendering result in a viewport, and inherits from class MaxSDK::Graphics::ViewFragment
. One or more view fragment plug-ins may be connected into the fragment graph that makes up the viewport rendering system. This allows flexible customization of viewport rendering.
3ds Max 2015 only supports shader fragments. Other fragment types will be supported in future releases.
The basic view API works together with the fragment system, and is used for managing, saving and loading the fragment graph for a viewport.
A sample fragment plugin project can be found in the SDK samples directory, under maxsdk\samples\render\activeshadefragment .
Header files for the fragment system API are located in maxsdk\include\Graphics\FragmentGraph .
The header files for the view system can be found under maxsdk\include\Graphics\ViewSystem .
New consolidation API
The consolidation API is used to improve the Graphics System, consolidating certain related render items together to reduce draw calls and speed up viewport performance. Consolidation APIs are located in:
- maxsdk\include\Graphics\IConsolidationRenderItem.h
- maxsdk\include\Graphics\IConsolidationStrategy.h*
- maxsdk\include\Graphics\IConsolidationStrategy.h
See class documentation in the C++ API Reference, and samples in maxsdk\samples\objects\camera.cpp (SimpleCamera::UpdatePerNodeRenderItem
).
New built-in render items
New built-in render items have been added in:
- maxsdk\include\Graphics\Utilities\MarkerRenderItem.h* - class
MarkerRenderItem
, an alternate solution for marker functions in class GraphicsWindow.
- maxsdk\include\Graphics\Utilities\MarkerRenderItem.h* - class
- maxsdk\include\Graphics\Utilities\SplineRenderItem.h - class
SplineRenderItem
, an alternate solution for polyline functions in class GraphicsWindow. - maxsdk\include\Graphics\Utilities\MeshEdgeRenderItem.h - class
MeshEdgeRenderItem
, a class designed for small meshes that only render edges.
New hit test API
There are two new methods added to class ICustomRenderItem:
HitTest()
OnHit()
The two methods are used for hit testing an object that owns a custom render item (such as a custom gizmo). For details see class ICustomRenderItem
in the C++ API Reference, and maxsdk\include\Graphics\ICustomRenderItem.h .
Deprecated and Removed Items
The following deprecated classes, methods and parameters have been removed from the Graphics API:
- Merged IDisplayManager2 methods to IDisplayManager and removed IDisplayManager2.
- Removed the IObjectDisplay interface. Use IObjectDisplay2 instead.
- Removed the MaxContext parameter from IObjectDisplay2 methods.
- Removed the global function GenerateRenderItems().
- 3ds Max 2015 no longer supports the DirectX 10 driver, therefore support for it has been removed from the SDK.
The following classes are deprecated. We recommend that you no longer use them, as they will be removed from a future release:
- IPrimitiveRenderer related (use IVirtualDevice instead):
- IPrimitiveRenderer
- IRenderStateManager
- Immediate Render item (use CustomRenderItemHandle and ICustomRenderItem instead):
- ImmediateRenderItem
- IDisplayCallback
- DisplayCallbackContext