3ds Max C++ API Reference
shaders.h File Reference
#include "iparamb2.h"
#include "stdmat.h"
#include "buildver.h"

Classes

class  ShaderParamDlg
 A shader parameter dialog class. More...
 
class  BaseShader
 One of the base classes for the creation of the Shaders, which plug-in to the Standard material[?]. More...
 
class  Shader
 Used by developers to create Shader plug-ins. More...
 

Macros

#define N_ID_CHANNELS   16
 Number of IDs in stdMat. More...
 
#define OPACITY_PARAM   0
 
#define DEFAULT_SOFTEN   0.1f
 
#define SELFILLUM_CLR_ON   (1<<16)
 
#define HAS_BUMPS   0x01L
 Indicates that the bump mapping is present. More...
 
#define HAS_REFLECT   0x02L
 Indicates that there is any kind of reflection (raytraced, etc). More...
 
#define HAS_REFRACT   0x04L
 Indicates that there is any kind of refraction. More...
 
#define HAS_OPACITY   0x08L
 Indicates that opacity mapping is used. More...
 
#define HAS_REFLECT_MAP   0x10L
 Indicates that there is a reflection map only. More...
 
#define HAS_REFRACT_MAP   0x20L
 Indicates that there is a refraction map only. More...
 
#define HAS_MATTE_MTL   0x40L
 
#define UNSUPPORTED_CHANNEL   0x01L
 Indicates that the channel is not supported (is not used). More...
 
#define CLR_CHANNEL   0x02L
 A color channel. More...
 
#define MONO_CHANNEL   0x04L
 A monochrome channel. More...
 
#define BUMP_CHANNEL   0x08L
 The bump mapping channel. More...
 
#define REFL_CHANNEL   0x10L
 The reflection channel. More...
 
#define REFR_CHANNEL   0x20L
 The refraction channel. More...
 
#define DISP_CHANNEL   0x40L
 The displacement channel. More...
 
#define SLEV_CHANNEL   0x80L
 
#define ELIMINATE_CHANNEL   0x8000L
 Indicates that the channel is not supported. More...
 
#define SKIP_CHANNELS   (UNSUPPORTED_CHANNEL+BUMP_CHANNEL+REFL_CHANNEL+REFR_CHANNEL)
 This is used internally to indicate that the channels to be skipped. More...
 
#define DEFAULT_SHADER_CLASS_ID   BLINNClassID
 Class Id upper half for loading the Pre 3.0 shaders. More...
 
#define PHONGClassID   (STDSHADERS_CLASS_ID+2)
 
#define METALClassID   (STDSHADERS_CLASS_ID+4)
 
#define BLINNClassID   (STDSHADERS_CLASS_ID+3)
 For Blinn Shader. More...
 
#define ANISOSHADER_CLASS_ID   0x2857f460
 For Anisotropic Shader. More...
 
#define NEWSHADERS_CLASS_ID   0x2857f420
 For Oren/Nayar/Blinn Shader. More...
 
#define STRAUSS_SHADER_CLASS_ID   0x2857f450
 For Strauss Shader. More...
 
#define SHADERBASE_CHUNK   0x39bf
 
#define SHADERNAME_CHUNK   0x0100
 
#define STD_PARAM_NONE   (0)
 Indicates that none of the flags in the Standard_Parameters is used. More...
 
#define STD_PARAM_ALL   (0xffffffffL)
 Indicates that all of the flags in the Standard_Parameters are used. More...
 
#define STD_PARAM_METAL   (1)
 Only used by the Metal shader. More...
 
#define STD_PARAM_LOCKDS   (1<<1)
 Indicates support for the Diffuse/Specular lock. More...
 
#define STD_PARAM_LOCKAD   (1<<2)
 Indicates support for the Ambient/Diffuse lock. More...
 
#define STD_PARAM_LOCKADTEX   (1<<3)
 Indicates support for the Ambient/Diffuse texture lock. More...
 
#define STD_PARAM_SELFILLUM   (1<<4)
 Indicates support for the Self Illumination parameter. More...
 
#define STD_PARAM_SELFILLUM_CLR   (1<<5)
 Indicates support for the Self Illumination color parameter. More...
 
