You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
285 lines
6.5 KiB
285 lines
6.5 KiB
// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
|
|
// ( $BUMPMAP == 0 )
|
|
// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA
|
|
// defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPTINT && $LIGHTING_PREVIEW && $FASTPATHENVMAPTINT
|
|
// defined $LIGHTING_PREVIEW && defined $FASTPATHENVMAPCONTRAST && $LIGHTING_PREVIEW && $FASTPATHENVMAPCONTRAST
|
|
// defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
|
|
// ($FLASHLIGHT || $FLASHLIGHTSHADOWS) && $LIGHTING_PREVIEW
|
|
#include "shaderlib/cshader.h"
|
|
class lightmappedpaint_ps20_Static_Index
|
|
{
|
|
private:
|
|
int m_nBUMPMAP;
|
|
#ifdef _DEBUG
|
|
bool m_bBUMPMAP;
|
|
#endif
|
|
public:
|
|
void SetBUMPMAP( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 2 );
|
|
m_nBUMPMAP = i;
|
|
#ifdef _DEBUG
|
|
m_bBUMPMAP = true;
|
|
#endif
|
|
}
|
|
void SetBUMPMAP( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 );
|
|
m_nBUMPMAP = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bBUMPMAP = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nCUBEMAP;
|
|
#ifdef _DEBUG
|
|
bool m_bCUBEMAP;
|
|
#endif
|
|
public:
|
|
void SetCUBEMAP( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 2 );
|
|
m_nCUBEMAP = i;
|
|
#ifdef _DEBUG
|
|
m_bCUBEMAP = true;
|
|
#endif
|
|
}
|
|
void SetCUBEMAP( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 );
|
|
m_nCUBEMAP = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bCUBEMAP = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nSEAMLESS;
|
|
#ifdef _DEBUG
|
|
bool m_bSEAMLESS;
|
|
#endif
|
|
public:
|
|
void SetSEAMLESS( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nSEAMLESS = i;
|
|
#ifdef _DEBUG
|
|
m_bSEAMLESS = true;
|
|
#endif
|
|
}
|
|
void SetSEAMLESS( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nSEAMLESS = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bSEAMLESS = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nTHICKPAINT;
|
|
#ifdef _DEBUG
|
|
bool m_bTHICKPAINT;
|
|
#endif
|
|
public:
|
|
void SetTHICKPAINT( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nTHICKPAINT = i;
|
|
#ifdef _DEBUG
|
|
m_bTHICKPAINT = true;
|
|
#endif
|
|
}
|
|
void SetTHICKPAINT( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nTHICKPAINT = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bTHICKPAINT = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nDOPIXELFOG;
|
|
#ifdef _DEBUG
|
|
bool m_bDOPIXELFOG;
|
|
#endif
|
|
public:
|
|
void SetDOPIXELFOG( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 0 );
|
|
m_nDOPIXELFOG = i;
|
|
#ifdef _DEBUG
|
|
m_bDOPIXELFOG = true;
|
|
#endif
|
|
}
|
|
void SetDOPIXELFOG( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
|
|
m_nDOPIXELFOG = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bDOPIXELFOG = true;
|
|
#endif
|
|
}
|
|
public:
|
|
// CONSTRUCTOR
|
|
lightmappedpaint_ps20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
|
|
{
|
|
#ifdef _DEBUG
|
|
m_bBUMPMAP = false;
|
|
#endif // _DEBUG
|
|
m_nBUMPMAP = 0;
|
|
#ifdef _DEBUG
|
|
m_bCUBEMAP = false;
|
|
#endif // _DEBUG
|
|
m_nCUBEMAP = 0;
|
|
#ifdef _DEBUG
|
|
m_bSEAMLESS = false;
|
|
#endif // _DEBUG
|
|
m_nSEAMLESS = 0;
|
|
#ifdef _DEBUG
|
|
m_bTHICKPAINT = false;
|
|
#endif // _DEBUG
|
|
m_nTHICKPAINT = 0;
|
|
#ifdef _DEBUG
|
|
m_bDOPIXELFOG = true;
|
|
#endif // _DEBUG
|
|
m_nDOPIXELFOG = 0 ;
|
|
}
|
|
int GetIndex()
|
|
{
|
|
// Asserts to make sure that we aren't using any skipped combinations.
|
|
// Asserts to make sure that we are setting all of the combination vars.
|
|
#ifdef _DEBUG
|
|
bool bAllStaticVarsDefined = m_bBUMPMAP && m_bCUBEMAP && m_bSEAMLESS && m_bTHICKPAINT && m_bDOPIXELFOG;
|
|
Assert( bAllStaticVarsDefined );
|
|
#endif // _DEBUG
|
|
return ( 8 * m_nBUMPMAP ) + ( 24 * m_nCUBEMAP ) + ( 72 * m_nSEAMLESS ) + ( 144 * m_nTHICKPAINT ) + ( 288 * m_nDOPIXELFOG ) + 0;
|
|
}
|
|
};
|
|
#define shaderStaticTest_lightmappedpaint_ps20 psh_forgot_to_set_static_BUMPMAP + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_SEAMLESS + psh_forgot_to_set_static_THICKPAINT + 0
|
|
class lightmappedpaint_ps20_Dynamic_Index
|
|
{
|
|
private:
|
|
int m_nFASTPATHENVMAPCONTRAST;
|
|
#ifdef _DEBUG
|
|
bool m_bFASTPATHENVMAPCONTRAST;
|
|
#endif
|
|
public:
|
|
void SetFASTPATHENVMAPCONTRAST( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nFASTPATHENVMAPCONTRAST = i;
|
|
#ifdef _DEBUG
|
|
m_bFASTPATHENVMAPCONTRAST = true;
|
|
#endif
|
|
}
|
|
void SetFASTPATHENVMAPCONTRAST( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nFASTPATHENVMAPCONTRAST = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bFASTPATHENVMAPCONTRAST = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nFASTPATH;
|
|
#ifdef _DEBUG
|
|
bool m_bFASTPATH;
|
|
#endif
|
|
public:
|
|
void SetFASTPATH( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nFASTPATH = i;
|
|
#ifdef _DEBUG
|
|
m_bFASTPATH = true;
|
|
#endif
|
|
}
|
|
void SetFASTPATH( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nFASTPATH = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bFASTPATH = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nPIXELFOGTYPE;
|
|
#ifdef _DEBUG
|
|
bool m_bPIXELFOGTYPE;
|
|
#endif
|
|
public:
|
|
void SetPIXELFOGTYPE( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nPIXELFOGTYPE = i;
|
|
#ifdef _DEBUG
|
|
m_bPIXELFOGTYPE = true;
|
|
#endif
|
|
}
|
|
void SetPIXELFOGTYPE( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nPIXELFOGTYPE = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bPIXELFOGTYPE = true;
|
|
#endif
|
|
}
|
|
public:
|
|
// CONSTRUCTOR
|
|
lightmappedpaint_ps20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
|
|
{
|
|
#ifdef _DEBUG
|
|
m_bFASTPATHENVMAPCONTRAST = false;
|
|
#endif // _DEBUG
|
|
m_nFASTPATHENVMAPCONTRAST = 0;
|
|
#ifdef _DEBUG
|
|
m_bFASTPATH = false;
|
|
#endif // _DEBUG
|
|
m_nFASTPATH = 0;
|
|
#ifdef _DEBUG
|
|
m_bPIXELFOGTYPE = true;
|
|
#endif // _DEBUG
|
|
m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
|
|
}
|
|
int GetIndex()
|
|
{
|
|
// Asserts to make sure that we aren't using any skipped combinations.
|
|
// Asserts to make sure that we are setting all of the combination vars.
|
|
#ifdef _DEBUG
|
|
bool bAllDynamicVarsDefined = m_bFASTPATHENVMAPCONTRAST && m_bFASTPATH && m_bPIXELFOGTYPE;
|
|
Assert( bAllDynamicVarsDefined );
|
|
#endif // _DEBUG
|
|
return ( 1 * m_nFASTPATHENVMAPCONTRAST ) + ( 2 * m_nFASTPATH ) + ( 4 * m_nPIXELFOGTYPE ) + 0;
|
|
}
|
|
};
|
|
#define shaderDynamicTest_lightmappedpaint_ps20 psh_forgot_to_set_dynamic_FASTPATHENVMAPCONTRAST + psh_forgot_to_set_dynamic_FASTPATH + 0
|
|
|
|
static const ShaderComboInformation_t s_DynamicComboArray_lightmappedpaint_ps20[3] =
|
|
{
|
|
{ "FASTPATHENVMAPCONTRAST", 0, 1 },
|
|
{ "FASTPATH", 0, 1 },
|
|
{ "PIXELFOGTYPE", 0, 1 },
|
|
};
|
|
|
|
static const ShaderComboInformation_t s_StaticComboArray_lightmappedpaint_ps20[5] =
|
|
{
|
|
{ "BUMPMAP", 0, 2 },
|
|
{ "CUBEMAP", 0, 2 },
|
|
{ "SEAMLESS", 0, 1 },
|
|
{ "THICKPAINT", 0, 1 },
|
|
{ "DOPIXELFOG", 0, 0 },
|
|
};
|
|
static const ShaderComboSemantics_t lightmappedpaint_ps20_combos =
|
|
{
|
|
"lightmappedpaint_ps20", s_DynamicComboArray_lightmappedpaint_ps20, 3, s_StaticComboArray_lightmappedpaint_ps20, 5
|
|
};
|
|
|
|
class ConstructMe_lightmappedpaint_ps20
|
|
{
|
|
public:
|
|
ConstructMe_lightmappedpaint_ps20()
|
|
{
|
|
GetShaderDLL()->AddShaderComboInformation( &lightmappedpaint_ps20_combos );
|
|
}
|
|
};
|
|
|
|
static ConstructMe_lightmappedpaint_ps20 s_ConstructMe_lightmappedpaint_ps20;
|