MaxSDK::Graphics Namespace Reference
 
 
 
MaxSDK::Graphics Namespace Reference

This reference page is linked to from the following overview topics: New Classes and Methods, Porting Object Plug-ins to Nitrous, Plug-in Display Interface, About RenderItem.


Classes

class   AtomicRefCounter
  this class contains an integer which is initialized to zero. More...
class   BaseMaterialHandle
  This is base graphics material class. More...
class   BaseRasterHandle
  This is our base graphics raster resource class. More...
class   CustomRenderItemHandle
  CustomRenderItemHandle is a wrapper of ICustomRenderItem. More...
struct   DeviceCaps
  This struct is used to store some device related information. More...
class   DisplayCallbackContext
  This class contains context which can be queried in IDisplayCallback. More...
class   DrawContext
  The pipeline context contains the complete state of a single item being drawn all system supplied variables are contained here, as is the current virtual device. More...
class   GenerateMeshRenderItemsContext
  This class contains all information that will be passed to Mesh::GenerateRenderItems() or MNMesh::GenerateRenderItems() to update its display data. More...
class   GeometryRenderItemHandle
  This is a special render item which used only by Mesh/MNMesh. More...
class   HLSLMaterialHandle
  HLSLMaterialHandle is a material class to support HLSL custom material. More...
class   ICustomRenderItem
  This class is used to custom behavior of a render item. More...
class   IDisplayCallback
  A developer would implement this interface to allow immediate mode drawing of primitives, text and markers. More...
class   IDisplayManager
class   IDisplayManager2
  This is IDisplayManager extension, add a new interface to get device caps. More...
class   IDisposable
class   IHLSLMaterialTranslator
  Facilitates translation of material parameter values to their shaders representation. More...
class   IMeshDisplay2
  Use this interface to query the per node related render items from a mesh or mnesh. More...
class   ImmediateFragment
  ImmediateFragment is a class which let application render primitives outside the render loop. More...
class   ImmediateRenderItemHandle
  This class is used to wrap user defined IDisplayCallback class. More...
class   IndexBufferHandle
  IndexBufferHandle is a memory buffer that contain index data. More...
class   IObjectDisplay
  This is the base interface for all objects that want to be displayed in viewport. More...
class   IAddRenderItemsHelper
  Internal used only. More...
class   IObjectDisplay2
  To give object plugins better control of display, now object plugins can expose IObjectDisplay2 interface. More...
class   IParameterTranslator
  Facilitates translation of material and texture map parameter values to their shaders representation. More...
struct   TextureCoordStream
  This structure is used to define vertex's texture coordinate information. More...
struct   SimpleVertexStream
  Used by DrawPrimitive and DrawIndexedPrimitive for vertex data. More...
class   IPrimitiveRenderer
  This class is used to draw simple primitives, markers, text with given material and transformations. More...
class   AutoRestoreWorldMatrix
class   IRefObject
  This class is similar to IUnknown in COM except that this class don't have a QueryInterface function. More...
class   ARefObject
  This class implemented IRefObject interfaces. More...
class   SafeReferenceObjectProxy
  This class is internally used for preventing the AddRef and Release of a pointer returned by RefPtr::operator -> from being called. More...
class   DefaultLifeTimePolicy
class   RefPtr
  This template class act similar as CComPtr. More...
class   IRenderGeometry
  IRenderGeometry is a presentation of geometry. More...
class   IRenderItemContainer
  A render item container, it provides various methods to access the contained render items. More...
class   IRenderStateManager
  IRenderStateManager controls primitive renderer's current render style. More...
class   IShaderManager
  Represents the programmable shader associated with a material or texture map plug-in. More...
class   IShaderManagerCreator
  Factory class for IShaderManager objects. More...
class   ISimpleMaterial
  ISimpleMaterial provides any material or texture plugin the ability to display itself in the new Viewport Display system in 3ds Max 2012. More...
class   DisplayTextureHelper
  Used for creating texture handles (TexHandle) and updating texture data managed by the viewport display system. More...
class   ITextureDisplay
  This interface enables material and texture map plugins to display textures in the new viewport display system in 3ds Max 2012. More...
class   IViewportViewSetting
  Viewport Setting For The Nitrous Graphics Viewport. More...
class   IVirtualDevice
  This class provides low level access of GPU device. More...
struct   MaterialRequiredStreamElement
  This struct describes a single stream element that will be used by the hardware shader of a material. More...
class   MaterialRequiredStreams
  This class is used for describing the mesh stream requirements of a material. More...
class   Matrix44
class   MaxContext
  MaxContext contains pointers to all the viewports the given object will be displayed. More...
class   MeshElementDescription
  This class describes a single mesh element(which corresponds to a render item) required to be generated by calling Mesh::GenerateRenderItems() or MNMesh::GenerateRenderItems() from the specified mesh(or mnmesh). More...
class   RenderItemHandle
  This is the base wrapper class for all viewport render items. More...
class   RenderItemHandleArray
  This is a utility class. More...
class   RenderItemHandleDecorator
  This is a decorator class for RenderItemHandle. More...
class   RenderNodeHandle
  This class describes a graphics node. More...
class   RasterizerState
  This class encapsulates a complete rasterizer state, like fill mode, cull mode, point size, etc. More...
class   TargetBlendState
  This class holds the blend state for single render target. More...
class   BlendState
  This class holds the blend state for all render targets. More...
class   StencilOperation
  This class encapsulates a complete set of stencil buffer operations for stencil test. More...
class   DepthStencilState
  This class encapsulates a complete depth buffer and stencil buffer state. More...
class   SmartHandle
  This is the base wrapper class for all graphics primitive classes in max viewport: worlds, nodes, render items, materials, etc. More...
class   SolidColorMaterialHandle
  SolidColorMaterialHandle is a material class to support solid color. More...
class   StandardMaterialHandle
  StandardMaterialHandle is a material class to support phong style material . More...
