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.
262 lines
6.3 KiB
262 lines
6.3 KiB
// 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 sprite_ps20b_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 )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nVERTEXCOLOR = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bVERTEXCOLOR = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nCONSTANTCOLOR;
|
|
#ifdef _DEBUG
|
|
bool m_bCONSTANTCOLOR;
|
|
#endif
|
|
public:
|
|
void SetCONSTANTCOLOR( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nCONSTANTCOLOR = i;
|
|
#ifdef _DEBUG
|
|
m_bCONSTANTCOLOR = true;
|
|
#endif
|
|
}
|
|
void SetCONSTANTCOLOR( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nCONSTANTCOLOR = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bCONSTANTCOLOR = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nHDRTYPE;
|
|
#ifdef _DEBUG
|
|
bool m_bHDRTYPE;
|
|
#endif
|
|
public:
|
|
void SetHDRTYPE( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 2 );
|
|
m_nHDRTYPE = i;
|
|
#ifdef _DEBUG
|
|
m_bHDRTYPE = true;
|
|
#endif
|
|
}
|
|
void SetHDRTYPE( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 2 );
|
|
m_nHDRTYPE = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bHDRTYPE = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nSRGB;
|
|
#ifdef _DEBUG
|
|
bool m_bSRGB;
|
|
#endif
|
|
public:
|
|
void SetSRGB( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nSRGB = i;
|
|
#ifdef _DEBUG
|
|
m_bSRGB = true;
|
|
#endif
|
|
}
|
|
void SetSRGB( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nSRGB = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bSRGB = true;
|
|
#endif
|
|
}
|
|
private:
|
|
int m_nSRGB_OUTPUT_ADAPTER;
|
|
#ifdef _DEBUG
|
|
bool m_bSRGB_OUTPUT_ADAPTER;
|
|
#endif
|
|
public:
|
|
void SetSRGB_OUTPUT_ADAPTER( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nSRGB_OUTPUT_ADAPTER = i;
|
|
#ifdef _DEBUG
|
|
m_bSRGB_OUTPUT_ADAPTER = true;
|
|
#endif
|
|
}
|
|
void SetSRGB_OUTPUT_ADAPTER( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nSRGB_OUTPUT_ADAPTER = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bSRGB_OUTPUT_ADAPTER = true;
|
|
#endif
|
|
}
|
|
public:
|
|
// CONSTRUCTOR
|
|
sprite_ps20b_Static_Index( IShaderShadow *pShaderShadow, IMaterialVar **params )
|
|
{
|
|
#ifdef _DEBUG
|
|
m_bVERTEXCOLOR = false;
|
|
#endif // _DEBUG
|
|
m_nVERTEXCOLOR = 0;
|
|
#ifdef _DEBUG
|
|
m_bCONSTANTCOLOR = false;
|
|
#endif // _DEBUG
|
|
m_nCONSTANTCOLOR = 0;
|
|
#ifdef _DEBUG
|
|
m_bHDRTYPE = false;
|
|
#endif // _DEBUG
|
|
m_nHDRTYPE = 0;
|
|
#ifdef _DEBUG
|
|
m_bSRGB = false;
|
|
#endif // _DEBUG
|
|
m_nSRGB = 0;
|
|
#ifdef _DEBUG
|
|
m_bSRGB_OUTPUT_ADAPTER = false;
|
|
#endif // _DEBUG
|
|
m_nSRGB_OUTPUT_ADAPTER = 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_bCONSTANTCOLOR && m_bHDRTYPE && m_bSRGB && m_bSRGB_OUTPUT_ADAPTER;
|
|
Assert( bAllStaticVarsDefined );
|
|
#endif // _DEBUG
|
|
return ( 4 * m_nVERTEXCOLOR ) + ( 8 * m_nCONSTANTCOLOR ) + ( 16 * m_nHDRTYPE ) + ( 48 * m_nSRGB ) + ( 96 * m_nSRGB_OUTPUT_ADAPTER ) + 0;
|
|
}
|
|
};
|
|
#define shaderStaticTest_sprite_ps20b psh_forgot_to_set_static_VERTEXCOLOR + psh_forgot_to_set_static_CONSTANTCOLOR + psh_forgot_to_set_static_HDRTYPE + psh_forgot_to_set_static_SRGB + psh_forgot_to_set_static_SRGB_OUTPUT_ADAPTER + 0
|
|
class sprite_ps20b_Dynamic_Index
|
|
{
|
|
private:
|
|
int m_nHDRENABLED;
|
|
#ifdef _DEBUG
|
|
bool m_bHDRENABLED;
|
|
#endif
|
|
public:
|
|
void SetHDRENABLED( int i )
|
|
{
|
|
Assert( i >= 0 && i <= 1 );
|
|
m_nHDRENABLED = i;
|
|
#ifdef _DEBUG
|
|
m_bHDRENABLED = true;
|
|
#endif
|
|
}
|
|
void SetHDRENABLED( bool i )
|
|
{
|
|
Assert( ( i ? 1 : 0 ) >= 0 && ( i ? 1 : 0 ) <= 1 );
|
|
m_nHDRENABLED = i ? 1 : 0;
|
|
#ifdef _DEBUG
|
|
m_bHDRENABLED = 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
|
|
}
|
|
public:
|
|
// CONSTRUCTOR
|
|
sprite_ps20b_Dynamic_Index( IShaderDynamicAPI *pShaderAPI )
|
|
{
|
|
#ifdef _DEBUG
|
|
m_bHDRENABLED = false;
|
|
#endif // _DEBUG
|
|
m_nHDRENABLED = 0;
|
|
#ifdef _DEBUG
|
|
m_bPIXELFOGTYPE = true;
|
|
#endif // _DEBUG
|
|
m_nPIXELFOGTYPE = ( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ;
|
|
}
|
|
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_bHDRENABLED && m_bPIXELFOGTYPE;
|
|
Assert( bAllDynamicVarsDefined );
|
|
#endif // _DEBUG
|
|
return ( 1 * m_nHDRENABLED ) + ( 2 * m_nPIXELFOGTYPE ) + 0;
|
|
}
|
|
};
|
|
#define shaderDynamicTest_sprite_ps20b psh_forgot_to_set_dynamic_HDRENABLED + 0
|
|
|
|
static const ShaderComboInformation_t s_DynamicComboArray_sprite_ps20b[2] =
|
|
{
|
|
{ "HDRENABLED", 0, 1 },
|
|
{ "PIXELFOGTYPE", 0, 1 },
|
|
};
|
|
|
|
static const ShaderComboInformation_t s_StaticComboArray_sprite_ps20b[5] =
|
|
{
|
|
{ "VERTEXCOLOR", 0, 1 },
|
|
{ "CONSTANTCOLOR", 0, 1 },
|
|
{ "HDRTYPE", 0, 2 },
|
|
{ "SRGB", 0, 1 },
|
|
{ "SRGB_OUTPUT_ADAPTER", 0, 1 },
|
|
};
|
|
static const ShaderComboSemantics_t sprite_ps20b_combos =
|
|
{
|
|
"sprite_ps20b", s_DynamicComboArray_sprite_ps20b, 2, s_StaticComboArray_sprite_ps20b, 5
|
|
};
|
|
|
|
class ConstructMe_sprite_ps20b
|
|
{
|
|
public:
|
|
ConstructMe_sprite_ps20b()
|
|
{
|
|
GetShaderDLL()->AddShaderComboInformation( &sprite_ps20b_combos );
|
|
}
|
|
};
|
|
|
|
static ConstructMe_sprite_ps20b s_ConstructMe_sprite_ps20b;
|