Public Member Functions

StdMat2 Class Reference

Search for all occurrences

Detailed Description

See also:
Class StdMat, Class Shader, Class Sampler, Class Class_ID.

Description:
This class is available in release 3.0 and later only.

This is the base class for all materials supporting the plug-in shader mechanism. The 3ds Max Standard material is derived from this class.

#include <stdmat.h>

Inheritance diagram for StdMat2:
Inheritance graph
[legend]

List of all members.

Public Member Functions

BOOL  SupportsShaders ()
virtual BOOL  KeyAtTimeByID (ParamID id, TimeValue t)=0
  Checks if the material parameter has a key set at the specified time.
MAX_DEPRECATED BOOL  KeyAtTime (int id, TimeValue t)
virtual int  GetMapState (int indx)=0
virtual MSTR  GetMapName (int indx)=0
virtual void  SyncADTexLock (BOOL lockOn)=0
virtual BOOL  SwitchShader (Class_ID id)=0
virtual Shader GetShader ()=0
virtual BOOL  IsFaceted ()=0
virtual void  SetFaceted (BOOL on)=0
virtual long  StdIDToChannel (long id)=0
virtual void  SetShading (int s)
virtual int  GetShading ()
virtual BOOL  SwitchSampler (Class_ID id)=0
virtual Sampler GetPixelSampler (int mtlNum, BOOL backFace)=0
virtual BOOL  GetSelfIllumColorOn (int mtlNum=0, BOOL backFace=FALSE)=0
virtual Color  GetSelfIllumColor (int mtlNum, BOOL backFace)=0
virtual Color  GetSelfIllumColor (TimeValue t)=0
virtual void  SetSelfIllumColorOn (BOOL on)=0
virtual void  SetSelfIllumColor (Color c, TimeValue t)=0
virtual float  GetReflectionDim (float diffIllumIntensity)
virtual Color  TranspColor (float opac, Color filt, Color diff)=0
virtual float  GetEffOpacity (ShadeContext &sc, float opac)=0

Member Function Documentation

BOOL SupportsShaders ( ) [inline, virtual]
Remarks:
This method returns TRUE if the material supports shaders, otherwise FALSE.
Default Implementation:
{ return FALSE; }

Reimplemented from Mtl.

{ return TRUE; }
virtual BOOL KeyAtTimeByID ( ParamID  id,
TimeValue  t 
) [pure virtual]

Checks if the material parameter has a key set at the specified time.

Parameters:
id - The ID of the parameter to check.
t - The time to check.
Returns:
TRUE if the specified parameter whose ID is passed has a key at the time passed; otherwise FALSE.
MAX_DEPRECATED BOOL KeyAtTime ( int  id,
TimeValue  t 
)
Deprecated:
Deprecated in 3ds Max 2012. Please use KeyAtTimeByID instead.
virtual int GetMapState ( int  indx ) [pure virtual]
Remarks:
Returns a value to indicate the state of the specified map. One of the following values:

0: No map present.

1: Map present but disabled.

2: Map present and on.
Parameters:
int indx

The index of the map to check. See List of Material Texture Map Indices.
virtual MSTR GetMapName ( int  indx ) [pure virtual]
Remarks:
Returns the name of the map whose index is passed.
Parameters:
int indx

The index of the map to check. See List of Material Texture Map Indices.
virtual void SyncADTexLock ( BOOL  lockOn ) [pure virtual]
Remarks:
This method is called when the state of the Ambient/Diffuse Texture lock is toggled. The material should store the setting and update the UI as required.
Parameters:
BOOL lockOn

TRUE for on; FALSE for off.
virtual BOOL SwitchShader ( Class_ID  id ) [pure virtual]
Remarks:
This method is called when a new Shader has been selected.
Parameters:
Class_ID id

