mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-06-07 19:32:09 +03:00
- Experimental RPC stuff for the future - Fixed players running over allies with vehicles (kind of) - Modified redirect filter infrastructure to support when there's no target filter (meaning it will just make sure the entity exists) - Fixed SDK_EyeRefract - Fixed env_beam SetStart/EndEntity - New "OnStateChange" output on NPCs - scripted_face removed (use generic facing VCDs instead) - Fixed RPC - View ID nodraw keyvalue + reflective glass view ID fix - CopyAnimationDataFrom expansion (more variables copied) - Fixed pre-Mapbase env_projectedtextures not updating after loading a save - Fixed(?) player companion grenade throwing being interrupted - Added convars for secondary and NPC shotgun pellet amounts - NPC fade distance/scale transfers to its ragdoll - Made node graph rebuild occur sooner after map load - Added option to disable "node graph out of date" message - Fixed ent_fire delay (decimals discarded before) - "SetFilter" on func_clip_vphysics - Fixed func_tank zero barrel (untested) - Fixed npc_turret_ground parenting fix - Added toggle-able weapon_crossbow experimental hit location code - Fixed ally grenades being considered Combine grenades - Added SDK_MonitorScreen and SDK_UnlitTwoTexture - Updated README - Added !activator/!caller support to logic_collision_pair - Fixed ortho not working in script_intro - Added Nbc66's closed captioning language fix - Applied fade fix to server ragdolls - Added combine_mine friend/foe filters - Fixed env_starfield pausing - Reworked PickupWeapon/Item inputs - Fixed context response system $ usage - Fixed env_break_shooter velocity/speed - Made func_breakable "Spawn on break" support other entities - Fixed OnThrowGrenade > point_entity_replace blip - Added mapname to logic_externaldata - Added "Random Template" to point_template - Added "Use LOS" to trigger_look - Added flags based on L4D(2) to trigger_playermovement - Added npc_combine_s "Alternate Capable" keyvalue that enables both grenades and alt-fire at the same time regardless of elite status - Fixed npc_combine_s DropGrenade input - Miscellaneous code and comment changes
56 lines
2.0 KiB
Plaintext
56 lines
2.0 KiB
Plaintext
//========== Copyright (c) Valve Corporation, All rights reserved. ==========//
|
|
//paired with unlittwotexture_vs20
|
|
|
|
// STATIC: "TEXTURE2" "0..1"
|
|
|
|
// DYNAMIC: "PIXELFOGTYPE" "0..1"
|
|
// DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..1" [ps20b] [PC]
|
|
// DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..0" [ps20b] [XBOX]
|
|
|
|
#if defined( SHADER_MODEL_PS_2_0 )
|
|
# define WRITE_DEPTH_TO_DESTALPHA 0
|
|
#endif
|
|
|
|
#include "shader_constant_register_map.h"
|
|
#include "common_ps_fxc.h"
|
|
|
|
sampler BaseTextureSampler : register( s0 );
|
|
sampler SecondaryTextureSampler : register( s1 );
|
|
|
|
|
|
const float4 g_Contrast : register( c1 );
|
|
const float4 g_Saturation : register( c2 );
|
|
const float4 g_Tint : register( c3 );
|
|
const float4 g_FogParams : register( PSREG_FOG_PARAMS );
|
|
const float4 g_EyePos_SpecExponent : register( PSREG_EYEPOS_SPEC_EXPONENT );
|
|
|
|
#define g_Grey float4( 0.33333f, 0.33333f, 0.33333f, 0.33333f )
|
|
|
|
struct PS_INPUT
|
|
{
|
|
float2 vTexCoord0 : TEXCOORD0;
|
|
float2 vTexCoord1 : TEXCOORD1;
|
|
|
|
float4 vColor : COLOR0;
|
|
|
|
float4 worldPos_projPosZ : TEXCOORD7;
|
|
};
|
|
|
|
float4 main( PS_INPUT i ) : COLOR
|
|
{
|
|
float4 resultColor = tex2D( BaseTextureSampler, i.vTexCoord0 ) * i.vColor; // base texture modulated with vertex color
|
|
|
|
#if (TEXTURE2 == 1)
|
|
resultColor = tex2D( SecondaryTextureSampler, i.vTexCoord1 ) * resultColor; // modulate base color by another texture
|
|
#endif
|
|
|
|
float3 tempColor = resultColor.rgb * resultColor.rgb; //base * base
|
|
resultColor.rgb = lerp( resultColor.rgb, tempColor.rgb, g_Contrast.rgb ); // blend between color and color * color
|
|
tempColor = dot( resultColor.rgb, g_Grey ); // color greyscaled
|
|
resultColor.rgb = lerp( tempColor.rgb, resultColor.rgb, g_Saturation.rgb ); // blend between color and greyscale
|
|
resultColor.rgb = resultColor.rgb * g_Tint.rgb; // tint
|
|
|
|
float fogFactor = CalcPixelFogFactor( PIXELFOGTYPE, g_FogParams, g_EyePos_SpecExponent.xyz, i.worldPos_projPosZ.xyz, i.worldPos_projPosZ.w );
|
|
return FinalOutput( resultColor, fogFactor, PIXELFOGTYPE, TONEMAP_SCALE_NONE, (WRITE_DEPTH_TO_DESTALPHA != 0), i.worldPos_projPosZ.w );
|
|
}
|