Counter Strike : Global Offensive Source Code
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.
 
 
 
 
 
 

401 lines
9.6 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_ps30_Static_Index
{
private:
int m_nSFM;
#ifdef _DEBUG
bool m_bSFM;
#endif
public:
void SetSFM( int i )
{
Assert( i >= 0 && i <= 1 );
m_nSFM = i;
#ifdef _DEBUG
m_bSFM = true;
#endif
}
void SetSFM( bool i )
{
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
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 <= 2 );
m_nFLASHLIGHTDEPTHFILTERMODE = i;
#ifdef _DEBUG
m_bFLASHLIGHTDEPTHFILTERMODE = true;
#endif
}
void SetFLASHLIGHTDEPTHFILTERMODE( bool i )
{
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 );
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_ps30_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 ( 8 * m_nSFM ) + ( 16 * m_nNORMALMAP ) + ( 48 * m_nNORMALMAP2 ) + ( 96 * m_nWORLDVERTEXTRANSITION ) + ( 192 * m_nSEAMLESS ) + ( 384 * m_nDETAILTEXTURE ) + ( 768 * m_nDETAIL_BLEND_MODE ) + ( 9216 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 27648 * m_nDOPIXELFOG ) + 0;
}
};
#define shaderStaticTest_flashlight_ps30 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_ps30_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_nUBERLIGHT;
#ifdef _DEBUG
bool m_bUBERLIGHT;
#endif
public:
void SetUBERLIGHT( int i )
{
Assert( i >= 0 && i <= 1 );
m_nUBERLIGHT = i;
#ifdef _DEBUG
m_bUBERLIGHT = true;
#endif
}
void SetUBERLIGHT( bool i )
{
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
m_nUBERLIGHT = i ? 1 : 0;
#ifdef _DEBUG
m_bUBERLIGHT = 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_ps30_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
{
#ifdef _DEBUG
m_bFLASHLIGHTSHADOWS = false;
#endif // _DEBUG
m_nFLASHLIGHTSHADOWS = 0;
#ifdef _DEBUG
m_bUBERLIGHT = false;
#endif // _DEBUG
m_nUBERLIGHT = 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_bUBERLIGHT && m_bPIXELFOGTYPE;
Assert( bAllDynamicVarsDefined );
#endif // _DEBUG
return ( 1 * m_nFLASHLIGHTSHADOWS ) + ( 2 * m_nUBERLIGHT ) + ( 4 * m_nPIXELFOGTYPE ) + 0;
}
};
#define shaderDynamicTest_flashlight_ps30 psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + psh_forgot_to_set_dynamic_UBERLIGHT + 0
static const ShaderComboInformation_t s_DynamicComboArray_flashlight_ps30[3] =
{
{ "FLASHLIGHTSHADOWS", 0, 1 },
{ "UBERLIGHT", 0, 1 },
{ "PIXELFOGTYPE", 0, 1 },
};
static const ShaderComboInformation_t s_StaticComboArray_flashlight_ps30[9] =
{
{ "SFM", 0, 1 },
{ "NORMALMAP", 0, 2 },
{ "NORMALMAP2", 0, 1 },
{ "WORLDVERTEXTRANSITION", 0, 1 },
{ "SEAMLESS", 0, 1 },
{ "DETAILTEXTURE", 0, 1 },
{ "DETAIL_BLEND_MODE", 0, 11 },
{ "FLASHLIGHTDEPTHFILTERMODE", 0, 2 },
{ "DOPIXELFOG", 0, 1 },
};
static const ShaderComboSemantics_t flashlight_ps30_combos =
{
"flashlight_ps30", s_DynamicComboArray_flashlight_ps30, 3, s_StaticComboArray_flashlight_ps30, 9
};
class ConstructMe_flashlight_ps30
{
public:
ConstructMe_flashlight_ps30()
{
GetShaderDLL()->AddShaderComboInformation( &flashlight_ps30_combos );
}
};
static ConstructMe_flashlight_ps30 s_ConstructMe_flashlight_ps30;