class   ChildObjectDisplayCallback
  This is the utility display callback class for any compound object that would like to customize the display of its child objects so that each child object could decide on its own how its child render items would be rendered when IDisplayCallback::DoDisplay() is invoked. More...
class   CompoundObjectAddRenderItemsHelper
  This is the utility AddRenderItemsHelper class for any compound object that would like to customize the display of its child-objects. More...
class   TargetHandle
  Application can use this class either as a render target or convert it to texture and assign to model. More...
class   PresentableTargetHandle
  This class is similar as TargetHandle. More...
struct   LockedRect
  Defines a rectangular region that has been locked by a call to TextureHandle::LockRect(). More...
class   TextureHandle
  This is texture class to support texture for material, such as TextureMaterialHandle. More...
class   TextureHandleUtility
  This is utility class to create TextureHandle from Texmap. More...
class   TextureMaterialHandle
  This is material class to support material with texture. More...
class   UpdateDisplayContext
  This class contains all information that will be passed to IObjectDisplay::UpdateDisplay and will be used by plugin to update its display data. More...
class   UpdateNodeContext
  This class contains node dependent information for calling IObjectDisplay2::UpdatePerNodeItems(), and IObjectDisplay2::UpdatePerViewItems() More...
class   UpdateViewContext
  This class contains view dependent information for calling IObjectDisplay2::UpdatePerViewItems() More...
class   VertexBufferHandle
  VertexBufferHandle is a memory buffer that contain vertex data. More...
class   VertexColorMaterialHandle
  VertexColorMaterialHandle is a material class to support vertex color. More...

Typedefs

typedef RefPtr< ICustomRenderItem ICustomRenderItemPtr
typedef RefPtr< IDisplayCallback IDisplayCallbackPtr
typedef RefPtr< IRefObject RefObjectPtr
typedef RefPtr< IRenderGeometry IRenderGeometryPtr
typedef RefPtr
< ChildObjectDisplayCallback
ChildObjectDisplayCallbackPtr
typedef MaxSDK::Array
< TargetHandle
TargetHandleArray
typedef unsigned __int64  Identifier
  This is the unique id type of our internal graphics objects.
typedef MaxSDK::Array
< VertexBufferHandle
VertexBufferHandleArray

Enumerations

enum   VertexFieldType {
  VertexFieldTypeUnknown, VertexFieldFloat1, VertexFieldFloat2, VertexFieldFloat3,
  VertexFieldFloat4, VertexFieldColor, VertexFieldTypeCount
}
  types available for vertex fields, e.g. More...
enum   VertexFieldUsage {
  VertexFieldUsageUnknown, VertexFieldUsagePosition, VertexFieldUsageNormal, VertexFieldUsageDiffuse,
  VertexFieldUsageSpecular, VertexFieldUsageTexcoord, VertexFieldUsageTangent, VertexFieldUsageBitangent,
  VertexFieldUsageCount
}
  Indicates the usage of a vertex field of a vertex buffer. More...
enum   MeshChannelCategory {
  MeshChannelUnknown, MeshChannelPosition, MeshChannelVertexNormal, MeshChannelTexcoord,
  MeshChannelVertexColor, MeshChannelTangent, MeshChannelBitangent, MeshChannelFaceMap,
  MeshChannelCategoryCount
}
  Indicates the data source of a vertex field of a mesh vertex buffer. More...
enum   IndexType { IndexTypeUnknown, IndexTypeShort, IndexTypeInt, IndexTypeCount }
  Buffers are composed of arrays of elements all of the same type. More...
enum   BufferUsageType {
  BufferUsageTypeNone, BufferUsageStatic, BufferUsageDynamic, BufferUsageStreamOut,
  BufferUsageShaderResource, BufferUsageStreamOutAndShaderResource
}
  BufferUsageType Types for OGS buffer usage. More...
enum   VisualStyle {
  VisualStyleRealistic = 0, VisualStyleShaded, VisualStyleFacets, VisualStyleConsistentColor,
  VisualStyleHiddenLine, VisualStyleWireframe, VisualStyleBoundingBox, VisualStyleInk,
  VisualStyleColorInk, VisualStyleAcrylic, VisualStyleTech, VisualStyleGraphite,
  VisualStyleColorPencil, VisualStylePastel, VisualStyleClay, VisualStyleCount
}
  Enum type for all visual styles of nitrous viewport. More...
enum   ObjectDisplayRequirement { ObjectDisplayRequireLegacyDisplayMode = 0x00000001, ObjectDisplayRequireUpdatePerViewItems = 0x00000002 }
  This enum contains flags that can be combined together to specify whether or not certain functions of IObjectDisplay2 will be supported. More...
enum   MaterialRequirementFlags { MaterialRequirementSplitByMaterialID = 0x00000001 }
  This enum defines requirement flags of material additional to mesh stream requirements of MaterialRequiredStreams. More...
enum   MeshElementType {
  MeshElementTypeSolidMesh, MeshElementTypeVertexTicks, MeshElementTypeEdge, MeshElementTypeDiagonal,
  MeshElementTypeFace, MeshElementTypeNormal
}
  This enum describes the type of mesh element to be generated. More...
enum   MeshPart { MeshPartSelected, MeshPartUnselected, MeshPartWhole }
  When a mesh is displayed in any sub-object level, this enum help decide which part of the mesh this mesh element belongs to. More...
enum   BuiltInMeshElementDescription {
  ElementDescriptionSolidMesh, ElementDescriptionVetexTicks, ElementDescriptionWireframe, ElementDescriptionSelectedEdge,
  ElementDescriptionDiagonal, ElementDescriptionSelectedDiagonal, ElementDescriptionSelectedFace
}
  This enum defines some kinds of built-in mesh element descriptions. More...
enum   PrimitiveType {
  PrimitivePointList, PrimitiveLineList, PrimitiveLineStrip, PrimitiveTriangleList,
  PrimitiveTriangleStrip, PrimitiveTypeCount
}
  Supported primitive types. More...
