Shader generators were built on top of Ashli, a shader compiler from AMD ATI.
Now all shader generation in 3ds Max is performed by mental mill. To get similar data being generated based on actual supported shader code, the developer is advised to use the IEffectFile interface
#include
<DeprecatedRealtimeMaterialTexturemapShaderAPI.h>
Public Types |
|
enum | CodeVersion { PS_1_X, PS_2_0, PS_3_0, PS_2_X } |
Public Member Functions |
|
virtual MCHAR * | GenerateFragmentCode (StdMat2 *mtl, Tab< INode * > lights, bool &transp)=0 |
Generate HLSL Code based on the material.
|
|
virtual MCHAR * | GenerateVertexCode ()=0 |
Generates a basic Vertex shader to support
the pixel shader. |
|
virtual MCHAR * | GenerateEffectFile (StdMat2 *mtl, Tab< INode * > lights, CodeVersion code, bool &transp, int instSize, bool useLPRT=false)=0 |
Generates an Effect File based on the material supplied.
|
|
virtual Texmap * | GetShaderDefinedTexmap (StdMat2 *mat, MCHAR *mapName, bool &bump)=0 |
Get the texture map used by the specified
mapName. |
|
virtual void | Release ()=0 |
Static Public Member Functions |
|
static
DllExport IHLSLCodeGenerator * |
GetHLSLCodeGenerator () |
Access to the factory class. |
enum CodeVersion |
static DllExport IHLSLCodeGenerator* GetHLSLCodeGenerator | ( | ) | [static] |
Access to the factory class.
virtual MCHAR* GenerateFragmentCode | ( | StdMat2 * | mtl, |
Tab< INode * > | lights, | ||
bool & | transp | ||
) | [pure virtual] |
Generate HLSL Code based on the material.
This will create HLSL code based on the material and lights in the scene. It will generate code for Blinn and ONB style specular component. It will support Ambient,Diffuse, specular, Self Illumination, opacity, bump, reflection maps.
*mtl | The material source |
lights | A table of lights to used in the HLSL generation |
&transp | True if there is a transparent component |
virtual MCHAR* GenerateVertexCode | ( | ) | [pure virtual] |
Generates a basic Vertex shader to support the pixel shader.
virtual MCHAR* GenerateEffectFile | ( | StdMat2 * | mtl, |
Tab< INode * > | lights, | ||
CodeVersion | code, | ||
bool & | transp, | ||
int | instSize, | ||
bool | useLPRT =
false |
||
) | [pure virtual] |
Generates an Effect File based on the material supplied.
This is similar to GenerateFragmentCode, but will optimize the HLSL code to assembler, based on a pass compiler. The effect file generated will only represent what is currently seen in the viewport
*mtl | The material that will be used to generate the effect |
lights | An array of lights to be used by the shader |
code | The Shader Model to compile to |
&transp | Tells the code if transparency is used. This can be used to setup specific RenderStates |
instSize | The maximum number of instructions |
useLPRT | This is not needed by the developer. It is used in conjunction with Ashli |
virtual Texmap* GetShaderDefinedTexmap | ( | StdMat2 * | mat, |
MCHAR * | mapName, | ||
bool & | bump | ||
) | [pure virtual] |
Get the texture map used by the specified mapName.
When the material tree is processed, a texture map can provide its only HLSL code and texture samplers. This function will return the texmap of these maps and the default diffuse, bump etc..
*mat | The standard material whose textures are to be queried |
*mapName | This is the name parsed out in the effect file |
&bump | Allows special handling of the bump map |
virtual void Release | ( | ) | [pure virtual] |