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.
463 lines
9.7 KiB
463 lines
9.7 KiB
![]()
4 years ago
|
#include "shaderlib/cshader.h"
|
||
|
class vertexlit_and_unlit_generic_vs30_Static_Index
|
||
|
{
|
||
|
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_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 )
|
||
|
{
|
||
|
m_nCUBEMAP = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bCUBEMAP = 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 )
|
||
|
{
|
||
|
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 )
|
||
|
{
|
||
|
m_nFLASHLIGHT = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bFLASHLIGHT = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nSEAMLESS_BASE;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bSEAMLESS_BASE;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetSEAMLESS_BASE( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nSEAMLESS_BASE = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSEAMLESS_BASE = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetSEAMLESS_BASE( bool i )
|
||
|
{
|
||
|
m_nSEAMLESS_BASE = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSEAMLESS_BASE = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nSEAMLESS_DETAIL;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bSEAMLESS_DETAIL;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetSEAMLESS_DETAIL( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nSEAMLESS_DETAIL = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSEAMLESS_DETAIL = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetSEAMLESS_DETAIL( bool i )
|
||
|
{
|
||
|
m_nSEAMLESS_DETAIL = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSEAMLESS_DETAIL = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nSEPARATE_DETAIL_UVS;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bSEPARATE_DETAIL_UVS;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetSEPARATE_DETAIL_UVS( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nSEPARATE_DETAIL_UVS = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSEPARATE_DETAIL_UVS = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetSEPARATE_DETAIL_UVS( bool i )
|
||
|
{
|
||
|
m_nSEPARATE_DETAIL_UVS = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSEPARATE_DETAIL_UVS = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nDECAL;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bDECAL;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetDECAL( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nDECAL = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDECAL = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetDECAL( bool i )
|
||
|
{
|
||
|
m_nDECAL = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDECAL = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nDONT_GAMMA_CONVERT_VERTEX_COLOR;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bDONT_GAMMA_CONVERT_VERTEX_COLOR;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetDONT_GAMMA_CONVERT_VERTEX_COLOR( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nDONT_GAMMA_CONVERT_VERTEX_COLOR = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDONT_GAMMA_CONVERT_VERTEX_COLOR = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetDONT_GAMMA_CONVERT_VERTEX_COLOR( bool i )
|
||
|
{
|
||
|
m_nDONT_GAMMA_CONVERT_VERTEX_COLOR = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDONT_GAMMA_CONVERT_VERTEX_COLOR = true;
|
||
|
#endif
|
||
|
}
|
||
|
public:
|
||
|
vertexlit_and_unlit_generic_vs30_Static_Index( )
|
||
|
{
|
||
|
#ifdef _DEBUG
|
||
|
m_bVERTEXCOLOR = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nVERTEXCOLOR = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bCUBEMAP = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nCUBEMAP = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bHALFLAMBERT = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nHALFLAMBERT = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bFLASHLIGHT = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nFLASHLIGHT = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSEAMLESS_BASE = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nSEAMLESS_BASE = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSEAMLESS_DETAIL = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nSEAMLESS_DETAIL = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSEPARATE_DETAIL_UVS = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nSEPARATE_DETAIL_UVS = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDECAL = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nDECAL = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDONT_GAMMA_CONVERT_VERTEX_COLOR = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nDONT_GAMMA_CONVERT_VERTEX_COLOR = 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_bVERTEXCOLOR && m_bCUBEMAP && m_bHALFLAMBERT && m_bFLASHLIGHT && m_bSEAMLESS_BASE && m_bSEAMLESS_DETAIL && m_bSEPARATE_DETAIL_UVS && m_bDECAL && m_bDONT_GAMMA_CONVERT_VERTEX_COLOR;
|
||
|
Assert( bAllStaticVarsDefined );
|
||
|
#endif // _DEBUG
|
||
|
return ( 256 * m_nVERTEXCOLOR ) + ( 512 * m_nCUBEMAP ) + ( 1024 * m_nHALFLAMBERT ) + ( 2048 * m_nFLASHLIGHT ) + ( 4096 * m_nSEAMLESS_BASE ) + ( 8192 * m_nSEAMLESS_DETAIL ) + ( 16384 * m_nSEPARATE_DETAIL_UVS ) + ( 32768 * m_nDECAL ) + ( 65536 * m_nDONT_GAMMA_CONVERT_VERTEX_COLOR ) + 0;
|
||
|
}
|
||
|
};
|
||
|
#define shaderStaticTest_vertexlit_and_unlit_generic_vs30 vsh_forgot_to_set_static_VERTEXCOLOR + vsh_forgot_to_set_static_CUBEMAP + vsh_forgot_to_set_static_HALFLAMBERT + vsh_forgot_to_set_static_FLASHLIGHT + vsh_forgot_to_set_static_SEAMLESS_BASE + vsh_forgot_to_set_static_SEAMLESS_DETAIL + vsh_forgot_to_set_static_SEPARATE_DETAIL_UVS + vsh_forgot_to_set_static_DECAL + vsh_forgot_to_set_static_DONT_GAMMA_CONVERT_VERTEX_COLOR + 0
|
||
|
class vertexlit_and_unlit_generic_vs30_Dynamic_Index
|
||
|
{
|
||
|
private:
|
||
|
int m_nCOMPRESSED_VERTS;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bCOMPRESSED_VERTS;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetCOMPRESSED_VERTS( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nCOMPRESSED_VERTS = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bCOMPRESSED_VERTS = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetCOMPRESSED_VERTS( bool i )
|
||
|
{
|
||
|
m_nCOMPRESSED_VERTS = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bCOMPRESSED_VERTS = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nDYNAMIC_LIGHT;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bDYNAMIC_LIGHT;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetDYNAMIC_LIGHT( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nDYNAMIC_LIGHT = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDYNAMIC_LIGHT = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetDYNAMIC_LIGHT( bool i )
|
||
|
{
|
||
|
m_nDYNAMIC_LIGHT = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDYNAMIC_LIGHT = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nSTATIC_LIGHT_VERTEX;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bSTATIC_LIGHT_VERTEX;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetSTATIC_LIGHT_VERTEX( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nSTATIC_LIGHT_VERTEX = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSTATIC_LIGHT_VERTEX = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetSTATIC_LIGHT_VERTEX( bool i )
|
||
|
{
|
||
|
m_nSTATIC_LIGHT_VERTEX = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSTATIC_LIGHT_VERTEX = true;
|
||
|
#endif
|
||
|
}
|
||
|
private:
|
||
|
int m_nSTATIC_LIGHT_LIGHTMAP;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bSTATIC_LIGHT_LIGHTMAP;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetSTATIC_LIGHT_LIGHTMAP( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nSTATIC_LIGHT_LIGHTMAP = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSTATIC_LIGHT_LIGHTMAP = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetSTATIC_LIGHT_LIGHTMAP( bool i )
|
||
|
{
|
||
|
m_nSTATIC_LIGHT_LIGHTMAP = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSTATIC_LIGHT_LIGHTMAP = 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_nSKINNING;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bSKINNING;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetSKINNING( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nSKINNING = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSKINNING = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetSKINNING( bool i )
|
||
|
{
|
||
|
m_nSKINNING = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSKINNING = 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
|
||
|
}
|
||
|
private:
|
||
|
int m_nMORPHING;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bMORPHING;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetMORPHING( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nMORPHING = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bMORPHING = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetMORPHING( bool i )
|
||
|
{
|
||
|
m_nMORPHING = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bMORPHING = true;
|
||
|
#endif
|
||
|
}
|
||
|
public:
|
||
|
vertexlit_and_unlit_generic_vs30_Dynamic_Index()
|
||
|
{
|
||
|
#ifdef _DEBUG
|
||
|
m_bCOMPRESSED_VERTS = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nCOMPRESSED_VERTS = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDYNAMIC_LIGHT = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nDYNAMIC_LIGHT = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSTATIC_LIGHT_VERTEX = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nSTATIC_LIGHT_VERTEX = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSTATIC_LIGHT_LIGHTMAP = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nSTATIC_LIGHT_LIGHTMAP = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bDOWATERFOG = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nDOWATERFOG = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bSKINNING = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nSKINNING = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bLIGHTING_PREVIEW = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nLIGHTING_PREVIEW = 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bMORPHING = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nMORPHING = 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_bCOMPRESSED_VERTS && m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT_VERTEX && m_bSTATIC_LIGHT_LIGHTMAP && m_bDOWATERFOG && m_bSKINNING && m_bLIGHTING_PREVIEW && m_bMORPHING;
|
||
|
Assert( bAllDynamicVarsDefined );
|
||
|
#endif // _DEBUG
|
||
|
return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDYNAMIC_LIGHT ) + ( 4 * m_nSTATIC_LIGHT_VERTEX ) + ( 8 * m_nSTATIC_LIGHT_LIGHTMAP ) + ( 16 * m_nDOWATERFOG ) + ( 32 * m_nSKINNING ) + ( 64 * m_nLIGHTING_PREVIEW ) + ( 128 * m_nMORPHING ) + 0;
|
||
|
}
|
||
|
};
|
||
|
#define shaderDynamicTest_vertexlit_and_unlit_generic_vs30 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_DYNAMIC_LIGHT + vsh_forgot_to_set_dynamic_STATIC_LIGHT_VERTEX + vsh_forgot_to_set_dynamic_STATIC_LIGHT_LIGHTMAP + vsh_forgot_to_set_dynamic_DOWATERFOG + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_LIGHTING_PREVIEW + vsh_forgot_to_set_dynamic_MORPHING + 0
|