Public Types | Public Member Functions | Static Public Member Functions

IHLSLCodeGenerator2 Class Reference

Search for all occurrences

Detailed Description

Shader generators were built on top of Ashli, a shader compiler from AMD ATI.

Deprecated:
Shader generation is now handled by MetaSL and the mental mill compiler

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>

List of all members.

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.

Member Enumeration Documentation


Member Function Documentation

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.

Parameters:
*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
Returns:
A string containing the effect file. This can be loaded in the DirectX 9 Shader material
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.

Parameters:
*mtl The material source
lights A table of lights to used in the HLSL generation
&transp True if there is a transparent component
Returns:
A string containing the code.
static DllExport IHLSLCodeGenerator2* GetHLSLCodeGenerator2 ( ) [static]

Access to the factory class.


IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2
IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2 IHLSLCodeGenerator2