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 * | GenerateEffectFile2 (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 MCHAR * | GenerateFragmentCode2 (StdMat2 *mtl, Tab< INode * > lights, bool &transp)=0 |
Generate HLSL Code based on the material.
|
|
Static Public Member Functions |
|
static
DllExport IHLSLCodeGenerator2 * |
GetHLSLCodeGenerator2 () |
Access to the factory class. |
enum CodeVersion |
virtual MCHAR* GenerateEffectFile2 | ( | 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. This version of the function will generate code for all maps whether they are visible in the viewport or not.
*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 MCHAR* GenerateFragmentCode2 | ( | 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. This version of the function will generate code for all maps whether they are visible in the viewport or not.
*mtl | The material source |
lights | A table of lights to used in the HLSL generation |
&transp | True if there is a transparent component |
static DllExport IHLSLCodeGenerator2* GetHLSLCodeGenerator2 | ( | ) | [static] |
Access to the factory class.