The Class_ID of the new shader to switch to.
virtual Shader* GetShader ( ) [pure virtual]
Remarks:
Returns a pointer to the Shader in use. See Class Shader for details on this plug-in type.
virtual BOOL IsFaceted ( ) [pure virtual]
Remarks:
Returns TRUE if the shader is faceted; otherwise FALSE. The pre-R3 Constant shader is faceted. The other shaders are not.
virtual void SetFaceted ( BOOL  on ) [pure virtual]
Remarks:
Sets the faceted setting of the Shader.
Parameters:
BOOL on

TRUE if it is faceted; FALSE if not.
virtual long StdIDToChannel ( long  id ) [pure virtual]
Remarks:
Returns the index of the mapping channels which corresponds to the specified Standard materials texture map ID.
Parameters:
long id

The ID whose corresponding channel to return. See List of Material Texture Map Indices.
Returns:
The zero based index of the channel. If there is not a corresponding channel return -1.
virtual void SetShading ( int  s ) [inline, virtual]
Remarks:
Sets the active shader to the one specified. The supported types are the pre-R3 shaders.
Parameters:
int s

One of the following values (all other values are a NOOP):

SHADE_CONST (Phong, faceted).

SHADE_PHONG

SHADE_METAL

SHADE_BLINN
Default Implementation:
{}

Implements StdMat.

{}
virtual int GetShading ( ) [inline, virtual]
Remarks:
Returns one of the pre-R3 shader types. If an R3 shader type is active, SHADE_BLINN is returned.
Returns:
One of the following values:

SHADE_CONST (Phong, faceted).

SHADE_PHONG

SHADE_METAL

SHADE_BLINN
Default Implementation:
{ return -1; }

Implements StdMat.

{ return -1; } 
virtual BOOL SwitchSampler ( Class_ID  id ) [pure virtual]
Remarks:
This method is called when the active Sampler is switched.
Parameters:
Class_ID id

The Class_ID of the new Sampler.
virtual Sampler* GetPixelSampler ( int  mtlNum,
BOOL  backFace 
) [pure virtual]
Remarks:
Returns a pointer to the sampler used.

Reimplemented from Mtl.

virtual BOOL GetSelfIllumColorOn ( int  mtlNum = 0,
BOOL  backFace = FALSE 
) [pure virtual]
Remarks:
Returns the Self Illumination Color On setting. TRUE if on; FALSE if off.
Parameters:
These parameters are not used and may be ignored.

Reimplemented from Mtl.

virtual Color GetSelfIllumColor ( int  mtlNum,
BOOL  backFace 
) [pure virtual]
Remarks:
Returns the Self Illumination Color setting.
Parameters:
These parameters are not used and may be ignored.

Reimplemented from Mtl.

virtual Color GetSelfIllumColor ( TimeValue  t ) [pure virtual]
Remarks:
Returns the Self Illumination Color setting at the specified time.
Parameters:
TimeValue t

The time at which to get the color.
virtual void SetSelfIllumColorOn ( BOOL  on ) [pure virtual]
Remarks:
Sets the Self Illumination Color On setting
Parameters:
BOOL on

TRUE for on; FALSE for off.
virtual void SetSelfIllumColor ( Color  c,
TimeValue  t 
) [pure virtual]
Remarks:
Sets the Self Illumination Color setting at the specified time.
Parameters:
Color c

The color to set.

TimeValue t

The time at which to set the color.
virtual float GetReflectionDim ( float  diffIllumIntensity ) [inline, virtual]
{ return 1.0f; }        
virtual Color TranspColor ( float  opac,
Color  filt,
Color  diff 
) [pure virtual]
virtual float GetEffOpacity ( ShadeContext sc,
float  opac 
) [pure virtual]

StdMat2 StdMat2 StdMat2 StdMat2 StdMat2 StdMat2 StdMat2 StdMat2 StdMat2 StdMat2
StdMat2 StdMat2 StdMat2 StdMat2 StdMat2 StdMat2 StdMat2 StdMat2 StdMat2 StdMat2