Garry's Mod Wiki

Revision Difference

Shaders/screenspace_general#565659

<cat>shader</cat> <title>screenspace_general</title> <shader> <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. For more information about creating custom shaders, see <page text="the Custom Shaders reference page">custom_shaders</page>. </description> <parameters> <item name="PIXSHADER" type="string" default="">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.</item> <item name="VERTEXSHADER" type="string" default="">Your supplied custom vertex shader. Must have `_vs20` or `_vs30` postfix at the end.</item> <item name="DISABLE_COLOR_WRITES" type="boolean" default="false"></item> <item name="ALPHATESTED" type="float" default="0"></item> <item name="ALPHA_BLEND" type="boolean" default="false"></item> <item name="ALPHA_BLEND_COLOR_OVERLAY" type="boolean" default="false"></item> <item name="BASETEXTURE" type="ITexture" default="">Texture that will be supplied to your shader.</item> <item name="TEXTURE1" type="ITexture" default="">Texture that will be available in slot 1 to your shader.</item> <item name="TEXTURE2" type="ITexture" default="">Texture that will be available in slot 2 to your shader.</item> <item name="TEXTURE3" type="ITexture" default="">Texture that will be available in slot 3 to your shader.</item> <item name="LINEARREAD_BASETEXTURE" type="boolean" default="false">Whether to linearly read the textures color or to apply gamma correction.</item> <item name="LINEARREAD_TEXTURE1" type="boolean" default="false">Whether to linearly read the textures color or to apply gamma correction.</item> <item name="LINEARREAD_TEXTURE2" type="boolean" default="false">Whether to linearly read the textures color or to apply gamma correction.</item> <item name="LINEARREAD_TEXTURE3" type="boolean" default="false">Whether to linearly read the textures color or to apply gamma correction.</item> <item name="LINEARWRITE" type="boolean" default="false">Whether to linearly write the textures color or to apply gamma correction.</item> <item name="VERTEXTRANSFORM" type="boolean" default="false">Verts are in world space.</item> <item name="VERTEXNORMAL" type="boolean" default="false">Specify vertex normal (compressed) in material format.</item> <item name="ALPHABLEND" type="boolean" default="false">Whether or not to enable alpha blend.</item> <item name="MULTIPLYCOLOR" type="boolean" default="false">Whether or not to multiply src and dest color.</item> <item name="WRITEALPHA" type="boolean" default="false">Whether or not to enable alpha write.</item> <item name="WRITEDEPTH" type="boolean" default="false">Whether or not to enable depth write.</item> <item name="TCSIZE0" type="integer" default="2">Number of components in texture coord0.</item> <item name="TCSIZE1" type="integer" default="0">Number of components in texture coord1.</item> <item name="TCSIZE2" type="integer" default="0">Number of components in texture coord2.</item> <item name="TCSIZE3" type="integer" default="0">Number of components in texture coord3.</item> <item name="TCSIZE4" type="integer" default="0">Number of components in texture coord4.</item> <item name="TCSIZE5" type="integer" default="0">Number of components in texture coord5.</item> <item name="TCSIZE6" type="integer" default="0">Number of components in texture coord6.</item> <item name="TCSIZE7" type="integer" default="0">Number of components in texture coord7.</item> <item name="POINTSAMPLE_BASETEXTURE" type="boolean" default="false"></item>⤶ <item name="POINTSAMPLE_TEXTURE1" type="boolean" default="false"></item>⤶ <item name="POINTSAMPLE_TEXTURE2" type="boolean" default="false"></item>⤶ <item name="POINTSAMPLE_TEXTURE3" type="boolean" default="false"></item>⤶ <item2 name="POINTSAMPLE_BASETEXTURE" type="boolean" default="false">Doesn't exist.</item>⤶ <item2 name="POINTSAMPLE_TEXTURE1" type="boolean" default="false">Doesn't exist.</item2>⤶ <item2 name="POINTSAMPLE_TEXTURE2" type="boolean" default="false">Doesn't exist.</item2>⤶ <item2 name="POINTSAMPLE_TEXTURE3" type="boolean" default="false">Doesn't exist.</item2>⤶ <item name="CULL" type="boolean" default="0">Culling control - `0` = nocull, `1` = do cull.</item> <item name="DEPTHTEST" type="boolean" default="0">Enable depth test.</item> <item name="COPYALPHA" type="boolean" default="0"></item> <item name="VIEWPROJMAT" type="matrix" default="0">Used by g_viewProjMatrix (register c11) in pixel shader.</item> <item name="INVVIEWPROJMAT" type="matrix" default="0">Used by g_invViewMatrix (register c15) in pixel shader.</item> <item name="BLENDOPMIN" type="integer" default="0"></item> <item name="X360APPCHOOSER" type="boolean">Setting this to 1 allows to supply mesh colors, and to multiply meshes to view projection. It's recommended to be set to 1. <removed notag="true">This was a workaround added by Valve for the x360, you should now use $VERTEXCOLOR and $VERTEXTRANSFORM instead.</removed> </item> <item name="VERTEXCOLOR" type="number"></item> <item name="IGNOREZ" type="boolean" default="false">Whether or not to ignore the ZBuffer.</item> <item name="C0_X" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C0_Y" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C0_Z" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C0_W" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C1_X" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C1_Y" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C1_Z" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C1_W" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C2_X" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C2_Y" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C2_Z" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C2_W" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C3_X" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C3_Y" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C3_Z" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> <item name="C3_W" type="float" default="0">Dummy parameter you can utilise for your custom shader.</item> </parameters> </shader>