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.
374 lines
9.1 KiB
374 lines
9.1 KiB
// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
|
|
// ( $SFM == 0 ) && ( $UBERLIGHT == 1 )
|
|
// !$WORLDVERTEXTRANSITION && $NORMALMAP2
|
|
// !$NORMALMAP && $NORMALMAP2
|
|
// !$DETAILTEXTURE && ( $DETAIL_BLEND_MODE != 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
|
|
// 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 flashlight_ps20b_Static_Index
|
|
{
|
|
private:
|
|
int m_nSFM;
|
|
#ifdef _DEBUG
|
|
bool m_bSFM;
|
|
#endif
|
|
public:
|
|
void SetSFM( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 0 );
|
|
m_nSFM = i;
|
|
#ifdef _DEBUG
|
|
m_bSFM = true;
|
|
#endif
|
|
}
|
|
void SetSFM( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
|
|
m_nSFM = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bSFM = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nNORMALMAP;
|
|
#ifdef _DEBUG
|
|
bool m_bNORMALMAP;
|
|
#endif
|
|
public:
|
|
void SetNORMALMAP( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 2 );
|
|
m_nNORMALMAP = i;
|
|
#ifdef _DEBUG
|
|
m_bNORMALMAP = true;
|
|
#endif
|
|
}
|
|
void SetNORMALMAP( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 );
|
|
m_nNORMALMAP = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bNORMALMAP = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nNORMALMAP2;
|
|
#ifdef _DEBUG
|
|
bool m_bNORMALMAP2;
|
|
#endif
|
|
public:
|
|
void SetNORMALMAP2( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nNORMALMAP2 = i;
|
|
#ifdef _DEBUG
|
|
m_bNORMALMAP2 = true;
|
|
#endif
|
|
}
|
|
void SetNORMALMAP2( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nNORMALMAP2 = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bNORMALMAP2 = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nWORLDVERTEXTRANSITION;
|
|
#ifdef _DEBUG
|
|
bool m_bWORLDVERTEXTRANSITION;
|
|
#endif
|
|
public:
|
|
void SetWORLDVERTEXTRANSITION( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nWORLDVERTEXTRANSITION = i;
|
|
#ifdef _DEBUG
|
|
m_bWORLDVERTEXTRANSITION = true;
|
|
#endif
|
|
}
|
|
void SetWORLDVERTEXTRANSITION( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nWORLDVERTEXTRANSITION = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bWORLDVERTEXTRANSITION = 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_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_nDETAIL_BLEND_MODE;
|
|
#ifdef _DEBUG
|
|
bool m_bDETAIL_BLEND_MODE;
|
|
#endif
|
|
public:
|
|
void SetDETAIL_BLEND_MODE( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 11 );
|
|
m_nDETAIL_BLEND_MODE = i;
|
|
#ifdef _DEBUG
|
|
m_bDETAIL_BLEND_MODE = true;
|
|
#endif
|
|
}
|
|
void SetDETAIL_BLEND_MODE( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 11 );
|
|
m_nDETAIL_BLEND_MODE = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bDETAIL_BLEND_MODE = 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_nDOPIXELFOG;
|
|
#ifdef _DEBUG
|
|
bool m_bDOPIXELFOG;
|
|
#endif
|
|
public:
|
|
void SetDOPIXELFOG( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nDOPIXELFOG = i;
|
|
#ifdef _DEBUG
|
|
m_bDOPIXELFOG = true;
|
|
#endif
|
|
}
|
|
void SetDOPIXELFOG( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nDOPIXELFOG = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bDOPIXELFOG = true;
|
|
#endif
|
|
}
|
|
public:
|
|
// CONSTRUCTOR
|
|
flashlight_ps20b_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
|
|
{
|
|
#ifdef _DEBUG
|
|
m_bSFM = false;
|
|
#endif // _DEBUG
|
|
m_nSFM = 0;
|
|
#ifdef _DEBUG
|
|
m_bNORMALMAP = false;
|
|
#endif // _DEBUG
|
|
m_nNORMALMAP = 0;
|
|
#ifdef _DEBUG
|
|
m_bNORMALMAP2 = false;
|
|
#endif // _DEBUG
|
|
m_nNORMALMAP2 = 0;
|
|
#ifdef _DEBUG
|
|
m_bWORLDVERTEXTRANSITION = false;
|
|
#endif // _DEBUG
|
|
m_nWORLDVERTEXTRANSITION = 0;
|
|
#ifdef _DEBUG
|
|
m_bSEAMLESS = false;
|
|
#endif // _DEBUG
|
|
m_nSEAMLESS = 0;
|
|
#ifdef _DEBUG
|
|
m_bDETAILTEXTURE = false;
|
|
#endif // _DEBUG
|
|
m_nDETAILTEXTURE = 0;
|
|
#ifdef _DEBUG
|
|
m_bDETAIL_BLEND_MODE = false;
|
|
#endif // _DEBUG
|
|
m_nDETAIL_BLEND_MODE = 0;
|
|
#ifdef _DEBUG
|
|
m_bFLASHLIGHTDEPTHFILTERMODE = false;
|
|
#endif // _DEBUG
|
|
m_nFLASHLIGHTDEPTHFILTERMODE = 0;
|
|
#ifdef _DEBUG
|
|
m_bDOPIXELFOG = true;
|
|
#endif // _DEBUG
|
|
m_nDOPIXELFOG = !IS_FLAG_SET( MATERIAL_VAR_VERTEXFOG ) ? 1 : 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_bSFM && m_bNORMALMAP && m_bNORMALMAP2 && m_bWORLDVERTEXTRANSITION && m_bSEAMLESS && m_bDETAILTEXTURE && m_bDETAIL_BLEND_MODE && m_bFLASHLIGHTDEPTHFILTERMODE && m_bDOPIXELFOG;
|
|
Assert( bAllStaticVarsDefined );
|
|
#endif // _DEBUG
|
|
return ( 4 * m_nSFM ) + ( 4 * m_nNORMALMAP ) + ( 12 * m_nNORMALMAP2 ) + ( 24 * m_nWORLDVERTEXTRANSITION ) + ( 48 * m_nSEAMLESS ) + ( 96 * m_nDETAILTEXTURE ) + ( 192 * m_nDETAIL_BLEND_MODE ) + ( 2304 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 2304 * m_nDOPIXELFOG ) + 0;
|
|
}
|
|
};
|
|
#define shaderStaticTest_flashlight_ps20b psh_forgot_to_set_static_SFM + psh_forgot_to_set_static_NORMALMAP + psh_forgot_to_set_static_NORMALMAP2 + psh_forgot_to_set_static_WORLDVERTEXTRANSITION + psh_forgot_to_set_static_SEAMLESS + psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + 0
|
|
class flashlight_ps20b_Dynamic_Index
|
|
{
|
|
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
|
|
}
|
|
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
|
|
flashlight_ps20b_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
|
|
{
|
|
#ifdef _DEBUG
|
|
m_bFLASHLIGHTSHADOWS = false;
|
|
#endif // _DEBUG
|
|
m_nFLASHLIGHTSHADOWS = 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_bFLASHLIGHTSHADOWS && m_bPIXELFOGTYPE;
|
|
Assert( bAllDynamicVarsDefined );
|
|
#endif // _DEBUG
|
|
return ( 1 * m_nFLASHLIGHTSHADOWS ) + ( 2 * m_nPIXELFOGTYPE ) + 0;
|
|
}
|
|
};
|
|
#define shaderDynamicTest_flashlight_ps20b psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + 0
|
|
|
|
static const ShaderComboInformation_t s_DynamicComboArray_flashlight_ps20b[2] =
|
|
{
|
|
{ "FLASHLIGHTSHADOWS", 0, 1 },
|
|
{ "PIXELFOGTYPE", 0, 1 },
|
|
};
|
|
|
|
static const ShaderComboInformation_t s_StaticComboArray_flashlight_ps20b[9] =
|
|
{
|
|
{ "SFM", 0, 0 },
|
|
{ "NORMALMAP", 0, 2 },
|
|
{ "NORMALMAP2", 0, 1 },
|
|
{ "WORLDVERTEXTRANSITION", 0, 1 },
|
|
{ "SEAMLESS", 0, 1 },
|
|
{ "DETAILTEXTURE", 0, 1 },
|
|
{ "DETAIL_BLEND_MODE", 0, 11 },
|
|
{ "FLASHLIGHTDEPTHFILTERMODE", 0, 0 },
|
|
{ "DOPIXELFOG", 0, 1 },
|
|
};
|
|
static const ShaderComboSemantics_t flashlight_ps20b_combos =
|
|
{
|
|
"flashlight_ps20b", s_DynamicComboArray_flashlight_ps20b, 2, s_StaticComboArray_flashlight_ps20b, 9
|
|
};
|
|
|
|
class ConstructMe_flashlight_ps20b
|
|
{
|
|
public:
|
|
ConstructMe_flashlight_ps20b()
|
|
{
|
|
GetShaderDLL()->AddShaderComboInformation( &flashlight_ps20b_combos );
|
|
}
|
|
};
|
|
|
|
static ConstructMe_flashlight_ps20b s_ConstructMe_flashlight_ps20b;
|