enum   BufferClearFlag { ClearBackbuffer = 0x1, ClearDepthBuffer = 0x2, ClearStencilBuffer = 0x4, ClearAll = 0x7 }
  This flag describes the way to clear the current buffers. More...
enum   BlendSelector {
  BlendSelectorBlendFactor, BlendSelectorBothInvSourceAlpha, BlendSelectorBothSourceAlpha, BlendSelectorDestinationAlpha,
  BlendSelectorDestinationColor, BlendSelectorInvBlendFactor, BlendSelectorInvDestinationAlpha, BlendSelectorInvDestinationColor,
  BlendSelectorInvSourceAlpha, BlendSelectorInvSourceColor, BlendSelectorOne, BlendSelectorSourceAlpha,
  BlendSelectorSourceAlphaSat, BlendSelectorSourceColor, BlendSelectorZero
}
  blend selector. More...
enum   CullMode { CullModeCW, CullModeCCW, CullModeNone }
  cull type. More...
enum   FillMode { FillSolid, FillWireFrame }
  fill mode for polygons More...
enum   CompareFunction {
  CompareFunctionAlways, CompareFunctionEqual, CompareFunctionGreater, CompareFunctionGreaterEqual,
  CompareFunctionLess, CompareFunctionLessEqual, CompareFunctionNever, CompareFunctionNotEqual
}
  compare functions More...
enum   ColorWriteEnable {
  ColorWriteEnableNone = 0, ColorWriteEnableAlpha = 0x8, ColorWriteEnableBlue = 0x4, ColorWriteEnableGreen = 0x2,
  ColorWriteEnableRed = 0x1, ColorWriteEnableRedGreenBlue = 0x7, ColorWriteEnableRedGreenBlueAlpha = 0xf, WRITEENABLE_FORCE_DWORD = 0x7fffffff
}
enum   BlendOperation {
  BlendOperationAdd, BlendOperationMax, BlendOperationMin, BlendOperationSubtract,
  BlendOperationReverseSubtract
}
  blend operations More...
enum   StencilOperationType {
  StencilOperationTypeDecrement = 8, StencilOperationTypeDecrementSaturation = 5, StencilOperationTypeIncrement = 7, StencilOperationTypeIncrementSaturation = 4,
  StencilOperationTypeInvert = 6, StencilOperationTypeKeep = 1, StencilOperationTypeReplace = 3, StencilOperationTypeZeroStencil = 2,
  STENCILOP_FORCE_DWORD = 0x7fffffff
}
  Stencil buffer operation. More...
enum   AccessType {
  AccessTypeNone = 0x0, ReadAcess = 0x1, WriteAcess = 0x2, ReadWriteAcess = ReadAcess | WriteAcess,
  WriteDiscardAcess
}
  AccessType Types for accessing buffers. More...
enum   TextureFormat {
  TextureFormatUnknown, TextureFormatA8R8G8B8, TextureFormatA16B16G16R16, TextureFormatA32B32G32R32F,
  TextureFormatCount
}
  TextureFormat indicates which type the texture is. More...
enum   GraphicFeatureLevel {
  Level_Unknown = 0, Level_NULL = 5, Level2_0 = 20, Level2_1 = 21,
  Level3_0 = 30, Level3_1 = 31, Level4_0 = 40, Level4_1 = 41,
  Level4_5 = 45, Level5_0 = 50, Level_Count = 9
}
  This enum specifies the feature levels device supported. More...
enum   TextureType {
  TextureTypeUnknown = 0, TextureTypeImage1D = 1, TextureTypeImage1DArray = 2, TextureTypeImage2D = 3,
  TextureTypeImage2DArray = 4, TextureTypeCubeMap = 5, TextureTypeVolume = 6, TextureTypeCount
}
  Texture type enums. More...
enum   ResourceUsage {
  ResourceUsageNormal = 0, ResourceUsageDynamic = 1, ResourceUsageStaging = 2, ResourceUsageMask = 0xf,
  ResourceUsageStream = 0x10, ResourceUsageTarget = 0x20
}
  Resource usage, used for texture. More...
enum   RenderItemCategory {
  RenderItemCategorySolidMesh = 0x00000001, RenderItemCategoryDiagonalMesh = 0x00000002, RenderItemCategoryEdgeMesh = 0x00000004, RenderItemCategorySubObjectVertexTicks = 0x00000008,
  RenderItemCategorySubObjectEdgeMesh = 0x00000010, RenderItemCategoryOtherSubObjects = 0x00000020, RenderItemCategoryGizmo = 0x00000040
}
enum   RenderItemVisibilityGroup { RenderItemVisible_Unknown, RenderItemVisible_Shaded, RenderItemVisible_Wireframe, RenderItemVisible_Gizmo }
  This enum defines in what group a render item is visible. More...
enum   ObjectComponentRequirement {
  ObjectComponentSolidMesh = 0x00000001, ObjectComponentWireframe = 0x00000002, ObjectComponentVertexTicks = 0x00000004, ObjectComponentDiagonal = 0x00000008,
  ObjectComponentSelected = 0x00000010, ObjectComponentUnselected = 0x00000020, ObjectComponentBackfaceCull = 0x00000040, ObjectComponentVertexColorSoftSelection = 0x00000080
}
  This enum contains flags that can be combined together to specify which part is required by the node when updating render items. More...

Functions

DataBridgeAPI size_t  GetVertexStride (const VertexFieldType type)
  Get the vertex stride by a given vertex type, in bytes.
DataBridgeAPI size_t  GetIndexStride (const IndexType type)
  Get the index stride by a given index type, in bytes.
CoreExport IDisplayManager GetIDisplayManager ()
CoreExport IDisplayManager2 GetIDisplayManager2 ()
  Helper function to access the IDisplayManager2 core interface.
bool  IsRetainedModeEnabled ()
  Helper function to test whether the new viewport graphics system is running.
