diff --git a/materialsystem/stdshaders/DecalModulate_dx9.cpp b/materialsystem/stdshaders/DecalModulate_dx9.cpp index ecb1c79e..e7659c93 100644 --- a/materialsystem/stdshaders/DecalModulate_dx9.cpp +++ b/materialsystem/stdshaders/DecalModulate_dx9.cpp @@ -180,8 +180,7 @@ BEGIN_VS_SHADER( DecalModulate_dx9, { DECLARE_DYNAMIC_VERTEX_SHADER( vertexlit_and_unlit_generic_vs20 ); SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, 0 ); // Use simplest possible vertex lighting, since ps is so simple - SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_VERTEX, 0 ); // - SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_LIGHTMAP, 0); // + SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, 0); // SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, fogIndex ); SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, 0 ); SET_DYNAMIC_VERTEX_SHADER_COMBO( LIGHTING_PREVIEW, 0 ); @@ -209,8 +208,7 @@ BEGIN_VS_SHADER( DecalModulate_dx9, DECLARE_DYNAMIC_VERTEX_SHADER( vertexlit_and_unlit_generic_vs30 ); SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, 0 ); // Use simplest possible vertex lighting, since ps is so simple - SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_VERTEX, 0 ); // - SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_LIGHTMAP, 0); // + SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, 0); // SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, fogIndex ); SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, pShaderAPI->GetCurrentNumBones() > 0 ); SET_DYNAMIC_VERTEX_SHADER_COMBO( LIGHTING_PREVIEW, 0 ); diff --git a/materialsystem/stdshaders/fxctmp9/VertexLit_and_unlit_Generic_vs20.inc b/materialsystem/stdshaders/fxctmp9/VertexLit_and_unlit_Generic_vs20.inc index 96bc192f..2f300469 100644 --- a/materialsystem/stdshaders/fxctmp9/VertexLit_and_unlit_Generic_vs20.inc +++ b/materialsystem/stdshaders/fxctmp9/VertexLit_and_unlit_Generic_vs20.inc @@ -1,462 +1,264 @@ -#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 +// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!! +// $USE_STATIC_CONTROL_FLOW && ( $NUM_LIGHTS > 0 ) +// ($SEPARATE_DETAIL_UVS) && ($SEAMLESS_DETAIL) +// ($DONT_GAMMA_CONVERT_VERTEX_COLOR && ( ! $VERTEXCOLOR ) ) +// defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH + +#ifndef VERTEXLIT_AND_UNLIT_GENERIC_VS20_H +#define VERTEXLIT_AND_UNLIT_GENERIC_VS20_H + +#include "shaderapi/ishaderapi.h" +#include "shaderapi/ishadershadow.h" +#include "materialsystem/imaterialvar.h" + +class vertexlit_and_unlit_generic_vs20_Static_Index +{ + unsigned int m_nVERTEXCOLOR : 2; + unsigned int m_nCUBEMAP : 2; + unsigned int m_nHALFLAMBERT : 2; + unsigned int m_nFLASHLIGHT : 2; + unsigned int m_nSEAMLESS_BASE : 2; + unsigned int m_nSEAMLESS_DETAIL : 2; + unsigned int m_nSEPARATE_DETAIL_UVS : 2; + unsigned int m_nUSE_STATIC_CONTROL_FLOW : 2; + unsigned int m_nDONT_GAMMA_CONVERT_VERTEX_COLOR : 2; +#ifdef _DEBUG + bool m_bVERTEXCOLOR : 1; + bool m_bCUBEMAP : 1; + bool m_bHALFLAMBERT : 1; + bool m_bFLASHLIGHT : 1; + bool m_bSEAMLESS_BASE : 1; + bool m_bSEAMLESS_DETAIL : 1; + bool m_bSEPARATE_DETAIL_UVS : 1; + bool m_bUSE_STATIC_CONTROL_FLOW : 1; + bool m_bDONT_GAMMA_CONVERT_VERTEX_COLOR : 1; +#endif // _DEBUG +public: + void SetVERTEXCOLOR( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nVERTEXCOLOR = i; +#ifdef _DEBUG + m_bVERTEXCOLOR = true; +#endif // _DEBUG + } + + void SetCUBEMAP( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nCUBEMAP = i; +#ifdef _DEBUG + m_bCUBEMAP = true; +#endif // _DEBUG + } + + void SetHALFLAMBERT( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nHALFLAMBERT = i; +#ifdef _DEBUG + m_bHALFLAMBERT = true; +#endif // _DEBUG + } + + void SetFLASHLIGHT( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nFLASHLIGHT = i; +#ifdef _DEBUG + m_bFLASHLIGHT = true; +#endif // _DEBUG + } + + void SetSEAMLESS_BASE( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSEAMLESS_BASE = i; +#ifdef _DEBUG + m_bSEAMLESS_BASE = true; +#endif // _DEBUG + } + + void SetSEAMLESS_DETAIL( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSEAMLESS_DETAIL = i; +#ifdef _DEBUG + m_bSEAMLESS_DETAIL = true; +#endif // _DEBUG + } + + void SetSEPARATE_DETAIL_UVS( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSEPARATE_DETAIL_UVS = i; +#ifdef _DEBUG + m_bSEPARATE_DETAIL_UVS = true; +#endif // _DEBUG + } + + 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 // _DEBUG + } + + 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 // _DEBUG + } + + vertexlit_and_unlit_generic_vs20_Static_Index( ) + { + m_nVERTEXCOLOR = 0; + m_nCUBEMAP = 0; + m_nHALFLAMBERT = 0; + m_nFLASHLIGHT = 0; + m_nSEAMLESS_BASE = 0; + m_nSEAMLESS_DETAIL = 0; + m_nSEPARATE_DETAIL_UVS = 0; + m_nUSE_STATIC_CONTROL_FLOW = 0; + m_nDONT_GAMMA_CONVERT_VERTEX_COLOR = 0; +#ifdef _DEBUG + m_bVERTEXCOLOR = false; + m_bCUBEMAP = false; + m_bHALFLAMBERT = false; + m_bFLASHLIGHT = false; + m_bSEAMLESS_BASE = false; + m_bSEAMLESS_DETAIL = false; + m_bSEPARATE_DETAIL_UVS = false; + m_bUSE_STATIC_CONTROL_FLOW = false; + m_bDONT_GAMMA_CONVERT_VERTEX_COLOR = false; +#endif // _DEBUG + } + + int GetIndex() const + { + Assert( 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 ); + return ( 192 * m_nVERTEXCOLOR ) + ( 384 * m_nCUBEMAP ) + ( 768 * m_nHALFLAMBERT ) + ( 1536 * m_nFLASHLIGHT ) + ( 3072 * m_nSEAMLESS_BASE ) + ( 6144 * m_nSEAMLESS_DETAIL ) + ( 12288 * m_nSEPARATE_DETAIL_UVS ) + ( 24576 * m_nUSE_STATIC_CONTROL_FLOW ) + ( 49152 * 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 + + +class vertexlit_and_unlit_generic_vs20_Dynamic_Index +{ + unsigned int m_nCOMPRESSED_VERTS : 2; + unsigned int m_nDYNAMIC_LIGHT : 2; + unsigned int m_nSTATIC_LIGHT : 2; + unsigned int m_nDOWATERFOG : 2; + unsigned int m_nSKINNING : 2; + unsigned int m_nLIGHTING_PREVIEW : 2; + unsigned int m_nNUM_LIGHTS : 2; +#ifdef _DEBUG + bool m_bCOMPRESSED_VERTS : 1; + bool m_bDYNAMIC_LIGHT : 1; + bool m_bSTATIC_LIGHT : 1; + bool m_bDOWATERFOG : 1; + bool m_bSKINNING : 1; + bool m_bLIGHTING_PREVIEW : 1; + bool m_bNUM_LIGHTS : 1; +#endif // _DEBUG +public: + void SetCOMPRESSED_VERTS( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nCOMPRESSED_VERTS = i; +#ifdef _DEBUG + m_bCOMPRESSED_VERTS = true; +#endif // _DEBUG + } + + void SetDYNAMIC_LIGHT( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nDYNAMIC_LIGHT = i; +#ifdef _DEBUG + m_bDYNAMIC_LIGHT = true; +#endif // _DEBUG + } + + void SetSTATIC_LIGHT( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSTATIC_LIGHT = i; +#ifdef _DEBUG + m_bSTATIC_LIGHT = true; +#endif // _DEBUG + } + + void SetDOWATERFOG( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nDOWATERFOG = i; +#ifdef _DEBUG + m_bDOWATERFOG = true; +#endif // _DEBUG + } + + void SetSKINNING( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSKINNING = i; +#ifdef _DEBUG + m_bSKINNING = true; +#endif // _DEBUG + } + + void SetLIGHTING_PREVIEW( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nLIGHTING_PREVIEW = i; +#ifdef _DEBUG + m_bLIGHTING_PREVIEW = true; +#endif // _DEBUG + } + + void SetNUM_LIGHTS( int i ) + { + Assert( i >= 0 && i <= 2 ); + m_nNUM_LIGHTS = i; +#ifdef _DEBUG + m_bNUM_LIGHTS = true; +#endif // _DEBUG + } + + vertexlit_and_unlit_generic_vs20_Dynamic_Index() + { + m_nCOMPRESSED_VERTS = 0; + m_nDYNAMIC_LIGHT = 0; + m_nSTATIC_LIGHT = 0; + m_nDOWATERFOG = 0; + m_nSKINNING = 0; + m_nLIGHTING_PREVIEW = 0; + m_nNUM_LIGHTS = 0; +#ifdef _DEBUG + m_bCOMPRESSED_VERTS = false; + m_bDYNAMIC_LIGHT = false; + m_bSTATIC_LIGHT = false; + m_bDOWATERFOG = false; + m_bSKINNING = false; + m_bLIGHTING_PREVIEW = false; + m_bNUM_LIGHTS = false; +#endif // _DEBUG + } + + int GetIndex() const + { + Assert( m_bCOMPRESSED_VERTS && m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT && m_bDOWATERFOG && m_bSKINNING && m_bLIGHTING_PREVIEW && m_bNUM_LIGHTS ); + return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDYNAMIC_LIGHT ) + ( 4 * m_nSTATIC_LIGHT ) + ( 8 * m_nDOWATERFOG ) + ( 16 * m_nSKINNING ) + ( 32 * m_nLIGHTING_PREVIEW ) + ( 64 * 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 + 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 + + +#endif // VERTEXLIT_AND_UNLIT_GENERIC_VS20_H diff --git a/materialsystem/stdshaders/fxctmp9/skin_ps20b.inc b/materialsystem/stdshaders/fxctmp9/skin_ps20b.inc index 6bd3c160..0000ea70 100644 --- a/materialsystem/stdshaders/fxctmp9/skin_ps20b.inc +++ b/materialsystem/stdshaders/fxctmp9/skin_ps20b.inc @@ -1,537 +1,322 @@ -#include "shaderlib/cshader.h" -class skin_ps20b_Static_Index -{ -private: - int m_nCONVERT_TO_SRGB; -#ifdef _DEBUG - bool m_bCONVERT_TO_SRGB; -#endif -public: - void SetCONVERT_TO_SRGB( int i ) - { - Assert( i >= 0 && i <= 0 ); - m_nCONVERT_TO_SRGB = i; -#ifdef _DEBUG - m_bCONVERT_TO_SRGB = true; -#endif - } - void SetCONVERT_TO_SRGB( bool i ) - { - m_nCONVERT_TO_SRGB = i ? 1 : 0; -#ifdef _DEBUG - m_bCONVERT_TO_SRGB = 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_nSELFILLUM; -#ifdef _DEBUG - bool m_bSELFILLUM; -#endif -public: - void SetSELFILLUM( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nSELFILLUM = i; -#ifdef _DEBUG - m_bSELFILLUM = true; -#endif - } - void SetSELFILLUM( bool i ) - { - m_nSELFILLUM = i ? 1 : 0; -#ifdef _DEBUG - m_bSELFILLUM = true; -#endif - } -private: - int m_nSELFILLUMFRESNEL; -#ifdef _DEBUG - bool m_bSELFILLUMFRESNEL; -#endif -public: - void SetSELFILLUMFRESNEL( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nSELFILLUMFRESNEL = i; -#ifdef _DEBUG - m_bSELFILLUMFRESNEL = true; -#endif - } - void SetSELFILLUMFRESNEL( bool i ) - { - m_nSELFILLUMFRESNEL = i ? 1 : 0; -#ifdef _DEBUG - m_bSELFILLUMFRESNEL = 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_nLIGHTWARPTEXTURE; -#ifdef _DEBUG - bool m_bLIGHTWARPTEXTURE; -#endif -public: - void SetLIGHTWARPTEXTURE( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nLIGHTWARPTEXTURE = i; -#ifdef _DEBUG - m_bLIGHTWARPTEXTURE = true; -#endif - } - void SetLIGHTWARPTEXTURE( bool i ) - { - m_nLIGHTWARPTEXTURE = i ? 1 : 0; -#ifdef _DEBUG - m_bLIGHTWARPTEXTURE = true; -#endif - } -private: - int m_nPHONGWARPTEXTURE; -#ifdef _DEBUG - bool m_bPHONGWARPTEXTURE; -#endif -public: - void SetPHONGWARPTEXTURE( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nPHONGWARPTEXTURE = i; -#ifdef _DEBUG - m_bPHONGWARPTEXTURE = true; -#endif - } - void SetPHONGWARPTEXTURE( bool i ) - { - m_nPHONGWARPTEXTURE = i ? 1 : 0; -#ifdef _DEBUG - m_bPHONGWARPTEXTURE = true; -#endif - } -private: - int m_nWRINKLEMAP; -#ifdef _DEBUG - bool m_bWRINKLEMAP; -#endif -public: - void SetWRINKLEMAP( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nWRINKLEMAP = i; -#ifdef _DEBUG - m_bWRINKLEMAP = true; -#endif - } - void SetWRINKLEMAP( bool i ) - { - m_nWRINKLEMAP = i ? 1 : 0; -#ifdef _DEBUG - m_bWRINKLEMAP = true; -#endif - } -private: - int m_nDETAIL_BLEND_MODE; -#ifdef _DEBUG - bool m_bDETAIL_BLEND_MODE; -#endif -public: - void SetDETAIL_BLEND_MODE( int i ) - { - Assert( i >= 0 && i <= 6 ); - m_nDETAIL_BLEND_MODE = i; -#ifdef _DEBUG - m_bDETAIL_BLEND_MODE = true; -#endif - } - void SetDETAIL_BLEND_MODE( bool i ) - { - m_nDETAIL_BLEND_MODE = i ? 1 : 0; -#ifdef _DEBUG - m_bDETAIL_BLEND_MODE = true; -#endif - } -private: - int m_nDETAILTEXTURE; -#ifdef _DEBUG - bool m_bDETAILTEXTURE; -#endif -public: - void SetDETAILTEXTURE( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nDETAILTEXTURE = i; -#ifdef _DEBUG - m_bDETAILTEXTURE = true; -#endif - } - void SetDETAILTEXTURE( bool i ) - { - m_nDETAILTEXTURE = i ? 1 : 0; -#ifdef _DEBUG - m_bDETAILTEXTURE = true; -#endif - } -private: - int m_nRIMLIGHT; -#ifdef _DEBUG - bool m_bRIMLIGHT; -#endif -public: - void SetRIMLIGHT( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nRIMLIGHT = i; -#ifdef _DEBUG - m_bRIMLIGHT = true; -#endif - } - void SetRIMLIGHT( bool i ) - { - m_nRIMLIGHT = i ? 1 : 0; -#ifdef _DEBUG - m_bRIMLIGHT = true; -#endif - } -private: - int m_nFLASHLIGHTDEPTHFILTERMODE; -#ifdef _DEBUG - bool m_bFLASHLIGHTDEPTHFILTERMODE; -#endif -public: - void SetFLASHLIGHTDEPTHFILTERMODE( int i ) - { - Assert( i >= 0 && i <= 2 ); - m_nFLASHLIGHTDEPTHFILTERMODE = i; -#ifdef _DEBUG - m_bFLASHLIGHTDEPTHFILTERMODE = true; -#endif - } - void SetFLASHLIGHTDEPTHFILTERMODE( bool i ) - { - m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0; -#ifdef _DEBUG - m_bFLASHLIGHTDEPTHFILTERMODE = true; -#endif - } -private: - int m_nFASTPATH_NOBUMP; -#ifdef _DEBUG - bool m_bFASTPATH_NOBUMP; -#endif -public: - void SetFASTPATH_NOBUMP( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nFASTPATH_NOBUMP = i; -#ifdef _DEBUG - m_bFASTPATH_NOBUMP = true; -#endif - } - void SetFASTPATH_NOBUMP( bool i ) - { - m_nFASTPATH_NOBUMP = i ? 1 : 0; -#ifdef _DEBUG - m_bFASTPATH_NOBUMP = true; -#endif - } -private: - int m_nBLENDTINTBYBASEALPHA; -#ifdef _DEBUG - bool m_bBLENDTINTBYBASEALPHA; -#endif -public: - void SetBLENDTINTBYBASEALPHA( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nBLENDTINTBYBASEALPHA = i; -#ifdef _DEBUG - m_bBLENDTINTBYBASEALPHA = true; -#endif - } - void SetBLENDTINTBYBASEALPHA( bool i ) - { - m_nBLENDTINTBYBASEALPHA = i ? 1 : 0; -#ifdef _DEBUG - m_bBLENDTINTBYBASEALPHA = true; -#endif - } -public: - skin_ps20b_Static_Index( ) - { -#ifdef _DEBUG - m_bCONVERT_TO_SRGB = false; -#endif // _DEBUG - m_nCONVERT_TO_SRGB = 0; -#ifdef _DEBUG - m_bCUBEMAP = false; -#endif // _DEBUG - m_nCUBEMAP = 0; -#ifdef _DEBUG - m_bSELFILLUM = false; -#endif // _DEBUG - m_nSELFILLUM = 0; -#ifdef _DEBUG - m_bSELFILLUMFRESNEL = false; -#endif // _DEBUG - m_nSELFILLUMFRESNEL = 0; -#ifdef _DEBUG - m_bFLASHLIGHT = false; -#endif // _DEBUG - m_nFLASHLIGHT = 0; -#ifdef _DEBUG - m_bLIGHTWARPTEXTURE = false; -#endif // _DEBUG - m_nLIGHTWARPTEXTURE = 0; -#ifdef _DEBUG - m_bPHONGWARPTEXTURE = false; -#endif // _DEBUG - m_nPHONGWARPTEXTURE = 0; -#ifdef _DEBUG - m_bWRINKLEMAP = false; -#endif // _DEBUG - m_nWRINKLEMAP = 0; -#ifdef _DEBUG - m_bDETAIL_BLEND_MODE = false; -#endif // _DEBUG - m_nDETAIL_BLEND_MODE = 0; -#ifdef _DEBUG - m_bDETAILTEXTURE = false; -#endif // _DEBUG - m_nDETAILTEXTURE = 0; -#ifdef _DEBUG - m_bRIMLIGHT = false; -#endif // _DEBUG - m_nRIMLIGHT = 0; -#ifdef _DEBUG - m_bFLASHLIGHTDEPTHFILTERMODE = false; -#endif // _DEBUG - m_nFLASHLIGHTDEPTHFILTERMODE = 0; -#ifdef _DEBUG - m_bFASTPATH_NOBUMP = false; -#endif // _DEBUG - m_nFASTPATH_NOBUMP = 0; -#ifdef _DEBUG - m_bBLENDTINTBYBASEALPHA = false; -#endif // _DEBUG - m_nBLENDTINTBYBASEALPHA = 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_bCONVERT_TO_SRGB && m_bCUBEMAP && m_bSELFILLUM && m_bSELFILLUMFRESNEL && m_bFLASHLIGHT && m_bLIGHTWARPTEXTURE && m_bPHONGWARPTEXTURE && m_bWRINKLEMAP && m_bDETAIL_BLEND_MODE && m_bDETAILTEXTURE && m_bRIMLIGHT && m_bFLASHLIGHTDEPTHFILTERMODE && m_bFASTPATH_NOBUMP && m_bBLENDTINTBYBASEALPHA; - Assert( bAllStaticVarsDefined ); -#endif // _DEBUG - return ( 160 * m_nCONVERT_TO_SRGB ) + ( 160 * m_nCUBEMAP ) + ( 320 * m_nSELFILLUM ) + ( 640 * m_nSELFILLUMFRESNEL ) + ( 1280 * m_nFLASHLIGHT ) + ( 2560 * m_nLIGHTWARPTEXTURE ) + ( 5120 * m_nPHONGWARPTEXTURE ) + ( 10240 * m_nWRINKLEMAP ) + ( 20480 * m_nDETAIL_BLEND_MODE ) + ( 143360 * m_nDETAILTEXTURE ) + ( 286720 * m_nRIMLIGHT ) + ( 573440 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 1720320 * m_nFASTPATH_NOBUMP ) + ( 3440640 * m_nBLENDTINTBYBASEALPHA ) + 0; - } -}; -#define shaderStaticTest_skin_ps20b psh_forgot_to_set_static_CONVERT_TO_SRGB + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_SELFILLUMFRESNEL + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_LIGHTWARPTEXTURE + psh_forgot_to_set_static_PHONGWARPTEXTURE + psh_forgot_to_set_static_WRINKLEMAP + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_RIMLIGHT + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_FASTPATH_NOBUMP + psh_forgot_to_set_static_BLENDTINTBYBASEALPHA + 0 -class skin_ps20b_Dynamic_Index -{ -private: - int m_nWRITEWATERFOGTODESTALPHA; -#ifdef _DEBUG - bool m_bWRITEWATERFOGTODESTALPHA; -#endif -public: - void SetWRITEWATERFOGTODESTALPHA( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nWRITEWATERFOGTODESTALPHA = i; -#ifdef _DEBUG - m_bWRITEWATERFOGTODESTALPHA = true; -#endif - } - void SetWRITEWATERFOGTODESTALPHA( bool i ) - { - m_nWRITEWATERFOGTODESTALPHA = i ? 1 : 0; -#ifdef _DEBUG - m_bWRITEWATERFOGTODESTALPHA = 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 ) - { - m_nPIXELFOGTYPE = i ? 1 : 0; -#ifdef _DEBUG - m_bPIXELFOGTYPE = true; -#endif - } -private: - int m_nNUM_LIGHTS; -#ifdef _DEBUG - bool m_bNUM_LIGHTS; -#endif -public: - void SetNUM_LIGHTS( int i ) - { - Assert( i >= 0 && i <= 4 ); - 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 - } -private: - int m_nWRITE_DEPTH_TO_DESTALPHA; -#ifdef _DEBUG - bool m_bWRITE_DEPTH_TO_DESTALPHA; -#endif -public: - void SetWRITE_DEPTH_TO_DESTALPHA( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nWRITE_DEPTH_TO_DESTALPHA = i; -#ifdef _DEBUG - m_bWRITE_DEPTH_TO_DESTALPHA = true; -#endif - } - void SetWRITE_DEPTH_TO_DESTALPHA( bool i ) - { - m_nWRITE_DEPTH_TO_DESTALPHA = i ? 1 : 0; -#ifdef _DEBUG - m_bWRITE_DEPTH_TO_DESTALPHA = true; -#endif - } -private: - int m_nFLASHLIGHTSHADOWS; -#ifdef _DEBUG - bool m_bFLASHLIGHTSHADOWS; -#endif -public: - void SetFLASHLIGHTSHADOWS( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nFLASHLIGHTSHADOWS = i; -#ifdef _DEBUG - m_bFLASHLIGHTSHADOWS = true; -#endif - } - void SetFLASHLIGHTSHADOWS( bool i ) - { - m_nFLASHLIGHTSHADOWS = i ? 1 : 0; -#ifdef _DEBUG - m_bFLASHLIGHTSHADOWS = true; -#endif - } -private: - int m_nPHONG_USE_EXPONENT_FACTOR; -#ifdef _DEBUG - bool m_bPHONG_USE_EXPONENT_FACTOR; -#endif -public: - void SetPHONG_USE_EXPONENT_FACTOR( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nPHONG_USE_EXPONENT_FACTOR = i; -#ifdef _DEBUG - m_bPHONG_USE_EXPONENT_FACTOR = true; -#endif - } - void SetPHONG_USE_EXPONENT_FACTOR( bool i ) - { - m_nPHONG_USE_EXPONENT_FACTOR = i ? 1 : 0; -#ifdef _DEBUG - m_bPHONG_USE_EXPONENT_FACTOR = true; -#endif - } -public: - skin_ps20b_Dynamic_Index() - { -#ifdef _DEBUG - m_bWRITEWATERFOGTODESTALPHA = false; -#endif // _DEBUG - m_nWRITEWATERFOGTODESTALPHA = 0; -#ifdef _DEBUG - m_bPIXELFOGTYPE = false; -#endif // _DEBUG - m_nPIXELFOGTYPE = 0; -#ifdef _DEBUG - m_bNUM_LIGHTS = false; -#endif // _DEBUG - m_nNUM_LIGHTS = 0; -#ifdef _DEBUG - m_bWRITE_DEPTH_TO_DESTALPHA = false; -#endif // _DEBUG - m_nWRITE_DEPTH_TO_DESTALPHA = 0; -#ifdef _DEBUG - m_bFLASHLIGHTSHADOWS = false; -#endif // _DEBUG - m_nFLASHLIGHTSHADOWS = 0; -#ifdef _DEBUG - m_bPHONG_USE_EXPONENT_FACTOR = false; -#endif // _DEBUG - m_nPHONG_USE_EXPONENT_FACTOR = 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_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE && m_bNUM_LIGHTS && m_bWRITE_DEPTH_TO_DESTALPHA && m_bFLASHLIGHTSHADOWS && m_bPHONG_USE_EXPONENT_FACTOR; - Assert( bAllDynamicVarsDefined ); -#endif // _DEBUG - return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + ( 4 * m_nNUM_LIGHTS ) + ( 20 * m_nWRITE_DEPTH_TO_DESTALPHA ) + ( 40 * m_nFLASHLIGHTSHADOWS ) + ( 80 * m_nPHONG_USE_EXPONENT_FACTOR ) + 0; - } -}; -#define shaderDynamicTest_skin_ps20b psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_NUM_LIGHTS + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + psh_forgot_to_set_dynamic_PHONG_USE_EXPONENT_FACTOR + 0 +// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!! +// ($PIXELFOGTYPE == 0) && ($WRITEWATERFOGTODESTALPHA != 0) +// (! $DETAILTEXTURE) && ( $DETAIL_BLEND_MODE != 0 ) +// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTSHADOWS == 1 ) +// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTDEPTHFILTERMODE != 0 ) +// ( $SELFILLUM == 0 ) && ( $SELFILLUMFRESNEL == 1 ) +// ( $FLASHLIGHT == 1 ) && ( $SELFILLUMFRESNEL == 1 ) +// ( $FLASHLIGHT == 1 ) && ( $SELFILLUM == 1 ) +// ( $BLENDTINTBYBASEALPHA ) && ( $SELFILLUM ) +// $FASTPATH_NOBUMP && ( $RIMLIGHT || $DETAILTEXTURE || $PHONGWARPTEXTURE || $SELFILLUM || $BLENDTINTBYBASEALPHA ) +// defined $HDRTYPE && defined $HDRENABLED && !$HDRTYPE && $HDRENABLED +// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA +// defined $LIGHTING_PREVIEW && defined $HDRTYPE && $LIGHTING_PREVIEW && $HDRTYPE != 0 +// 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 $HDRTYPE && defined $HDRENABLED && !$HDRTYPE && $HDRENABLED +// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA +// defined $LIGHTING_PREVIEW && defined $HDRTYPE && $LIGHTING_PREVIEW && $HDRTYPE != 0 +// 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 + +#ifndef SKIN_PS20B_H +#define SKIN_PS20B_H + +#include "shaderapi/ishaderapi.h" +#include "shaderapi/ishadershadow.h" +#include "materialsystem/imaterialvar.h" + +class skin_ps20b_Static_Index +{ + unsigned int m_nCONVERT_TO_SRGB : 1; + unsigned int m_nCUBEMAP : 2; + unsigned int m_nSELFILLUM : 2; + unsigned int m_nSELFILLUMFRESNEL : 2; + unsigned int m_nFLASHLIGHT : 2; + unsigned int m_nLIGHTWARPTEXTURE : 2; + unsigned int m_nPHONGWARPTEXTURE : 2; + unsigned int m_nWRINKLEMAP : 2; + unsigned int m_nDETAIL_BLEND_MODE : 3; + unsigned int m_nDETAILTEXTURE : 2; + unsigned int m_nRIMLIGHT : 2; + unsigned int m_nFLASHLIGHTDEPTHFILTERMODE : 2; + unsigned int m_nFASTPATH_NOBUMP : 2; + unsigned int m_nBLENDTINTBYBASEALPHA : 2; +#ifdef _DEBUG + bool m_bCONVERT_TO_SRGB : 1; + bool m_bCUBEMAP : 1; + bool m_bSELFILLUM : 1; + bool m_bSELFILLUMFRESNEL : 1; + bool m_bFLASHLIGHT : 1; + bool m_bLIGHTWARPTEXTURE : 1; + bool m_bPHONGWARPTEXTURE : 1; + bool m_bWRINKLEMAP : 1; + bool m_bDETAIL_BLEND_MODE : 1; + bool m_bDETAILTEXTURE : 1; + bool m_bRIMLIGHT : 1; + bool m_bFLASHLIGHTDEPTHFILTERMODE : 1; + bool m_bFASTPATH_NOBUMP : 1; + bool m_bBLENDTINTBYBASEALPHA : 1; +#endif // _DEBUG +public: + void SetCONVERT_TO_SRGB( int i ) + { + Assert( i >= 0 && i <= 0 ); + m_nCONVERT_TO_SRGB = i; +#ifdef _DEBUG + m_bCONVERT_TO_SRGB = true; +#endif // _DEBUG + } + + void SetCUBEMAP( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nCUBEMAP = i; +#ifdef _DEBUG + m_bCUBEMAP = true; +#endif // _DEBUG + } + + void SetSELFILLUM( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSELFILLUM = i; +#ifdef _DEBUG + m_bSELFILLUM = true; +#endif // _DEBUG + } + + void SetSELFILLUMFRESNEL( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSELFILLUMFRESNEL = i; +#ifdef _DEBUG + m_bSELFILLUMFRESNEL = true; +#endif // _DEBUG + } + + void SetFLASHLIGHT( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nFLASHLIGHT = i; +#ifdef _DEBUG + m_bFLASHLIGHT = true; +#endif // _DEBUG + } + + void SetLIGHTWARPTEXTURE( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nLIGHTWARPTEXTURE = i; +#ifdef _DEBUG + m_bLIGHTWARPTEXTURE = true; +#endif // _DEBUG + } + + void SetPHONGWARPTEXTURE( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nPHONGWARPTEXTURE = i; +#ifdef _DEBUG + m_bPHONGWARPTEXTURE = true; +#endif // _DEBUG + } + + void SetWRINKLEMAP( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nWRINKLEMAP = i; +#ifdef _DEBUG + m_bWRINKLEMAP = true; +#endif // _DEBUG + } + + void SetDETAIL_BLEND_MODE( int i ) + { + Assert( i >= 0 && i <= 6 ); + m_nDETAIL_BLEND_MODE = i; +#ifdef _DEBUG + m_bDETAIL_BLEND_MODE = true; +#endif // _DEBUG + } + + void SetDETAILTEXTURE( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nDETAILTEXTURE = i; +#ifdef _DEBUG + m_bDETAILTEXTURE = true; +#endif // _DEBUG + } + + void SetRIMLIGHT( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nRIMLIGHT = i; +#ifdef _DEBUG + m_bRIMLIGHT = true; +#endif // _DEBUG + } + + void SetFLASHLIGHTDEPTHFILTERMODE( int i ) + { + Assert( i >= 0 && i <= 2 ); + m_nFLASHLIGHTDEPTHFILTERMODE = i; +#ifdef _DEBUG + m_bFLASHLIGHTDEPTHFILTERMODE = true; +#endif // _DEBUG + } + + void SetFASTPATH_NOBUMP( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nFASTPATH_NOBUMP = i; +#ifdef _DEBUG + m_bFASTPATH_NOBUMP = true; +#endif // _DEBUG + } + + void SetBLENDTINTBYBASEALPHA( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nBLENDTINTBYBASEALPHA = i; +#ifdef _DEBUG + m_bBLENDTINTBYBASEALPHA = true; +#endif // _DEBUG + } + + skin_ps20b_Static_Index() + { + m_nCONVERT_TO_SRGB = 0; + m_nCUBEMAP = 0; + m_nSELFILLUM = 0; + m_nSELFILLUMFRESNEL = 0; + m_nFLASHLIGHT = 0; + m_nLIGHTWARPTEXTURE = 0; + m_nPHONGWARPTEXTURE = 0; + m_nWRINKLEMAP = 0; + m_nDETAIL_BLEND_MODE = 0; + m_nDETAILTEXTURE = 0; + m_nRIMLIGHT = 0; + m_nFLASHLIGHTDEPTHFILTERMODE = 0; + m_nFASTPATH_NOBUMP = 0; + m_nBLENDTINTBYBASEALPHA = 0; +#ifdef _DEBUG + m_bCONVERT_TO_SRGB = false; + m_bCUBEMAP = false; + m_bSELFILLUM = false; + m_bSELFILLUMFRESNEL = false; + m_bFLASHLIGHT = false; + m_bLIGHTWARPTEXTURE = false; + m_bPHONGWARPTEXTURE = false; + m_bWRINKLEMAP = false; + m_bDETAIL_BLEND_MODE = false; + m_bDETAILTEXTURE = false; + m_bRIMLIGHT = false; + m_bFLASHLIGHTDEPTHFILTERMODE = false; + m_bFASTPATH_NOBUMP = false; + m_bBLENDTINTBYBASEALPHA = false; +#endif // _DEBUG + } + + int GetIndex() const + { + Assert( m_bCONVERT_TO_SRGB && m_bCUBEMAP && m_bSELFILLUM && m_bSELFILLUMFRESNEL && m_bFLASHLIGHT && m_bLIGHTWARPTEXTURE && m_bPHONGWARPTEXTURE && m_bWRINKLEMAP && m_bDETAIL_BLEND_MODE && m_bDETAILTEXTURE && m_bRIMLIGHT && m_bFLASHLIGHTDEPTHFILTERMODE && m_bFASTPATH_NOBUMP && m_bBLENDTINTBYBASEALPHA ); + return ( 80 * m_nCONVERT_TO_SRGB ) + ( 80 * m_nCUBEMAP ) + ( 160 * m_nSELFILLUM ) + ( 320 * m_nSELFILLUMFRESNEL ) + ( 640 * m_nFLASHLIGHT ) + ( 1280 * m_nLIGHTWARPTEXTURE ) + ( 2560 * m_nPHONGWARPTEXTURE ) + ( 5120 * m_nWRINKLEMAP ) + ( 10240 * m_nDETAIL_BLEND_MODE ) + ( 71680 * m_nDETAILTEXTURE ) + ( 143360 * m_nRIMLIGHT ) + ( 286720 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 860160 * m_nFASTPATH_NOBUMP ) + ( 1720320 * m_nBLENDTINTBYBASEALPHA ) + 0; + } +}; + +#define shaderStaticTest_skin_ps20b psh_forgot_to_set_static_CONVERT_TO_SRGB + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_SELFILLUMFRESNEL + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_LIGHTWARPTEXTURE + psh_forgot_to_set_static_PHONGWARPTEXTURE + psh_forgot_to_set_static_WRINKLEMAP + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_RIMLIGHT + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_FASTPATH_NOBUMP + psh_forgot_to_set_static_BLENDTINTBYBASEALPHA + + +class skin_ps20b_Dynamic_Index +{ + unsigned int m_nWRITEWATERFOGTODESTALPHA : 2; + unsigned int m_nPIXELFOGTYPE : 2; + unsigned int m_nNUM_LIGHTS : 3; + unsigned int m_nWRITE_DEPTH_TO_DESTALPHA : 2; + unsigned int m_nFLASHLIGHTSHADOWS : 2; +#ifdef _DEBUG + bool m_bWRITEWATERFOGTODESTALPHA : 1; + bool m_bPIXELFOGTYPE : 1; + bool m_bNUM_LIGHTS : 1; + bool m_bWRITE_DEPTH_TO_DESTALPHA : 1; + bool m_bFLASHLIGHTSHADOWS : 1; +#endif // _DEBUG +public: + void SetWRITEWATERFOGTODESTALPHA( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nWRITEWATERFOGTODESTALPHA = i; +#ifdef _DEBUG + m_bWRITEWATERFOGTODESTALPHA = true; +#endif // _DEBUG + } + + void SetPIXELFOGTYPE( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nPIXELFOGTYPE = i; +#ifdef _DEBUG + m_bPIXELFOGTYPE = true; +#endif // _DEBUG + } + + void SetNUM_LIGHTS( int i ) + { + Assert( i >= 0 && i <= 4 ); + m_nNUM_LIGHTS = i; +#ifdef _DEBUG + m_bNUM_LIGHTS = true; +#endif // _DEBUG + } + + void SetWRITE_DEPTH_TO_DESTALPHA( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nWRITE_DEPTH_TO_DESTALPHA = i; +#ifdef _DEBUG + m_bWRITE_DEPTH_TO_DESTALPHA = true; +#endif // _DEBUG + } + + void SetFLASHLIGHTSHADOWS( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nFLASHLIGHTSHADOWS = i; +#ifdef _DEBUG + m_bFLASHLIGHTSHADOWS = true; +#endif // _DEBUG + } + + skin_ps20b_Dynamic_Index() + { + m_nWRITEWATERFOGTODESTALPHA = 0; + m_nPIXELFOGTYPE = 0; + m_nNUM_LIGHTS = 0; + m_nWRITE_DEPTH_TO_DESTALPHA = 0; + m_nFLASHLIGHTSHADOWS = 0; +#ifdef _DEBUG + m_bWRITEWATERFOGTODESTALPHA = false; + m_bPIXELFOGTYPE = false; + m_bNUM_LIGHTS = false; + m_bWRITE_DEPTH_TO_DESTALPHA = false; + m_bFLASHLIGHTSHADOWS = false; +#endif // _DEBUG + } + + int GetIndex() const + { + Assert( m_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE && m_bNUM_LIGHTS && m_bWRITE_DEPTH_TO_DESTALPHA && m_bFLASHLIGHTSHADOWS ); + return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + ( 4 * m_nNUM_LIGHTS ) + ( 20 * m_nWRITE_DEPTH_TO_DESTALPHA ) + ( 40 * m_nFLASHLIGHTSHADOWS ) + 0; + } +}; + +#define shaderDynamicTest_skin_ps20b psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_NUM_LIGHTS + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + + +#endif // SKIN_PS20B_H diff --git a/materialsystem/stdshaders/fxctmp9/skin_ps30.inc b/materialsystem/stdshaders/fxctmp9/skin_ps30.inc index fc77ac6d..02d4e8ae 100644 --- a/materialsystem/stdshaders/fxctmp9/skin_ps30.inc +++ b/materialsystem/stdshaders/fxctmp9/skin_ps30.inc @@ -1,537 +1,322 @@ -#include "shaderlib/cshader.h" -class skin_ps30_Static_Index -{ -private: - int m_nCONVERT_TO_SRGB; -#ifdef _DEBUG - bool m_bCONVERT_TO_SRGB; -#endif -public: - void SetCONVERT_TO_SRGB( int i ) - { - Assert( i >= 0 && i <= 0 ); - m_nCONVERT_TO_SRGB = i; -#ifdef _DEBUG - m_bCONVERT_TO_SRGB = true; -#endif - } - void SetCONVERT_TO_SRGB( bool i ) - { - m_nCONVERT_TO_SRGB = i ? 1 : 0; -#ifdef _DEBUG - m_bCONVERT_TO_SRGB = 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_nSELFILLUM; -#ifdef _DEBUG - bool m_bSELFILLUM; -#endif -public: - void SetSELFILLUM( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nSELFILLUM = i; -#ifdef _DEBUG - m_bSELFILLUM = true; -#endif - } - void SetSELFILLUM( bool i ) - { - m_nSELFILLUM = i ? 1 : 0; -#ifdef _DEBUG - m_bSELFILLUM = true; -#endif - } -private: - int m_nSELFILLUMFRESNEL; -#ifdef _DEBUG - bool m_bSELFILLUMFRESNEL; -#endif -public: - void SetSELFILLUMFRESNEL( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nSELFILLUMFRESNEL = i; -#ifdef _DEBUG - m_bSELFILLUMFRESNEL = true; -#endif - } - void SetSELFILLUMFRESNEL( bool i ) - { - m_nSELFILLUMFRESNEL = i ? 1 : 0; -#ifdef _DEBUG - m_bSELFILLUMFRESNEL = 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_nLIGHTWARPTEXTURE; -#ifdef _DEBUG - bool m_bLIGHTWARPTEXTURE; -#endif -public: - void SetLIGHTWARPTEXTURE( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nLIGHTWARPTEXTURE = i; -#ifdef _DEBUG - m_bLIGHTWARPTEXTURE = true; -#endif - } - void SetLIGHTWARPTEXTURE( bool i ) - { - m_nLIGHTWARPTEXTURE = i ? 1 : 0; -#ifdef _DEBUG - m_bLIGHTWARPTEXTURE = true; -#endif - } -private: - int m_nPHONGWARPTEXTURE; -#ifdef _DEBUG - bool m_bPHONGWARPTEXTURE; -#endif -public: - void SetPHONGWARPTEXTURE( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nPHONGWARPTEXTURE = i; -#ifdef _DEBUG - m_bPHONGWARPTEXTURE = true; -#endif - } - void SetPHONGWARPTEXTURE( bool i ) - { - m_nPHONGWARPTEXTURE = i ? 1 : 0; -#ifdef _DEBUG - m_bPHONGWARPTEXTURE = true; -#endif - } -private: - int m_nWRINKLEMAP; -#ifdef _DEBUG - bool m_bWRINKLEMAP; -#endif -public: - void SetWRINKLEMAP( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nWRINKLEMAP = i; -#ifdef _DEBUG - m_bWRINKLEMAP = true; -#endif - } - void SetWRINKLEMAP( bool i ) - { - m_nWRINKLEMAP = i ? 1 : 0; -#ifdef _DEBUG - m_bWRINKLEMAP = true; -#endif - } -private: - int m_nDETAIL_BLEND_MODE; -#ifdef _DEBUG - bool m_bDETAIL_BLEND_MODE; -#endif -public: - void SetDETAIL_BLEND_MODE( int i ) - { - Assert( i >= 0 && i <= 6 ); - m_nDETAIL_BLEND_MODE = i; -#ifdef _DEBUG - m_bDETAIL_BLEND_MODE = true; -#endif - } - void SetDETAIL_BLEND_MODE( bool i ) - { - m_nDETAIL_BLEND_MODE = i ? 1 : 0; -#ifdef _DEBUG - m_bDETAIL_BLEND_MODE = true; -#endif - } -private: - int m_nDETAILTEXTURE; -#ifdef _DEBUG - bool m_bDETAILTEXTURE; -#endif -public: - void SetDETAILTEXTURE( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nDETAILTEXTURE = i; -#ifdef _DEBUG - m_bDETAILTEXTURE = true; -#endif - } - void SetDETAILTEXTURE( bool i ) - { - m_nDETAILTEXTURE = i ? 1 : 0; -#ifdef _DEBUG - m_bDETAILTEXTURE = true; -#endif - } -private: - int m_nRIMLIGHT; -#ifdef _DEBUG - bool m_bRIMLIGHT; -#endif -public: - void SetRIMLIGHT( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nRIMLIGHT = i; -#ifdef _DEBUG - m_bRIMLIGHT = true; -#endif - } - void SetRIMLIGHT( bool i ) - { - m_nRIMLIGHT = i ? 1 : 0; -#ifdef _DEBUG - m_bRIMLIGHT = true; -#endif - } -private: - int m_nFLASHLIGHTDEPTHFILTERMODE; -#ifdef _DEBUG - bool m_bFLASHLIGHTDEPTHFILTERMODE; -#endif -public: - void SetFLASHLIGHTDEPTHFILTERMODE( int i ) - { - Assert( i >= 0 && i <= 2 ); - m_nFLASHLIGHTDEPTHFILTERMODE = i; -#ifdef _DEBUG - m_bFLASHLIGHTDEPTHFILTERMODE = true; -#endif - } - void SetFLASHLIGHTDEPTHFILTERMODE( bool i ) - { - m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0; -#ifdef _DEBUG - m_bFLASHLIGHTDEPTHFILTERMODE = true; -#endif - } -private: - int m_nFASTPATH_NOBUMP; -#ifdef _DEBUG - bool m_bFASTPATH_NOBUMP; -#endif -public: - void SetFASTPATH_NOBUMP( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nFASTPATH_NOBUMP = i; -#ifdef _DEBUG - m_bFASTPATH_NOBUMP = true; -#endif - } - void SetFASTPATH_NOBUMP( bool i ) - { - m_nFASTPATH_NOBUMP = i ? 1 : 0; -#ifdef _DEBUG - m_bFASTPATH_NOBUMP = true; -#endif - } -private: - int m_nBLENDTINTBYBASEALPHA; -#ifdef _DEBUG - bool m_bBLENDTINTBYBASEALPHA; -#endif -public: - void SetBLENDTINTBYBASEALPHA( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nBLENDTINTBYBASEALPHA = i; -#ifdef _DEBUG - m_bBLENDTINTBYBASEALPHA = true; -#endif - } - void SetBLENDTINTBYBASEALPHA( bool i ) - { - m_nBLENDTINTBYBASEALPHA = i ? 1 : 0; -#ifdef _DEBUG - m_bBLENDTINTBYBASEALPHA = true; -#endif - } -public: - skin_ps30_Static_Index( ) - { -#ifdef _DEBUG - m_bCONVERT_TO_SRGB = false; -#endif // _DEBUG - m_nCONVERT_TO_SRGB = 0; -#ifdef _DEBUG - m_bCUBEMAP = false; -#endif // _DEBUG - m_nCUBEMAP = 0; -#ifdef _DEBUG - m_bSELFILLUM = false; -#endif // _DEBUG - m_nSELFILLUM = 0; -#ifdef _DEBUG - m_bSELFILLUMFRESNEL = false; -#endif // _DEBUG - m_nSELFILLUMFRESNEL = 0; -#ifdef _DEBUG - m_bFLASHLIGHT = false; -#endif // _DEBUG - m_nFLASHLIGHT = 0; -#ifdef _DEBUG - m_bLIGHTWARPTEXTURE = false; -#endif // _DEBUG - m_nLIGHTWARPTEXTURE = 0; -#ifdef _DEBUG - m_bPHONGWARPTEXTURE = false; -#endif // _DEBUG - m_nPHONGWARPTEXTURE = 0; -#ifdef _DEBUG - m_bWRINKLEMAP = false; -#endif // _DEBUG - m_nWRINKLEMAP = 0; -#ifdef _DEBUG - m_bDETAIL_BLEND_MODE = false; -#endif // _DEBUG - m_nDETAIL_BLEND_MODE = 0; -#ifdef _DEBUG - m_bDETAILTEXTURE = false; -#endif // _DEBUG - m_nDETAILTEXTURE = 0; -#ifdef _DEBUG - m_bRIMLIGHT = false; -#endif // _DEBUG - m_nRIMLIGHT = 0; -#ifdef _DEBUG - m_bFLASHLIGHTDEPTHFILTERMODE = false; -#endif // _DEBUG - m_nFLASHLIGHTDEPTHFILTERMODE = 0; -#ifdef _DEBUG - m_bFASTPATH_NOBUMP = false; -#endif // _DEBUG - m_nFASTPATH_NOBUMP = 0; -#ifdef _DEBUG - m_bBLENDTINTBYBASEALPHA = false; -#endif // _DEBUG - m_nBLENDTINTBYBASEALPHA = 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_bCONVERT_TO_SRGB && m_bCUBEMAP && m_bSELFILLUM && m_bSELFILLUMFRESNEL && m_bFLASHLIGHT && m_bLIGHTWARPTEXTURE && m_bPHONGWARPTEXTURE && m_bWRINKLEMAP && m_bDETAIL_BLEND_MODE && m_bDETAILTEXTURE && m_bRIMLIGHT && m_bFLASHLIGHTDEPTHFILTERMODE && m_bFASTPATH_NOBUMP && m_bBLENDTINTBYBASEALPHA; - Assert( bAllStaticVarsDefined ); -#endif // _DEBUG - return ( 160 * m_nCONVERT_TO_SRGB ) + ( 160 * m_nCUBEMAP ) + ( 320 * m_nSELFILLUM ) + ( 640 * m_nSELFILLUMFRESNEL ) + ( 1280 * m_nFLASHLIGHT ) + ( 2560 * m_nLIGHTWARPTEXTURE ) + ( 5120 * m_nPHONGWARPTEXTURE ) + ( 10240 * m_nWRINKLEMAP ) + ( 20480 * m_nDETAIL_BLEND_MODE ) + ( 143360 * m_nDETAILTEXTURE ) + ( 286720 * m_nRIMLIGHT ) + ( 573440 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 1720320 * m_nFASTPATH_NOBUMP ) + ( 3440640 * m_nBLENDTINTBYBASEALPHA ) + 0; - } -}; -#define shaderStaticTest_skin_ps30 psh_forgot_to_set_static_CONVERT_TO_SRGB + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_SELFILLUMFRESNEL + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_LIGHTWARPTEXTURE + psh_forgot_to_set_static_PHONGWARPTEXTURE + psh_forgot_to_set_static_WRINKLEMAP + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_RIMLIGHT + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_FASTPATH_NOBUMP + psh_forgot_to_set_static_BLENDTINTBYBASEALPHA + 0 -class skin_ps30_Dynamic_Index -{ -private: - int m_nWRITEWATERFOGTODESTALPHA; -#ifdef _DEBUG - bool m_bWRITEWATERFOGTODESTALPHA; -#endif -public: - void SetWRITEWATERFOGTODESTALPHA( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nWRITEWATERFOGTODESTALPHA = i; -#ifdef _DEBUG - m_bWRITEWATERFOGTODESTALPHA = true; -#endif - } - void SetWRITEWATERFOGTODESTALPHA( bool i ) - { - m_nWRITEWATERFOGTODESTALPHA = i ? 1 : 0; -#ifdef _DEBUG - m_bWRITEWATERFOGTODESTALPHA = 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 ) - { - m_nPIXELFOGTYPE = i ? 1 : 0; -#ifdef _DEBUG - m_bPIXELFOGTYPE = true; -#endif - } -private: - int m_nNUM_LIGHTS; -#ifdef _DEBUG - bool m_bNUM_LIGHTS; -#endif -public: - void SetNUM_LIGHTS( int i ) - { - Assert( i >= 0 && i <= 4 ); - 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 - } -private: - int m_nWRITE_DEPTH_TO_DESTALPHA; -#ifdef _DEBUG - bool m_bWRITE_DEPTH_TO_DESTALPHA; -#endif -public: - void SetWRITE_DEPTH_TO_DESTALPHA( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nWRITE_DEPTH_TO_DESTALPHA = i; -#ifdef _DEBUG - m_bWRITE_DEPTH_TO_DESTALPHA = true; -#endif - } - void SetWRITE_DEPTH_TO_DESTALPHA( bool i ) - { - m_nWRITE_DEPTH_TO_DESTALPHA = i ? 1 : 0; -#ifdef _DEBUG - m_bWRITE_DEPTH_TO_DESTALPHA = true; -#endif - } -private: - int m_nFLASHLIGHTSHADOWS; -#ifdef _DEBUG - bool m_bFLASHLIGHTSHADOWS; -#endif -public: - void SetFLASHLIGHTSHADOWS( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nFLASHLIGHTSHADOWS = i; -#ifdef _DEBUG - m_bFLASHLIGHTSHADOWS = true; -#endif - } - void SetFLASHLIGHTSHADOWS( bool i ) - { - m_nFLASHLIGHTSHADOWS = i ? 1 : 0; -#ifdef _DEBUG - m_bFLASHLIGHTSHADOWS = true; -#endif - } -private: - int m_nPHONG_USE_EXPONENT_FACTOR; -#ifdef _DEBUG - bool m_bPHONG_USE_EXPONENT_FACTOR; -#endif -public: - void SetPHONG_USE_EXPONENT_FACTOR( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nPHONG_USE_EXPONENT_FACTOR = i; -#ifdef _DEBUG - m_bPHONG_USE_EXPONENT_FACTOR = true; -#endif - } - void SetPHONG_USE_EXPONENT_FACTOR( bool i ) - { - m_nPHONG_USE_EXPONENT_FACTOR = i ? 1 : 0; -#ifdef _DEBUG - m_bPHONG_USE_EXPONENT_FACTOR = true; -#endif - } -public: - skin_ps30_Dynamic_Index() - { -#ifdef _DEBUG - m_bWRITEWATERFOGTODESTALPHA = false; -#endif // _DEBUG - m_nWRITEWATERFOGTODESTALPHA = 0; -#ifdef _DEBUG - m_bPIXELFOGTYPE = false; -#endif // _DEBUG - m_nPIXELFOGTYPE = 0; -#ifdef _DEBUG - m_bNUM_LIGHTS = false; -#endif // _DEBUG - m_nNUM_LIGHTS = 0; -#ifdef _DEBUG - m_bWRITE_DEPTH_TO_DESTALPHA = false; -#endif // _DEBUG - m_nWRITE_DEPTH_TO_DESTALPHA = 0; -#ifdef _DEBUG - m_bFLASHLIGHTSHADOWS = false; -#endif // _DEBUG - m_nFLASHLIGHTSHADOWS = 0; -#ifdef _DEBUG - m_bPHONG_USE_EXPONENT_FACTOR = false; -#endif // _DEBUG - m_nPHONG_USE_EXPONENT_FACTOR = 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_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE && m_bNUM_LIGHTS && m_bWRITE_DEPTH_TO_DESTALPHA && m_bFLASHLIGHTSHADOWS && m_bPHONG_USE_EXPONENT_FACTOR; - Assert( bAllDynamicVarsDefined ); -#endif // _DEBUG - return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + ( 4 * m_nNUM_LIGHTS ) + ( 20 * m_nWRITE_DEPTH_TO_DESTALPHA ) + ( 40 * m_nFLASHLIGHTSHADOWS ) + ( 80 * m_nPHONG_USE_EXPONENT_FACTOR ) + 0; - } -}; -#define shaderDynamicTest_skin_ps30 psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_NUM_LIGHTS + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + psh_forgot_to_set_dynamic_PHONG_USE_EXPONENT_FACTOR + 0 +// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!! +// ($PIXELFOGTYPE == 0) && ($WRITEWATERFOGTODESTALPHA != 0) +// (! $DETAILTEXTURE) && ( $DETAIL_BLEND_MODE != 0 ) +// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTSHADOWS == 1 ) +// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTDEPTHFILTERMODE != 0 ) +// ( $SELFILLUM == 0 ) && ( $SELFILLUMFRESNEL == 1 ) +// ( $FLASHLIGHT == 1 ) && ( $SELFILLUMFRESNEL == 1 ) +// ( $FLASHLIGHT == 1 ) && ( $SELFILLUM == 1 ) +// ( $BLENDTINTBYBASEALPHA ) && ( $SELFILLUM ) +// $FASTPATH_NOBUMP && ( $RIMLIGHT || $DETAILTEXTURE || $PHONGWARPTEXTURE || $SELFILLUM || $BLENDTINTBYBASEALPHA ) +// defined $HDRTYPE && defined $HDRENABLED && !$HDRTYPE && $HDRENABLED +// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA +// defined $LIGHTING_PREVIEW && defined $HDRTYPE && $LIGHTING_PREVIEW && $HDRTYPE != 0 +// 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 $HDRTYPE && defined $HDRENABLED && !$HDRTYPE && $HDRENABLED +// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA +// defined $LIGHTING_PREVIEW && defined $HDRTYPE && $LIGHTING_PREVIEW && $HDRTYPE != 0 +// 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 + +#ifndef SKIN_PS30_H +#define SKIN_PS30_H + +#include "shaderapi/ishaderapi.h" +#include "shaderapi/ishadershadow.h" +#include "materialsystem/imaterialvar.h" + +class skin_ps30_Static_Index +{ + unsigned int m_nCONVERT_TO_SRGB : 1; + unsigned int m_nCUBEMAP : 2; + unsigned int m_nSELFILLUM : 2; + unsigned int m_nSELFILLUMFRESNEL : 2; + unsigned int m_nFLASHLIGHT : 2; + unsigned int m_nLIGHTWARPTEXTURE : 2; + unsigned int m_nPHONGWARPTEXTURE : 2; + unsigned int m_nWRINKLEMAP : 2; + unsigned int m_nDETAIL_BLEND_MODE : 3; + unsigned int m_nDETAILTEXTURE : 2; + unsigned int m_nRIMLIGHT : 2; + unsigned int m_nFLASHLIGHTDEPTHFILTERMODE : 2; + unsigned int m_nFASTPATH_NOBUMP : 2; + unsigned int m_nBLENDTINTBYBASEALPHA : 2; +#ifdef _DEBUG + bool m_bCONVERT_TO_SRGB : 1; + bool m_bCUBEMAP : 1; + bool m_bSELFILLUM : 1; + bool m_bSELFILLUMFRESNEL : 1; + bool m_bFLASHLIGHT : 1; + bool m_bLIGHTWARPTEXTURE : 1; + bool m_bPHONGWARPTEXTURE : 1; + bool m_bWRINKLEMAP : 1; + bool m_bDETAIL_BLEND_MODE : 1; + bool m_bDETAILTEXTURE : 1; + bool m_bRIMLIGHT : 1; + bool m_bFLASHLIGHTDEPTHFILTERMODE : 1; + bool m_bFASTPATH_NOBUMP : 1; + bool m_bBLENDTINTBYBASEALPHA : 1; +#endif // _DEBUG +public: + void SetCONVERT_TO_SRGB( int i ) + { + Assert( i >= 0 && i <= 0 ); + m_nCONVERT_TO_SRGB = i; +#ifdef _DEBUG + m_bCONVERT_TO_SRGB = true; +#endif // _DEBUG + } + + void SetCUBEMAP( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nCUBEMAP = i; +#ifdef _DEBUG + m_bCUBEMAP = true; +#endif // _DEBUG + } + + void SetSELFILLUM( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSELFILLUM = i; +#ifdef _DEBUG + m_bSELFILLUM = true; +#endif // _DEBUG + } + + void SetSELFILLUMFRESNEL( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSELFILLUMFRESNEL = i; +#ifdef _DEBUG + m_bSELFILLUMFRESNEL = true; +#endif // _DEBUG + } + + void SetFLASHLIGHT( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nFLASHLIGHT = i; +#ifdef _DEBUG + m_bFLASHLIGHT = true; +#endif // _DEBUG + } + + void SetLIGHTWARPTEXTURE( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nLIGHTWARPTEXTURE = i; +#ifdef _DEBUG + m_bLIGHTWARPTEXTURE = true; +#endif // _DEBUG + } + + void SetPHONGWARPTEXTURE( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nPHONGWARPTEXTURE = i; +#ifdef _DEBUG + m_bPHONGWARPTEXTURE = true; +#endif // _DEBUG + } + + void SetWRINKLEMAP( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nWRINKLEMAP = i; +#ifdef _DEBUG + m_bWRINKLEMAP = true; +#endif // _DEBUG + } + + void SetDETAIL_BLEND_MODE( int i ) + { + Assert( i >= 0 && i <= 6 ); + m_nDETAIL_BLEND_MODE = i; +#ifdef _DEBUG + m_bDETAIL_BLEND_MODE = true; +#endif // _DEBUG + } + + void SetDETAILTEXTURE( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nDETAILTEXTURE = i; +#ifdef _DEBUG + m_bDETAILTEXTURE = true; +#endif // _DEBUG + } + + void SetRIMLIGHT( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nRIMLIGHT = i; +#ifdef _DEBUG + m_bRIMLIGHT = true; +#endif // _DEBUG + } + + void SetFLASHLIGHTDEPTHFILTERMODE( int i ) + { + Assert( i >= 0 && i <= 2 ); + m_nFLASHLIGHTDEPTHFILTERMODE = i; +#ifdef _DEBUG + m_bFLASHLIGHTDEPTHFILTERMODE = true; +#endif // _DEBUG + } + + void SetFASTPATH_NOBUMP( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nFASTPATH_NOBUMP = i; +#ifdef _DEBUG + m_bFASTPATH_NOBUMP = true; +#endif // _DEBUG + } + + void SetBLENDTINTBYBASEALPHA( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nBLENDTINTBYBASEALPHA = i; +#ifdef _DEBUG + m_bBLENDTINTBYBASEALPHA = true; +#endif // _DEBUG + } + + skin_ps30_Static_Index() + { + m_nCONVERT_TO_SRGB = 0; + m_nCUBEMAP = 0; + m_nSELFILLUM = 0; + m_nSELFILLUMFRESNEL = 0; + m_nFLASHLIGHT = 0; + m_nLIGHTWARPTEXTURE = 0; + m_nPHONGWARPTEXTURE = 0; + m_nWRINKLEMAP = 0; + m_nDETAIL_BLEND_MODE = 0; + m_nDETAILTEXTURE = 0; + m_nRIMLIGHT = 0; + m_nFLASHLIGHTDEPTHFILTERMODE = 0; + m_nFASTPATH_NOBUMP = 0; + m_nBLENDTINTBYBASEALPHA = 0; +#ifdef _DEBUG + m_bCONVERT_TO_SRGB = false; + m_bCUBEMAP = false; + m_bSELFILLUM = false; + m_bSELFILLUMFRESNEL = false; + m_bFLASHLIGHT = false; + m_bLIGHTWARPTEXTURE = false; + m_bPHONGWARPTEXTURE = false; + m_bWRINKLEMAP = false; + m_bDETAIL_BLEND_MODE = false; + m_bDETAILTEXTURE = false; + m_bRIMLIGHT = false; + m_bFLASHLIGHTDEPTHFILTERMODE = false; + m_bFASTPATH_NOBUMP = false; + m_bBLENDTINTBYBASEALPHA = false; +#endif // _DEBUG + } + + int GetIndex() const + { + Assert( m_bCONVERT_TO_SRGB && m_bCUBEMAP && m_bSELFILLUM && m_bSELFILLUMFRESNEL && m_bFLASHLIGHT && m_bLIGHTWARPTEXTURE && m_bPHONGWARPTEXTURE && m_bWRINKLEMAP && m_bDETAIL_BLEND_MODE && m_bDETAILTEXTURE && m_bRIMLIGHT && m_bFLASHLIGHTDEPTHFILTERMODE && m_bFASTPATH_NOBUMP && m_bBLENDTINTBYBASEALPHA ); + return ( 80 * m_nCONVERT_TO_SRGB ) + ( 80 * m_nCUBEMAP ) + ( 160 * m_nSELFILLUM ) + ( 320 * m_nSELFILLUMFRESNEL ) + ( 640 * m_nFLASHLIGHT ) + ( 1280 * m_nLIGHTWARPTEXTURE ) + ( 2560 * m_nPHONGWARPTEXTURE ) + ( 5120 * m_nWRINKLEMAP ) + ( 10240 * m_nDETAIL_BLEND_MODE ) + ( 71680 * m_nDETAILTEXTURE ) + ( 143360 * m_nRIMLIGHT ) + ( 286720 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 860160 * m_nFASTPATH_NOBUMP ) + ( 1720320 * m_nBLENDTINTBYBASEALPHA ) + 0; + } +}; + +#define shaderStaticTest_skin_ps30 psh_forgot_to_set_static_CONVERT_TO_SRGB + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_SELFILLUMFRESNEL + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_LIGHTWARPTEXTURE + psh_forgot_to_set_static_PHONGWARPTEXTURE + psh_forgot_to_set_static_WRINKLEMAP + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_RIMLIGHT + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_FASTPATH_NOBUMP + psh_forgot_to_set_static_BLENDTINTBYBASEALPHA + + +class skin_ps30_Dynamic_Index +{ + unsigned int m_nWRITEWATERFOGTODESTALPHA : 2; + unsigned int m_nPIXELFOGTYPE : 2; + unsigned int m_nNUM_LIGHTS : 3; + unsigned int m_nWRITE_DEPTH_TO_DESTALPHA : 2; + unsigned int m_nFLASHLIGHTSHADOWS : 2; +#ifdef _DEBUG + bool m_bWRITEWATERFOGTODESTALPHA : 1; + bool m_bPIXELFOGTYPE : 1; + bool m_bNUM_LIGHTS : 1; + bool m_bWRITE_DEPTH_TO_DESTALPHA : 1; + bool m_bFLASHLIGHTSHADOWS : 1; +#endif // _DEBUG +public: + void SetWRITEWATERFOGTODESTALPHA( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nWRITEWATERFOGTODESTALPHA = i; +#ifdef _DEBUG + m_bWRITEWATERFOGTODESTALPHA = true; +#endif // _DEBUG + } + + void SetPIXELFOGTYPE( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nPIXELFOGTYPE = i; +#ifdef _DEBUG + m_bPIXELFOGTYPE = true; +#endif // _DEBUG + } + + void SetNUM_LIGHTS( int i ) + { + Assert( i >= 0 && i <= 4 ); + m_nNUM_LIGHTS = i; +#ifdef _DEBUG + m_bNUM_LIGHTS = true; +#endif // _DEBUG + } + + void SetWRITE_DEPTH_TO_DESTALPHA( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nWRITE_DEPTH_TO_DESTALPHA = i; +#ifdef _DEBUG + m_bWRITE_DEPTH_TO_DESTALPHA = true; +#endif // _DEBUG + } + + void SetFLASHLIGHTSHADOWS( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nFLASHLIGHTSHADOWS = i; +#ifdef _DEBUG + m_bFLASHLIGHTSHADOWS = true; +#endif // _DEBUG + } + + skin_ps30_Dynamic_Index() + { + m_nWRITEWATERFOGTODESTALPHA = 0; + m_nPIXELFOGTYPE = 0; + m_nNUM_LIGHTS = 0; + m_nWRITE_DEPTH_TO_DESTALPHA = 0; + m_nFLASHLIGHTSHADOWS = 0; +#ifdef _DEBUG + m_bWRITEWATERFOGTODESTALPHA = false; + m_bPIXELFOGTYPE = false; + m_bNUM_LIGHTS = false; + m_bWRITE_DEPTH_TO_DESTALPHA = false; + m_bFLASHLIGHTSHADOWS = false; +#endif // _DEBUG + } + + int GetIndex() const + { + Assert( m_bWRITEWATERFOGTODESTALPHA && m_bPIXELFOGTYPE && m_bNUM_LIGHTS && m_bWRITE_DEPTH_TO_DESTALPHA && m_bFLASHLIGHTSHADOWS ); + return ( 1 * m_nWRITEWATERFOGTODESTALPHA ) + ( 2 * m_nPIXELFOGTYPE ) + ( 4 * m_nNUM_LIGHTS ) + ( 20 * m_nWRITE_DEPTH_TO_DESTALPHA ) + ( 40 * m_nFLASHLIGHTSHADOWS ) + 0; + } +}; + +#define shaderDynamicTest_skin_ps30 psh_forgot_to_set_dynamic_WRITEWATERFOGTODESTALPHA + psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_NUM_LIGHTS + psh_forgot_to_set_dynamic_WRITE_DEPTH_TO_DESTALPHA + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + + +#endif // SKIN_PS30_H diff --git a/materialsystem/stdshaders/fxctmp9/skin_vs20.inc b/materialsystem/stdshaders/fxctmp9/skin_vs20.inc index 5c8ee4dc..54ae1ba0 100644 --- a/materialsystem/stdshaders/fxctmp9/skin_vs20.inc +++ b/materialsystem/stdshaders/fxctmp9/skin_vs20.inc @@ -1,187 +1,132 @@ -#include "shaderlib/cshader.h" -class skin_vs20_Static_Index -{ -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 - } -public: - skin_vs20_Static_Index( ) - { -#ifdef _DEBUG - m_bUSE_STATIC_CONTROL_FLOW = false; -#endif // _DEBUG - m_nUSE_STATIC_CONTROL_FLOW = 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_bUSE_STATIC_CONTROL_FLOW; - Assert( bAllStaticVarsDefined ); -#endif // _DEBUG - return ( 48 * m_nUSE_STATIC_CONTROL_FLOW ) + 0; - } -}; -#define shaderStaticTest_skin_vs20 vsh_forgot_to_set_static_USE_STATIC_CONTROL_FLOW + 0 -class skin_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_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: - skin_vs20_Dynamic_Index() - { -#ifdef _DEBUG - m_bCOMPRESSED_VERTS = false; -#endif // _DEBUG - m_nCOMPRESSED_VERTS = 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_bDOWATERFOG && m_bSKINNING && m_bLIGHTING_PREVIEW && m_bNUM_LIGHTS; - Assert( bAllDynamicVarsDefined ); -#endif // _DEBUG - return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nSKINNING ) + ( 8 * m_nLIGHTING_PREVIEW ) + ( 16 * m_nNUM_LIGHTS ) + 0; - } -}; -#define shaderDynamicTest_skin_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + 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 +// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!! +// $USE_STATIC_CONTROL_FLOW && ( $NUM_LIGHTS > 0 ) +// defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH + +#ifndef SKIN_VS20_H +#define SKIN_VS20_H + +#include "shaderapi/ishaderapi.h" +#include "shaderapi/ishadershadow.h" +#include "materialsystem/imaterialvar.h" + +class skin_vs20_Static_Index +{ + unsigned int m_nUSE_STATIC_CONTROL_FLOW : 2; +#ifdef _DEBUG + bool m_bUSE_STATIC_CONTROL_FLOW : 1; +#endif // _DEBUG +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 // _DEBUG + } + + skin_vs20_Static_Index() + { + m_nUSE_STATIC_CONTROL_FLOW = 0; +#ifdef _DEBUG + m_bUSE_STATIC_CONTROL_FLOW = false; +#endif // _DEBUG + } + + int GetIndex() const + { + Assert( m_bUSE_STATIC_CONTROL_FLOW ); + return ( 48 * m_nUSE_STATIC_CONTROL_FLOW ) + 0; + } +}; + +#define shaderStaticTest_skin_vs20 vsh_forgot_to_set_static_USE_STATIC_CONTROL_FLOW + + +class skin_vs20_Dynamic_Index +{ + unsigned int m_nCOMPRESSED_VERTS : 2; + unsigned int m_nDOWATERFOG : 2; + unsigned int m_nSKINNING : 2; + unsigned int m_nLIGHTING_PREVIEW : 2; + unsigned int m_nNUM_LIGHTS : 2; +#ifdef _DEBUG + bool m_bCOMPRESSED_VERTS : 1; + bool m_bDOWATERFOG : 1; + bool m_bSKINNING : 1; + bool m_bLIGHTING_PREVIEW : 1; + bool m_bNUM_LIGHTS : 1; +#endif // _DEBUG +public: + void SetCOMPRESSED_VERTS( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nCOMPRESSED_VERTS = i; +#ifdef _DEBUG + m_bCOMPRESSED_VERTS = true; +#endif // _DEBUG + } + + void SetDOWATERFOG( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nDOWATERFOG = i; +#ifdef _DEBUG + m_bDOWATERFOG = true; +#endif // _DEBUG + } + + void SetSKINNING( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSKINNING = i; +#ifdef _DEBUG + m_bSKINNING = true; +#endif // _DEBUG + } + + void SetLIGHTING_PREVIEW( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nLIGHTING_PREVIEW = i; +#ifdef _DEBUG + m_bLIGHTING_PREVIEW = true; +#endif // _DEBUG + } + + void SetNUM_LIGHTS( int i ) + { + Assert( i >= 0 && i <= 2 ); + m_nNUM_LIGHTS = i; +#ifdef _DEBUG + m_bNUM_LIGHTS = true; +#endif // _DEBUG + } + + skin_vs20_Dynamic_Index() + { + m_nCOMPRESSED_VERTS = 0; + m_nDOWATERFOG = 0; + m_nSKINNING = 0; + m_nLIGHTING_PREVIEW = 0; + m_nNUM_LIGHTS = 0; +#ifdef _DEBUG + m_bCOMPRESSED_VERTS = false; + m_bDOWATERFOG = false; + m_bSKINNING = false; + m_bLIGHTING_PREVIEW = false; + m_bNUM_LIGHTS = false; +#endif // _DEBUG + } + + int GetIndex() const + { + Assert( m_bCOMPRESSED_VERTS && m_bDOWATERFOG && m_bSKINNING && m_bLIGHTING_PREVIEW && m_bNUM_LIGHTS ); + return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDOWATERFOG ) + ( 4 * m_nSKINNING ) + ( 8 * m_nLIGHTING_PREVIEW ) + ( 16 * m_nNUM_LIGHTS ) + 0; + } +}; + +#define shaderDynamicTest_skin_vs20 vsh_forgot_to_set_dynamic_COMPRESSED_VERTS + 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 + + +#endif // SKIN_VS20_H diff --git a/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps20.inc b/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps20.inc index cc3b8ba2..70bff4d1 100644 --- a/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps20.inc +++ b/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps20.inc @@ -536,27 +536,6 @@ public: m_bLIGHTING_PREVIEW = 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 <= 0 ); - 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 - } public: vertexlit_and_unlit_generic_ps20_Dynamic_Index() { @@ -568,10 +547,6 @@ public: m_bLIGHTING_PREVIEW = false; #endif // _DEBUG m_nLIGHTING_PREVIEW = 0; -#ifdef _DEBUG - m_bSTATIC_LIGHT_LIGHTMAP = false; -#endif // _DEBUG - m_nSTATIC_LIGHT_LIGHTMAP = 0; } int GetIndex() { @@ -581,7 +556,7 @@ public: bool bAllDynamicVarsDefined = m_bPIXELFOGTYPE && m_bLIGHTING_PREVIEW && m_bSTATIC_LIGHT_LIGHTMAP; Assert( bAllDynamicVarsDefined ); #endif // _DEBUG - return ( 1 * m_nPIXELFOGTYPE ) + ( 2 * m_nLIGHTING_PREVIEW ) + ( 6 * m_nSTATIC_LIGHT_LIGHTMAP ) + 0; + return ( 1 * m_nPIXELFOGTYPE ) + ( 2 * m_nLIGHTING_PREVIEW ) + 0; } }; -#define shaderDynamicTest_vertexlit_and_unlit_generic_ps20 psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_LIGHTING_PREVIEW + psh_forgot_to_set_dynamic_STATIC_LIGHT_LIGHTMAP + 0 +#define shaderDynamicTest_vertexlit_and_unlit_generic_ps20 psh_forgot_to_set_dynamic_PIXELFOGTYPE + psh_forgot_to_set_dynamic_LIGHTING_PREVIEW + 0 diff --git a/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps20b.inc b/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps20b.inc index 8f52fcd1..b0df8b61 100644 --- a/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps20b.inc +++ b/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps20b.inc @@ -1,41 +1,3 @@ -// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!! -// ($DETAILTEXTURE == 0 ) && ( $DETAIL_BLEND_MODE != 0 ) -// ($DETAILTEXTURE == 0 ) && ( $SEAMLESS_DETAIL ) -// ($ENVMAPMASK || $SELFILLUM_ENVMAPMASK_ALPHA) && ($SEAMLESS_BASE || $SEAMLESS_DETAIL) -// $BASEALPHAENVMAPMASK && $ENVMAPMASK -// $BASEALPHAENVMAPMASK && $SELFILLUM -// $SELFILLUM && $SELFILLUM_ENVMAPMASK_ALPHA -// $SELFILLUM_ENVMAPMASK_ALPHA && (! $ENVMAPMASK) -// $ENVMAPMASK && ($FLASHLIGHT || $FLASHLIGHTSHADOWS) -// $BASEALPHAENVMAPMASK && ($SEAMLESS_BASE || $SEAMLESS_DETAIL) -// ($DISTANCEALPHA == 0) && ($DISTANCEALPHAFROMDETAIL || $SOFT_MASK || $OUTLINE || $OUTER_GLOW) -// ($DETAILTEXTURE == 0) && ($DISTANCEALPHAFROMDETAIL) -// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTSHADOWS == 1 ) -// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTDEPTHFILTERMODE != 0 ) -// ($DISTANCEALPHA) && ($ENVMAPMASK || $BASEALPHAENVMAPMASK || $SELFILLUM || $SELFILLUM_ENVMAPMASK_ALPHA ) -// ($DISTANCEALPHA) && ($SEAMLESS_BASE || $SEAMLESS_DETAIL || $CUBEMAP || $LIGHTING_PREVIEW ) -// ($DISTANCEALPHA) && ($WRITEWATERFOGTODESTALPHA || $PIXELFOGTYPE || $FLASHLIGHT || $FLASHLIGHTSHADOWS || $SRGB_INPUT_ADAPTER ) -// $SEAMLESS_BASE && $SRGB_INPUT_ADAPTER -// $SEAMLESS_BASE && ($BLENDTINTBYBASEALPHA ) -// ($BLENDTINTBYBASEALPHA) && ($SELFILLUM || (($DISTANCEALPHA) && ($DISTANCEALPHAFROMDETAIL == 0)) || $BASEALPHAENVMAPMASK) -// $FLASHLIGHT && $CUBEMAP -// $CUBEMAP_SPHERE_LEGACY && ($CUBEMAP == 0) -// ($STATIC_LIGHT_LIGHTMAP == 0) && ($DEBUG_LUXELS == 1) -// defined $HDRTYPE && defined $HDRENABLED && !$HDRTYPE && $HDRENABLED -// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA -// defined $LIGHTING_PREVIEW && defined $HDRTYPE && $LIGHTING_PREVIEW && $HDRTYPE != 0 -// 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 $HDRTYPE && defined $HDRENABLED && !$HDRTYPE && $HDRENABLED -// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA -// defined $LIGHTING_PREVIEW && defined $HDRTYPE && $LIGHTING_PREVIEW && $HDRTYPE != 0 -// 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 - #ifndef VERTEXLIT_AND_UNLIT_GENERIC_PS20B_H #define VERTEXLIT_AND_UNLIT_GENERIC_PS20B_H @@ -343,7 +305,7 @@ public: int GetIndex() const { Assert( m_bDETAILTEXTURE && m_bCUBEMAP && m_bDIFFUSELIGHTING && m_bENVMAPMASK && m_bBASEALPHAENVMAPMASK && m_bSELFILLUM && m_bVERTEXCOLOR && m_bFLASHLIGHT && m_bSELFILLUM_ENVMAPMASK_ALPHA && m_bDETAIL_BLEND_MODE && m_bSEAMLESS_BASE && m_bSEAMLESS_DETAIL && m_bDISTANCEALPHA && m_bDISTANCEALPHAFROMDETAIL && m_bSOFT_MASK && m_bOUTLINE && m_bOUTER_GLOW && m_bFLASHLIGHTDEPTHFILTERMODE && m_bDEPTHBLEND && m_bBLENDTINTBYBASEALPHA && m_bSRGB_INPUT_ADAPTER && m_bCUBEMAP_SPHERE_LEGACY ); - return ( 24 * m_nDETAILTEXTURE ) + ( 48 * m_nCUBEMAP ) + ( 96 * m_nDIFFUSELIGHTING ) + ( 192 * m_nENVMAPMASK ) + ( 384 * m_nBASEALPHAENVMAPMASK ) + ( 768 * m_nSELFILLUM ) + ( 1536 * m_nVERTEXCOLOR ) + ( 3072 * m_nFLASHLIGHT ) + ( 6144 * m_nSELFILLUM_ENVMAPMASK_ALPHA ) + ( 12288 * m_nDETAIL_BLEND_MODE ) + ( 122880 * m_nSEAMLESS_BASE ) + ( 245760 * m_nSEAMLESS_DETAIL ) + ( 491520 * m_nDISTANCEALPHA ) + ( 983040 * m_nDISTANCEALPHAFROMDETAIL ) + ( 1966080 * m_nSOFT_MASK ) + ( 3932160 * m_nOUTLINE ) + ( 7864320 * m_nOUTER_GLOW ) + ( 15728640 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 47185920 * m_nDEPTHBLEND ) + ( 94371840 * m_nBLENDTINTBYBASEALPHA ) + ( 188743680 * m_nSRGB_INPUT_ADAPTER ) + ( 377487360 * m_nCUBEMAP_SPHERE_LEGACY ) + 0; + return ( 6 * m_nDETAILTEXTURE ) + ( 12 * m_nCUBEMAP ) + ( 24 * m_nDIFFUSELIGHTING ) + ( 48 * m_nENVMAPMASK ) + ( 96 * m_nBASEALPHAENVMAPMASK ) + ( 192 * m_nSELFILLUM ) + ( 384 * m_nVERTEXCOLOR ) + ( 768 * m_nFLASHLIGHT ) + ( 1536 * m_nSELFILLUM_ENVMAPMASK_ALPHA ) + ( 3072 * m_nDETAIL_BLEND_MODE ) + ( 30720 * m_nSEAMLESS_BASE ) + ( 61440 * m_nSEAMLESS_DETAIL ) + ( 122880 * m_nDISTANCEALPHA ) + ( 245760 * m_nDISTANCEALPHAFROMDETAIL ) + ( 491520 * m_nSOFT_MASK ) + ( 983040 * m_nOUTLINE ) + ( 1966080 * m_nOUTER_GLOW ) + ( 3932160 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 11796480 * m_nDEPTHBLEND ) + ( 23592960 * m_nBLENDTINTBYBASEALPHA ) + ( 47185920 * m_nSRGB_INPUT_ADAPTER ) + ( 94371840 * m_nCUBEMAP_SPHERE_LEGACY ) + 0; } }; @@ -354,13 +316,9 @@ class vertexlit_and_unlit_generic_ps20b_Dynamic_Index { unsigned int m_nLIGHTING_PREVIEW : 2; unsigned int m_nFLASHLIGHTSHADOWS : 2; - unsigned int m_nSTATIC_LIGHT_LIGHTMAP : 2; - unsigned int m_nDEBUG_LUXELS : 2; #ifdef _DEBUG bool m_bLIGHTING_PREVIEW : 1; bool m_bFLASHLIGHTSHADOWS : 1; - bool m_bSTATIC_LIGHT_LIGHTMAP : 1; - bool m_bDEBUG_LUXELS : 1; #endif // _DEBUG public: void SetLIGHTING_PREVIEW( int i ) @@ -381,46 +339,24 @@ public: #endif // _DEBUG } - void SetSTATIC_LIGHT_LIGHTMAP( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nSTATIC_LIGHT_LIGHTMAP = i; -#ifdef _DEBUG - m_bSTATIC_LIGHT_LIGHTMAP = true; -#endif // _DEBUG - } - - void SetDEBUG_LUXELS( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nDEBUG_LUXELS = i; -#ifdef _DEBUG - m_bDEBUG_LUXELS = true; -#endif // _DEBUG - } - vertexlit_and_unlit_generic_ps20b_Dynamic_Index( ) { m_nLIGHTING_PREVIEW = 0; m_nFLASHLIGHTSHADOWS = 0; - m_nSTATIC_LIGHT_LIGHTMAP = 0; - m_nDEBUG_LUXELS = 0; #ifdef _DEBUG m_bLIGHTING_PREVIEW = false; m_bFLASHLIGHTSHADOWS = false; - m_bSTATIC_LIGHT_LIGHTMAP = false; - m_bDEBUG_LUXELS = false; #endif // _DEBUG } int GetIndex() const { - Assert( m_bLIGHTING_PREVIEW && m_bFLASHLIGHTSHADOWS && m_bSTATIC_LIGHT_LIGHTMAP && m_bDEBUG_LUXELS ); - return ( 1 * m_nLIGHTING_PREVIEW ) + ( 3 * m_nFLASHLIGHTSHADOWS ) + ( 6 * m_nSTATIC_LIGHT_LIGHTMAP ) + ( 12 * m_nDEBUG_LUXELS ) + 0; + Assert( m_bLIGHTING_PREVIEW && m_bFLASHLIGHTSHADOWS ); + return ( 1 * m_nLIGHTING_PREVIEW ) + ( 3 * m_nFLASHLIGHTSHADOWS ) + 0; } }; -#define shaderDynamicTest_vertexlit_and_unlit_generic_ps20b psh_forgot_to_set_dynamic_LIGHTING_PREVIEW + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + psh_forgot_to_set_dynamic_STATIC_LIGHT_LIGHTMAP + psh_forgot_to_set_dynamic_DEBUG_LUXELS +#define shaderDynamicTest_vertexlit_and_unlit_generic_ps20b psh_forgot_to_set_dynamic_LIGHTING_PREVIEW + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS #endif // VERTEXLIT_AND_UNLIT_GENERIC_PS20B_H diff --git a/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps30.inc b/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps30.inc index ce1c6f91..80c2e578 100644 --- a/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps30.inc +++ b/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_ps30.inc @@ -1,662 +1,386 @@ -#include "shaderlib/cshader.h" -class vertexlit_and_unlit_generic_ps30_Static_Index -{ -private: - int m_nDETAILTEXTURE; -#ifdef _DEBUG - bool m_bDETAILTEXTURE; -#endif -public: - void SetDETAILTEXTURE( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nDETAILTEXTURE = i; -#ifdef _DEBUG - m_bDETAILTEXTURE = true; -#endif - } - void SetDETAILTEXTURE( bool i ) - { - m_nDETAILTEXTURE = i ? 1 : 0; -#ifdef _DEBUG - m_bDETAILTEXTURE = 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_nDIFFUSELIGHTING; -#ifdef _DEBUG - bool m_bDIFFUSELIGHTING; -#endif -public: - void SetDIFFUSELIGHTING( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nDIFFUSELIGHTING = i; -#ifdef _DEBUG - m_bDIFFUSELIGHTING = true; -#endif - } - void SetDIFFUSELIGHTING( bool i ) - { - m_nDIFFUSELIGHTING = i ? 1 : 0; -#ifdef _DEBUG - m_bDIFFUSELIGHTING = true; -#endif - } -private: - int m_nENVMAPMASK; -#ifdef _DEBUG - bool m_bENVMAPMASK; -#endif -public: - void SetENVMAPMASK( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nENVMAPMASK = i; -#ifdef _DEBUG - m_bENVMAPMASK = true; -#endif - } - void SetENVMAPMASK( bool i ) - { - m_nENVMAPMASK = i ? 1 : 0; -#ifdef _DEBUG - m_bENVMAPMASK = true; -#endif - } -private: - int m_nBASEALPHAENVMAPMASK; -#ifdef _DEBUG - bool m_bBASEALPHAENVMAPMASK; -#endif -public: - void SetBASEALPHAENVMAPMASK( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nBASEALPHAENVMAPMASK = i; -#ifdef _DEBUG - m_bBASEALPHAENVMAPMASK = true; -#endif - } - void SetBASEALPHAENVMAPMASK( bool i ) - { - m_nBASEALPHAENVMAPMASK = i ? 1 : 0; -#ifdef _DEBUG - m_bBASEALPHAENVMAPMASK = true; -#endif - } -private: - int m_nSELFILLUM; -#ifdef _DEBUG - bool m_bSELFILLUM; -#endif -public: - void SetSELFILLUM( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nSELFILLUM = i; -#ifdef _DEBUG - m_bSELFILLUM = true; -#endif - } - void SetSELFILLUM( bool i ) - { - m_nSELFILLUM = i ? 1 : 0; -#ifdef _DEBUG - m_bSELFILLUM = 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_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_nSELFILLUM_ENVMAPMASK_ALPHA; -#ifdef _DEBUG - bool m_bSELFILLUM_ENVMAPMASK_ALPHA; -#endif -public: - void SetSELFILLUM_ENVMAPMASK_ALPHA( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nSELFILLUM_ENVMAPMASK_ALPHA = i; -#ifdef _DEBUG - m_bSELFILLUM_ENVMAPMASK_ALPHA = true; -#endif - } - void SetSELFILLUM_ENVMAPMASK_ALPHA( bool i ) - { - m_nSELFILLUM_ENVMAPMASK_ALPHA = i ? 1 : 0; -#ifdef _DEBUG - m_bSELFILLUM_ENVMAPMASK_ALPHA = true; -#endif - } -private: - int m_nDETAIL_BLEND_MODE; -#ifdef _DEBUG - bool m_bDETAIL_BLEND_MODE; -#endif -public: - void SetDETAIL_BLEND_MODE( int i ) - { - Assert( i >= 0 && i <= 9 ); - m_nDETAIL_BLEND_MODE = i; -#ifdef _DEBUG - m_bDETAIL_BLEND_MODE = true; -#endif - } - void SetDETAIL_BLEND_MODE( bool i ) - { - m_nDETAIL_BLEND_MODE = i ? 1 : 0; -#ifdef _DEBUG - m_bDETAIL_BLEND_MODE = 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_nDISTANCEALPHA; -#ifdef _DEBUG - bool m_bDISTANCEALPHA; -#endif -public: - void SetDISTANCEALPHA( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nDISTANCEALPHA = i; -#ifdef _DEBUG - m_bDISTANCEALPHA = true; -#endif - } - void SetDISTANCEALPHA( bool i ) - { - m_nDISTANCEALPHA = i ? 1 : 0; -#ifdef _DEBUG - m_bDISTANCEALPHA = true; -#endif - } -private: - int m_nDISTANCEALPHAFROMDETAIL; -#ifdef _DEBUG - bool m_bDISTANCEALPHAFROMDETAIL; -#endif -public: - void SetDISTANCEALPHAFROMDETAIL( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nDISTANCEALPHAFROMDETAIL = i; -#ifdef _DEBUG - m_bDISTANCEALPHAFROMDETAIL = true; -#endif - } - void SetDISTANCEALPHAFROMDETAIL( bool i ) - { - m_nDISTANCEALPHAFROMDETAIL = i ? 1 : 0; -#ifdef _DEBUG - m_bDISTANCEALPHAFROMDETAIL = true; -#endif - } -private: - int m_nSOFT_MASK; -#ifdef _DEBUG - bool m_bSOFT_MASK; -#endif -public: - void SetSOFT_MASK( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nSOFT_MASK = i; -#ifdef _DEBUG - m_bSOFT_MASK = true; -#endif - } - void SetSOFT_MASK( bool i ) - { - m_nSOFT_MASK = i ? 1 : 0; -#ifdef _DEBUG - m_bSOFT_MASK = true; -#endif - } -private: - int m_nOUTLINE; -#ifdef _DEBUG - bool m_bOUTLINE; -#endif -public: - void SetOUTLINE( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nOUTLINE = i; -#ifdef _DEBUG - m_bOUTLINE = true; -#endif - } - void SetOUTLINE( bool i ) - { - m_nOUTLINE = i ? 1 : 0; -#ifdef _DEBUG - m_bOUTLINE = true; -#endif - } -private: - int m_nOUTER_GLOW; -#ifdef _DEBUG - bool m_bOUTER_GLOW; -#endif -public: - void SetOUTER_GLOW( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nOUTER_GLOW = i; -#ifdef _DEBUG - m_bOUTER_GLOW = true; -#endif - } - void SetOUTER_GLOW( bool i ) - { - m_nOUTER_GLOW = i ? 1 : 0; -#ifdef _DEBUG - m_bOUTER_GLOW = true; -#endif - } -private: - int m_nFLASHLIGHTDEPTHFILTERMODE; -#ifdef _DEBUG - bool m_bFLASHLIGHTDEPTHFILTERMODE; -#endif -public: - void SetFLASHLIGHTDEPTHFILTERMODE( int i ) - { - Assert( i >= 0 && i <= 2 ); - m_nFLASHLIGHTDEPTHFILTERMODE = i; -#ifdef _DEBUG - m_bFLASHLIGHTDEPTHFILTERMODE = true; -#endif - } - void SetFLASHLIGHTDEPTHFILTERMODE( bool i ) - { - m_nFLASHLIGHTDEPTHFILTERMODE = i ? 1 : 0; -#ifdef _DEBUG - m_bFLASHLIGHTDEPTHFILTERMODE = true; -#endif - } -private: - int m_nDEPTHBLEND; -#ifdef _DEBUG - bool m_bDEPTHBLEND; -#endif -public: - void SetDEPTHBLEND( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nDEPTHBLEND = i; -#ifdef _DEBUG - m_bDEPTHBLEND = true; -#endif - } - void SetDEPTHBLEND( bool i ) - { - m_nDEPTHBLEND = i ? 1 : 0; -#ifdef _DEBUG - m_bDEPTHBLEND = true; -#endif - } -private: - int m_nBLENDTINTBYBASEALPHA; -#ifdef _DEBUG - bool m_bBLENDTINTBYBASEALPHA; -#endif -public: - void SetBLENDTINTBYBASEALPHA( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nBLENDTINTBYBASEALPHA = i; -#ifdef _DEBUG - m_bBLENDTINTBYBASEALPHA = true; -#endif - } - void SetBLENDTINTBYBASEALPHA( bool i ) - { - m_nBLENDTINTBYBASEALPHA = i ? 1 : 0; -#ifdef _DEBUG - m_bBLENDTINTBYBASEALPHA = true; -#endif - } -private: - int m_nCUBEMAP_SPHERE_LEGACY; -#ifdef _DEBUG - bool m_bCUBEMAP_SPHERE_LEGACY; -#endif -public: - void SetCUBEMAP_SPHERE_LEGACY( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nCUBEMAP_SPHERE_LEGACY = i; -#ifdef _DEBUG - m_bCUBEMAP_SPHERE_LEGACY = true; -#endif - } - void SetCUBEMAP_SPHERE_LEGACY( bool i ) - { - m_nCUBEMAP_SPHERE_LEGACY = i ? 1 : 0; -#ifdef _DEBUG - m_bCUBEMAP_SPHERE_LEGACY = true; -#endif - } -public: - vertexlit_and_unlit_generic_ps30_Static_Index( ) - { -#ifdef _DEBUG - m_bDETAILTEXTURE = false; -#endif // _DEBUG - m_nDETAILTEXTURE = 0; -#ifdef _DEBUG - m_bCUBEMAP = false; -#endif // _DEBUG - m_nCUBEMAP = 0; -#ifdef _DEBUG - m_bDIFFUSELIGHTING = false; -#endif // _DEBUG - m_nDIFFUSELIGHTING = 0; -#ifdef _DEBUG - m_bENVMAPMASK = false; -#endif // _DEBUG - m_nENVMAPMASK = 0; -#ifdef _DEBUG - m_bBASEALPHAENVMAPMASK = false; -#endif // _DEBUG - m_nBASEALPHAENVMAPMASK = 0; -#ifdef _DEBUG - m_bSELFILLUM = false; -#endif // _DEBUG - m_nSELFILLUM = 0; -#ifdef _DEBUG - m_bVERTEXCOLOR = false; -#endif // _DEBUG - m_nVERTEXCOLOR = 0; -#ifdef _DEBUG - m_bFLASHLIGHT = false; -#endif // _DEBUG - m_nFLASHLIGHT = 0; -#ifdef _DEBUG - m_bSELFILLUM_ENVMAPMASK_ALPHA = false; -#endif // _DEBUG - m_nSELFILLUM_ENVMAPMASK_ALPHA = 0; -#ifdef _DEBUG - m_bDETAIL_BLEND_MODE = false; -#endif // _DEBUG - m_nDETAIL_BLEND_MODE = 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_bDISTANCEALPHA = false; -#endif // _DEBUG - m_nDISTANCEALPHA = 0; -#ifdef _DEBUG - m_bDISTANCEALPHAFROMDETAIL = false; -#endif // _DEBUG - m_nDISTANCEALPHAFROMDETAIL = 0; -#ifdef _DEBUG - m_bSOFT_MASK = false; -#endif // _DEBUG - m_nSOFT_MASK = 0; -#ifdef _DEBUG - m_bOUTLINE = false; -#endif // _DEBUG - m_nOUTLINE = 0; -#ifdef _DEBUG - m_bOUTER_GLOW = false; -#endif // _DEBUG - m_nOUTER_GLOW = 0; -#ifdef _DEBUG - m_bFLASHLIGHTDEPTHFILTERMODE = false; -#endif // _DEBUG - m_nFLASHLIGHTDEPTHFILTERMODE = 0; -#ifdef _DEBUG - m_bDEPTHBLEND = false; -#endif // _DEBUG - m_nDEPTHBLEND = 0; -#ifdef _DEBUG - m_bBLENDTINTBYBASEALPHA = false; -#endif // _DEBUG - m_nBLENDTINTBYBASEALPHA = 0; -#ifdef _DEBUG - m_bCUBEMAP_SPHERE_LEGACY = false; -#endif // _DEBUG - m_nCUBEMAP_SPHERE_LEGACY = 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_bDETAILTEXTURE && m_bCUBEMAP && m_bDIFFUSELIGHTING && m_bENVMAPMASK && m_bBASEALPHAENVMAPMASK && m_bSELFILLUM && m_bVERTEXCOLOR && m_bFLASHLIGHT && m_bSELFILLUM_ENVMAPMASK_ALPHA && m_bDETAIL_BLEND_MODE && m_bSEAMLESS_BASE && m_bSEAMLESS_DETAIL && m_bDISTANCEALPHA && m_bDISTANCEALPHAFROMDETAIL && m_bSOFT_MASK && m_bOUTLINE && m_bOUTER_GLOW && m_bFLASHLIGHTDEPTHFILTERMODE && m_bDEPTHBLEND && m_bBLENDTINTBYBASEALPHA && m_bCUBEMAP_SPHERE_LEGACY; - Assert( bAllStaticVarsDefined ); -#endif // _DEBUG - return ( 24 * m_nDETAILTEXTURE ) + ( 48 * m_nCUBEMAP ) + ( 96 * m_nDIFFUSELIGHTING ) + ( 192 * m_nENVMAPMASK ) + ( 384 * m_nBASEALPHAENVMAPMASK ) + ( 768 * m_nSELFILLUM ) + ( 1536 * m_nVERTEXCOLOR ) + ( 3072 * m_nFLASHLIGHT ) + ( 6144 * m_nSELFILLUM_ENVMAPMASK_ALPHA ) + ( 12288 * m_nDETAIL_BLEND_MODE ) + ( 122880 * m_nSEAMLESS_BASE ) + ( 245760 * m_nSEAMLESS_DETAIL ) + ( 491520 * m_nDISTANCEALPHA ) + ( 983040 * m_nDISTANCEALPHAFROMDETAIL ) + ( 1966080 * m_nSOFT_MASK ) + ( 3932160 * m_nOUTLINE ) + ( 7864320 * m_nOUTER_GLOW ) + ( 15728640 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 47185920 * m_nDEPTHBLEND ) + ( 94371840 * m_nBLENDTINTBYBASEALPHA ) + ( 188743680 * m_nCUBEMAP_SPHERE_LEGACY ) + 0; - } -}; -#define shaderStaticTest_vertexlit_and_unlit_generic_ps30 psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_DIFFUSELIGHTING + psh_forgot_to_set_static_ENVMAPMASK + psh_forgot_to_set_static_BASEALPHAENVMAPMASK + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_VERTEXCOLOR + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_SELFILLUM_ENVMAPMASK_ALPHA + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_SEAMLESS_BASE + psh_forgot_to_set_static_SEAMLESS_DETAIL + psh_forgot_to_set_static_DISTANCEALPHA + psh_forgot_to_set_static_DISTANCEALPHAFROMDETAIL + psh_forgot_to_set_static_SOFT_MASK + psh_forgot_to_set_static_OUTLINE + psh_forgot_to_set_static_OUTER_GLOW + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_DEPTHBLEND + psh_forgot_to_set_static_BLENDTINTBYBASEALPHA + psh_forgot_to_set_static_CUBEMAP_SPHERE_LEGACY + 0 -class vertexlit_and_unlit_generic_ps30_Dynamic_Index -{ -private: - int m_nLIGHTING_PREVIEW; -#ifdef _DEBUG - bool m_bLIGHTING_PREVIEW; -#endif -public: - void SetLIGHTING_PREVIEW( int i ) - { - Assert( i >= 0 && i <= 2 ); - 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_nFLASHLIGHTSHADOWS; -#ifdef _DEBUG - bool m_bFLASHLIGHTSHADOWS; -#endif -public: - void SetFLASHLIGHTSHADOWS( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nFLASHLIGHTSHADOWS = i; -#ifdef _DEBUG - m_bFLASHLIGHTSHADOWS = true; -#endif - } - void SetFLASHLIGHTSHADOWS( bool i ) - { - m_nFLASHLIGHTSHADOWS = i ? 1 : 0; -#ifdef _DEBUG - m_bFLASHLIGHTSHADOWS = 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_nDEBUG_LUXELS; -#ifdef _DEBUG - bool m_bDEBUG_LUXELS; -#endif -public: - void SetDEBUG_LUXELS( int i ) - { - Assert( i >= 0 && i <= 1 ); - m_nDEBUG_LUXELS = i; -#ifdef _DEBUG - m_bDEBUG_LUXELS = true; -#endif - } - void SetDEBUG_LUXELS( bool i ) - { - m_nDEBUG_LUXELS = i ? 1 : 0; -#ifdef _DEBUG - m_bDEBUG_LUXELS = true; -#endif - } -public: - vertexlit_and_unlit_generic_ps30_Dynamic_Index() - { -#ifdef _DEBUG - m_bLIGHTING_PREVIEW = false; -#endif // _DEBUG - m_nLIGHTING_PREVIEW = 0; -#ifdef _DEBUG - m_bFLASHLIGHTSHADOWS = false; -#endif // _DEBUG - m_nFLASHLIGHTSHADOWS = 0; -#ifdef _DEBUG - m_bSTATIC_LIGHT_LIGHTMAP = false; -#endif // _DEBUG - m_nSTATIC_LIGHT_LIGHTMAP = 0; -#ifdef _DEBUG - m_bDEBUG_LUXELS = false; -#endif // _DEBUG - m_nDEBUG_LUXELS = 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_bLIGHTING_PREVIEW && m_bFLASHLIGHTSHADOWS && m_bSTATIC_LIGHT_LIGHTMAP && m_bDEBUG_LUXELS; - Assert( bAllDynamicVarsDefined ); -#endif // _DEBUG - return ( 1 * m_nLIGHTING_PREVIEW ) + ( 3 * m_nFLASHLIGHTSHADOWS ) + ( 6 * m_nSTATIC_LIGHT_LIGHTMAP ) + ( 12 * m_nDEBUG_LUXELS ) + 0; - } -}; -#define shaderDynamicTest_vertexlit_and_unlit_generic_ps30 psh_forgot_to_set_dynamic_LIGHTING_PREVIEW + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + psh_forgot_to_set_dynamic_STATIC_LIGHT_LIGHTMAP + psh_forgot_to_set_dynamic_DEBUG_LUXELS + 0 +// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!! +// ($DETAILTEXTURE == 0 ) && ( $DETAIL_BLEND_MODE != 0 ) +// ($DETAILTEXTURE == 0 ) && ( $SEAMLESS_DETAIL ) +// ($ENVMAPMASK || $SELFILLUM_ENVMAPMASK_ALPHA) && ($SEAMLESS_BASE || $SEAMLESS_DETAIL) +// $BASEALPHAENVMAPMASK && $ENVMAPMASK +// $BASEALPHAENVMAPMASK && $SELFILLUM +// $SELFILLUM && $SELFILLUM_ENVMAPMASK_ALPHA +// $SELFILLUM_ENVMAPMASK_ALPHA && (! $ENVMAPMASK) +// $ENVMAPMASK && ($FLASHLIGHT || $FLASHLIGHTSHADOWS) +// $BASEALPHAENVMAPMASK && ($SEAMLESS_BASE || $SEAMLESS_DETAIL) +// ($DISTANCEALPHA == 0) && ($DISTANCEALPHAFROMDETAIL || $SOFT_MASK || $OUTLINE || $OUTER_GLOW) +// ($DETAILTEXTURE == 0) && ($DISTANCEALPHAFROMDETAIL) +// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTSHADOWS == 1 ) +// ( $FLASHLIGHT == 0 ) && ( $FLASHLIGHTDEPTHFILTERMODE != 0 ) +// ($DISTANCEALPHA) && ($ENVMAPMASK || $BASEALPHAENVMAPMASK || $SELFILLUM || $SELFILLUM_ENVMAPMASK_ALPHA ) +// ($DISTANCEALPHA) && ($SEAMLESS_BASE || $SEAMLESS_DETAIL || $CUBEMAP || $LIGHTING_PREVIEW ) +// ($DISTANCEALPHA) && ($WRITEWATERFOGTODESTALPHA || $PIXELFOGTYPE || $FLASHLIGHT || $FLASHLIGHTSHADOWS || $SRGB_INPUT_ADAPTER ) +// $SEAMLESS_BASE && $SRGB_INPUT_ADAPTER +// $SEAMLESS_BASE && ($BLENDTINTBYBASEALPHA ) +// ($BLENDTINTBYBASEALPHA) && ($SELFILLUM || (($DISTANCEALPHA) && ($DISTANCEALPHAFROMDETAIL == 0)) || $BASEALPHAENVMAPMASK) +// $FLASHLIGHT && $CUBEMAP +// $CUBEMAP_SPHERE_LEGACY && ($CUBEMAP == 0) +// defined $HDRTYPE && defined $HDRENABLED && !$HDRTYPE && $HDRENABLED +// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA +// defined $LIGHTING_PREVIEW && defined $HDRTYPE && $LIGHTING_PREVIEW && $HDRTYPE != 0 +// 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 $HDRTYPE && defined $HDRENABLED && !$HDRTYPE && $HDRENABLED +// defined $PIXELFOGTYPE && defined $WRITEWATERFOGTODESTALPHA && ( $PIXELFOGTYPE != 1 ) && $WRITEWATERFOGTODESTALPHA +// defined $LIGHTING_PREVIEW && defined $HDRTYPE && $LIGHTING_PREVIEW && $HDRTYPE != 0 +// 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 + +#ifndef VERTEXLIT_AND_UNLIT_GENERIC_PS30_H +#define VERTEXLIT_AND_UNLIT_GENERIC_PS30_H + +#include "shaderapi/ishaderapi.h" +#include "shaderapi/ishadershadow.h" +#include "materialsystem/imaterialvar.h" + +class vertexlit_and_unlit_generic_ps30_Static_Index +{ + unsigned int m_nDETAILTEXTURE : 2; + unsigned int m_nCUBEMAP : 2; + unsigned int m_nDIFFUSELIGHTING : 2; + unsigned int m_nENVMAPMASK : 2; + unsigned int m_nBASEALPHAENVMAPMASK : 2; + unsigned int m_nSELFILLUM : 2; + unsigned int m_nVERTEXCOLOR : 2; + unsigned int m_nFLASHLIGHT : 2; + unsigned int m_nSELFILLUM_ENVMAPMASK_ALPHA : 2; + unsigned int m_nDETAIL_BLEND_MODE : 4; + unsigned int m_nSEAMLESS_BASE : 2; + unsigned int m_nSEAMLESS_DETAIL : 2; + unsigned int m_nDISTANCEALPHA : 2; + unsigned int m_nDISTANCEALPHAFROMDETAIL : 2; + unsigned int m_nSOFT_MASK : 2; + unsigned int m_nOUTLINE : 2; + unsigned int m_nOUTER_GLOW : 2; + unsigned int m_nFLASHLIGHTDEPTHFILTERMODE : 2; + unsigned int m_nDEPTHBLEND : 2; + unsigned int m_nBLENDTINTBYBASEALPHA : 2; + unsigned int m_nCUBEMAP_SPHERE_LEGACY : 2; +#ifdef _DEBUG + bool m_bDETAILTEXTURE : 1; + bool m_bCUBEMAP : 1; + bool m_bDIFFUSELIGHTING : 1; + bool m_bENVMAPMASK : 1; + bool m_bBASEALPHAENVMAPMASK : 1; + bool m_bSELFILLUM : 1; + bool m_bVERTEXCOLOR : 1; + bool m_bFLASHLIGHT : 1; + bool m_bSELFILLUM_ENVMAPMASK_ALPHA : 1; + bool m_bDETAIL_BLEND_MODE : 1; + bool m_bSEAMLESS_BASE : 1; + bool m_bSEAMLESS_DETAIL : 1; + bool m_bDISTANCEALPHA : 1; + bool m_bDISTANCEALPHAFROMDETAIL : 1; + bool m_bSOFT_MASK : 1; + bool m_bOUTLINE : 1; + bool m_bOUTER_GLOW : 1; + bool m_bFLASHLIGHTDEPTHFILTERMODE : 1; + bool m_bDEPTHBLEND : 1; + bool m_bBLENDTINTBYBASEALPHA : 1; + bool m_bCUBEMAP_SPHERE_LEGACY : 1; +#endif // _DEBUG +public: + void SetDETAILTEXTURE( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nDETAILTEXTURE = i; +#ifdef _DEBUG + m_bDETAILTEXTURE = true; +#endif // _DEBUG + } + + void SetCUBEMAP( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nCUBEMAP = i; +#ifdef _DEBUG + m_bCUBEMAP = true; +#endif // _DEBUG + } + + void SetDIFFUSELIGHTING( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nDIFFUSELIGHTING = i; +#ifdef _DEBUG + m_bDIFFUSELIGHTING = true; +#endif // _DEBUG + } + + void SetENVMAPMASK( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nENVMAPMASK = i; +#ifdef _DEBUG + m_bENVMAPMASK = true; +#endif // _DEBUG + } + + void SetBASEALPHAENVMAPMASK( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nBASEALPHAENVMAPMASK = i; +#ifdef _DEBUG + m_bBASEALPHAENVMAPMASK = true; +#endif // _DEBUG + } + + void SetSELFILLUM( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSELFILLUM = i; +#ifdef _DEBUG + m_bSELFILLUM = true; +#endif // _DEBUG + } + + void SetVERTEXCOLOR( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nVERTEXCOLOR = i; +#ifdef _DEBUG + m_bVERTEXCOLOR = true; +#endif // _DEBUG + } + + void SetFLASHLIGHT( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nFLASHLIGHT = i; +#ifdef _DEBUG + m_bFLASHLIGHT = true; +#endif // _DEBUG + } + + void SetSELFILLUM_ENVMAPMASK_ALPHA( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSELFILLUM_ENVMAPMASK_ALPHA = i; +#ifdef _DEBUG + m_bSELFILLUM_ENVMAPMASK_ALPHA = true; +#endif // _DEBUG + } + + void SetDETAIL_BLEND_MODE( int i ) + { + Assert( i >= 0 && i <= 9 ); + m_nDETAIL_BLEND_MODE = i; +#ifdef _DEBUG + m_bDETAIL_BLEND_MODE = true; +#endif // _DEBUG + } + + void SetSEAMLESS_BASE( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSEAMLESS_BASE = i; +#ifdef _DEBUG + m_bSEAMLESS_BASE = true; +#endif // _DEBUG + } + + void SetSEAMLESS_DETAIL( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSEAMLESS_DETAIL = i; +#ifdef _DEBUG + m_bSEAMLESS_DETAIL = true; +#endif // _DEBUG + } + + void SetDISTANCEALPHA( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nDISTANCEALPHA = i; +#ifdef _DEBUG + m_bDISTANCEALPHA = true; +#endif // _DEBUG + } + + void SetDISTANCEALPHAFROMDETAIL( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nDISTANCEALPHAFROMDETAIL = i; +#ifdef _DEBUG + m_bDISTANCEALPHAFROMDETAIL = true; +#endif // _DEBUG + } + + void SetSOFT_MASK( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSOFT_MASK = i; +#ifdef _DEBUG + m_bSOFT_MASK = true; +#endif // _DEBUG + } + + void SetOUTLINE( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nOUTLINE = i; +#ifdef _DEBUG + m_bOUTLINE = true; +#endif // _DEBUG + } + + void SetOUTER_GLOW( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nOUTER_GLOW = i; +#ifdef _DEBUG + m_bOUTER_GLOW = true; +#endif // _DEBUG + } + + void SetFLASHLIGHTDEPTHFILTERMODE( int i ) + { + Assert( i >= 0 && i <= 2 ); + m_nFLASHLIGHTDEPTHFILTERMODE = i; +#ifdef _DEBUG + m_bFLASHLIGHTDEPTHFILTERMODE = true; +#endif // _DEBUG + } + + void SetDEPTHBLEND( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nDEPTHBLEND = i; +#ifdef _DEBUG + m_bDEPTHBLEND = true; +#endif // _DEBUG + } + + void SetBLENDTINTBYBASEALPHA( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nBLENDTINTBYBASEALPHA = i; +#ifdef _DEBUG + m_bBLENDTINTBYBASEALPHA = true; +#endif // _DEBUG + } + + void SetCUBEMAP_SPHERE_LEGACY( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nCUBEMAP_SPHERE_LEGACY = i; +#ifdef _DEBUG + m_bCUBEMAP_SPHERE_LEGACY = true; +#endif // _DEBUG + } + + vertexlit_and_unlit_generic_ps30_Static_Index() + { + m_nDETAILTEXTURE = 0; + m_nCUBEMAP = 0; + m_nDIFFUSELIGHTING = 0; + m_nENVMAPMASK = 0; + m_nBASEALPHAENVMAPMASK = 0; + m_nSELFILLUM = 0; + m_nVERTEXCOLOR = 0; + m_nFLASHLIGHT = 0; + m_nSELFILLUM_ENVMAPMASK_ALPHA = 0; + m_nDETAIL_BLEND_MODE = 0; + m_nSEAMLESS_BASE = 0; + m_nSEAMLESS_DETAIL = 0; + m_nDISTANCEALPHA = 0; + m_nDISTANCEALPHAFROMDETAIL = 0; + m_nSOFT_MASK = 0; + m_nOUTLINE = 0; + m_nOUTER_GLOW = 0; + m_nFLASHLIGHTDEPTHFILTERMODE = 0; + m_nDEPTHBLEND = 0; + m_nBLENDTINTBYBASEALPHA = 0; + m_nCUBEMAP_SPHERE_LEGACY = 0; +#ifdef _DEBUG + m_bDETAILTEXTURE = false; + m_bCUBEMAP = false; + m_bDIFFUSELIGHTING = false; + m_bENVMAPMASK = false; + m_bBASEALPHAENVMAPMASK = false; + m_bSELFILLUM = false; + m_bVERTEXCOLOR = false; + m_bFLASHLIGHT = false; + m_bSELFILLUM_ENVMAPMASK_ALPHA = false; + m_bDETAIL_BLEND_MODE = false; + m_bSEAMLESS_BASE = false; + m_bSEAMLESS_DETAIL = false; + m_bDISTANCEALPHA = false; + m_bDISTANCEALPHAFROMDETAIL = false; + m_bSOFT_MASK = false; + m_bOUTLINE = false; + m_bOUTER_GLOW = false; + m_bFLASHLIGHTDEPTHFILTERMODE = false; + m_bDEPTHBLEND = false; + m_bBLENDTINTBYBASEALPHA = false; + m_bCUBEMAP_SPHERE_LEGACY = false; +#endif // _DEBUG + } + + int GetIndex() const + { + Assert( m_bDETAILTEXTURE && m_bCUBEMAP && m_bDIFFUSELIGHTING && m_bENVMAPMASK && m_bBASEALPHAENVMAPMASK && m_bSELFILLUM && m_bVERTEXCOLOR && m_bFLASHLIGHT && m_bSELFILLUM_ENVMAPMASK_ALPHA && m_bDETAIL_BLEND_MODE && m_bSEAMLESS_BASE && m_bSEAMLESS_DETAIL && m_bDISTANCEALPHA && m_bDISTANCEALPHAFROMDETAIL && m_bSOFT_MASK && m_bOUTLINE && m_bOUTER_GLOW && m_bFLASHLIGHTDEPTHFILTERMODE && m_bDEPTHBLEND && m_bBLENDTINTBYBASEALPHA && m_bCUBEMAP_SPHERE_LEGACY ); + return ( 6 * m_nDETAILTEXTURE ) + ( 12 * m_nCUBEMAP ) + ( 24 * m_nDIFFUSELIGHTING ) + ( 48 * m_nENVMAPMASK ) + ( 96 * m_nBASEALPHAENVMAPMASK ) + ( 192 * m_nSELFILLUM ) + ( 384 * m_nVERTEXCOLOR ) + ( 768 * m_nFLASHLIGHT ) + ( 1536 * m_nSELFILLUM_ENVMAPMASK_ALPHA ) + ( 3072 * m_nDETAIL_BLEND_MODE ) + ( 30720 * m_nSEAMLESS_BASE ) + ( 61440 * m_nSEAMLESS_DETAIL ) + ( 122880 * m_nDISTANCEALPHA ) + ( 245760 * m_nDISTANCEALPHAFROMDETAIL ) + ( 491520 * m_nSOFT_MASK ) + ( 983040 * m_nOUTLINE ) + ( 1966080 * m_nOUTER_GLOW ) + ( 3932160 * m_nFLASHLIGHTDEPTHFILTERMODE ) + ( 11796480 * m_nDEPTHBLEND ) + ( 23592960 * m_nBLENDTINTBYBASEALPHA ) + ( 47185920 * m_nCUBEMAP_SPHERE_LEGACY ) + 0; + } +}; + +#define shaderStaticTest_vertexlit_and_unlit_generic_ps30 psh_forgot_to_set_static_DETAILTEXTURE + psh_forgot_to_set_static_CUBEMAP + psh_forgot_to_set_static_DIFFUSELIGHTING + psh_forgot_to_set_static_ENVMAPMASK + psh_forgot_to_set_static_BASEALPHAENVMAPMASK + psh_forgot_to_set_static_SELFILLUM + psh_forgot_to_set_static_VERTEXCOLOR + psh_forgot_to_set_static_FLASHLIGHT + psh_forgot_to_set_static_SELFILLUM_ENVMAPMASK_ALPHA + psh_forgot_to_set_static_DETAIL_BLEND_MODE + psh_forgot_to_set_static_SEAMLESS_BASE + psh_forgot_to_set_static_SEAMLESS_DETAIL + psh_forgot_to_set_static_DISTANCEALPHA + psh_forgot_to_set_static_DISTANCEALPHAFROMDETAIL + psh_forgot_to_set_static_SOFT_MASK + psh_forgot_to_set_static_OUTLINE + psh_forgot_to_set_static_OUTER_GLOW + psh_forgot_to_set_static_FLASHLIGHTDEPTHFILTERMODE + psh_forgot_to_set_static_DEPTHBLEND + psh_forgot_to_set_static_BLENDTINTBYBASEALPHA + psh_forgot_to_set_static_CUBEMAP_SPHERE_LEGACY + + +class vertexlit_and_unlit_generic_ps30_Dynamic_Index +{ + unsigned int m_nLIGHTING_PREVIEW : 2; + unsigned int m_nFLASHLIGHTSHADOWS : 2; +#ifdef _DEBUG + bool m_bLIGHTING_PREVIEW : 1; + bool m_bFLASHLIGHTSHADOWS : 1; +#endif // _DEBUG +public: + void SetLIGHTING_PREVIEW( int i ) + { + Assert( i >= 0 && i <= 2 ); + m_nLIGHTING_PREVIEW = i; +#ifdef _DEBUG + m_bLIGHTING_PREVIEW = true; +#endif // _DEBUG + } + + void SetFLASHLIGHTSHADOWS( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nFLASHLIGHTSHADOWS = i; +#ifdef _DEBUG + m_bFLASHLIGHTSHADOWS = true; +#endif // _DEBUG + } + + vertexlit_and_unlit_generic_ps30_Dynamic_Index() + { + m_nLIGHTING_PREVIEW = 0; + m_nFLASHLIGHTSHADOWS = 0; +#ifdef _DEBUG + m_bLIGHTING_PREVIEW = false; + m_bFLASHLIGHTSHADOWS = false; +#endif // _DEBUG + } + + int GetIndex() const + { + Assert( m_bLIGHTING_PREVIEW && m_bFLASHLIGHTSHADOWS ); + return ( 1 * m_nLIGHTING_PREVIEW ) + ( 3 * m_nFLASHLIGHTSHADOWS ) + 0; + } +}; + +#define shaderDynamicTest_vertexlit_and_unlit_generic_ps30 psh_forgot_to_set_dynamic_LIGHTING_PREVIEW + psh_forgot_to_set_dynamic_FLASHLIGHTSHADOWS + + +#endif // VERTEXLIT_AND_UNLIT_GENERIC_PS30_H diff --git a/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_vs30.inc b/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_vs30.inc index 7473d292..1d62b01f 100644 --- a/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_vs30.inc +++ b/materialsystem/stdshaders/fxctmp9/vertexlit_and_unlit_generic_vs30.inc @@ -1,462 +1,263 @@ -#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 +// ALL SKIP STATEMENTS THAT AFFECT THIS SHADER!!! +// ($SEPARATE_DETAIL_UVS) && ($SEAMLESS_DETAIL) +// ($DONT_GAMMA_CONVERT_VERTEX_COLOR && ( ! $VERTEXCOLOR ) ) +// defined $LIGHTING_PREVIEW && defined $FASTPATH && $LIGHTING_PREVIEW && $FASTPATH + +#ifndef VERTEXLIT_AND_UNLIT_GENERIC_VS30_H +#define VERTEXLIT_AND_UNLIT_GENERIC_VS30_H + +#include "shaderapi/ishaderapi.h" +#include "shaderapi/ishadershadow.h" +#include "materialsystem/imaterialvar.h" + +class vertexlit_and_unlit_generic_vs30_Static_Index +{ + unsigned int m_nVERTEXCOLOR : 2; + unsigned int m_nCUBEMAP : 2; + unsigned int m_nHALFLAMBERT : 2; + unsigned int m_nFLASHLIGHT : 2; + unsigned int m_nSEAMLESS_BASE : 2; + unsigned int m_nSEAMLESS_DETAIL : 2; + unsigned int m_nSEPARATE_DETAIL_UVS : 2; + unsigned int m_nDECAL : 2; + unsigned int m_nDONT_GAMMA_CONVERT_VERTEX_COLOR : 2; +#ifdef _DEBUG + bool m_bVERTEXCOLOR : 1; + bool m_bCUBEMAP : 1; + bool m_bHALFLAMBERT : 1; + bool m_bFLASHLIGHT : 1; + bool m_bSEAMLESS_BASE : 1; + bool m_bSEAMLESS_DETAIL : 1; + bool m_bSEPARATE_DETAIL_UVS : 1; + bool m_bDECAL : 1; + bool m_bDONT_GAMMA_CONVERT_VERTEX_COLOR : 1; +#endif // _DEBUG +public: + void SetVERTEXCOLOR( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nVERTEXCOLOR = i; +#ifdef _DEBUG + m_bVERTEXCOLOR = true; +#endif // _DEBUG + } + + void SetCUBEMAP( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nCUBEMAP = i; +#ifdef _DEBUG + m_bCUBEMAP = true; +#endif // _DEBUG + } + + void SetHALFLAMBERT( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nHALFLAMBERT = i; +#ifdef _DEBUG + m_bHALFLAMBERT = true; +#endif // _DEBUG + } + + void SetFLASHLIGHT( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nFLASHLIGHT = i; +#ifdef _DEBUG + m_bFLASHLIGHT = true; +#endif // _DEBUG + } + + void SetSEAMLESS_BASE( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSEAMLESS_BASE = i; +#ifdef _DEBUG + m_bSEAMLESS_BASE = true; +#endif // _DEBUG + } + + void SetSEAMLESS_DETAIL( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSEAMLESS_DETAIL = i; +#ifdef _DEBUG + m_bSEAMLESS_DETAIL = true; +#endif // _DEBUG + } + + void SetSEPARATE_DETAIL_UVS( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSEPARATE_DETAIL_UVS = i; +#ifdef _DEBUG + m_bSEPARATE_DETAIL_UVS = true; +#endif // _DEBUG + } + + void SetDECAL( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nDECAL = i; +#ifdef _DEBUG + m_bDECAL = true; +#endif // _DEBUG + } + + 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 // _DEBUG + } + + vertexlit_and_unlit_generic_vs30_Static_Index() + { + m_nVERTEXCOLOR = 0; + m_nCUBEMAP = 0; + m_nHALFLAMBERT = 0; + m_nFLASHLIGHT = 0; + m_nSEAMLESS_BASE = 0; + m_nSEAMLESS_DETAIL = 0; + m_nSEPARATE_DETAIL_UVS = 0; + m_nDECAL = 0; + m_nDONT_GAMMA_CONVERT_VERTEX_COLOR = 0; +#ifdef _DEBUG + m_bVERTEXCOLOR = false; + m_bCUBEMAP = false; + m_bHALFLAMBERT = false; + m_bFLASHLIGHT = false; + m_bSEAMLESS_BASE = false; + m_bSEAMLESS_DETAIL = false; + m_bSEPARATE_DETAIL_UVS = false; + m_bDECAL = false; + m_bDONT_GAMMA_CONVERT_VERTEX_COLOR = false; +#endif // _DEBUG + } + + int GetIndex() const + { + Assert( 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 ); + return ( 128 * m_nVERTEXCOLOR ) + ( 256 * m_nCUBEMAP ) + ( 512 * m_nHALFLAMBERT ) + ( 1024 * m_nFLASHLIGHT ) + ( 2048 * m_nSEAMLESS_BASE ) + ( 4096 * m_nSEAMLESS_DETAIL ) + ( 8192 * m_nSEPARATE_DETAIL_UVS ) + ( 16384 * m_nDECAL ) + ( 32768 * 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 + + +class vertexlit_and_unlit_generic_vs30_Dynamic_Index +{ + unsigned int m_nCOMPRESSED_VERTS : 2; + unsigned int m_nDYNAMIC_LIGHT : 2; + unsigned int m_nSTATIC_LIGHT : 2; + unsigned int m_nDOWATERFOG : 2; + unsigned int m_nSKINNING : 2; + unsigned int m_nLIGHTING_PREVIEW : 2; + unsigned int m_nMORPHING : 2; +#ifdef _DEBUG + bool m_bCOMPRESSED_VERTS : 1; + bool m_bDYNAMIC_LIGHT : 1; + bool m_bSTATIC_LIGHT : 1; + bool m_bDOWATERFOG : 1; + bool m_bSKINNING : 1; + bool m_bLIGHTING_PREVIEW : 1; + bool m_bMORPHING : 1; +#endif // _DEBUG +public: + void SetCOMPRESSED_VERTS( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nCOMPRESSED_VERTS = i; +#ifdef _DEBUG + m_bCOMPRESSED_VERTS = true; +#endif // _DEBUG + } + + void SetDYNAMIC_LIGHT( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nDYNAMIC_LIGHT = i; +#ifdef _DEBUG + m_bDYNAMIC_LIGHT = true; +#endif // _DEBUG + } + + void SetSTATIC_LIGHT( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSTATIC_LIGHT = i; +#ifdef _DEBUG + m_bSTATIC_LIGHT = true; +#endif // _DEBUG + } + + void SetDOWATERFOG( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nDOWATERFOG = i; +#ifdef _DEBUG + m_bDOWATERFOG = true; +#endif // _DEBUG + } + + void SetSKINNING( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nSKINNING = i; +#ifdef _DEBUG + m_bSKINNING = true; +#endif // _DEBUG + } + + void SetLIGHTING_PREVIEW( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nLIGHTING_PREVIEW = i; +#ifdef _DEBUG + m_bLIGHTING_PREVIEW = true; +#endif // _DEBUG + } + + void SetMORPHING( int i ) + { + Assert( i >= 0 && i <= 1 ); + m_nMORPHING = i; +#ifdef _DEBUG + m_bMORPHING = true; +#endif // _DEBUG + } + + vertexlit_and_unlit_generic_vs30_Dynamic_Index() + { + m_nCOMPRESSED_VERTS = 0; + m_nDYNAMIC_LIGHT = 0; + m_nSTATIC_LIGHT = 0; + m_nDOWATERFOG = 0; + m_nSKINNING = 0; + m_nLIGHTING_PREVIEW = 0; + m_nMORPHING = 0; +#ifdef _DEBUG + m_bCOMPRESSED_VERTS = false; + m_bDYNAMIC_LIGHT = false; + m_bSTATIC_LIGHT = false; + m_bDOWATERFOG = false; + m_bSKINNING = false; + m_bLIGHTING_PREVIEW = false; + m_bMORPHING = false; +#endif // _DEBUG + } + + int GetIndex() const + { + Assert( m_bCOMPRESSED_VERTS && m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT && m_bDOWATERFOG && m_bSKINNING && m_bLIGHTING_PREVIEW && m_bMORPHING ); + return ( 1 * m_nCOMPRESSED_VERTS ) + ( 2 * m_nDYNAMIC_LIGHT ) + ( 4 * m_nSTATIC_LIGHT ) + ( 8 * m_nDOWATERFOG ) + ( 16 * m_nSKINNING ) + ( 32 * m_nLIGHTING_PREVIEW ) + ( 64 * 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 + 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 + + +#endif // VERTEXLIT_AND_UNLIT_GENERIC_VS30_H diff --git a/materialsystem/stdshaders/skin_dx9_helper.cpp b/materialsystem/stdshaders/skin_dx9_helper.cpp index cc999788..1e2d30f3 100644 --- a/materialsystem/stdshaders/skin_dx9_helper.cpp +++ b/materialsystem/stdshaders/skin_dx9_helper.cpp @@ -23,7 +23,7 @@ static ConVar mat_fullbright( "mat_fullbright", "0", FCVAR_CHEAT ); static ConVar r_lightwarpidentity( "r_lightwarpidentity", "0", FCVAR_CHEAT ); -static ConVar r_rimlight( "r_rimlight", "1", FCVAR_NONE ); +static ConVar r_rimlight( "r_rimlight", "1", FCVAR_CHEAT ); // Textures may be bound to the following samplers: // SHADER_SAMPLER0 Base (Albedo) / Gloss in alpha @@ -270,9 +270,6 @@ void DrawSkin_DX9_Internal( CBaseVSShader *pShader, IMaterialVar** params, IShad float flTintReplacementAmount = GetFloatParam( info.m_nTintReplacesBaseColor, params ); - float flPhongExponentFactor = ( info.m_nPhongExponentFactor != -1 ) ? GetFloatParam( info.m_nPhongExponentFactor, params ) : 0.0f; - const bool bHasPhongExponentFactor = flPhongExponentFactor != 0.0f; - BlendType_t nBlendType= pShader->EvaluateBlendRequirements( bBlendTintByBaseAlpha ? -1 : info.m_nBaseTexture, true ); bool bFullyOpaque = (nBlendType != BT_BLENDADD) && (nBlendType != BT_BLEND) && !bIsAlphaTested && !bHasFlashlight; //dest alpha is free for special use @@ -679,7 +676,6 @@ void DrawSkin_DX9_Internal( CBaseVSShader *pShader, IMaterialVar** params, IShad SET_DYNAMIC_PIXEL_SHADER_COMBO( WRITE_DEPTH_TO_DESTALPHA, bWriteDepthToAlpha ); SET_DYNAMIC_PIXEL_SHADER_COMBO( PIXELFOGTYPE, pShaderAPI->GetPixelFogCombo() ); SET_DYNAMIC_PIXEL_SHADER_COMBO( FLASHLIGHTSHADOWS, bFlashlightShadows ); - SET_DYNAMIC_PIXEL_SHADER_COMBO( PHONG_USE_EXPONENT_FACTOR, bHasPhongExponentFactor ); SET_DYNAMIC_PIXEL_SHADER( skin_ps20b ); } #ifndef _X360 @@ -701,7 +697,6 @@ void DrawSkin_DX9_Internal( CBaseVSShader *pShader, IMaterialVar** params, IShad SET_DYNAMIC_PIXEL_SHADER_COMBO( WRITE_DEPTH_TO_DESTALPHA, bWriteDepthToAlpha ); SET_DYNAMIC_PIXEL_SHADER_COMBO( PIXELFOGTYPE, pShaderAPI->GetPixelFogCombo() ); SET_DYNAMIC_PIXEL_SHADER_COMBO( FLASHLIGHTSHADOWS, bFlashlightShadows ); - SET_DYNAMIC_PIXEL_SHADER_COMBO( PHONG_USE_EXPONENT_FACTOR, bHasPhongExponentFactor ); SET_DYNAMIC_PIXEL_SHADER( skin_ps30 ); bool bUnusedTexCoords[3] = { false, false, !pShaderAPI->IsHWMorphingEnabled() || !bIsDecal }; @@ -811,23 +806,15 @@ void DrawSkin_DX9_Internal( CBaseVSShader *pShader, IMaterialVar** params, IShad float vSpecularTint[4] = {1, 1, 1, 4}; pShaderAPI->GetWorldSpaceCameraPosition( vEyePos_SpecExponent ); - // If we have a phong exponent factor, then use that as a multiplier against the texture. - if ( bHasPhongExponentFactor ) + // Use the alpha channel of the normal map for the exponent by default + vEyePos_SpecExponent[3] = -1.f; + if ( (info.m_nPhongExponent != -1) && params[info.m_nPhongExponent]->IsDefined() ) { - vEyePos_SpecExponent[3] = flPhongExponentFactor; - } - else - { - // Use the alpha channel of the normal map for the exponent by default - vEyePos_SpecExponent[3] = -1.f; - if ( (info.m_nPhongExponent != -1) && params[info.m_nPhongExponent]->IsDefined() ) + float fValue = params[info.m_nPhongExponent]->GetFloatValue(); + if ( fValue > 0.f ) { - float fValue = params[info.m_nPhongExponent]->GetFloatValue(); - if ( fValue > 0.f ) - { - // Nonzero value in material overrides map channel - vEyePos_SpecExponent[3] = fValue; - } + // Nonzero value in material overrides map channel + vEyePos_SpecExponent[3] = fValue; } } diff --git a/materialsystem/stdshaders/skin_ps20b.fxc b/materialsystem/stdshaders/skin_ps20b.fxc index 8d2e3204..20c3eef9 100644 --- a/materialsystem/stdshaders/skin_ps20b.fxc +++ b/materialsystem/stdshaders/skin_ps20b.fxc @@ -24,8 +24,6 @@ // DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..1" [ps30] // DYNAMIC: "FLASHLIGHTSHADOWS" "0..1" [ps20b] // DYNAMIC: "FLASHLIGHTSHADOWS" "0..1" [ps30] -// DYNAMIC: "PHONG_USE_EXPONENT_FACTOR" "0..0" [ps20] -// DYNAMIC: "PHONG_USE_EXPONENT_FACTOR" "0..1" [ps20b] [ps30] [PC] // SKIP: ($PIXELFOGTYPE == 0) && ($WRITEWATERFOGTODESTALPHA != 0) @@ -78,9 +76,7 @@ const float4 g_EyePos_SpecExponent : register( PSREG_EYEPOS_SPEC_EXPONENT ); const float4 g_FogParams : register( PSREG_FOG_PARAMS ); const float4 g_FlashlightAttenuationFactors_RimMask : register( PSREG_FLASHLIGHT_ATTENUATION ); // On non-flashlight pass, x has rim mask control const float4 g_FlashlightPos_RimBoost : register( PSREG_FLASHLIGHT_POSITION_RIM_BOOST ); -#if FLASHLIGHT - const float4x4 g_FlashlightWorldToTexture : register( PSREG_FLASHLIGHT_TO_WORLD_TEXTURE ); -#endif +const float4x4 g_FlashlightWorldToTexture : register( PSREG_FLASHLIGHT_TO_WORLD_TEXTURE ); const float4 g_FresnelSpecParams : register( PSREG_FRESNEL_SPEC_PARAMS ); // xyz are fresnel, w is specular boost const float4 g_SpecularRimParams : register( PSREG_SPEC_RIM_PARAMS ); // xyz are specular tint color, w is rim power PixelShaderLightInfo cLightInfo[3] : register( PSREG_LIGHT_INFO_ARRAY ); // 2 registers each - 6 registers total (4th light spread across w's) @@ -100,7 +96,6 @@ const float4 g_ShaderControls : register( PSREG_CONSTANT_27 ); // x is #define g_fTintReplacementControl g_ShaderControls.z #define g_fInvertPhongMask g_ShaderControls.w - sampler BaseTextureSampler : register( s0 ); // Base map, selfillum in alpha sampler SpecularWarpSampler : register( s1 ); // Specular warp sampler (for iridescence etc) sampler DiffuseWarpSampler : register( s2 ); // Lighting warp sampler (1D texture for diffuse lighting modification) @@ -124,6 +119,7 @@ sampler DetailSampler : register( s13 ); // detail texture sampler SelfIllumMaskSampler : register( s14 ); // selfillummask + struct PS_INPUT { float4 baseTexCoordDetailTexCoord : TEXCOORD0; // xy=base zw=detail @@ -262,11 +258,7 @@ float4 main( PS_INPUT i ) : COLOR [flatten] #endif -#if ( PHONG_USE_EXPONENT_FACTOR ) - fSpecExp = ( 1.0f + g_EyePos_SpecExponent.w * vSpecExpMap.r ); -#else fSpecExp = (g_EyePos_SpecExponent.w >= 0.0) ? g_EyePos_SpecExponent.w : (1.0f + 149.0f * vSpecExpMap.r); -#endif // If constant tint is negative, tint with albedo, based upon scalar tint map #if defined( _X360 ) @@ -294,17 +286,15 @@ float4 main( PS_INPUT i ) : COLOR } else { - #if FLASHLIGHT - float4 flashlightSpacePosition = mul( float4( vWorldPos, 1.0f ), g_FlashlightWorldToTexture ); + float4 flashlightSpacePosition = mul( float4( vWorldPos, 1.0f ), g_FlashlightWorldToTexture ); - DoSpecularFlashlight( g_FlashlightPos, vWorldPos, flashlightSpacePosition, worldSpaceNormal, - g_FlashlightAttenuationFactors.xyz, g_FlashlightAttenuationFactors.w, - FlashlightSampler, ShadowDepthSampler, NormalizeRandRotSampler, FLASHLIGHTDEPTHFILTERMODE, FLASHLIGHTSHADOWS, true, vProjPos.xy / vProjPos.z, - fSpecExp, vEyeDir, bDoSpecularWarp, SpecularWarpSampler, fFresnelRanges, g_EnvmapTint_ShadowTweaks, + DoSpecularFlashlight( g_FlashlightPos, vWorldPos, flashlightSpacePosition, worldSpaceNormal, + g_FlashlightAttenuationFactors.xyz, g_FlashlightAttenuationFactors.w, + FlashlightSampler, ShadowDepthSampler, NormalizeRandRotSampler, FLASHLIGHTDEPTHFILTERMODE, FLASHLIGHTSHADOWS, true, vProjPos.xy / vProjPos.z, + fSpecExp, vEyeDir, bDoSpecularWarp, SpecularWarpSampler, fFresnelRanges, g_EnvmapTint_ShadowTweaks, - // These two values are output - diffuseLighting, specularLighting ); - #endif + // These two values are output + diffuseLighting, specularLighting ); } // If we didn't already apply Fresnel to specular warp, modulate the specular diff --git a/materialsystem/stdshaders/vertexlit_and_unlit_generic_ps2x.fxc b/materialsystem/stdshaders/vertexlit_and_unlit_generic_ps2x.fxc index eb3cbfac..1d1a47d0 100644 --- a/materialsystem/stdshaders/vertexlit_and_unlit_generic_ps2x.fxc +++ b/materialsystem/stdshaders/vertexlit_and_unlit_generic_ps2x.fxc @@ -31,9 +31,6 @@ // DYNAMIC: "LIGHTING_PREVIEW" "0..0" [XBOX] // DYNAMIC: "FLASHLIGHTSHADOWS" "0..1" [ps20b] // DYNAMIC: "FLASHLIGHTSHADOWS" "0..1" [ps30] -// DYNAMIC: "STATIC_LIGHT_LIGHTMAP" "0..1" [ps20b] [ps30] -// DYNAMIC: "STATIC_LIGHT_LIGHTMAP" "0..0" [ps20] -// DYNAMIC: "DEBUG_LUXELS" "0..1" [ps20b] [ps30] // detail blend mode 6 = ps20b only // SKIP: $DETAIL_BLEND_MODE == 6 [ps20] @@ -74,9 +71,6 @@ // SKIP: $CUBEMAP_SPHERE_LEGACY && ($CUBEMAP == 0) -// Debugging luxels only makes sense if we have lightmaps on this geometry. -// SKIP: ($STATIC_LIGHT_LIGHTMAP == 0) && ($DEBUG_LUXELS == 1) - #include "common_flashlight_fxc.h" #include "common_vertexlitgeneric_dx9.h" @@ -111,7 +105,6 @@ sampler FlashlightSampler : register( s7 ); sampler ShadowDepthSampler : register( s8 ); // Flashlight shadow depth map sampler sampler DepthSampler : register( s10 ); //depth buffer sampler for depth blending sampler SelfIllumMaskSampler : register( s11 ); // selfillummask -sampler LightMapSampler : register( s12 ); struct PS_INPUT { @@ -174,10 +167,6 @@ const float4 g_OutlineParams : register( c9 ); const float3 g_DetailTint : register( c10 ); #endif -#if DEBUG_LUXELS -const float4 g_LuxelScale : register( c11 ); -#endif - // Calculate unified fog float CalcPixelFogFactorConst( float fPixelFogType, const float4 fogParams, const float flEyePosZ, const float flWorldPosZ, const float flProjPosZ ) @@ -342,24 +331,12 @@ float4 main( PS_INPUT i ) : COLOR } float3 diffuseLighting = float3( 1.0f, 1.0f, 1.0f ); - if( bDiffuseLighting || bVertexColor ) + if( bDiffuseLighting || bVertexColor && !( bVertexColor && bDiffuseLighting ) ) { diffuseLighting = i.color.rgb; } -#if STATIC_LIGHT_LIGHTMAP - // This matches the behavior of vertex lighting, which multiplies by cOverbright (which is not accessible here) - // And converts from Gamma space to Linear space before being used. - float2 lightmapTexCoords = i.baseTexCoord.xy; - #if DEBUG_LUXELS - lightmapTexCoords.xy *= g_LuxelScale.xy; - #endif - float3 f3LightmapColor = GammaToLinear( 2.0f * tex2D( LightMapSampler, lightmapTexCoords ).rgb ); - diffuseLighting = f3LightmapColor; -#endif - float3 albedo = baseColor; - if (bBlendTintByBaseAlpha) { float3 tintedColor = albedo * g_DiffuseModulation.rgb; diff --git a/materialsystem/stdshaders/vertexlit_and_unlit_generic_vs20.fxc b/materialsystem/stdshaders/vertexlit_and_unlit_generic_vs20.fxc index 0a85a979..9db6f864 100644 --- a/materialsystem/stdshaders/vertexlit_and_unlit_generic_vs20.fxc +++ b/materialsystem/stdshaders/vertexlit_and_unlit_generic_vs20.fxc @@ -12,8 +12,7 @@ // STATIC: "DONT_GAMMA_CONVERT_VERTEX_COLOR" "0..1" // DYNAMIC: "COMPRESSED_VERTS" "0..1" // DYNAMIC: "DYNAMIC_LIGHT" "0..1" -// DYNAMIC: "STATIC_LIGHT_VERTEX" "0..1" -// DYNAMIC: "STATIC_LIGHT_LIGHTMAP" "0..1" +// DYNAMIC: "STATIC_LIGHT" "0..1" // DYNAMIC: "DOWATERFOG" "0..1" // DYNAMIC: "SKINNING" "0..1" // DYNAMIC: "LIGHTING_PREVIEW" "0..1" [PC] @@ -102,7 +101,9 @@ struct VS_OUTPUT #endif float4 color : TEXCOORD2; // Vertex color (from lighting or unlit) +#if CUBEMAP || _X360 float3 worldVertToEyeVector : TEXCOORD3; // Necessary for cubemaps +#endif float3 worldSpaceNormal : TEXCOORD4; // Necessary for cubemaps and flashlight @@ -124,7 +125,7 @@ VS_OUTPUT main( const VS_INPUT v ) VS_OUTPUT o = ( VS_OUTPUT )0; bool bDynamicLight = DYNAMIC_LIGHT ? true : false; - bool bStaticLight = STATIC_LIGHT_VERTEX ? true : false; + bool bStaticLight = STATIC_LIGHT ? true : false; bool bDoLighting = !g_bVertexColor && (bDynamicLight || bStaticLight); float4 vPosition = v.vPos; diff --git a/materialsystem/stdshaders/vertexlitgeneric_dx9.cpp b/materialsystem/stdshaders/vertexlitgeneric_dx9.cpp index 5e7e61e9..47105813 100644 --- a/materialsystem/stdshaders/vertexlitgeneric_dx9.cpp +++ b/materialsystem/stdshaders/vertexlitgeneric_dx9.cpp @@ -41,7 +41,6 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" ) SHADER_PARAM( SELFILLUMFRESNELMINMAXEXP, SHADER_PARAM_TYPE_VEC4, "0", "Self illum fresnel min, max, exp" ) SHADER_PARAM( ALPHATESTREFERENCE, SHADER_PARAM_TYPE_FLOAT, "0.0", "" ) SHADER_PARAM( FLASHLIGHTNOLAMBERT, SHADER_PARAM_TYPE_BOOL, "0", "Flashlight pass sets N.L=1.0" ) - SHADER_PARAM( LIGHTMAP, SHADER_PARAM_TYPE_TEXTURE, "shadertest/BaseTexture", "lightmap texture--will be bound by the engine") // Debugging term for visualizing ambient data on its own SHADER_PARAM( AMBIENTONLY, SHADER_PARAM_TYPE_INTEGER, "0", "Control drawing of non-ambient light ()" ) @@ -54,7 +53,6 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" ) SHADER_PARAM( PHONGFRESNELRANGES, SHADER_PARAM_TYPE_VEC3, "[0 0.5 1]", "Parameters for remapping fresnel output" ) SHADER_PARAM( PHONGBOOST, SHADER_PARAM_TYPE_FLOAT, "1.0", "Phong overbrightening factor (specular mask channel should be authored to account for this)" ) SHADER_PARAM( PHONGEXPONENTTEXTURE, SHADER_PARAM_TYPE_TEXTURE, "shadertest/BaseTexture", "Phong Exponent map" ) - SHADER_PARAM( PHONGEXPONENTFACTOR, SHADER_PARAM_TYPE_FLOAT, "0.0", "When using a phong exponent texture, this will be multiplied by the 0..1 that comes out of the texture." ) SHADER_PARAM( PHONG, SHADER_PARAM_TYPE_BOOL, "0", "enables phong lighting" ) SHADER_PARAM( BASEMAPALPHAPHONGMASK, SHADER_PARAM_TYPE_INTEGER, "0", "indicates that there is no normal map and that the phong mask is in base alpha" ) SHADER_PARAM( INVERTPHONGMASK, SHADER_PARAM_TYPE_INTEGER, "0", "invert the phong mask (0=full phong, 1=no phong)" ) @@ -165,7 +163,6 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" ) info.m_nEnvmapSaturation = ENVMAPSATURATION; info.m_nAlphaTestReference = ALPHATESTREFERENCE; info.m_nFlashlightNoLambert = FLASHLIGHTNOLAMBERT; - info.m_nLightmap = LIGHTMAP; info.m_nFlashlightTexture = FLASHLIGHTTEXTURE; info.m_nFlashlightTextureFrame = FLASHLIGHTTEXTUREFRAME; @@ -181,7 +178,6 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" ) info.m_nDiffuseWarpTexture = LIGHTWARPTEXTURE; info.m_nPhongWarpTexture = PHONGWARPTEXTURE; info.m_nPhongBoost = PHONGBOOST; - info.m_nPhongExponentFactor = PHONGEXPONENTFACTOR; info.m_nPhongFresnelRanges = PHONGFRESNELRANGES; info.m_nPhong = PHONG; info.m_nBaseMapAlphaPhongMask = BASEMAPALPHAPHONGMASK; diff --git a/materialsystem/stdshaders/vertexlitgeneric_dx9_helper.cpp b/materialsystem/stdshaders/vertexlitgeneric_dx9_helper.cpp index d3fd54f7..e08cc497 100644 --- a/materialsystem/stdshaders/vertexlitgeneric_dx9_helper.cpp +++ b/materialsystem/stdshaders/vertexlitgeneric_dx9_helper.cpp @@ -32,7 +32,6 @@ static ConVar mat_fullbright( "mat_fullbright","0", FCVAR_CHEAT ); static ConVar r_lightwarpidentity( "r_lightwarpidentity","0", FCVAR_CHEAT ); -static ConVar mat_luxels( "mat_luxels", "0", FCVAR_CHEAT ); static inline bool WantsSkinShader( IMaterialVar** params, const VertexLitGeneric_DX9_Vars_t &info ) @@ -383,8 +382,7 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial bool bIsAlphaTested = IS_FLAG_SET( MATERIAL_VAR_ALPHATEST ) != 0; bool bHasDiffuseWarp = (!bHasFlashlight || IsX360() ) && hasDiffuseLighting && (info.m_nDiffuseWarpTexture != -1) && params[info.m_nDiffuseWarpTexture]->IsTexture(); - bool bHasLightmapTexture = IsTextureSet( info.m_nLightmap, params ); - bool bHasMatLuxel = bHasLightmapTexture && mat_luxels.GetBool(); + //bool bNoCull = IS_FLAG_SET( MATERIAL_VAR_NOCULL ); bool bFlashlightNoLambert = false; @@ -624,11 +622,6 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial pShaderShadow->EnableTexture( SHADER_SAMPLER11, true ); // self illum mask } - - // Always enable this sampler, used for lightmaps depending on the dynamic combo. - // Lightmaps are generated in gamma space, but not sRGB, so leave that disabled. Conversion is done in the shader. - pShaderShadow->EnableTexture( SHADER_SAMPLER12, true ); - bool bSRGBWrite = true; if( (info.m_nLinearWrite != -1) && (params[info.m_nLinearWrite]->GetIntValue() == 1) ) { @@ -1195,32 +1188,12 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial // Set up light combo state - LightState_t lightState = { 0, false, false, false }; + LightState_t lightState = {0, false, false}; if ( bVertexLitGeneric && (!bHasFlashlight || IsX360() ) ) { pShaderAPI->GetDX9LightState( &lightState ); } - // Override the lighting desired if we have a lightmap set! - if ( bHasLightmapTexture ) - { - lightState.m_bStaticLightVertex = false; - lightState.m_bStaticLightTexel = true; - - // Usual case, not debugging. - if (!bHasMatLuxel) - { - pShader->BindTexture(SHADER_SAMPLER12, info.m_nLightmap); - } - else - { - float dimensions[] = { 0.0f, 0.0f, 0.0f, 0.0f }; - DynamicCmdsOut.BindStandardTexture( SHADER_SAMPLER12, TEXTURE_DEBUG_LUXELS ); - pShader->GetTextureDimensions( &dimensions[0], &dimensions[1], info.m_nLightmap ); - DynamicCmdsOut.SetPixelShaderConstant( 11, dimensions, 1 ); - } - } - MaterialFogMode_t fogType = pShaderAPI->GetSceneFogMode(); int fogIndex = ( fogType == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ) ? 1 : 0; int numBones = pShaderAPI->GetCurrentNumBones(); @@ -1316,8 +1289,7 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial DECLARE_DYNAMIC_VERTEX_SHADER( vertexlit_and_unlit_generic_vs20 ); SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, lightState.HasDynamicLight() ); - SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_VERTEX, lightState.m_bStaticLightVertex ? 1 : 0 ); - SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_LIGHTMAP, lightState.m_bStaticLightTexel ? 1 : 0); + SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLightVertex ? 1 : 0 ); SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, fogIndex ); SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, numBones > 0 ); SET_DYNAMIC_VERTEX_SHADER_COMBO( @@ -1334,8 +1306,6 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial // SET_DYNAMIC_PIXEL_SHADER_COMBO( PIXELFOGTYPE, pShaderAPI->GetPixelFogCombo() ); SET_DYNAMIC_PIXEL_SHADER_COMBO( FLASHLIGHTSHADOWS, bFlashlightShadows ); - SET_DYNAMIC_PIXEL_SHADER_COMBO( STATIC_LIGHT_LIGHTMAP, lightState.m_bStaticLightTexel ? 1 : 0 ); - SET_DYNAMIC_PIXEL_SHADER_COMBO( DEBUG_LUXELS, bHasMatLuxel ? 1 : 0 ); SET_DYNAMIC_PIXEL_SHADER_COMBO( LIGHTING_PREVIEW, pShaderAPI->GetIntRenderingParameter(INT_RENDERPARM_ENABLE_FIXED_LIGHTING) ); @@ -1345,7 +1315,6 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial { DECLARE_DYNAMIC_PIXEL_SHADER( vertexlit_and_unlit_generic_ps20 ); SET_DYNAMIC_PIXEL_SHADER_COMBO( PIXELFOGTYPE, pShaderAPI->GetPixelFogCombo() ); - SET_DYNAMIC_PIXEL_SHADER_COMBO( STATIC_LIGHT_LIGHTMAP, lightState.m_bStaticLightTexel ? 1 : 0 ); SET_DYNAMIC_PIXEL_SHADER_COMBO( LIGHTING_PREVIEW, pShaderAPI->GetIntRenderingParameter(INT_RENDERPARM_ENABLE_FIXED_LIGHTING) ); @@ -1359,8 +1328,7 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial DECLARE_DYNAMIC_VERTEX_SHADER( vertexlit_and_unlit_generic_vs30 ); SET_DYNAMIC_VERTEX_SHADER_COMBO( DYNAMIC_LIGHT, lightState.HasDynamicLight() ); - SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_VERTEX, lightState.m_bStaticLightVertex ? 1 : 0 ); - SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT_LIGHTMAP, lightState.m_bStaticLightTexel ? 1 : 0 ); + SET_DYNAMIC_VERTEX_SHADER_COMBO( STATIC_LIGHT, lightState.m_bStaticLightVertex ? 1 : 0 ); SET_DYNAMIC_VERTEX_SHADER_COMBO( DOWATERFOG, fogIndex ); SET_DYNAMIC_VERTEX_SHADER_COMBO( SKINNING, numBones > 0 ); SET_DYNAMIC_VERTEX_SHADER_COMBO( LIGHTING_PREVIEW, @@ -1372,8 +1340,6 @@ static void DrawVertexLitGeneric_DX9_Internal( CBaseVSShader *pShader, IMaterial DECLARE_DYNAMIC_PIXEL_SHADER( vertexlit_and_unlit_generic_ps30 ); // SET_DYNAMIC_PIXEL_SHADER_COMBO( PIXELFOGTYPE, pShaderAPI->GetPixelFogCombo() ); SET_DYNAMIC_PIXEL_SHADER_COMBO( FLASHLIGHTSHADOWS, bFlashlightShadows ); - SET_DYNAMIC_PIXEL_SHADER_COMBO( STATIC_LIGHT_LIGHTMAP, lightState.m_bStaticLightTexel ? 1 : 0 ); - SET_DYNAMIC_PIXEL_SHADER_COMBO( DEBUG_LUXELS, bHasMatLuxel ? 1 : 0 ); SET_DYNAMIC_PIXEL_SHADER_COMBO( LIGHTING_PREVIEW, pShaderAPI->GetIntRenderingParameter(INT_RENDERPARM_ENABLE_FIXED_LIGHTING) ); SET_DYNAMIC_PIXEL_SHADER_CMD( DynamicCmdsOut, vertexlit_and_unlit_generic_ps30 ); diff --git a/materialsystem/stdshaders/vertexlitgeneric_dx9_helper.h b/materialsystem/stdshaders/vertexlitgeneric_dx9_helper.h index 5820dbeb..0b5b02e4 100644 --- a/materialsystem/stdshaders/vertexlitgeneric_dx9_helper.h +++ b/materialsystem/stdshaders/vertexlitgeneric_dx9_helper.h @@ -54,7 +54,6 @@ struct VertexLitGeneric_DX9_Vars_t int m_nFlashlightNoLambert; int m_nFlashlightTexture; int m_nFlashlightTextureFrame; - int m_nLightmap; int m_nSelfIllumTint; int m_nSelfIllumFresnel; @@ -68,7 +67,6 @@ struct VertexLitGeneric_DX9_Vars_t int m_nPhongWarpTexture; int m_nPhongBoost; int m_nPhongFresnelRanges; - int m_nPhongExponentFactor; int m_nSelfIllumEnvMapMask_Alpha; int m_nAmbientOnly; int m_nHDRColorScale; @@ -132,6 +130,7 @@ struct VertexLitGeneric_DX9_Vars_t int m_nBlendTintByBaseAlpha; int m_nTintReplacesBaseColor; + }; void InitParamsVertexLitGeneric_DX9( CBaseVSShader *pShader, IMaterialVar** params, const char *pMaterialName, bool bVertexLitGeneric, VertexLitGeneric_DX9_Vars_t &info );