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.9 KiB
463 lines
9.9 KiB
5 years ago
|
#include "shaderlib/cshader.h"
|
||
|
class vertexlit_and_unlit_generic_vs20_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_nUSE_STATIC_CONTROL_FLOW;
|
||
|
#ifdef _DEBUG
|
||
|
bool m_bUSE_STATIC_CONTROL_FLOW;
|
||
|
#endif
|
||
|
public:
|
||
|
void SetUSE_STATIC_CONTROL_FLOW( int i )
|
||
|
{
|
||
|
Assert( i >= 0 && i <= 1 );
|
||
|
m_nUSE_STATIC_CONTROL_FLOW = i;
|
||
|
#ifdef _DEBUG
|
||
|
m_bUSE_STATIC_CONTROL_FLOW = true;
|
||
|
#endif
|
||
|
}
|
||
|
void SetUSE_STATIC_CONTROL_FLOW( bool i )
|
||
|
{
|
||
|
m_nUSE_STATIC_CONTROL_FLOW = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bUSE_STATIC_CONTROL_FLOW = 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_vs20_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_bUSE_STATIC_CONTROL_FLOW = false;
|
||
|
#endif // _DEBUG
|
||
|
m_nUSE_STATIC_CONTROL_FLOW = 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_bUSE_STATIC_CONTROL_FLOW && m_bDONT_GAMMA_CONVERT_VERTEX_COLOR;
|
||
|
Assert( bAllStaticVarsDefined );
|
||
|
#endif // _DEBUG
|
||
|
return ( 384 * m_nVERTEXCOLOR ) + ( 768 * m_nCUBEMAP ) + ( 1536 * m_nHALFLAMBERT ) + ( 3072 * m_nFLASHLIGHT ) + ( 6144 * m_nSEAMLESS_BASE ) + ( 12288 * m_nSEAMLESS_DETAIL ) + ( 24576 * m_nSEPARATE_DETAIL_UVS ) + ( 49152 * m_nUSE_STATIC_CONTROL_FLOW ) + ( 98304 * m_nDONT_GAMMA_CONVERT_VERTEX_COLOR ) + 0;
|
||
|
}
|
||
|
};
|
||
|
#define shaderStaticTest_vertexlit_and_unlit_generic_vs20 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_USE_STATIC_CONTROL_FLOW + vsh_forgot_to_set_static_DONT_GAMMA_CONVERT_VERTEX_COLOR + 0
|
||
|
class vertexlit_and_unlit_generic_vs20_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_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 )
|
||
|
{
|
||
|
m_nNUM_LIGHTS = i ? 1 : 0;
|
||
|
#ifdef _DEBUG
|
||
|
m_bNUM_LIGHTS = true;
|
||
|
#endif
|
||
|
}
|
||
|
public:
|
||
|
vertexlit_and_unlit_generic_vs20_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_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_bCOMPRESSED_VERTS && m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT_VERTEX && m_bSTATIC_LIGHT_LIGHTMAP && m_bDOWATERFOG && m_bSKINNING && m_bLIGHTING_PREVIEW && m_bNUM_LIGHTS;
|
||
|
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_nNUM_LIGHTS ) + 0;
|
||
|
}
|
||
|
};
|
||
|
#define shaderDynamicTest_vertexlit_and_unlit_generic_vs20 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_NUM_LIGHTS + 0
|