This article's documentation is for anything that uses the Source engine. Click here for more information.

Screenspace General: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Mark as stub and add context/information its intended purpose)
Line 1: Line 1:
{{LanguageBar}}
{{LanguageBar}}
{{Stub}}


'''{{code|screenspace_general}}''' is a shader available since {{orangebox|2}} that is intended to draw screenspace meshes with customizable pixel shader, textures and constants.
{{this is a|vertex shader|since=source 2007|name=screenspace_general}}{{confirm}} It is most commonly used to draw generic screenspace effects.


An SDK to easily create custom pixel shaders for any Source game is available here: [https://github.com/ficool2/sdk_screenspace_shaders sdk_screenspace_shaders].
Unlike other shaders using {{code|screenspaceeffect}} as its [[Shader#Vertex shaders|vertex shader]], {{code|screenspace_general}} allows developers to easily access and modify its [[Shader#pixel shader|pixel shader]], 4 texture samplers and 4 shader register constants.{{clarify}}
{{note|This shader also correctly displays on brushes, [[info_overlay]]s, [[decal]]s, and models (requires [[$softwareskin]] 1 and [[$translucent]] 1)}}
 
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 {{code|haloaddoutline_ps20}} pixel shader to apply cheap blur. {{code|$C0_X}} controls the glow fade value (restricted to 1.0f in [https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dce/mp/src/game/client/glow_outline_effect.cpp#L287-L289 code].)
{{todo|Test if changing {{code|$C0_X}} actually does what it says it is supposed to do.}}


== Parameters ==
== Parameters ==
{{todo|These are documented in the SDK above.}}
{{todo|List parameters from {{file|screenspace_general|cpp}}}}
 
== Tools ==
An SDK to easily create custom pixel shaders for any Source game is available here: [https://github.com/ficool2/sdk_screenspace_shaders ficool2/sdk_screenspace_shaders].
{{note|Although not intended. This shader also correctly displays on brushes, [[info_overlay]]s, [[decal]]s, and models (requires [[$softwareskin]] 1 and [[$translucent]] 1)}}
{{todo|Is this sdk_screenspace_shaders exclusive?}}
 
[[Category:Shaders]]
[[Category:Shaders]]

Revision as of 15:30, 26 December 2024

English (en)Translate (Translate)

Stub

This article or section is a stub. You can help by expanding it.

screenspace_general is a Vertex shader available in all Source Source games since Source 2007 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.)

Todo: Test if changing $C0_X actually does what it says it is supposed to do.

Parameters

Todo: List parameters from 🖿screenspace_general.cpp

Tools

An SDK to easily create custom pixel shaders for any Source game is available here: ficool2/sdk_screenspace_shaders.

Note.pngNote:Although not intended. This shader also correctly displays on brushes, info_overlays, decals, and models (requires $softwareskin 1 and $translucent 1)
Todo: Is this sdk_screenspace_shaders exclusive?