|
|
// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
// 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 vortwarp_ps20_Static_Index { private: int m_nBASETEXTURE; #ifdef _DEBUG bool m_bBASETEXTURE; #endif public: void SetBASETEXTURE( int i ) { Assert( i >= 0 && i <= 1 ); m_nBASETEXTURE = i; #ifdef _DEBUG m_bBASETEXTURE = true; #endif } void SetBASETEXTURE( bool i ) { Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 ); m_nBASETEXTURE = i ? 1 : 0; #ifdef _DEBUG m_bBASETEXTURE = true; #endif } private: int m_nCUBEMAP; #ifdef _DEBUG bool m_bCUBEMAP; #endif public: void SetCUBEMAP( int i ) { Assert( i >= 0 && i <= 1 ); m_nCUBEMAP = i; #ifdef _DEBUG m_bCUBEMAP = true; #endif } void SetCUBEMAP( bool i ) { Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 ); m_nCUBEMAP = i ? 1 : 0; #ifdef _DEBUG m_bCUBEMAP = true; #endif } private: int m_nDIFFUSELIGHTING; #ifdef _DEBUG bool m_bDIFFUSELIGHTING; #endif public: void SetDIFFUSELIGHTING( int i ) { Assert( i >= 0 && i <= 1 ); m_nDIFFUSELIGHTING = i; #ifdef _DEBUG m_bDIFFUSELIGHTING = true; #endif } void SetDIFFUSELIGHTING( bool i ) { Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 ); m_nDIFFUSELIGHTING = i ? 1 : 0; #ifdef _DEBUG m_bDIFFUSELIGHTING = true; #endif } private: int m_nNORMALMAPALPHAENVMAPMASK; #ifdef _DEBUG bool m_bNORMALMAPALPHAENVMAPMASK; #endif public: void SetNORMALMAPALPHAENVMAPMASK( int i ) { Assert( i >= 0 && i <= 1 ); m_nNORMALMAPALPHAENVMAPMASK = i; #ifdef _DEBUG m_bNORMALMAPALPHAENVMAPMASK = true; #endif } void SetNORMALMAPALPHAENVMAPMASK( bool i ) { Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 ); m_nNORMALMAPALPHAENVMAPMASK = i ? 1 : 0; #ifdef _DEBUG m_bNORMALMAPALPHAENVMAPMASK = true; #endif } private: int m_nHALFLAMBERT; #ifdef _DEBUG bool m_bHALFLAMBERT; #endif public: void SetHALFLAMBERT( int i ) { Assert( i >= 0 && i <= 1 ); m_nHALFLAMBERT = i; #ifdef _DEBUG m_bHALFLAMBERT = true; #endif } void SetHALFLAMBERT( bool i ) { Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 ); m_nHALFLAMBERT = i ? 1 : 0; #ifdef _DEBUG m_bHALFLAMBERT = 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_nTRANSLUCENT; #ifdef _DEBUG bool m_bTRANSLUCENT; #endif public: void SetTRANSLUCENT( int i ) { Assert( i >= 0 && i <= 1 ); m_nTRANSLUCENT = i; #ifdef _DEBUG m_bTRANSLUCENT = true; #endif } void SetTRANSLUCENT( bool i ) { Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 ); m_nTRANSLUCENT = i ? 1 : 0; #ifdef _DEBUG m_bTRANSLUCENT = true; #endif } public: // CONSTRUCTOR
vortwarp_ps20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params ) { #ifdef _DEBUG m_bBASETEXTURE = false; #endif // _DEBUG
m_nBASETEXTURE = 0; #ifdef _DEBUG m_bCUBEMAP = false; #endif // _DEBUG
m_nCUBEMAP = 0; #ifdef _DEBUG m_bDIFFUSELIGHTING = false; #endif // _DEBUG
m_nDIFFUSELIGHTING = 0; #ifdef _DEBUG m_bNORMALMAPALPHAENVMAPMASK = false; #endif // _DEBUG
m_nNORMALMAPALPHAENVMAPMASK = 0; #ifdef _DEBUG m_bHALFLAMBERT = false; #endif // _DEBUG
m_nHALFLAMBERT = 0; #ifdef _DEBUG m_bFLASHLIGHT = false; #endif // _DEBUG
m_nFLASHLIGHT = 0; #ifdef _DEBUG m_bTRANSLUCENT = false; #endif // _DEBUG
m_nTRANSLUCENT = 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_bBASETEXTURE && m_bCUBEMAP && m_bDIFFUSELIGHTING && m_bNORMALMAPALPHAENVMAPMASK && m_bHALFLAMBERT && m_bFLASHLIGHT && m_bTRANSLUCENT; Assert( bAllStaticVarsDefined ); #endif // _DEBUG
return ( 48 * m_nBASETEXTURE ) + ( 96 * m_nCUBEMAP ) + ( 192 * m_nDIFFUSELIGHTING ) + ( 384 * m_nNORMALMAPALPHAENVMAPMASK ) + ( 768 * m_nHALFLAMBERT ) + ( 1536 * m_nFLASHLIGHT ) + ( 3072 * m_nTRANSLUCENT ) + 0; } }; #define shaderStaticTest_vortwarp_ps20 psh_forgot_to_set_static_BASETEXTURE + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_DIFFUSELIGHTING + psh_forgot_to_set_static_NORMALMAPALPHAENVMAPMASK + psh_forgot_to_set_static_HALFLAMBERT + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_TRANSLUCENT + 0 class vortwarp_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 } private: int m_nWARPINGIN; #ifdef _DEBUG bool m_bWARPINGIN; #endif public: void SetWARPINGIN( int i ) { Assert( i >= 0 && i <= 1 ); m_nWARPINGIN = i; #ifdef _DEBUG m_bWARPINGIN = true; #endif } void SetWARPINGIN( bool i ) { Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 ); m_nWARPINGIN = i ? 1 : 0; #ifdef _DEBUG m_bWARPINGIN = true; #endif } private: int m_nAMBIENT_LIGHT; #ifdef _DEBUG bool m_bAMBIENT_LIGHT; #endif public: void SetAMBIENT_LIGHT( int i ) { Assert( i >= 0 && i <= 1 ); m_nAMBIENT_LIGHT = i; #ifdef _DEBUG m_bAMBIENT_LIGHT = true; #endif } void SetAMBIENT_LIGHT( bool i ) { Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 ); m_nAMBIENT_LIGHT = i ? 1 : 0; #ifdef _DEBUG m_bAMBIENT_LIGHT = true; #endif } private: int m_nNUM_LIGHTS; #ifdef _DEBUG bool m_bNUM_LIGHTS; #endif public: void SetNUM_LIGHTS( int i ) { Assert( i >= 0 && i <= 2 ); m_nNUM_LIGHTS = i; #ifdef _DEBUG m_bNUM_LIGHTS = true; #endif } void SetNUM_LIGHTS( bool i ) { Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 ); m_nNUM_LIGHTS = i ? 1 : 0; #ifdef _DEBUG m_bNUM_LIGHTS = true; #endif } public: // CONSTRUCTOR
vortwarp_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 ) ; #ifdef _DEBUG m_bWARPINGIN = false; #endif // _DEBUG
m_nWARPINGIN = 0; #ifdef _DEBUG m_bAMBIENT_LIGHT = false; #endif // _DEBUG
m_nAMBIENT_LIGHT = 0; #ifdef _DEBUG m_bNUM_LIGHTS = false; #endif // _DEBUG
m_nNUM_LIGHTS = 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_bWARPINGIN && m_bAMBIENT_LIGHT && m_bNUM_LIGHTS; Assert( bAllDynamicVarsDefined ); #endif // _DEBUG
return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + ( 4 * m_nWARPINGIN ) + ( 8 * m_nAMBIENT_LIGHT ) + ( 16 * m_nNUM_LIGHTS ) + 0; } }; #define shaderDynamicTest_vortwarp_ps20 psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_WARPINGIN + psh_forgot_to_set_dynamic_AMBIENT_LIGHT + psh_forgot_to_set_dynamic_NUM_LIGHTS + 0
static const ShaderComboInformation_t s_DynamicComboArray_vortwarp_ps20[5] = { { "WRITEWATERFOGTODESTALPHA", 0, 1 }, { "PIXELFOGTYPE", 0, 1 }, { "WARPINGIN", 0, 1 }, { "AMBIENT_LIGHT", 0, 1 }, { "NUM_LIGHTS", 0, 2 }, };
static const ShaderComboInformation_t s_StaticComboArray_vortwarp_ps20[7] = { { "BASETEXTURE", 0, 1 }, { "CUBEMAP", 0, 1 }, { "DIFFUSELIGHTING", 0, 1 }, { "NORMALMAPALPHAENVMAPMASK", 0, 1 }, { "HALFLAMBERT", 0, 1 }, { "FLASHLIGHT", 0, 1 }, { "TRANSLUCENT", 0, 1 }, }; static const ShaderComboSemantics_t vortwarp_ps20_combos = { "vortwarp_ps20", s_DynamicComboArray_vortwarp_ps20, 5, s_StaticComboArray_vortwarp_ps20, 7 };
class ConstructMe_vortwarp_ps20 { public: ConstructMe_vortwarp_ps20() { GetShaderDLL()->AddShaderComboInformation( &vortwarp_ps20_combos ); } };
static ConstructMe_vortwarp_ps20 s_ConstructMe_vortwarp_ps20;
|