bool  IsHardwareHitTesting (ViewExp *vpt)
  Helper function to test whether the new viewport graphics system is performing hardware hit testing.
template<class RefObjectType , class SafeRefObjectType , class LifeTimePolicy >
bool  operator== (void *pPtr, const RefPtr< RefObjectType, SafeRefObjectType, LifeTimePolicy > &pInterface)
template<class RefObjectType , class SafeRefObjectType , class LifeTimePolicy >
bool  operator!= (void *pPtr, const RefPtr< RefObjectType, SafeRefObjectType, LifeTimePolicy > &pInterface)
GraphicsDriverAPI void  MaxWorldMatrixToMatrix44 (Matrix44 &outMatrix, const Matrix3 &inMatrix)
  Convert Matrix3 to Matrix44.
GraphicsDriverAPI void  Matrix44ToMaxWorldMatrix (Matrix3 &outMatrix, const Matrix44 &inMatrix)
  Convert Matrix44 to Matrix3.
GraphicsDriverAPI const
MeshElementDescription
GetBuiltInMeshElementDescription (BuiltInMeshElementDescription type)
  Get a specified built-in mesh element description.
GraphicsDriverAPI size_t  GetTextureFormatPixelSize (TextureFormat format)
  Get the number of bytes for each pixel by a given texture format.
MAX_DEPRECATED
GraphicsDriverAPI void 
GenerateRenderItems (RenderItemHandleArray &renderItems, Mesh *pMaxMesh, unsigned long renderItemCategoryFlags, const MaterialRequiredStreams &requiredStreams)
MAX_DEPRECATED
GraphicsDriverAPI void 
GenerateRenderItems (RenderItemHandleArray &renderItems, MNMesh *pMaxMesh, unsigned long renderItemCategoryFlags, const MaterialRequiredStreams &requiredStreams)
GraphicsDriverAPI
VertexBufferHandle 
GenerateInstanceData (Matrix3 *worldTransforms, size_t count)
  Generate the instance data from a Matrix3 array.
GraphicsDriverAPI bool  GenerateInstanceRenderItem (RenderItemHandle &hInstanceRenderItem, const RenderItemHandle &hTupleMeshHandle, const VertexBufferHandle &hInstanceData)
  Generate the instance render item from a tuple mesh and a Matrix3 array.

Variables

const Identifier  NIL_ID = (Identifier)-1
  Invalid id value.

Typedef Documentation

typedef unsigned __int64 Identifier

This is the unique id type of our internal graphics objects.


Enumeration Type Documentation

types available for vertex fields, e.g.

Float4

Enumerator:
VertexFieldTypeUnknown 

unknown field

VertexFieldFloat1 

single float field

VertexFieldFloat2 

double float field.

x,y

VertexFieldFloat3 

triple float field

VertexFieldFloat4 

quad float field

VertexFieldColor 

color field

VertexFieldTypeCount 

Indicates the usage of a vertex field of a vertex buffer.

This enum is used to make hardware shaders understand the usage of vertex buffer.

Enumerator:
VertexFieldUsageUnknown 

Unknown usage.

VertexFieldUsagePosition 

Position.

VertexFieldUsageNormal 

Normal.

VertexFieldUsageDiffuse 

Vertex diffuse color.

VertexFieldUsageSpecular 

Vertex specular color.

VertexFieldUsageTexcoord 

Texture coordinate.

VertexFieldUsageTangent 

tangent

VertexFieldUsageBitangent 

bitangent

VertexFieldUsageCount 

Indicates the data source of a vertex field of a mesh vertex buffer.

e.g. Position, Normal, Texture, etc.

Enumerator:
MeshChannelUnknown 

Unknown data source.

MeshChannelPosition 

position

MeshChannelVertexNormal 

vertex normal components

MeshChannelTexcoord 

texture coordinate components

MeshChannelVertexColor 

vertex color components

MeshChannelTangent 

tangent components

MeshChannelBitangent 

bitangent components

MeshChannelFaceMap 

face map components

MeshChannelCategoryCount 

Buffers are composed of arrays of elements all of the same type.

This enum describes the size and interpretation of the elements in the buffer. Index buffers can have ushort or uint elements.

Enumerator:
IndexTypeUnknown 

not defined

IndexTypeShort 

unsigned 16 bit short integer, used for index buffers.

IndexTypeInt 

unsigned 32 bit integer, used for index buffers.

IndexTypeCount 

BufferUsageType Types for OGS buffer usage.

Enumerator:
BufferUsageTypeNone 

Unknown usage type.

BufferUsageStatic 

Static buffer.

BufferUsageDynamic 

Dynamic buffer.

BufferUsageStreamOut 

StreamOut buffer used as stream out.

BufferUsageShaderResource 

Used as a shader resource like texture.

BufferUsageStreamOutAndShaderResource 

Used as a stream out target and a shader resource.

Enum type for all visual styles of nitrous viewport.

Enumerator:
VisualStyleRealistic 

The realistic visual style.

VisualStyleShaded 

The shaded visual style.

VisualStyleFacets 

The facet visual style.

VisualStyleConsistentColor 

The consistent color visual style.

VisualStyleHiddenLine 

The hidden line visual style.

VisualStyleWireframe 

The wireframe visual style.

VisualStyleBoundingBox 

The bounding box visual style.

VisualStyleInk 

The ink visual style for NPR.

VisualStyleColorInk 

The color ink visual style of NPR.

VisualStyleAcrylic 

The acrylic stylized visual style.

VisualStyleTech 

The tech stylized visual style.

VisualStyleGraphite 

The graphite stylized visual style.

VisualStyleColorPencil 

The color pencil stylized visual style.

VisualStylePastel 

The pastel stylized visual style.

VisualStyleClay 

The clay visual style.

VisualStyleCount 

The count of all visual styles.

This enum contains flags that can be combined together to specify whether or not certain functions of IObjectDisplay2 will be supported.

Enumerator:
ObjectDisplayRequireLegacyDisplayMode 

