3ds Max C++ API Reference
StandardMaterialHandle Class Reference

StandardMaterialHandle is a material class to support phong style material . More...

#include <StandardMaterialHandle.h>

+ Inheritance diagram for StandardMaterialHandle:

Public Member Functions

GraphicsDriverAPI StandardMaterialHandle ()
 
GraphicsDriverAPI StandardMaterialHandle (const StandardMaterialHandle &from)
 
GraphicsDriverAPI StandardMaterialHandleoperator= (const StandardMaterialHandle &from)
 
virtual GraphicsDriverAPI ~StandardMaterialHandle ()
 
GraphicsDriverAPI bool Initialize ()
 Initialize the standard material instance. More...
 
virtual GraphicsDriverAPI const MaterialRequiredStreamsGetRequiredStreams () const
 Returns the material required streams to tell how to setup mesh data. More...
 
GraphicsDriverAPI void SetAmbient (const AColor &color)
 Sets ambient color. More...
 
GraphicsDriverAPI const AColorGetAmbient () const
 Returns the ambient color. More...
 
GraphicsDriverAPI void SetDiffuse (const AColor &color)
 Sets diffuse color. More...
 
GraphicsDriverAPI const AColorGetDiffuse () const
 Returns the diffuse color. More...
 
GraphicsDriverAPI void SetSpecular (const AColor &color)
 Sets specular color. More...
 
GraphicsDriverAPI const AColorGetSpecular () const
 Returns the specular color. More...
 
GraphicsDriverAPI void SetSpecularLevel (float level)
 Sets specular level. More...
 
GraphicsDriverAPI float GetSpecularLevel () const
 Returns the specular level. More...
 
GraphicsDriverAPI void SetSpecularPower (float power)
 Sets specular power. More...
 
GraphicsDriverAPI float GetSpecularPower () const
 Returns the specular power. More...
 
GraphicsDriverAPI void SetEmission (const AColor &color)
 Sets emission color. More...
 
GraphicsDriverAPI const AColorGetEmission () const
 Returns the emission color. More...
 
GraphicsDriverAPI void SetOpacity (float opacity)
 Sets opacity value. More...
 
GraphicsDriverAPI float GetOpacity () const
 Returns the opacity value. More...
 
GraphicsDriverAPI void SetTwoSided (bool twoSided)
 Sets two side flag. More...
 
GraphicsDriverAPI bool GetTwoSided () const
 Returns the two side flag. More...
 
GraphicsDriverAPI void SetDiffuseTexture (const BaseRasterHandle &hTexture)
 Sets diffuse texture. More...
 
GraphicsDriverAPI BaseRasterHandle GetDiffuseTexture ()
 Returns the diffuse texture. More...
 
GraphicsDriverAPI void ClearDiffuseTexture ()
 Clear the diffuse texture. More...
 
GraphicsDriverAPI void SetOpacityTexture (const BaseRasterHandle &hTexture)
 Sets opacity texture. More...
 
GraphicsDriverAPI BaseRasterHandle GetOpacityTexture ()
 Returns the opacity texture. More...
 
GraphicsDriverAPI void ClearOpacityTexture ()
 Clear the opacity texture. More...
 
- Public Member Functions inherited from BaseMaterialHandle
GraphicsDriverAPI BaseMaterialHandle ()
 
GraphicsDriverAPI BaseMaterialHandle (const BaseMaterialHandle &from)
 
GraphicsDriverAPI BaseMaterialHandleoperator= (const BaseMaterialHandle &from)
 
virtual GraphicsDriverAPI ~BaseMaterialHandle ()
 
GraphicsDriverAPI void Activate (DrawContext &drawContext)
 Activates the material handle with the specified pipeline context. More...
 
GraphicsDriverAPI void Terminate ()
 Terminates the material handle, performing any cleanup required by the material handle. More...
 
GraphicsDriverAPI unsigned int GetPassCount (DrawContext &drawContext) const
 Retrieves the number of passes required to render the material handle. More...
 
GraphicsDriverAPI void ActivatePass (DrawContext &drawContext, unsigned int pass)
 Activates the specified pass of the material handle, at which point it may render geometry as necessary for the pass. More...
 
GraphicsDriverAPI void PassesFinished (DrawContext &drawContext)
 Called after all of the passes for the material handle have been drawn. More...
 
- Public Member Functions inherited from SmartHandle
virtual GraphicsDriverAPI ~SmartHandle ()
 destructor More...
 
GraphicsDriverAPI bool IsValid () const
 Check if this handle is valid. More...
 
GraphicsDriverAPI void Release ()
 Release the underlying graphics objects. More...
 
GraphicsDriverAPI Identifier GetObjectID () const
 Get the underlying graphics object id. More...
 
GraphicsDriverAPI void SetPointer (IRefObject *pObject)
 
GraphicsDriverAPI IRefObjectGetPointer () const
 Get the underlying graphics object pointer. More...
 
bool operator== (const SmartHandle &rhs) const
 
bool operator!= (const SmartHandle &rhs) const
 
bool operator< (const SmartHandle &rhs) const
 
bool operator<= (const SmartHandle &rhs) const
 
bool operator> (const SmartHandle &rhs) const
 
bool operator>= (const SmartHandle &rhs) const
 
