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
The sprite sheet to use for the shader.
Distance and Size
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.
Maximum number of units within which this particle will be visible (default = 100,000). Can be overwritten by a particle system.
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
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.
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.
Amount to gradually zoom between frames on the second sequence. 2.0 will double the size of a frame over its lifetime.
Use ONE:INVSRCALPHA blending.
Amount to blend second texture into frame by.
Depth
Enables soft particles rendering. This uses the depth buffer to reduce the harsh edges otherwise seen when a particle sprite intersects 3D geometry.
Bug:Broken in Black Mesa since the very first mod release, this parametr doesn't work at all. This feature is restored since Xen Engine update. [todo tested in?]
$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.
Calculate 1-depthblendalpha so that sprites appear when they are near geometry.
Todo: What is this?
Orientation
0 = always face camera, 1 = rotate around z, 2 = parallel to ground, 3 = parallel to control point's surface
Matrix used to orient in orientation mode 2.
Aim at camera using orientation mode 1.
Appearance
Enables expensive transparency.
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.
If specified, then the red value of the image is used to index this ramp to produce the output color.
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
.Multiply output RGB by output alpha to avoid precision problems.
Multiply output RGB by intensity factor.
Vertex Colors
Use computed vertex colors.
Use computed vertex alpha values.
Enable computing vertex color by interpolating two colors based on vertex r color channels.
Lerp color 1.
Lerp color 2.
Amount of vertex fog to apply.
Misc
Weight green/alphas from the two frames for a scalar result.
Spline type. 0 = none, 1 = catmulll rom. Disables instancing.
Todo: 2 found in .vmts.
Whether to use GPU vertex instancing. Xbox 360 only.
Amount to scale alpha by between start and end of trail/rope.
Amount to scale radius by between start and end of trail/rope.
Todo: Writing to a shadow depth buffer
Todo: Crop based on these dimensions?
$distancealpha
Use distance-coded alpha generated from hi-res texture by vtex.
Enable soft edges to distance coded textures.
Start value for soft edges for distance coded textures.
End value for soft edges for distance coded textures.
Color of the outline for distance coded images.
Alpha value for the outline.
Outer start value for the outline.
Inner start value for the outline.
Inner end value for the outline.
Outer end value for the outline.
Allow per particle outline control.