SpriteCard
Jump to navigation
Jump to search
SpriteCard is a Pixel shader available in all
Source games since
Source 2007. It is for sprite cards that are used with Source's particle system. It supports the unusual animation frame storage of Source's particles (see Animated Particles).
Parameters
- $basetexture <texture>
- The sprite sheet to use for the shader.
Distance and Size
- $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: $minsizeis good for ensuring that effects like bloodspray are visible at a distance.
- $maxfadesize <normal>
- Causes a particle to begin (min) and end (max) fading out based on its on-screen size. Both params are required.
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 the
$maxdistance, the particle will never reach full opacity.
Blending
- $blendframes <boolean>
- 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.
- $dualsequence <boolean>
- 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.
- $maxlumframeblend1 and $maxlumframeblend2 <integer>
- Instead of blending between animation frames for the first/second sequence, select pixels based upon max luminance.
- $zoomanimateseq2 <float> (DX9 SM2)
- Amount to gradually zoom between frames on the second sequence. 2.0 will double the size of a frame over its lifetime.
- $addoverblend <boolean>
- Use ONE:INVSRCALPHA blending.
- $addbasetexture2 <float>
- Amount to blend second texture into frame by.
Depth
- $depthblend <boolean> (DX9 SM2)
- Enables soft particles rendering. This uses the depth buffer to reduce the harsh edges otherwise seen when a particle sprite intersects 3D geometry.
Bug:Doesn't work in
Black Mesa (mod) and other versions before
Xengine.
- $depthblendscale <float> (DX9 SM2)
$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: The depth blend effect is limited by the very short 128-unit range of the depth buffer. Beyond this distance, it has no effect. This may be different in games or mods with an increased depth buffer range, although precision may be an issue.
- $inversedepthblend <boolean> (in all games since
)
- Calculate 1-depthblendalpha so that sprites appear when they are near geometry. Seems to be disabled on PC builds of CS:GO. (No shader combo)
- $scenedepth <texture> (only in
)
- Sets the depth texture. By default is set to "_rt_FullFrameDepth", probably internal use for the PS3.
Orientation
- $orientation <integer>
-
- 0 = always face camera
- 1 = rotate around z
- 2 = parallel to ground
- 3 = parallel to control point's surface (in all games since
) Might be incompatible with $dualsequencedue to shared vertex shader inputs.
orientation_typeis set inrender_animated_particlesand should not be set manually.
- $orientationmatrix <matrix> (in all games since
)
- Matrix used to orient in orientation mode 2.
This is usually overwritten by the particle rendering system via therender_animated_particlesrenderer and should not be set manually.
- $aimatcamera <boolean> (only in
)
- Aim at camera when using orientation mode 1.
Appearance
- $translucent <boolean>
- Translucency based upon the texture's alpha channel.
- $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.
- $ramptexture <texture> (DX9 SM2)
- If specified, then the red value of the image is used to index this ramp to produce the output color.
- $opaque <boolean> (in all games since
)
- Are we opaque? Default 0.
Note: Enabling this disables these parameters: $addbasetexture2, $dualsequence, $sequence_blend_mode, $maxlumframeblend1, $maxlumframeblend2, $extractgreenalpha, $ramptexture, $zoomanimateseq2, $addoverblend, $addself, $blendframes, $depthblend, and$inversedepthblend.
- $muloutputbyalpha <boolean> (in all games since
)
- Multiply output RGB by output alpha to avoid precision problems.
- $intensity <float> (in all games since
)
- Multiply output RGB by intensity factor.
Vertex Colors
- $vertexcolor <boolean>
- Use computed vertex colors.
- $vertexalpha <boolean>
- Use computed vertex alpha values.
- $vertexcolorlerp <boolean> (in all games since
)
- Enable computing vertex color by interpolating two colors based on vertex r color channels.
- $lerpcolor1 <vector3> (in all games since
)
- Lerp color 1.
- $lerpcolor2 <vector3> (in all games since
)
- Lerp color 2.
- $vertexfogamount <float> (in all games since
)
- Amount of vertex fog to apply.
Misc
- $extractgreenalpha <boolean>
- Weight green/alphas from the two frames for a scalar result.
- $splinetype <integer>
- Spline type. 0 = none, 1 = catmulll rom. Disables instancing. Todo: 2 found in .vmts.
- $useinstancing <boolean>
- Whether to use GPU vertex instancing. Xbox 360 only.
- $alphatrailfade <float> (in all games since
)
- Amount to scale alpha by between start and end of trail/rope.
- $radiustrailfade <float> (in all games since
)
- Amount to scale radius by between start and end of trail/rope.
- $shadowdepth <integer> (in all games since
)
- Todo: Writing to a shadow depth buffer
- $cropfactor <vector2> (in all games since
)
- Todo: Crop based on these dimensions?
$distancealpha
- $distancealpha <boolean> (in all games since
)
- Use distance-coded alpha generated from hi-res texture by vtex.
- $softedges <boolean> (in all games since
)
- Enable soft edges to distance coded textures.
- $edgesoftnessstart <float> (in all games since
)
- Start value for soft edges for distance coded textures.
- $edgesoftnessend <float> (in all games since
)
- End value for soft edges for distance coded textures.
- $outlinecolor <RGB matrix> (in all games since
)
- Color of the outline for distance coded images.
- $outlinealpha <float> (in all games since
)
- Alpha value for the outline.
- $outlinestart0 <float> (in all games since
)
- Outer start value for the outline.
- $outlinestart1 <float> (in all games since
)
- Inner start value for the outline.
- $outlineend0 <float> (in all games since
)
- Inner end value for the outline.
- $outlineend1 <float> (in all games since
)
- Outer end value for the outline.
- $perparticleoutline <boolean> (in all games since
)
- Allow per particle outline control.