#define STD_PARAM_AMBIENT_CLR   (1<<6)
 Indicates support for the Ambient color parameter. More...
 
#define STD_PARAM_DIFFUSE_CLR   (1<<7)
 Indicates support for the Diffuse color parameter. More...
 
#define STD_PARAM_SPECULAR_CLR   (1<<8)
 Indicates support for the Specular color parameter. More...
 
#define STD_PARAM_FILTER_CLR   (1<<9)
 Indicates support for the Filter color parameter. More...
 
#define STD_PARAM_GLOSSINESS   (1<<10)
 Indicates support for the Glossiness parameter. More...
 
#define STD_PARAM_SOFTEN_LEV   (1<<11)
 Indicates support for the Soften Level parameter. More...
 
#define STD_PARAM_SPECULAR_LEV   (1<<12)
 Indicates support for the Specular Level parameter. More...
 
#define STD_PARAM_DIFFUSE_LEV   (1<<13)
 Indicates support for the Diffuse Level parameter. More...
 
#define STD_PARAM_DIFFUSE_RHO   (1<<14)
 Indicates support for the Roughness parameter. More...
 
#define STD_PARAM_ANISO   (1<<15)
 Indicates support for the Specular Highlight Anisotropy parameter. More...
 
#define STD_PARAM_ORIENTATION   (1<<16)
 Indicates support for the Specular Highlight Orientation parameter. More...
 
#define STD_PARAM_REFL_LEV   (1<<17)
 This is reserved for future use. More...
 
#define STD_PARAM_SELFILLUM_CLR_ON   (1<<18)
 Indicates support for the Self Illumination Color On/Off checkbox. More...
 
#define STD_BASIC2_DLG   (1<<20)
 This bit is only set by the three pre-R3 shaders (Phong, Blinn, and Metal). More...
 
#define STD_EXTRA_DLG   (1<<21)
 Indicates support for the Extended Parameters rollout. More...
 
#define STD_EXTRA_REFLECTION   (1<<22)
 Indicates support for Reflection Dimming parameters (Apply, Dim Level, Refl Level). More...
 
#define STD_EXTRA_REFRACTION   (1<<23)
 Indicates support for Index of Refraction parameter. More...
 
#define STD_EXTRA_OPACITY   (1<<24)
 Indicates support for Opacity parameters (Amount, In/Out, Type). More...
 
#define STD_EXTRA
 
#define STD_BASIC   (0x00021ffeL | STD_BASIC2_DLG)
 
#define STD_BASIC_METAL   (0x00021fffL | STD_BASIC2_DLG)
 
#define STD_ANISO   (0x0002cffe)
 
#define STD_MULTILAYER   (0x0002fffe)
 
#define STD_ONB   (0x00023ffe)
 
#define STD_WARD   (0x00000bce)
 

Enumerations

enum  Shader_Anisotropic_Shader_BlockID { aniso_params }
 BlockID Anisotropic Shader. More...
 
enum  Shader_Anisotropic_Shader_ParamIDs {
  an_ambient , an_diffuse , an_specular , an_self_illum_color ,
  an_diffuse_level , an_specular_level , an_self_illum_amnt , an_glossiness ,
  an_anisotropy , an_orientation , an_map_channel , an_ad_texlock ,
  an_ad_lock , an_ds_lock , an_use_self_illum_color
}
 ParamID's for Anisotropic Shader. More...
 
enum  Shader_Oren_Nayar_Blinn_BlockID { onb_params }
 BlockID Oren Nayer Blinn Shader. More...
 
enum  Shader_Oren_Nayar_Blinn_ParamIDs {
  onb_ambient , onb_diffuse , onb_specular , onb_self_illum_color ,
  onb_self_illum_amnt , onb_glossiness , onb_specular_level , onb_soften ,
  onb_diffuse_level , onb_roughness , onb_ad_texlock , onb_ad_lock ,
  onb_ds_lock , onb_use_self_illum_color
}
 ParamID's for Oren Nayer Blinn Shader. More...
 
enum  Shader_Strauss_BlockID { strauss_params }
 BlockID for Strauss Shader. More...
 