GraphicsDriverAPI SmartHandle (const SmartHandle &)
 
GraphicsDriverAPI SmartHandleoperator= (const SmartHandle &)
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 
- Protected Member Functions inherited from SmartHandle
GraphicsDriverAPI SmartHandle ()
 
- Protected Attributes inherited from SmartHandle
IRefObjectmpObject
 

Detailed Description

StandardMaterialHandle is a material class to support phong style material .

This class is used for viewport display and Quicksilver. It's used by RenderItemHandle::SetCustomMaterial() to describe the phong style surface. How to use:

hMaterial.Initialize();
pItem->SetCustomMaterial(hMaterial); // pItem is an instance of RenderItemHandle

Constructor & Destructor Documentation

◆ StandardMaterialHandle() [1/2]

◆ StandardMaterialHandle() [2/2]

◆ ~StandardMaterialHandle()

Member Function Documentation

◆ operator=()

◆ Initialize()

GraphicsDriverAPI bool Initialize ( )

Initialize the standard material instance.

A StandardMaterialHandle must be initialized before it's used.

Returns
true if successfully initialized, false otherwise.

◆ GetRequiredStreams()

virtual GraphicsDriverAPI const MaterialRequiredStreams* GetRequiredStreams ( ) const
virtual

Returns the material required streams to tell how to setup mesh data.

When a StandardMaterialHandle is used by RenderItemHandle::SetCustomMaterial(), it also needs to know about the material requirement streams to setup corresponding mesh data. It could be used by GenerateRenderItems::GenerateRenderItems() for RenderItemHandle.

Returns
the material required streams.

Reimplemented from BaseMaterialHandle.

◆ SetAmbient()

GraphicsDriverAPI void SetAmbient ( const AColor color)

Sets ambient color.

Parameters
[in]colorThe ambient color.

◆ GetAmbient()

GraphicsDriverAPI const AColor& GetAmbient ( ) const

Returns the ambient color.

Returns
the ambient color.

◆ SetDiffuse()

GraphicsDriverAPI void SetDiffuse ( const AColor color)

Sets diffuse color.

If diffuse texture exists, this value will be ignored.

Parameters
[in]colorThe diffuse color.

◆ GetDiffuse()

GraphicsDriverAPI const AColor& GetDiffuse ( ) const

Returns the diffuse color.

Returns
the diffuse color.

◆ SetSpecular()

GraphicsDriverAPI void SetSpecular ( const AColor color)

Sets specular color.

Parameters
[in]colorThe specular color.

◆ GetSpecular()

GraphicsDriverAPI const AColor& GetSpecular ( ) const

Returns the specular color.

Returns
the specular color.

◆ SetSpecularLevel()

GraphicsDriverAPI void SetSpecularLevel ( float  level)

Sets specular level.

Parameters
[in]levelThe specular level.

◆ GetSpecularLevel()

GraphicsDriverAPI float GetSpecularLevel ( ) const

Returns the specular level.

Returns
the specular level.

◆ SetSpecularPower()

GraphicsDriverAPI void SetSpecularPower ( float  power)

Sets specular power.

Parameters
[in]powerThe specular power.

◆ GetSpecularPower()

GraphicsDriverAPI float GetSpecularPower ( ) const

Returns the specular power.

Returns
the specular power.

◆ SetEmission()

GraphicsDriverAPI void SetEmission ( const AColor color)

Sets emission color.

Parameters
[in]colorThe emission color.

◆ GetEmission()

GraphicsDriverAPI const AColor& GetEmission ( ) const

Returns the emission color.

Returns
the emission color.

◆ SetOpacity()

GraphicsDriverAPI void SetOpacity ( float  opacity)

Sets opacity value.

If opacity texture exists, this value will be ignored.

Parameters
[in]opacityThe opacity value.

◆ GetOpacity()

GraphicsDriverAPI float GetOpacity ( ) const

Returns the opacity value.

Returns
the opacity value.

◆ SetTwoSided()

GraphicsDriverAPI void SetTwoSided ( bool  twoSided)

Sets two side flag.

Parameters
[in]twoSidedThe two side flag.

◆ GetTwoSided()

GraphicsDriverAPI bool GetTwoSided ( ) const

Returns the two side flag.

Returns
the two side flag.

◆ SetDiffuseTexture()

GraphicsDriverAPI void SetDiffuseTexture ( const BaseRasterHandle hTexture)

Sets diffuse texture.

Parameters
[in]hTextureThe diffuse texture handle.

◆ GetDiffuseTexture()

GraphicsDriverAPI BaseRasterHandle GetDiffuseTexture ( )

Returns the diffuse texture.

Returns
the diffuse texture.

◆ ClearDiffuseTexture()

GraphicsDriverAPI void ClearDiffuseTexture ( )

Clear the diffuse texture.

◆ SetOpacityTexture()

GraphicsDriverAPI void SetOpacityTexture ( const BaseRasterHandle hTexture)

Sets opacity texture.

Parameters
[in]hTextureThe opacity texture.

◆ GetOpacityTexture()

GraphicsDriverAPI BaseRasterHandle GetOpacityTexture ( )

Returns the opacity texture.

Returns
the opacity texture.

◆ ClearOpacityTexture()

GraphicsDriverAPI void ClearOpacityTexture ( )

Clear the opacity texture.