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.
353 lines
9.3 KiB
353 lines
9.3 KiB
// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
|
|
// $DETAILTEXTURE && ( $BUMPMAP && !$DETAIL_ALPHA_MASK_BASE_TEXTURE )
|
|
// $VERTEXCOLOR && $BUMPMAP
|
|
// $FLASHLIGHT && $SELFILLUM
|
|
// $FLASHLIGHT && $DETAIL_ALPHA_MASK_BASE_TEXTURE
|
|
// $FLASHLIGHT && $BUMPMAP
|
|
// 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
|
|
// 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
|
|
// 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 worldtwotextureblend_ps20_Static_Index
|
|
{
|
|
private:
|
|
int m_nDETAILTEXTURE;
|
|
#ifdef _DEBUG
|
|
bool m_bDETAILTEXTURE;
|
|
#endif
|
|
public:
|
|
void SetDETAILTEXTURE( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nDETAILTEXTURE = i;
|
|
#ifdef _DEBUG
|
|
m_bDETAILTEXTURE = true;
|
|
#endif
|
|
}
|
|
void SetDETAILTEXTURE( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nDETAILTEXTURE = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bDETAILTEXTURE = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nBUMPMAP;
|
|
#ifdef _DEBUG
|
|
bool m_bBUMPMAP;
|
|
#endif
|
|
public:
|
|
void SetBUMPMAP( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nBUMPMAP = i;
|
|
#ifdef _DEBUG
|
|
m_bBUMPMAP = true;
|
|
#endif
|
|
}
|
|
void SetBUMPMAP( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nBUMPMAP = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bBUMPMAP = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nVERTEXCOLOR;
|
|
#ifdef _DEBUG
|
|
bool m_bVERTEXCOLOR;
|
|
#endif
|
|
public:
|
|
void SetVERTEXCOLOR( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nVERTEXCOLOR = i;
|
|
#ifdef _DEBUG
|
|
m_bVERTEXCOLOR = true;
|
|
#endif
|
|
}
|
|
void SetVERTEXCOLOR( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nVERTEXCOLOR = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bVERTEXCOLOR = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nSELFILLUM;
|
|
#ifdef _DEBUG
|
|
bool m_bSELFILLUM;
|
|
#endif
|
|
public:
|
|
void SetSELFILLUM( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nSELFILLUM = i;
|
|
#ifdef _DEBUG
|
|
m_bSELFILLUM = true;
|
|
#endif
|
|
}
|
|
void SetSELFILLUM( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nSELFILLUM = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bSELFILLUM = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nDETAIL_ALPHA_MASK_BASE_TEXTURE;
|
|
#ifdef _DEBUG
|
|
bool m_bDETAIL_ALPHA_MASK_BASE_TEXTURE;
|
|
#endif
|
|
public:
|
|
void SetDETAIL_ALPHA_MASK_BASE_TEXTURE( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nDETAIL_ALPHA_MASK_BASE_TEXTURE = i;
|
|
#ifdef _DEBUG
|
|
m_bDETAIL_ALPHA_MASK_BASE_TEXTURE = true;
|
|
#endif
|
|
}
|
|
void SetDETAIL_ALPHA_MASK_BASE_TEXTURE( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nDETAIL_ALPHA_MASK_BASE_TEXTURE = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bDETAIL_ALPHA_MASK_BASE_TEXTURE = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nFLASHLIGHT;
|
|
#ifdef _DEBUG
|
|
bool m_bFLASHLIGHT;
|
|
#endif
|
|
public:
|
|
void SetFLASHLIGHT( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nFLASHLIGHT = i;
|
|
#ifdef _DEBUG
|
|
m_bFLASHLIGHT = true;
|
|
#endif
|
|
}
|
|
void SetFLASHLIGHT( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nFLASHLIGHT = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bFLASHLIGHT = 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_nSHADER_SRGB_READ;
|
|
#ifdef _DEBUG
|
|
bool m_bSHADER_SRGB_READ;
|
|
#endif
|
|
public:
|
|
void SetSHADER_SRGB_READ( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 0 );
|
|
m_nSHADER_SRGB_READ = i;
|
|
#ifdef _DEBUG
|
|
m_bSHADER_SRGB_READ = true;
|
|
#endif
|
|
}
|
|
void SetSHADER_SRGB_READ( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
|
|
m_nSHADER_SRGB_READ = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bSHADER_SRGB_READ = true;
|
|
#endif
|
|
}
|
|
public:
|
|
// CONSTRUCTOR
|
|
worldtwotextureblend_ps20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
|
|
{
|
|
#ifdef _DEBUG
|
|
m_bDETAILTEXTURE = false;
|
|
#endif // _DEBUG
|
|
m_nDETAILTEXTURE = 0;
|
|
#ifdef _DEBUG
|
|
m_bBUMPMAP = false;
|
|
#endif // _DEBUG
|
|
m_nBUMPMAP = 0;
|
|
#ifdef _DEBUG
|
|
m_bVERTEXCOLOR = false;
|
|
#endif // _DEBUG
|
|
m_nVERTEXCOLOR = 0;
|
|
#ifdef _DEBUG
|
|
m_bSELFILLUM = false;
|
|
#endif // _DEBUG
|
|
m_nSELFILLUM = 0;
|
|
#ifdef _DEBUG
|
|
m_bDETAIL_ALPHA_MASK_BASE_TEXTURE = false;
|
|
#endif // _DEBUG
|
|
m_nDETAIL_ALPHA_MASK_BASE_TEXTURE = 0;
|
|
#ifdef _DEBUG
|
|
m_bFLASHLIGHT = false;
|
|
#endif // _DEBUG
|
|
m_nFLASHLIGHT = 0;
|
|
#ifdef _DEBUG
|
|
m_bSEAMLESS = false;
|
|
#endif // _DEBUG
|
|
m_nSEAMLESS = 0;
|
|
#ifdef _DEBUG
|
|
m_bSHADER_SRGB_READ = false;
|
|
#endif // _DEBUG
|
|
m_nSHADER_SRGB_READ = 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_bDETAILTEXTURE && m_bBUMPMAP && m_bVERTEXCOLOR && m_bSELFILLUM && m_bDETAIL_ALPHA_MASK_BASE_TEXTURE && m_bFLASHLIGHT && m_bSEAMLESS && m_bSHADER_SRGB_READ;
|
|
Assert( bAllStaticVarsDefined );
|
|
#endif // _DEBUG
|
|
return ( 4 * m_nDETAILTEXTURE ) + ( 8 * m_nBUMPMAP ) + ( 16 * m_nVERTEXCOLOR ) + ( 32 * m_nSELFILLUM ) + ( 64 * m_nDETAIL_ALPHA_MASK_BASE_TEXTURE ) + ( 128 * m_nFLASHLIGHT ) + ( 256 * m_nSEAMLESS ) + ( 512 * m_nSHADER_SRGB_READ ) + 0;
|
|
}
|
|
};
|
|
#define shaderStaticTest_worldtwotextureblend_ps20 psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_BUMPMAP + psh_forgot_to_set_static_VERTEXCOLOR + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_DETAIL_ALPHA_MASK_BASE_TEXTURE + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_SEAMLESS + psh_forgot_to_set_static_SHADER_SRGB_READ + 0
|
|
class worldtwotextureblend_ps20_Dynamic_Index
|
|
{
|
|
private:
|
|
int m_nWRITEWATERFOGTODESTALPHA;
|
|
#ifdef _DEBUG
|
|
bool m_bWRITEWATERFOGTODESTALPHA;
|
|
#endif
|
|
public:
|
|
void SetWRITEWATERFOGTODESTALPHA( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nWRITEWATERFOGTODESTALPHA = i;
|
|
#ifdef _DEBUG
|
|
m_bWRITEWATERFOGTODESTALPHA = true;
|
|
#endif
|
|
}
|
|
void SetWRITEWATERFOGTODESTALPHA( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nWRITEWATERFOGTODESTALPHA = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bWRITEWATERFOGTODESTALPHA = 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
|
|
worldtwotextureblend_ps20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
|
|
{
|
|
#ifdef _DEBUG
|
|
m_bWRITEWATERFOGTODESTALPHA = false;
|
|
#endif // _DEBUG
|
|
m_nWRITEWATERFOGTODESTALPHA = 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_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE;
|
|
Assert( bAllDynamicVarsDefined );
|
|
#endif // _DEBUG
|
|
return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + 0;
|
|
}
|
|
};
|
|
#define shaderDynamicTest_worldtwotextureblend_ps20 psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + 0
|
|
|
|
static const ShaderComboInformation_t s_DynamicComboArray_worldtwotextureblend_ps20[2] =
|
|
{
|
|
{ "WRITEWATERFOGTODESTALPHA", 0, 1 },
|
|
{ "PIXELFOGTYPE", 0, 1 },
|
|
};
|
|
|
|
static const ShaderComboInformation_t s_StaticComboArray_worldtwotextureblend_ps20[8] =
|
|
{
|
|
{ "DETAILTEXTURE", 0, 1 },
|
|
{ "BUMPMAP", 0, 1 },
|
|
{ "VERTEXCOLOR", 0, 1 },
|
|
{ "SELFILLUM", 0, 1 },
|
|
{ "DETAIL_ALPHA_MASK_BASE_TEXTURE", 0, 1 },
|
|
{ "FLASHLIGHT", 0, 1 },
|
|
{ "SEAMLESS", 0, 1 },
|
|
{ "SHADER_SRGB_READ", 0, 0 },
|
|
};
|
|
static const ShaderComboSemantics_t worldtwotextureblend_ps20_combos =
|
|
{
|
|
"worldtwotextureblend_ps20", s_DynamicComboArray_worldtwotextureblend_ps20, 2, s_StaticComboArray_worldtwotextureblend_ps20, 8
|
|
};
|
|
|
|
class ConstructMe_worldtwotextureblend_ps20
|
|
{
|
|
public:
|
|
ConstructMe_worldtwotextureblend_ps20()
|
|
{
|
|
GetShaderDLL()->AddShaderComboInformation( &worldtwotextureblend_ps20_combos );
|
|
}
|
|
};
|
|
|
|
static ConstructMe_worldtwotextureblend_ps20 s_ConstructMe_worldtwotextureblend_ps20;
|