enum  Shader_Strauss_ParamIDs { st_diffuse , st_glossiness , st_metalness }
 ParamID's for Strauss Shader. More...
 

Functions

static Class_ID BlinnClassID (STDSHADERS_CLASS_ID+3, 0)
 For Blinn Shader. More...
 
static Class_ID AnisoShaderClassID (ANISOSHADER_CLASS_ID, 0)
 For Anisotropic Shader. More...
 
static Class_ID AnisoShaderDlgClassID (ANISOSHADER_CLASS_ID, 0)
 For Anisotropic Shader. More...
 
static Class_ID OrenNayarBlinnShaderClassID (NEWSHADERS_CLASS_ID+1, 0)
 For Oren/Nayar/Blinn Shader. More...
 
static Class_ID OrenNayarShaderDlgClassID (NEWSHADERS_CLASS_ID+2, 0)
 For Oren/Nayar/Blinn Shader. More...
 
static Class_ID StraussShaderClassID (STRAUSS_SHADER_CLASS_ID, 0)
 For Strauss Shader. More...
 

Macro Definition Documentation

◆ N_ID_CHANNELS

#define N_ID_CHANNELS   16

Number of IDs in stdMat.

◆ OPACITY_PARAM

#define OPACITY_PARAM   0

◆ DEFAULT_SOFTEN

#define DEFAULT_SOFTEN   0.1f

◆ SELFILLUM_CLR_ON

#define SELFILLUM_CLR_ON   (1<<16)

◆ DEFAULT_SHADER_CLASS_ID

#define DEFAULT_SHADER_CLASS_ID   BLINNClassID

Class Id upper half for loading the Pre 3.0 shaders.

◆ PHONGClassID

#define PHONGClassID   (STDSHADERS_CLASS_ID+2)

◆ METALClassID

#define METALClassID   (STDSHADERS_CLASS_ID+4)

◆ BLINNClassID

#define BLINNClassID   (STDSHADERS_CLASS_ID+3)

For Blinn Shader.

◆ ANISOSHADER_CLASS_ID

#define ANISOSHADER_CLASS_ID   0x2857f460

For Anisotropic Shader.

◆ NEWSHADERS_CLASS_ID

#define NEWSHADERS_CLASS_ID   0x2857f420

For Oren/Nayar/Blinn Shader.

◆ STRAUSS_SHADER_CLASS_ID

#define STRAUSS_SHADER_CLASS_ID   0x2857f450

For Strauss Shader.

◆ STD_EXTRA

#define STD_EXTRA
Value:
#define STD_EXTRA_DLG
Indicates support for the Extended Parameters rollout.
Definition: shaders.h:832
#define STD_EXTRA_REFRACTION
Indicates support for Index of Refraction parameter.
Definition: shaders.h:840
#define STD_EXTRA_REFLECTION
Indicates support for Reflection Dimming parameters (Apply, Dim Level, Refl Level).
Definition: shaders.h:836
#define STD_EXTRA_OPACITY
Indicates support for Opacity parameters (Amount, In/Out, Type).
Definition: shaders.h:845

◆ STD_BASIC

#define STD_BASIC   (0x00021ffeL | STD_BASIC2_DLG)

◆ STD_BASIC_METAL

#define STD_BASIC_METAL   (0x00021fffL | STD_BASIC2_DLG)

◆ STD_ANISO

#define STD_ANISO   (0x0002cffe)

◆ STD_MULTILAYER

#define STD_MULTILAYER   (0x0002fffe)

◆ STD_ONB

#define STD_ONB   (0x00023ffe)

◆ STD_WARD

#define STD_WARD   (0x00000bce)

Enumeration Type Documentation

◆ Shader_Anisotropic_Shader_BlockID

BlockID Anisotropic Shader.

Enumerator
aniso_params 
179 {
181 };
@ aniso_params
Definition: shaders.h:180

◆ Shader_Anisotropic_Shader_ParamIDs

ParamID's for Anisotropic Shader.