Check if this plugin contains legacy display code and want legacy code to be called as well.

Signal this bit if contains legacy display code. Default value for this bit is false.

ObjectDisplayRequireUpdatePerViewItems 

Trying to update items on per view basis is very time consuming.

So only signal this bit if there are actual per view-dependent render items to update. Otherwise call to UpdatePerViewItems will be ignored. Default value for this bit is false.

This enum defines requirement flags of material additional to mesh stream requirements of MaterialRequiredStreams.

Enumerator:
MaterialRequirementSplitByMaterialID 

Plug-in needs to split mesh to sub meshes according to face material id.

This flag is on when the material is multi/sub material.

This enum describes the type of mesh element to be generated.

Each mesh element corresponds to a specific render item generated by calling Mesh::GenerateRenderItems() or MNMesh::GenerateRenderItems().

Enumerator:
MeshElementTypeSolidMesh 

Solid Mesh, it could be: vertex color mesh or general mesh.

This will be displayed in any viewport that requires smooth mesh.

MeshElementTypeVertexTicks 

Vertex ticks.

This will be displayed when the node has "Vertex Ticks" display option on or the vertex tick sub-object be selected.

MeshElementTypeEdge 

Edge mesh, this layer includes the edges.

This will be displayed in viewport that has "wireframe" or "hidden line" on or when the edge sub-object level is selected.

MeshElementTypeDiagonal 

Diagonal Mesh.

This is the dotted edge lines when user turn off "edges only" display property of a node and enable the wireframe mode of viewport.

MeshElementTypeFace 

Face Mesh.

This is the face render item of the mesh when this mesh is displayed in face sub-object level.

MeshElementTypeNormal 

Mesh normals.

This mesh element is required when we need to show all normals of selected face.

enum MeshPart

When a mesh is displayed in any sub-object level, this enum help decide which part of the mesh this mesh element belongs to.

Enumerator:
MeshPartSelected 

Selected part.

Only the selected part of the mesh will be displayed.

