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.
227 lines
5.1 KiB
227 lines
5.1 KiB
// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!!
|
|
// ( $MORPHING || $SKINNING || $COMPRESSED_VERTS ) && $TESSELLATION
|
|
// defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH
|
|
#include "shaderlib/cshader.h"
|
|
class depthwrite_vs20_Static_Index
|
|
{
|
|
private:
|
|
int m_nONLY_PROJECT_POSITION;
|
|
#ifdef _DEBUG
|
|
bool m_bONLY_PROJECT_POSITION;
|
|
#endif
|
|
public:
|
|
void SetONLY_PROJECT_POSITION( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nONLY_PROJECT_POSITION = i;
|
|
#ifdef _DEBUG
|
|
m_bONLY_PROJECT_POSITION = true;
|
|
#endif
|
|
}
|
|
void SetONLY_PROJECT_POSITION( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nONLY_PROJECT_POSITION = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bONLY_PROJECT_POSITION = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nTREESWAY;
|
|
#ifdef _DEBUG
|
|
bool m_bTREESWAY;
|
|
#endif
|
|
public:
|
|
void SetTREESWAY( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 2 );
|
|
m_nTREESWAY = i;
|
|
#ifdef _DEBUG
|
|
m_bTREESWAY = true;
|
|
#endif
|
|
}
|
|
void SetTREESWAY( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 );
|
|
m_nTREESWAY = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bTREESWAY = true;
|
|
#endif
|
|
}
|
|
public:
|
|
// CONSTRUCTOR
|
|
depthwrite_vs20_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
|
|
{
|
|
#ifdef _DEBUG
|
|
m_bONLY_PROJECT_POSITION = false;
|
|
#endif // _DEBUG
|
|
m_nONLY_PROJECT_POSITION = 0;
|
|
#ifdef _DEBUG
|
|
m_bTREESWAY = false;
|
|
#endif // _DEBUG
|
|
m_nTREESWAY = 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_bONLY_PROJECT_POSITION && m_bTREESWAY;
|
|
Assert( bAllStaticVarsDefined );
|
|
#endif // _DEBUG
|
|
return ( 4 * m_nONLY_PROJECT_POSITION ) + ( 8 * m_nTREESWAY ) + 0;
|
|
}
|
|
};
|
|
#define shaderStaticTest_depthwrite_vs20 vsh_forgot_to_set_static_ONLY_PROJECT_POSITION + vsh_forgot_to_set_static_TREESWAY + 0
|
|
class depthwrite_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 )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nCOMPRESSED_VERTS = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bCOMPRESSED_VERTS = 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 )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nSKINNING = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bSKINNING = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nMORPHING;
|
|
#ifdef _DEBUG
|
|
bool m_bMORPHING;
|
|
#endif
|
|
public:
|
|
void SetMORPHING( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 0 );
|
|
m_nMORPHING = i;
|
|
#ifdef _DEBUG
|
|
m_bMORPHING = true;
|
|
#endif
|
|
}
|
|
void SetMORPHING( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
|
|
m_nMORPHING = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bMORPHING = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nTESSELLATION;
|
|
#ifdef _DEBUG
|
|
bool m_bTESSELLATION;
|
|
#endif
|
|
public:
|
|
void SetTESSELLATION( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 0 );
|
|
m_nTESSELLATION = i;
|
|
#ifdef _DEBUG
|
|
m_bTESSELLATION = true;
|
|
#endif
|
|
}
|
|
void SetTESSELLATION( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 0 );
|
|
m_nTESSELLATION = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bTESSELLATION = true;
|
|
#endif
|
|
}
|
|
public:
|
|
// CONSTRUCTOR
|
|
depthwrite_vs20_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
|
|
{
|
|
#ifdef _DEBUG
|
|
m_bCOMPRESSED_VERTS = false;
|
|
#endif // _DEBUG
|
|
m_nCOMPRESSED_VERTS = 0;
|
|
#ifdef _DEBUG
|
|
m_bSKINNING = false;
|
|
#endif // _DEBUG
|
|
m_nSKINNING = 0;
|
|
#ifdef _DEBUG
|
|
m_bMORPHING = true;
|
|
#endif // _DEBUG
|
|
m_nMORPHING = false ;
|
|
#ifdef _DEBUG
|
|
m_bTESSELLATION = false;
|
|
#endif // _DEBUG
|
|
m_nTESSELLATION = 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_bSKINNING && m_bMORPHING && m_bTESSELLATION;
|
|
Assert( bAllDynamicVarsDefined );
|
|
#endif // _DEBUG
|
|
return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nSKINNING ) + ( 4 * m_nMORPHING ) + ( 4 * m_nTESSELLATION ) + 0;
|
|
}
|
|
};
|
|
#define shaderDynamicTest_depthwrite_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + vsh_forgot_to_set_dynamic_SKINNING + vsh_forgot_to_set_dynamic_TESSELLATION + 0
|
|
|
|
static const ShaderComboInformation_t s_DynamicComboArray_depthwrite_vs20[4] =
|
|
{
|
|
{ "COMPRESSED_VERTS", 0, 1 },
|
|
{ "SKINNING", 0, 1 },
|
|
{ "MORPHING", 0, 0 },
|
|
{ "TESSELLATION", 0, 0 },
|
|
};
|
|
|
|
static const ShaderComboInformation_t s_StaticComboArray_depthwrite_vs20[2] =
|
|
{
|
|
{ "ONLY_PROJECT_POSITION", 0, 1 },
|
|
{ "TREESWAY", 0, 2 },
|
|
};
|
|
static const ShaderComboSemantics_t depthwrite_vs20_combos =
|
|
{
|
|
"depthwrite_vs20", s_DynamicComboArray_depthwrite_vs20, 4, s_StaticComboArray_depthwrite_vs20, 2
|
|
};
|
|
|
|
class ConstructMe_depthwrite_vs20
|
|
{
|
|
public:
|
|
ConstructMe_depthwrite_vs20()
|
|
{
|
|
GetShaderDLL()->AddShaderComboInformation( &depthwrite_vs20_combos );
|
|
}
|
|
};
|
|
|
|
static ConstructMe_depthwrite_vs20 s_ConstructMe_depthwrite_vs20;
|