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.
338 lines
6.8 KiB
338 lines
6.8 KiB
5 years ago
|
#include "shaderlib/cshader.h"
|
||
|
class lightmappedgeneric_vs20_Static_Index
|
||
|
{
|
||
|
private:
|
||
|
int m_nENVMAP_MASK;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bENVMAP_MASK;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetENVMAP_MASK( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nENVMAP_MASK = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bENVMAP_MASK = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetENVMAP_MASK( bool i )
|
||
|
{
|
||
|
m_nENVMAP_MASK = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bENVMAP_MASK = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nTANGENTSPACE;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bTANGENTSPACE;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetTANGENTSPACE( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nTANGENTSPACE = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bTANGENTSPACE = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetTANGENTSPACE( bool i )
|
||
|
{
|
||
|
m_nTANGENTSPACE = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bTANGENTSPACE = 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 )
|
||
|
{
|
||
|
m_nBUMPMAP = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bBUMPMAP = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nDIFFUSEBUMPMAP;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bDIFFUSEBUMPMAP;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetDIFFUSEBUMPMAP( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nDIFFUSEBUMPMAP = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDIFFUSEBUMPMAP = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetDIFFUSEBUMPMAP( bool i )
|
||
|
{
|
||
|
m_nDIFFUSEBUMPMAP = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDIFFUSEBUMPMAP = 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 )
|
||
|
{
|
||
|
m_nVERTEXCOLOR = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bVERTEXCOLOR = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nVERTEXALPHATEXBLENDFACTOR;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bVERTEXALPHATEXBLENDFACTOR;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetVERTEXALPHATEXBLENDFACTOR( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nVERTEXALPHATEXBLENDFACTOR = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bVERTEXALPHATEXBLENDFACTOR = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetVERTEXALPHATEXBLENDFACTOR( bool i )
|
||
|
{
|
||
|
m_nVERTEXALPHATEXBLENDFACTOR = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bVERTEXALPHATEXBLENDFACTOR = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nRELIEF_MAPPING;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bRELIEF_MAPPING;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetRELIEF_MAPPING( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 0 );
|
||
|
m_nRELIEF_MAPPING = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bRELIEF_MAPPING = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetRELIEF_MAPPING( bool i )
|
||
|
{
|
||
|
m_nRELIEF_MAPPING = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bRELIEF_MAPPING = 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 )
|
||
|
{
|
||
|
m_nSEAMLESS = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSEAMLESS = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nBUMPMASK;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bBUMPMASK;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetBUMPMASK( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nBUMPMASK = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bBUMPMASK = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetBUMPMASK( bool i )
|
||
|
{
|
||
|
m_nBUMPMASK = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bBUMPMASK = true;
|
||
|
#endif
|
||
|
}
|
||
|
public:
|
||
|
lightmappedgeneric_vs20_Static_Index( )
|
||
|
{
|
||
|
#ifdef _DEBUG
|
||
|
m_bENVMAP_MASK = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nENVMAP_MASK = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bTANGENTSPACE = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nTANGENTSPACE = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bBUMPMAP = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nBUMPMAP = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDIFFUSEBUMPMAP = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nDIFFUSEBUMPMAP = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bVERTEXCOLOR = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nVERTEXCOLOR = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bVERTEXALPHATEXBLENDFACTOR = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nVERTEXALPHATEXBLENDFACTOR = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bRELIEF_MAPPING = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nRELIEF_MAPPING = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSEAMLESS = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nSEAMLESS = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bBUMPMASK = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nBUMPMASK = 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_bENVMAP_MASK && m_bTANGENTSPACE && m_bBUMPMAP && m_bDIFFUSEBUMPMAP && m_bVERTEXCOLOR && m_bVERTEXALPHATEXBLENDFACTOR && m_bRELIEF_MAPPING && m_bSEAMLESS && m_bBUMPMASK;
|
||
|
Assert( bAllStaticVarsDefined );
|
||
|
#endif // _DEBUG
|
||
|
return ( 8 * m_nENVMAP_MASK ) + ( 16 * m_nTANGENTSPACE ) + ( 32 * m_nBUMPMAP ) + ( 64 * m_nDIFFUSEBUMPMAP ) + ( 128 * m_nVERTEXCOLOR ) + ( 256 * m_nVERTEXALPHATEXBLENDFACTOR ) + ( 512 * m_nRELIEF_MAPPING ) + ( 512 * m_nSEAMLESS ) + ( 1024 * m_nBUMPMASK ) + 0;
|
||
|
}
|
||
|
};
|
||
|
#define shaderStaticTest_lightmappedgeneric_vs20 vsh_forgot_to_set_static_ENVMAP_MASK + vsh_forgot_to_set_static_TANGENTSPACE + vsh_forgot_to_set_static_BUMPMAP + vsh_forgot_to_set_static_DIFFUSEBUMPMAP + vsh_forgot_to_set_static_VERTEXCOLOR + vsh_forgot_to_set_static_VERTEXALPHATEXBLENDFACTOR + vsh_forgot_to_set_static_RELIEF_MAPPING + vsh_forgot_to_set_static_SEAMLESS + vsh_forgot_to_set_static_BUMPMASK + 0
|
||
|
class lightmappedgeneric_vs20_Dynamic_Index
|
||
|
{
|
||
|
private:
|
||
|
int m_nFASTPATH;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bFASTPATH;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetFASTPATH( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nFASTPATH = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bFASTPATH = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetFASTPATH( bool i )
|
||
|
{
|
||
|
m_nFASTPATH = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bFASTPATH = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nDOWATERFOG;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bDOWATERFOG;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetDOWATERFOG( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nDOWATERFOG = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDOWATERFOG = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetDOWATERFOG( bool i )
|
||
|
{
|
||
|
m_nDOWATERFOG = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDOWATERFOG = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nLIGHTING_PREVIEW;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bLIGHTING_PREVIEW;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetLIGHTING_PREVIEW( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nLIGHTING_PREVIEW = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bLIGHTING_PREVIEW = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetLIGHTING_PREVIEW( bool i )
|
||
|
{
|
||
|
m_nLIGHTING_PREVIEW = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bLIGHTING_PREVIEW = true;
|
||
|
#endif
|
||
|
}
|
||
|
public:
|
||
|
lightmappedgeneric_vs20_Dynamic_Index()
|
||
|
{
|
||
|
#ifdef _DEBUG
|
||
|
m_bFASTPATH = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nFASTPATH = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDOWATERFOG = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nDOWATERFOG = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bLIGHTING_PREVIEW = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nLIGHTING_PREVIEW = 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_bFASTPATH && m_bDOWATERFOG && m_bLIGHTING_PREVIEW;
|
||
|
Assert( bAllDynamicVarsDefined );
|
||
|
#endif // _DEBUG
|
||
|
return ( 1 * m_nFASTPATH ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nLIGHTING_PREVIEW ) + 0;
|
||
|
}
|
||
|
};
|
||
|
#define shaderDynamicTest_lightmappedgeneric_vs20 vsh_forgot_to_set_dynamic_FASTPATH + vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_LIGHTING_PREVIEW + 0
|