Screenspace General: Difference between revisions
Robotboy655 (talk | contribs) (→Other parameters: fix missing description due to wiki formatting) |
Robotboy655 (talk | contribs) (demote parameter sub headers) |
||
Line 24: | Line 24: | ||
{{MatParam|$VERTEXSHADER|string|Name of the vertex shader to use. {{csgo|since}}{{confirm}} }} | {{MatParam|$VERTEXSHADER|string|Name of the vertex shader to use. {{csgo|since}}{{confirm}} }} | ||
==Custom shader inputs== | === Custom shader inputs === | ||
{{MatParam|$c0_x|float|}} | {{MatParam|$c0_x|float|}} | ||
{{MatParam|$c0_y|float|}} | {{MatParam|$c0_y|float|}} | ||
Line 54: | Line 54: | ||
{{MatParam|$TEXTURE3|texture|}} | {{MatParam|$TEXTURE3|texture|}} | ||
== Other parameters == | === Other parameters === | ||
{{MatParam|$DISABLE_COLOR_WRITES|integer|}} | {{MatParam|$DISABLE_COLOR_WRITES|integer|}} | ||
Revision as of 07:49, 9 January 2025


Screenspace_General
is a Vertex shader available in all Source games since
Source 2007.[confirm] It is most commonly used to draw generic screenspace effects.
Unlike other shaders using screenspaceeffect as its vertex shader, screenspace_general allows developers to easily access and modify its pixel shader, 4 texture samplers and 4 shader register constants.[Clarify]
This can be useful for quickly iterating and testing screen effects, without having to reload all shaders, or recompile stdshaders to define/modify parameters.
Notable usage
dev/halo_add_to_screen
Used by the TF2 Glow Effect (2013 SDK) to help create an outline around models using stencils. It uses the haloaddoutline_ps20 pixel shader to apply cheap blur. $C0_X controls the glow fade value (restricted to 1.0f in code.)
Parameters
Custom shader inputs
$c0_x
$c0_y
$c0_z
$c0_w
$c1_x
$c1_y
$c1_z
$c1_w
$c2_x
$c2_y
$c2_z
$c2_w
$c3_x
$c3_y
$c3_z
$c3_w
$c4_x
$c4_y
$c4_z
$c4_w
$c5_x
$c5_y
$c5_z
$c5_w
Other parameters
$ALPHATESTED
$ALPHA_BLEND
$ALPHA_BLEND_COLOR_OVERLAY
$LINEARREAD_BASETEXTURE
$LINEARREAD_TEXTURE1
$LINEARREAD_TEXTURE2
$LINEARREAD_TEXTURE3
$LINEARWRITE
$VERTEXTRANSFORM
$VERTEXNORMAL
$ALPHABLEND
$MULTIPLYCOLOR
$WRITEALPHA
$WRITEDEPTH
$TCSIZE0
$TCSIZE1
$TCSIZE2
$TCSIZE3
$TCSIZE4
$TCSIZE5
$TCSIZE6
$TCSIZE7
$POINTSAMPLE_BASETEXTURE
$POINTSAMPLE_TEXTURE1
$POINTSAMPLE_TEXTURE2
$POINTSAMPLE_TEXTURE3
$VIEWPROJMAT
$INVVIEWPROJMAT
$BlendOpMin
Tools
An SDK to easily create custom pixel shaders for any Source game is available here: ficool2/sdk_screenspace_shaders.
