mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-17 20:10:21 +03:00
Initial Mapbase commit (squashed from mapbase-beta)
This commit is contained in:
@@ -11,10 +11,13 @@
|
||||
#include "emissive_scroll_blended_pass_helper.h"
|
||||
#include "cloak_blended_pass_helper.h"
|
||||
#include "flesh_interior_blended_pass_helper.h"
|
||||
|
||||
#ifdef GAME_SHADER_DLL
|
||||
#include "weapon_sheen_pass_helper.h"
|
||||
#endif
|
||||
|
||||
|
||||
BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
BEGIN_VS_SHADER( SDK_VertexLitGeneric, "Help for SDK_VertexLitGeneric" )
|
||||
BEGIN_SHADER_PARAMS
|
||||
SHADER_PARAM( ALBEDO, SHADER_PARAM_TYPE_TEXTURE, "shadertest/BaseTexture", "albedo (Base texture with no baked lighting)" )
|
||||
SHADER_PARAM( COMPRESS, SHADER_PARAM_TYPE_TEXTURE, "shadertest/BaseTexture", "compression wrinklemap" )
|
||||
@@ -92,6 +95,7 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
SHADER_PARAM( CLOAKCOLORTINT, SHADER_PARAM_TYPE_COLOR, "[1 1 1]", "Cloak color tint" )
|
||||
SHADER_PARAM( REFRACTAMOUNT, SHADER_PARAM_TYPE_FLOAT, "2", "" )
|
||||
|
||||
#ifdef GAME_SHADER_DLL
|
||||
// Weapon Sheen Pass
|
||||
SHADER_PARAM( SHEENPASSENABLED, SHADER_PARAM_TYPE_BOOL, "0", "Enables weapon sheen render in a second pass" )
|
||||
SHADER_PARAM( SHEENMAP, SHADER_PARAM_TYPE_TEXTURE, "shadertest/shadertest_env", "sheenmap" )
|
||||
@@ -104,6 +108,7 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
SHADER_PARAM( SHEENMAPMASKOFFSETY, SHADER_PARAM_TYPE_FLOAT, "0", "Y Offset of the mask relative to model space coords of target" )
|
||||
SHADER_PARAM( SHEENMAPMASKDIRECTION, SHADER_PARAM_TYPE_INTEGER, "0", "The direction the sheen should move (length direction of weapon) XYZ, 0,1,2" )
|
||||
SHADER_PARAM( SHEENINDEX, SHADER_PARAM_TYPE_INTEGER, "0", "Index of the Effect Type (Color Additive, Override etc...)" )
|
||||
#endif
|
||||
|
||||
// Flesh Interior Pass
|
||||
SHADER_PARAM( FLESHINTERIORENABLED, SHADER_PARAM_TYPE_BOOL, "0", "Enable Flesh interior blend pass" )
|
||||
@@ -134,6 +139,10 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
|
||||
SHADER_PARAM( BLENDTINTBYBASEALPHA, SHADER_PARAM_TYPE_BOOL, "0", "Use the base alpha to blend in the $color modulation")
|
||||
SHADER_PARAM( BLENDTINTCOLOROVERBASE, SHADER_PARAM_TYPE_FLOAT, "0", "blend between tint acting as a multiplication versus a replace" )
|
||||
|
||||
#ifdef MAPBASE
|
||||
SHADER_PARAM( PHONGDISABLEHALFLAMBERT, SHADER_PARAM_TYPE_BOOL, "0", "Disable half lambert for phong" )
|
||||
#endif
|
||||
END_SHADER_PARAMS
|
||||
|
||||
void SetupVars( VertexLitGeneric_DX9_Vars_t& info )
|
||||
@@ -209,6 +218,10 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
info.m_nSelfIllumMask = SELFILLUMMASK;
|
||||
info.m_nBlendTintByBaseAlpha = BLENDTINTBYBASEALPHA;
|
||||
info.m_nTintReplacesBaseColor = BLENDTINTCOLOROVERBASE;
|
||||
|
||||
#ifdef MAPBASE
|
||||
info.m_nPhongDisableHalfLambert = PHONGDISABLEHALFLAMBERT;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Cloak Pass
|
||||
@@ -224,6 +237,7 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
info.m_nBumpTransform = BUMPTRANSFORM;
|
||||
}
|
||||
|
||||
#ifdef GAME_SHADER_DLL
|
||||
// Weapon Sheen Pass
|
||||
void SetupVarsWeaponSheenPass( WeaponSheenPassVars_t &info )
|
||||
{
|
||||
@@ -242,6 +256,7 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
info.m_nBumpFrame = BUMPFRAME;
|
||||
info.m_nBumpTransform = BUMPTRANSFORM;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool NeedsPowerOfTwoFrameBufferTexture( IMaterialVar **params, bool bCheckSpecificToThisFrame ) const
|
||||
{
|
||||
@@ -253,8 +268,11 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
return true;
|
||||
// else, not cloaking this frame, so check flag2 in case the base material still needs it
|
||||
}
|
||||
|
||||
#ifdef GAME_SHADER_DLL
|
||||
if ( params[SHEENPASSENABLED]->GetIntValue() ) // If material supports weapon sheen
|
||||
return true;
|
||||
#endif
|
||||
|
||||
// Check flag2 if not drawing cloak pass
|
||||
return IS_FLAG2_SET( MATERIAL_VAR2_NEEDS_POWER_OF_TWO_FRAME_BUFFER_TEXTURE );
|
||||
@@ -331,6 +349,7 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
InitParamsCloakBlendedPass( this, params, pMaterialName, info );
|
||||
}
|
||||
|
||||
#ifdef GAME_SHADER_DLL
|
||||
// Sheen Pass
|
||||
if ( !params[SHEENPASSENABLED]->IsDefined() )
|
||||
{
|
||||
@@ -342,6 +361,7 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
SetupVarsWeaponSheenPass( info );
|
||||
InitParamsWeaponSheenPass( this, params, pMaterialName, info );
|
||||
}
|
||||
#endif
|
||||
|
||||
// Emissive Scroll Pass
|
||||
if ( !params[EMISSIVEBLENDENABLED]->IsDefined() )
|
||||
@@ -396,6 +416,7 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
InitCloakBlendedPass( this, params, info );
|
||||
}
|
||||
|
||||
#ifdef GAME_SHADER_DLL
|
||||
// TODO : Only do this if we're in range of the camera
|
||||
// Weapon Sheen
|
||||
if ( params[SHEENPASSENABLED]->GetIntValue() )
|
||||
@@ -404,6 +425,7 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
SetupVarsWeaponSheenPass( info );
|
||||
InitWeaponSheenPass( this, params, info );
|
||||
}
|
||||
#endif
|
||||
|
||||
// Emissive Scroll Pass
|
||||
if ( params[EMISSIVEBLENDENABLED]->GetIntValue() )
|
||||
@@ -449,6 +471,7 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
Draw( false );
|
||||
}
|
||||
|
||||
#ifdef GAME_SHADER_DLL
|
||||
// Weapon sheen pass
|
||||
// only if doing standard as well (don't do it if cloaked)
|
||||
if ( params[SHEENPASSENABLED]->GetIntValue() )
|
||||
@@ -465,6 +488,7 @@ BEGIN_VS_SHADER( VertexLitGeneric, "Help for VertexLitGeneric" )
|
||||
Draw( false );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Cloak Pass
|
||||
if ( params[CLOAKPASSENABLED]->GetIntValue() )
|
||||
|
||||
Reference in New Issue
Block a user