This reference page is linked to from the following overview topics: Hardware Shader UI Feature.
A new interface for 3ds Max 2008.
This interface is used for manipulating material shading model in the viewport. A material would implement this interface so as to control the "Show map in viewport" (SMIV) button. In 3dsmax 2008 the SMIV button can now show as a flyoff, for regular shading (Blue) and Hardware shading (Pink). If a material supports a Hardware representation then it can implement this interface and return the correct level support in IsShadingModelSupported. This will mean the UI is reflective of the support available. This interface DOES NOT provide any support for the actual Hardware implementation - purely the UI synchronisation. An implementation for this interface can be found at .cpp where it support the case where the material deals with plugin hardware shaders as well. Currently in 3ds max 2008, only two materials implement a Hardware version, and they are the Standard Material and Mental Images's Architectural and Design Material.
#include <IMaterialViewportShading.h>
Public Types |
|
enum | ShadingModel { Standard, Hardware, OtherTypes } |
This enumeration defines how the material is behaving in viewport. More... |
|
Public Member Functions |
|
virtual CoreExport BaseInterface * | GetInterface (Interface_ID id) |
virtual CoreExport Interface_ID | GetID () |
Static Public Member Functions |
|
static CoreExport bool | IsShadingModelSupported (const MtlBase &material, ShadingModel model) |
Does the material support a specific shading
model in viewport. |
|
static CoreExport ShadingModel | GetCurrentShadingModel (const MtlBase &material) |
Used to query the material for its current
level of viewport rendering. |
|
static CoreExport bool | SetCurrentShadingModel (MtlBase &material, ShadingModel model) |
Set the shading model of the material in
viewport and update the UI of material editor. |
|
static CoreExport int | GetSupportedMapLevels (const MtlBase &material) |
The map levels needs to be defined by the
material, it will tell the various shader compilers how far to go
in the search of materials/maps. |
|
Protected Member Functions |
|
virtual bool | IsShadingModelSupported (ShadingModel model) const =0 |
Does the material support a specific shading
model in viewport. |
|
virtual ShadingModel | GetCurrentShadingModel () const =0 |
Used to query the material for its current
level of viewport rendering. |
|
virtual bool | SetCurrentShadingModel (ShadingModel model)=0 |
Set the shading model of the material in
viewport. |
|
virtual int | GetSupportedMapLevels () const =0 |
The map levels needs to be defined by the
material, it will tell the various shader compilers how far to go
in the search of materials/maps. |
enum ShadingModel |
This enumeration defines how the material is behaving in viewport.
{ Standard, Hardware, OtherTypes, };
virtual CoreExport BaseInterface* GetInterface | ( | Interface_ID | id | ) | [virtual] |
Reimplemented from BaseInterface.
virtual CoreExport Interface_ID GetID | ( | ) | [virtual] |
Reimplemented from BaseInterface.
virtual bool IsShadingModelSupported | ( | ShadingModel | model | ) | const [protected, pure virtual] |
Does the material support a specific shading model in viewport.
This will be used to enable the SMIV options.
model | The shading model, for now it must be Standard or Hardware. |
virtual ShadingModel GetCurrentShadingModel | ( | ) | const [protected, pure virtual] |
Used to query the material for its current level of viewport rendering.
virtual bool SetCurrentShadingModel | ( | ShadingModel | model | ) | [protected, pure virtual] |
Set the shading model of the material in viewport.
model | The shading model, must be Standard or Hardware. |
virtual int GetSupportedMapLevels | ( | ) | const [protected, pure virtual] |
The map levels needs to be defined by the material, it will tell the various shader compilers how far to go in the search of materials/maps.
Most materials will stop searching after one level, as the shader becomes too complex. For example specifiying 1 will mean the first map found will be used e.g a BitmapTex in a diffuse slot. The compiler will not search any further for maps to support. In this case it will probably bake the submaps to textures and will not try to generate shader code for these submaps.
static CoreExport bool IsShadingModelSupported | ( | const MtlBase & | material, |
ShadingModel | model | ||
) | [static] |
Does the material support a specific shading model in viewport.
This will be used to enable the SMIV options.
material | The material you want to test. If the material does not support IMaterialViewportShading interface, then only standard shading model is supported. |
model | The shading model, for now it must be Standard or Hardware. |
static CoreExport ShadingModel GetCurrentShadingModel | ( | const MtlBase & | material | ) | [static] |
Used to query the material for its current level of viewport rendering.
material | The material you want to get shading model from. If the material does not support IMaterialViewportShading interface, then the function will return Standard shading model. |
static CoreExport bool SetCurrentShadingModel | ( | MtlBase & | material, |
ShadingModel | model | ||
) | [static] |
Set the shading model of the material in viewport and update the UI of material editor.
material | The material you want to set its shading model. If the material does not support the shading model, the function will fail. |
model | The shading model, must be Standard or Hardware. |
static CoreExport int GetSupportedMapLevels | ( | const MtlBase & | material | ) | [static] |
The map levels needs to be defined by the material, it will tell the various shader compilers how far to go in the search of materials/maps.
Most materials will stop searching after one level, as the shader becomes too complex. For example specifiying 1 will mean the first map found will be used e.g a BitmapTex in a diffuse slot. The compiler will not search any further for maps to support. In this case it will probably bake the submaps to textures and will not try to generate shader code for these submaps.
material | The material you want to get map levels from. If the material does not support IMaterialViewportShading interface, the function returns 1. |