List of shaderParm variables: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Tels (talk | contribs)
m add info about the damage overlay
Line 41: Line 41:
|0.00 to 1.00 (or to X.yz)
|0.00 to 1.00 (or to X.yz)
Set by spawnarg shaderParm3 on the entity in the editor.
Set by spawnarg shaderParm3 on the entity in the editor.
|Materials: Alpha (transparency) value, eg, alphatest 0.8. Also used in some LOD materials as the alpha threshold, in this case the engine adjusts the value between 0 and 1.0 at runtime depending on distance to the player.
|Materials: Alpha (transparency) value, eg, alphatest 0.8. Also used in some LOD materials as the alpha threshold. In this case the engine adjusts the value between 0 and 1.0 at runtime depending on distance to the player.
Foglights: Distance in units beyond which fog is completely opaque (so higher values make fog thinner.)
Foglights: Distance in units beyond which fog is completely opaque (so higher values make fog thinner.)
Damage overlay (tunnel vision): Alpha, based on player health
Damage overlay (tunnel vision): Alpha, based on player health
Line 61: Line 61:
|6
|6
|about 0.5 .. 3
|about 0.5 .. 3
|Used by [[atdm:liquid_water]] entities to control the hight of the vertex waves. Default is 1.5.
|Used by [[atdm:liquid_water]] entities to control the height of the vertex waves. Default is 1.5.
|once
|once


Line 71: Line 71:


0..1 (speed)
0..1 (speed)
|Used by the moon-light textures in <code>textures/darkmod/sfx/</code>
|Used by the moonlight textures in <code>textures/darkmod/sfx/</code>


Also used by some tree entities to vary leaf movement speed, eg, for wind. See [[Trees and how to make custom ones]]
Also used by some tree entities to vary leaf movement speed, eg, for wind. See [[Trees and how to make custom ones]]
Line 79: Line 79:
|8
|8
|0..360
|0..360
|Used by the clock hand decals to mimick time-keeping
|Used by the clock hand decals to mimic time-keeping
|run-time by script
|run-time by script



Revision as of 13:32, 4 March 2014

Variables named shaderParm0 to shaderParm11 influence the rendering of certain materials. They are either set once in the map editor for some specific entity, or at run-time by various scripts or the C++ code.

Inside material definitions, these can be accessed via parm0 ... parm11.

The parms are on a per-entity base, so you can f.i. influence the material (and thus color) of entities or the color of the light.

See also the list of global variables.

List of shaderParms

# Value Used by Type
0 0.00 to 1.00 Red value set by _color spawnarg in the editor

Damage overlay (tunnel vision): Time since the last damage, so when damage occurs, it can flash

once
run-time
1 0.00 to 1.00 Green value set by _color spawnarg in the editor once
2 0.00 to 1.00 Blue value set by _color spawnarg in the editor once
3 0.00 to 1.00 (or to X.yz)

Set by spawnarg shaderParm3 on the entity in the editor.

Materials: Alpha (transparency) value, eg, alphatest 0.8. Also used in some LOD materials as the alpha threshold. In this case the engine adjusts the value between 0 and 1.0 at runtime depending on distance to the player.

Foglights: Distance in units beyond which fog is completely opaque (so higher values make fog thinner.) Damage overlay (tunnel vision): Alpha, based on player health

once
run-time
4 0 to 1 set shaderparm4 on flickering lights with a value 0 to 1 to vary the flicker offset so they don't all flicker in sync. ?
5 about 0.05 .. 0.5 Used by atdm:liquid_water entities to control the (translation) speed of the water waves. Default is 0.1. once
6 about 0.5 .. 3 Used by atdm:liquid_water entities to control the height of the vertex waves. Default is 1.5. once
7 0..1 (brightness)


0..1 (speed)

Used by the moonlight textures in textures/darkmod/sfx/

Also used by some tree entities to vary leaf movement speed, eg, for wind. See Trees and how to make custom ones

once
8 0..360 Used by the clock hand decals to mimic time-keeping run-time by script
9 ? ? ?
10 ? ? ?
11 0 or 1 non-zero when something is highlighted for frob. This is used by material definitions to make materials "light up" when entities are in the frob-highlight. run-time

See also