Enumerator
an_ambient 
an_diffuse 
an_specular 
an_self_illum_color 
an_diffuse_level 
an_specular_level 
an_self_illum_amnt 
an_glossiness 
an_anisotropy 
an_orientation 
an_map_channel 
an_ad_texlock 
an_ad_lock 
an_ds_lock 
an_use_self_illum_color 
185 {
190 };
@ an_map_channel
Definition: shaders.h:189
@ an_orientation
Definition: shaders.h:188
@ an_ad_lock
Definition: shaders.h:189
@ an_diffuse_level
Definition: shaders.h:187
@ an_ds_lock
Definition: shaders.h:189
@ an_diffuse
Definition: shaders.h:186
@ an_use_self_illum_color
Definition: shaders.h:189
@ an_glossiness
Definition: shaders.h:188
@ an_self_illum_amnt
Definition: shaders.h:187
@ an_specular
Definition: shaders.h:186
@ an_ambient
Definition: shaders.h:186
@ an_specular_level
Definition: shaders.h:187
@ an_anisotropy
Definition: shaders.h:188
@ an_self_illum_color
Definition: shaders.h:186
@ an_ad_texlock
Definition: shaders.h:189

◆ Shader_Oren_Nayar_Blinn_BlockID

BlockID Oren Nayer Blinn Shader.

Enumerator
onb_params 
199 {
200  onb_params
201 };
@ onb_params
Definition: shaders.h:200

◆ Shader_Oren_Nayar_Blinn_ParamIDs

ParamID's for Oren Nayer Blinn Shader.

Enumerator
onb_ambient 
onb_diffuse 
onb_specular 
onb_self_illum_color 
onb_self_illum_amnt 
onb_glossiness 
onb_specular_level 
onb_soften 
onb_diffuse_level 
onb_roughness 
onb_ad_texlock 
onb_ad_lock 
onb_ds_lock 
onb_use_self_illum_color 
204 {
210 };
@ onb_use_self_illum_color
Definition: shaders.h:209
@ onb_specular_level
Definition: shaders.h:207
@ onb_self_illum_amnt
Definition: shaders.h:206
@ onb_specular
Definition: shaders.h:205
@ onb_self_illum_color
Definition: shaders.h:206
@ onb_diffuse_level
Definition: shaders.h:208
@ onb_roughness
Definition: shaders.h:208
@ onb_glossiness
Definition: shaders.h:207
@ onb_soften
Definition: shaders.h:207
@ onb_ad_texlock
Definition: shaders.h:209
@ onb_ad_lock
Definition: shaders.h:209
@ onb_diffuse
Definition: shaders.h:205
@ onb_ambient
Definition: shaders.h:205
@ onb_ds_lock
Definition: shaders.h:209

◆ Shader_Strauss_BlockID

BlockID for Strauss Shader.

Enumerator
strauss_params 
219 {
221 };
@ strauss_params
Definition: shaders.h:220

◆ Shader_Strauss_ParamIDs

ParamID's for Strauss Shader.

Enumerator
st_diffuse 
st_glossiness 
st_metalness 
225 {
227 };
@ st_metalness
Definition: shaders.h:226
@ st_diffuse
Definition: shaders.h:226
@ st_glossiness
Definition: shaders.h:226

Function Documentation

◆ BlinnClassID()

static Class_ID BlinnClassID ( STDSHADERS_CLASS_ID 3,
 
)
static

For Blinn Shader.

◆ AnisoShaderClassID()

static Class_ID AnisoShaderClassID ( ANISOSHADER_CLASS_ID  ,
 
)
static

For Anisotropic Shader.

◆ AnisoShaderDlgClassID()

static Class_ID AnisoShaderDlgClassID ( ANISOSHADER_CLASS_ID  ,
 
)
static

For Anisotropic Shader.

◆ OrenNayarBlinnShaderClassID()

static Class_ID OrenNayarBlinnShaderClassID ( NEWSHADERS_CLASS_ID 1,
 
)
static

For Oren/Nayar/Blinn Shader.

◆ OrenNayarShaderDlgClassID()

static Class_ID OrenNayarShaderDlgClassID ( NEWSHADERS_CLASS_ID 2,
 
)
static

For Oren/Nayar/Blinn Shader.

◆ StraussShaderClassID()

static Class_ID StraussShaderClassID ( STRAUSS_SHADER_CLASS_ID  ,
 
)
static

For Strauss Shader.