Remarks:
For an edge/diagonal/face mesh element, this value indicates that the mesh element only includes the selected edges/diagonals/faces of the mesh. For a vertex ticks mesh element, it will include the whole of the mesh. But selected vertices will be displayed in red(indicating they're selected).
MeshPartUnselected 

Unselected part.

Only the unselected part of the mesh will be displayed.

Remarks:
For an edge/diagonal/face mesh element, this value indicates that the render item only include the unselected edges/diagonals/faces of the mesh. For a vertex ticks mesh element, it will include the whole of the mesh. But selected vertices won't be displayed in red.
MeshPartWhole 

Whole part.

This value indicates an render item includes the whole of the mesh.

This enum defines some kinds of built-in mesh element descriptions.

Developer may query a built-in mesh element description by calling MeshElementDescription::GetBuiltInMeshElementDescription() using any enum value below.

Enumerator:
ElementDescriptionSolidMesh 

The mesh element description of a solid mesh.

MeshElementType : MeshElementTypeSolidMesh MeshPart : MeshPartWhole UseSoftSelectionColor : false BackfaceCull : false

ElementDescriptionVetexTicks 

The mesh element description of vertex ticks.

MeshElementType : MeshElementTypeVertexTicks MeshPart : MeshPartWhole UseSoftSelectionColor : false BackfaceCull : false

ElementDescriptionWireframe 

The mesh element description of a wireframe mesh.

MeshElementType : MeshElementTypeEdge MeshPart : MeshPartWhole UseSoftSelectionColor : false BackfaceCull : false

ElementDescriptionSelectedEdge 

The mesh element description of selected edges.

MeshElementType : MeshElementTypeEdge MeshPart : MeshPartSelected UseSoftSelectionColor : false BackfaceCull : false

ElementDescriptionDiagonal 

The mesh element description of diagonals.

MeshElementType : MeshElementTypeDiagonal MeshPart : MeshPartWhole UseSoftSelectionColor : false BackfaceCull : false

ElementDescriptionSelectedDiagonal 

The mesh element description of selected diagonals.

MeshElementType : MeshElementTypeDiagonal MeshPart : MeshPartSelected UseSoftSelectionColor : false BackfaceCull : false

ElementDescriptionSelectedFace 

The mesh element description of selected faces.

MeshElementType : MeshElementTypeFace MeshPart : MeshPartSelected UseSoftSelectionColor : false BackfaceCull : false

Supported primitive types.

Enumerator:
PrimitivePointList 

A list of independent points.

PrimitiveLineList 

A list of unconnected two-point line segments, such that the number of lines is the the total number of points divided by two.

PrimitiveLineStrip 

A polyline, where each point is connected to the previous vertex, yielding a single polyline with (vertex_count - 1) two-point line segments.

PrimitiveTriangleList 

A list of unconnected triangles, yielding (vertex_count / 3) triangles.

PrimitiveTriangleStrip 

A strip of connected triangles, such that each vertex after the first three vertices defines a new triangle, yielding (vertex_count - 1) connected triangles.

Remarks:
Strips of even a small number of triangles provides better performance and reduced memory consumption relative to the same geometry represented with a triangle list. There is substantial research and software devoted to generating optimal triangle strips. See http://en.wikipedia.org/wiki/Triangle_strip for details.
PrimitiveTypeCount 

This flag describes the way to clear the current buffers.

Enumerator:
ClearBackbuffer 

clear the target

ClearDepthBuffer 

clear the zbuffer

ClearStencilBuffer 

clear the stencil

ClearAll 

clear the zbuffer, target & stencil

        {
                ClearBackbuffer = 0x1, 
                ClearDepthBuffer = 0x2, 
                ClearStencilBuffer = 0x4, 
                ClearAll = 0x7,
        };

blend selector.

selects a blend source/destination

Enumerator:
BlendSelectorBlendFactor 

use blend factor in blend state

BlendSelectorBothInvSourceAlpha 

use inverse source alpha

BlendSelectorBothSourceAlpha 

use source aplha

BlendSelectorDestinationAlpha 

use the destination alpha

BlendSelectorDestinationColor 

use the destination color

BlendSelectorInvBlendFactor 

use inversed blend factor

BlendSelectorInvDestinationAlpha 

use the inverse destination alpha

BlendSelectorInvDestinationColor 

use the inverse destination color

BlendSelectorInvSourceAlpha 

use inverse source alpha

BlendSelectorInvSourceColor 

use inverse source color

BlendSelectorOne 

always 1,1,1

BlendSelectorSourceAlpha 

use the source alpha

BlendSelectorSourceAlphaSat 

use the source alpha and saturate it

BlendSelectorSourceColor 

use the source color

BlendSelectorZero 

always 0

enum CullMode

cull type.

Enumerator:
CullModeCW 

cull backfaces of CW polygons

CullModeCCW 

cull backfaces of CCW polygons

CullModeNone 

don't cull backfaces

enum FillMode

fill mode for polygons

Enumerator:
FillSolid 

draw as a solid object

FillWireFrame 

draw as a wireframe object

compare functions

Enumerator:
CompareFunctionAlways 

always true

CompareFunctionEqual 

true if equal

CompareFunctionGreater 

true if greater

CompareFunctionGreaterEqual 

true if greater or equal

CompareFunctionLess 

true if less

CompareFunctionLessEqual 

true if less or equal

CompareFunctionNever 

never true

CompareFunctionNotEqual 

true if not equal

Enumerator:
ColorWriteEnableNone 

None, all off.

ColorWriteEnableAlpha 

Write alpha.

Same as d3d.ColorWriteEnable.Alpha,

ColorWriteEnableBlue 

Write blue.

Same as d3d.ColorWriteEnable.Blue,

ColorWriteEnableGreen 

Write green.

Same as d3d.ColorWriteEnable.Green,

ColorWriteEnableRed 

Write red.

Same as d3d.ColorWriteEnable.Red,

ColorWriteEnableRedGreenBlue 

Write RGB but no alpha.

Same as d3d.ColorWriteEnable.RedGreenBlue,

ColorWriteEnableRedGreenBlueAlpha 

Write all RGBA.

Same as d3d.ColorWriteEnable.RedGreenBlueAlpha,

WRITEENABLE_FORCE_DWORD 

blend operations

Enumerator:
BlendOperationAdd 

add the source and destination together

BlendOperationMax 

max of the source and destination

BlendOperationMin 

min of the source and destination

BlendOperationSubtract 

dest gets dest minus source

BlendOperationReverseSubtract 

dest gets source minus dest

Stencil buffer operation.

Enumerator:
StencilOperationTypeDecrement 

Decrement the stencil buffer entry, wrapping to the maximum value if the new value is less than zero.

Same as d3d.StencilOperation.Decrement,

StencilOperationTypeDecrementSaturation 

Decrement the stencil buffer entry, clamping to zero.

Same as d3d.StencilOperation.DecrementSaturation,

StencilOperationTypeIncrement 

Increment the stencil buffer entry, wrapping to zero if the new value exceeds the maximum value.

Same as d3d.StencilOperation.Increment,

StencilOperationTypeIncrementSaturation 

Increment the stencil buffer entry, clamping to the maximum value.

Same as d3d.StencilOperation.IncrementSaturation,

StencilOperationTypeInvert 

Invert the bits in the stencil-buffer entry.

Same as d3d.StencilOperation.Invert

StencilOperationTypeKeep 

Do not update the entry in the stencil buffer.

This is the default value. Same as d3d.StencilOperation.Keep,

StencilOperationTypeReplace 

Replace the stencil-buffer entry with a reference value.

Same as d3d.StencilOperation.Replace,

StencilOperationTypeZeroStencil 

Set the stencil-buffer entry to 0.

Same as d3d.StencilOperation.Zero,

STENCILOP_FORCE_DWORD 

AccessType Types for accessing buffers.

Enumerator:
AccessTypeNone 

Data is not accessed yet.

ReadAcess 

Data will only be read.

WriteAcess 

Data will only be written.

ReadWriteAcess 
WriteDiscardAcess 

To be used by dynamic buffer for write-discard access.

        {
                AccessTypeNone = 0x0,
                ReadAcess = 0x1,
                WriteAcess = 0x2,
                /* Data will be read and written.
                */
                ReadWriteAcess = ReadAcess | WriteAcess,  //0x3
                WriteDiscardAcess
        };

TextureFormat indicates which type the texture is.

Enumerator:
TextureFormatUnknown 

Unknown texture format.

TextureFormatA8R8G8B8 

8 bit int for each of RGB and A, with byte ordering ARGB

TextureFormatA16B16G16R16 

16 bit int for each of RGB and A, with byte ordering ABGR

TextureFormatA32B32G32R32F 

32 bit float for each of RGB and A, with byte ordering ABGR

TextureFormatCount 

This enum specifies the feature levels device supported.

Enumerator:
Level_Unknown 

Unknown feature level.

Level_NULL 

NULL feature level.

Level2_0 

Feature Level 2_0.

Level2_1 

Feature Level 2_1.

Level3_0 

Feature Level 3_0.

Level3_1 

Feature Level 3_1.

Level4_0 

Feature Level 4_0.

Level4_1 

Feature Level 4_1 Notes: Feature Level4_1 corresponds to the NV DX10+ device, which supports some of DX10.1 features.

Level4_5 

Feature Level 4_5 Notes: Feature Level4_5 corresponds to DX10.1 device, which supports all of DX10.1 features.

The OS must be Vista SP1 or above.

Level5_0 

Feature Level 5_0 Notes: Feature Level5_0 corresponds to DX11 device, which supports all of DX11 features.

The OS must be "Vista SP2 + Platform update" or above.

Level_Count 

Feature Level count.

        {
                Level_Unknown = 0,
                Level_NULL = 5,
                Level2_0   = 20,
                Level2_1   = 21,
                Level3_0   = 30,
                Level3_1   = 31,
                Level4_0   = 40,
                Level4_1   = 41,
                Level4_5   = 45,
                Level5_0   = 50,

                Level_Count = 9
        };

Texture type enums.

Enumerator:
TextureTypeUnknown 

unknown texture type

TextureTypeImage1D 

1d bitmap texture

TextureTypeImage1DArray 

1d bitmap texture array

TextureTypeImage2D 

bitmap texture

TextureTypeImage2DArray 

bitmap texture

TextureTypeCubeMap 

cube map texture

TextureTypeVolume 

volume texture

TextureTypeCount 

Resource usage, used for texture.

Enumerator:
ResourceUsageNormal 

Normal usage, means it's a video memory resource Immutable or default depending on access.

ResourceUsageDynamic 

If the resource contents are to be changed often, ResourceUsageDynamic is recommended to achieve fast update.

Used with the correct map flag( WriteDiscard or WriteNoOverwrite), maximum performance to change the contents will be achieved. Meaning of WriteNoOverwrite: WriteNoOverwrite signifies that the application promises not to write to data that the GPU is using. In exchange, the GPU allows the application to write to other parts of the same buffer. The application must ensure that it does not write over any data in use by the GPU. Common Usage of WriteDiscard with WriteNoOverwrite as map flags: WriteDiscard and WriteNoOverwrite are normally used in conjunction with dynamic index/vertex buffers, although they can also be used with dynamic textures. A common use of these two flags involves filling dynamic index/vertex buffers with geometry that can be seen from the camera's current position. The first time that data is entered into the buffer on a given frame, Map is called with WriteDiscard; doing so invalidates the previous contents of the buffer. The buffer is then filled with all available data. Subsequent writes to the buffer within the same frame should use WriteNoOverwrite. This will enable the CPU to access a resource that is potentially being used by the GPU as long as the restrictions described previously are respected.

ResourceUsageStaging 

Staging usage, means it's a system memory resource on each devices.

For cpu readback

ResourceUsageMask 

Usage mask.

For anding off the high bits

ResourceUsageStream 

Usage for stream output.

For vb & ibs, may be used as a texture

ResourceUsageTarget 

Usage for render target, it means the resource created from video memory and can be used as render-target for vb & ibs & textures, may be used as a render target/stream output buffer.

Deprecated:
Deprecated enums in 3ds Max 2013.

NOTE: There's no replacement for this enum.

Enumerator:
RenderItemCategorySolidMesh 
RenderItemCategoryDiagonalMesh 
RenderItemCategoryEdgeMesh 
RenderItemCategorySubObjectVertexTicks 
RenderItemCategorySubObjectEdgeMesh 
RenderItemCategoryOtherSubObjects 
RenderItemCategoryGizmo 

This enum defines in what group a render item is visible.

Enumerator:
RenderItemVisible_Unknown 

By default, all render items are in default visible group.

That means the system will determine when the render item will be displayed based on the render item traits. If the render item is mesh, it will be displayed in shaded/realistic mode. If the render item is lines, it will be displayed in wireframe/edged faces mode. Any other render items including display callbacks will be displayed as gizmos.

RenderItemVisible_Shaded 

This kind of render item will only be visible if visual style is shaded or realistic.

RenderItemVisible_Wireframe 

This kind of render item is visible in wireframe visual style, or edged faces is on, or "wireframe selected" is on and the node is selected.

RenderItemVisible_Gizmo 

This kind of render item is always visible, no matter what the visual style is.

This enum contains flags that can be combined together to specify which part is required by the node when updating render items.

Enumerator:
ObjectComponentSolidMesh 

Require solid mesh, it could be: vertex color mesh or general mesh.

This will be displayed in any viewport that requires smooth mesh.

ObjectComponentWireframe 

Require wireframe mesh, this layer includes the edges.

This will be displayed in viewport that has "wireframe" or "hidden line" on.

ObjectComponentVertexTicks 

Require vertex ticks.

This will be displayed when the node has "Vertex Ticks" display option on or the vertex tick sub-object be selected.

ObjectComponentDiagonal 

Require diagonals.

This is the dotted edge lines when user enabled "show edges" of a node and enable the wireframe mode of viewport.

ObjectComponentSelected 

one or more of the node is selected

ObjectComponentUnselected 

one or more of the node is not selected

ObjectComponentBackfaceCull 

one or more of the node has the object property "Backface Cull" on.

ObjectComponentVertexColorSoftSelection 

one or more of the node has the object property "Vertex Channel Display" on and the active channel is soft selection


Function Documentation

DataBridgeAPI size_t MaxSDK::Graphics::GetVertexStride ( const VertexFieldType  type )

Get the vertex stride by a given vertex type, in bytes.

Parameters:
type the vertex type.
Returns:
the vertex stride, in bytes.
DataBridgeAPI size_t MaxSDK::Graphics::GetIndexStride ( const IndexType  type )

Get the index stride by a given index type, in bytes.

Parameters:
type the index type.
Returns:
the index stride, in bytes.
CoreExport IDisplayManager* MaxSDK::Graphics::GetIDisplayManager ( )
Deprecated:
Deprecated function.

Use GetIDisplayManager2() instead. /*! Helper function to access the IDisplayManager core interface

Returns:
A pointer to IDisplayManager
CoreExport IDisplayManager2* MaxSDK::Graphics::GetIDisplayManager2 ( )

Helper function to access the IDisplayManager2 core interface.

Returns:
A pointer to IDisplayManager2
bool MaxSDK::Graphics::IsRetainedModeEnabled ( ) [inline]

Helper function to test whether the new viewport graphics system is running.

Returns:
TRUE if new viewport graphics is active
{
        IDisplayManager* pGraphicsManager = GetIDisplayManager();
        return NULL != pGraphicsManager && pGraphicsManager->IsRetainedModeEnabled();
}
bool MaxSDK::Graphics::IsHardwareHitTesting ( ViewExp vpt ) [inline]

Helper function to test whether the new viewport graphics system is performing hardware hit testing.

Parameters:
vpt The specific viewport in which we want to know whether we are performing hardware hit testing.
Returns:
TRUE if new viewport graphics is performing hardware hit testing.
{
        IDisplayManager* pGraphicsManager = GetIDisplayManager();
        return NULL != pGraphicsManager && pGraphicsManager->IsHardwareHitTesting(vpt);
}
bool MaxSDK::Graphics::operator== ( void *  pPtr,
const RefPtr< RefObjectType, SafeRefObjectType, LifeTimePolicy > &  pInterface 
) [inline]
{
        return pPtr == pInterface.GetPointer();
}
bool MaxSDK::Graphics::operator!= ( void *  pPtr,
const RefPtr< RefObjectType, SafeRefObjectType, LifeTimePolicy > &  pInterface 
) [inline]
{
        return pPtr != pInterface.GetPointer();
}
GraphicsDriverAPI void MaxSDK::Graphics::MaxWorldMatrixToMatrix44 ( Matrix44 &  outMatrix,
const Matrix3 inMatrix 
)

Convert Matrix3 to Matrix44.

Parameters:
outMatrix the Matrix44 output
inMatrix the source Matrix3
GraphicsDriverAPI void MaxSDK::Graphics::Matrix44ToMaxWorldMatrix ( Matrix3 outMatrix,
const Matrix44 &  inMatrix 
)

Convert Matrix44 to Matrix3.

Parameters:
outMatrix the Matrix3 output
inMatrix the source Matrix44
GraphicsDriverAPI const MeshElementDescription& MaxSDK::Graphics::GetBuiltInMeshElementDescription ( BuiltInMeshElementDescription  type )

Get a specified built-in mesh element description.

Parameters:
type the kind of built-in mesh element description
Returns:
the specified mesh element description.
GraphicsDriverAPI size_t MaxSDK::Graphics::GetTextureFormatPixelSize ( TextureFormat  format )

Get the number of bytes for each pixel by a given texture format.

Parameters:
format The given texture format.
Returns:
The number of bytes for each pixel by that given texture format.
MAX_DEPRECATED GraphicsDriverAPI void MaxSDK::Graphics::GenerateRenderItems ( RenderItemHandleArray &  renderItems,
Mesh pMaxMesh,
unsigned long  renderItemCategoryFlags,
const MaterialRequiredStreams &  requiredStreams 
)
Deprecated:
Deprecated method in terms of implementation as of 3ds Max 2013.

Please use Mesh::GenerateRenderItems() instead

MAX_DEPRECATED GraphicsDriverAPI void MaxSDK::Graphics::GenerateRenderItems ( RenderItemHandleArray &  renderItems,
MNMesh pMaxMesh,
unsigned long  renderItemCategoryFlags,
const MaterialRequiredStreams &  requiredStreams 
)
Deprecated:
Deprecated method in terms of implementation as of 3ds Max 2013.

Please use MNMesh::GenerateRenderItems() instead

GraphicsDriverAPI VertexBufferHandle MaxSDK::Graphics::GenerateInstanceData ( Matrix3 worldTransforms,
size_t  count 
)

Generate the instance data from a Matrix3 array.

Remarks:
The input matrix array should contain object-to-world matrices. Each matrix is used to render an mesh instance. The return object VertexBufferHandle is needed by GenerateInstanceRenderItem(). Multiple instance render items can sharing the same VertexBufferHandle. The returned vertex buffer contains world matrices and inverse transpose world matrices. This function automatically compute inverse transpose world matrices from world matrices and then fill the buffer.
Parameters:
worldTransforms pointer to world transform matrices. Each matrix is a instance of Mesh.
count the number of the instances
Returns:
the instance data handle.
GraphicsDriverAPI bool MaxSDK::Graphics::GenerateInstanceRenderItem ( RenderItemHandle &  hInstanceRenderItem,
const RenderItemHandle &  hTupleMeshHandle,
const VertexBufferHandle &  hInstanceData 
)

Generate the instance render item from a tuple mesh and a Matrix3 array.

Remarks:
Instance rendering is a way to draw many objects that use the same geometry. These objects shares same materials and modifiers. The only difference between objects is world transformation. You can specify a matrix array for the mesh, then the mesh will be drawn for many times. Each corresponds to a matrix in the array. Typical usage of these instance functions should like following:
        //Sample code fragment in IDisplay::UpdateDisplay()
        //1. Generate render items from mesh.
        mesh.GenerateRenderItems(tempRenderItemArray, generateRenderItemsContext);

        //2. Generate instance data. The data can be shared by multiply instance render items.
        MaxSDK::Graphics::VertexBufferHandle hInstanceData = 
        MaxSDK::Graphics::GenerateInstanceData(Matrices, NumberOfMatrices);

        //3. Check all of the render items and covert them to instance render item.
        for (size_t i = 0; i < tempRenderItemArray.length(); ++i)
        {
                MaxSDK::Graphics::RenderItemHandle hInstanceItem;
                //4. Try to generate instance render item. Only tuple mesh render item can convert to instance render item
                if (MaxSDK::Graphics::GenerateInstanceRenderItem(hInstanceItem, tempRenderItemArray[i], hInstanceData))
                {
                        //If the function successed, add the generated instance render item to final render item array(mRenderItemHandles).
                        mRenderItemHandles.append(hInstanceItem) ;
                }
                else
                {
                        //If the function failed, add original render item to the final array(mRenderItemHandles).
                        //Typically this render item is other render item type like immediate render item.
                        mRenderItemHandles.append(tempRenderItemArray[i]);
                }
        }
Parameters:
hInstanceRenderItem the instance render item handle which can replace original tuple mesh render item.
hTupleMeshHandle handle of a tuple mesh render item
hInstanceData handle generated by GenerateInstanceData
Returns:
true if successful created the instance render item.

Variable Documentation