SpriteCard

From Valve Developer Community
Revision as of 06:49, 3 May 2010 by TomEdwards (talk | contribs) (soft particles)
Jump to navigation Jump to 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.
Todo: What if it's in a rendertarget?
Tip.pngTip:$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.pngTip:Good for controlling performance when walking through a cloud of large particles.
$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 <float>
Allows a HDR like factor 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>
$depthblendscale <float>
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 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 (above 90) soften more but lead to very obvious opacity falloff.
Note.pngNote:The depth blend effect is limited by the very short 128-unit range of the depth buffer. Beyond this distance, it has no effect.