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.
435 lines
12 KiB
435 lines
12 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
|
|
// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTSHADOWS == 1 ) [ps30]
|
|
// 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_ps20b_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_nFLASHLIGHTDEPTHFILTERMODE;
|
|
#ifdef _DEBUG
|
|
bool m_bFLASHLIGHTDEPTHFILTERMODE;
|
|
#endif
|
|
public:
|
|
void SetFLASHLIGHTDEPTHFILTERMODE( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 0 );
|
|
m_nFLASHLIGHTDEPTHFILTERMODE = i;
|
|
#ifdef _DEBUG
|
|
m_bFLASHLIGHTDEPTHFILTERMODE = true;
|
|
#endif
|
|
}
|
|
void SetFLASHLIGHTDEPTHFILTERMODE( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
|
|
m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bFLASHLIGHTDEPTHFILTERMODE = 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 <= 1 );
|
|
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 ) <= 1 );
|
|
m_nSHADER_SRGB_READ = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bSHADER_SRGB_READ = true;
|
|
#endif
|
|
}
|
|
public:
|
|
// CONSTRUCTOR
|
|
worldtwotextureblend_ps20b_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_bFLASHLIGHTDEPTHFILTERMODE = false;
|
|
#endif // _DEBUG
|
|
m_nFLASHLIGHTDEPTHFILTERMODE = 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_bFLASHLIGHTDEPTHFILTERMODE && m_bSHADER_SRGB_READ;
|
|
Assert( bAllStaticVarsDefined );
|
|
#endif // _DEBUG
|
|
return ( 8 * m_nDETAILTEXTURE ) + ( 16 * m_nBUMPMAP ) + ( 32 * m_nVERTEXCOLOR ) + ( 64 * m_nSELFILLUM ) + ( 128 * m_nDETAIL_ALPHA_MASK_BASE_TEXTURE ) + ( 256 * m_nFLASHLIGHT ) + ( 512 * m_nSEAMLESS ) + ( 1024 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 1024 * m_nSHADER_SRGB_READ ) + 0;
|
|
}
|
|
};
|
|
#define shaderStaticTest_worldtwotextureblend_ps20b 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_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_SHADER_SRGB_READ + 0
|
|
class worldtwotextureblend_ps20b_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
|
|
}
|
|
private:
|
|
int m_nWRITE_DEPTH_TO_DESTALPHA;
|
|
#ifdef _DEBUG
|
|
bool m_bWRITE_DEPTH_TO_DESTALPHA;
|
|
#endif
|
|
public:
|
|
void SetWRITE_DEPTH_TO_DESTALPHA( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 0 );
|
|
m_nWRITE_DEPTH_TO_DESTALPHA = i;
|
|
#ifdef _DEBUG
|
|
m_bWRITE_DEPTH_TO_DESTALPHA = true;
|
|
#endif
|
|
}
|
|
void SetWRITE_DEPTH_TO_DESTALPHA( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
|
|
m_nWRITE_DEPTH_TO_DESTALPHA = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bWRITE_DEPTH_TO_DESTALPHA = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nFLASHLIGHTSHADOWS;
|
|
#ifdef _DEBUG
|
|
bool m_bFLASHLIGHTSHADOWS;
|
|
#endif
|
|
public:
|
|
void SetFLASHLIGHTSHADOWS( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nFLASHLIGHTSHADOWS = i;
|
|
#ifdef _DEBUG
|
|
m_bFLASHLIGHTSHADOWS = true;
|
|
#endif
|
|
}
|
|
void SetFLASHLIGHTSHADOWS( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nFLASHLIGHTSHADOWS = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bFLASHLIGHTSHADOWS = true;
|
|
#endif
|
|
}
|
|
public:
|
|
// CONSTRUCTOR
|
|
worldtwotextureblend_ps20b_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 ) ;
|
|
#ifdef _DEBUG
|
|
m_bWRITE_DEPTH_TO_DESTALPHA = false;
|
|
#endif // _DEBUG
|
|
m_nWRITE_DEPTH_TO_DESTALPHA = 0;
|
|
#ifdef _DEBUG
|
|
m_bFLASHLIGHTSHADOWS = false;
|
|
#endif // _DEBUG
|
|
m_nFLASHLIGHTSHADOWS = 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 bAllDynamicVarsDefined = m_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE && m_bWRITE_DEPTH_TO_DESTALPHA && m_bFLASHLIGHTSHADOWS;
|
|
Assert( bAllDynamicVarsDefined );
|
|
#endif // _DEBUG
|
|
return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + ( 4 * m_nWRITE_DEPTH_TO_DESTALPHA ) + ( 4 * m_nFLASHLIGHTSHADOWS ) + 0;
|
|
}
|
|
};
|
|
#define shaderDynamicTest_worldtwotextureblend_ps20b psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + 0
|
|
|
|
static const ShaderComboInformation_t s_DynamicComboArray_WorldTwoTextureBlend_ps20b[4] =
|
|
{
|
|
{ "WRITEWATERFOGTODESTALPHA", 0, 1 },
|
|
{ "PIXELFOGTYPE", 0, 1 },
|
|
{ "WRITE_DEPTH_TO_DESTALPHA", 0, 0 },
|
|
{ "FLASHLIGHTSHADOWS", 0, 1 },
|
|
};
|
|
|
|
static const ShaderComboInformation_t s_StaticComboArray_WorldTwoTextureBlend_ps20b[9] =
|
|
{
|
|
{ "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 },
|
|
{ "FLASHLIGHTDEPTHFILTERMODE", 0, 0 },
|
|
{ "SHADER_SRGB_READ", 0, 1 },
|
|
};
|
|
static const ShaderComboSemantics_t WorldTwoTextureBlend_ps20b_combos =
|
|
{
|
|
"WorldTwoTextureBlend_ps20b", s_DynamicComboArray_WorldTwoTextureBlend_ps20b, 4, s_StaticComboArray_WorldTwoTextureBlend_ps20b, 9
|
|
};
|
|
|
|
class ConstructMe_WorldTwoTextureBlend_ps20b
|
|
{
|
|
public:
|
|
ConstructMe_WorldTwoTextureBlend_ps20b()
|
|
{
|
|
GetShaderDLL()->AddShaderComboInformation( &WorldTwoTextureBlend_ps20b_combos );
|
|
}
|
|
};
|
|
|
|
static ConstructMe_WorldTwoTextureBlend_ps20b s_ConstructMe_WorldTwoTextureBlend_ps20b;
|