screenspace_general
Description
This shader is a wrapper for providing custom pixel and vertex shaders, while it is named screenspace_general
there is nothing inherently screenspace
only about this shader, it is merely the name that was chosen before it received extra functionality that allowed it to do more than just screenspace work, as such this is a general shader that can be used on brushes, decals, info_overlays, models, and more.
The following content paths are supported: MOD, BSP, THIRDPARTY
Source Engine games use the game/shaders/fxc
(GMod uses the garrysmod/shaders/fxc
) folder to load .vcs
shaders.
For Linux/Mac users who rely on the ToGL translation layer for their graphics they might run into issues because of lacking SM3.0 support. Running the game through compatibility tools like Proton which make use of DXVK will bypass this issue.
If you are trying to make UI shaders, use constant colors, or use textures in UI, and do not want them to be gamma-corrected (see issue 2807, issue 2241), then set
$linearwrite
to 1 (and linearread_basetexture
/etc in case if you are using textures in your shader).Example of custom pixel shader

See Also
- Shader Authoring - Valve Developer Community for the shader authoring process.
- SDK Screenspace Shaders - ficool2 GitHub for more information on screenspace_general.
- SCell555's Shader Compiler for standalone shader compilation which is useful for Linux/Mac users through Wine/Crossover, or for CI/CD processes. If you encounter
SM1 non-float expression
, it means you have to download the original d3dcompiler for Wine via winetricks. - Srlions's RDNX library a shader example which draws rounded shapes.
- EthanTheGreat's gm_universe shaders a shader example which draws planets.
- EthanTheGreat's gm_shaderbuild utility a utility that allows you to hotload shaders for easy development.
Parameters
string PIXSHADER
Your supplied custom pixel shader. Must have
_ps20
postfix at the end. If you want to use SM3.0 pixel shaders you must also pass a SM3.0 vertex shader, otherwise you are limited to SM2.0b.Default: ""
string VERTEXSHADER
Your supplied custom vertex shader. Must have
_vs20
or _vs30
postfix at the end.Default: ""
boolean LINEARREAD_BASETEXTURE
Whether to linearly read the textures color or to apply gamma correction.
Default: false
boolean LINEARREAD_TEXTURE1
Whether to linearly read the textures color or to apply gamma correction.
Default: false
boolean LINEARREAD_TEXTURE2
Whether to linearly read the textures color or to apply gamma correction.
Default: false
boolean LINEARREAD_TEXTURE3
Whether to linearly read the textures color or to apply gamma correction.
Default: false
boolean LINEARWRITE
Whether to linearly write the textures color or to apply gamma correction.
Default: false
boolean X360APPCHOOSER
Setting this to 1 allows to supply mesh colors, and to multiply meshes to view projection. It's recommended to be set to 1.
This was a workaround added by Valve for the x360, you should now use $VERTEXCOLOR instead.