From Valve Developer Community
Revision as of 17:51, 14 May 2019 by Deprecated (talk | contribs) (Changed DX9 information to use DX9 template, misc fixes)
Jump to: navigation, search

The SpriteCard shader is for materials that will be used with Source's particle system. It supports the unusual animation frame storage of Source's particles (see Animated Particles), and also provides the following unique parameters:

$minsize <normal>
$maxsize <normal>
A minimum/maximum on-screen size for a particle. It will never go over/under the specified value. To do: What if it's in a rendertarget?
Tip.png Tip: $minsize is good for ensuring that effects like bloodspray are visible at a distance.
$minfadesize <normal>
$maxfadesize <normal>
Causes a particle to begin (min) and end (max) fading out based on its on-screen size. Both params are required.
Tip.png Tip: Good for controlling performance when walking through a cloud of large particles.
$maxdistance <float>
Maximum number of units within which this particle will be visible (default = 100,000). Can be overwritten by a particle system.
$farfadeinterval <float>
Number of units over which a particle should fade (default = 400). If this is higher than $maxdistance, the particle will never reach full opacity.
$blendframes <bool>
By default animated textures blend between any given two animation frames to increase the apparent animation rate. In translucent materials this adds additional overdraw to the scene, however. Disabling frame blend will trade the animation smoothing for performance.
$overbrightfactor <normal>
Allows an HDR-like factor to be applied to the sprite. The base value is 0, where 1.0 would make it nearly two times as bright. This value can help make sprites like fire and light glows feel more realistic.
$depthblend <bool> (DX9+)
$depthblendscale <float> (DX9+)
Enables soft particle rendering. This uses the depth buffer to reduce the harsh edges otherwise seen when a particle sprite intersects 3D geometry.
$depthblend enables the effect, while $depthblendscale (default = 50) determines the extent to which the particles should be softened: low values soften less but lead to visible color banding along edges, while high values soften more but lead to very obvious opacity falloff.
Note.png Note: The depth blend effect is limited by the very short 128-unit range of the depth buffer. Beyond this distance, it has no effect.

Untested params

$dualsequence <bool>
Blend two separate animated sequences
$sequence_blend_mode <choices>
Defines the blend mode between the images in dual sequence particles. 0 = avg, 1=alpha from first, rgb from 2nd, 2= first over second
Instead of blending between animation frames for the first/second sequence, select pixels based upon max luminance.
$zoomanimateseq2 <normal>
Amount to gradually zoom between frames on the second sequence. 2.0 will double the size of a frame over its lifetime.
$ramptexture <texture> (DX9+)
If specified, then the red value of the image is used to index this ramp to produce the output color.
$extractgreenalpha <bool>
Grayscale data sitting in green/alpha channels.
$addoverblend <bool>
$addself <float>
Amount of base texture to additively blend in.
Spline type. 0 = none, 1=ctamull rom. Disables instancing.
$useinstancing <bool>
Whether to use GPU vertex instancing. Xbox 360 only.