Core (shader): Difference between revisions
Jump to navigation
Jump to search
Note:In order for this shader to work properly, it must be used with a
Note:This shader does not exist in engine branches after the Orange Box.
Deprecated (talk | contribs) (Created Core shader page) |
NvC DmN CH (talk | contribs) m (envmaps will are force drawn) |
||
| Line 19: | Line 19: | ||
; <code>[[$envmap]] <texture></code> | ; <code>[[$envmap]] <texture></code> | ||
: Adds a cubemap reflection on top of the refraction. | : Adds a cubemap reflection on top of the refraction. | ||
: {{note|Specular reflections will be drawn even if <code>mat_specular</code> is set to 0}} | |||
; <code>$envmapframe <int></code> | ; <code>$envmapframe <int></code> | ||
: The frame to start an animated cubemap on. | : The frame to start an animated cubemap on. | ||
Revision as of 19:01, 1 June 2019
Core is a material shader introduced in Episode One. It is used to create a unstable, reflecting and refracting core of energy, used exclusively for the Core reactor in the Citadel in Episode One.
prop_coreball at the position of (2688,12139,5170). This value is hardcoded into the shader.Shader Parameters
$corecolortexture <texture>- The texture to use for the colors that get dynamically modified by the shader. The alpha channel of the
$corecolortexturedetermines the translucency of the core. $corecolortextureframe <texture>- The frame to start an animated
$corecolortextureon. $normalmap <texture>$dudvmap <texture>(DX8)- The pattern of refraction is defined by a normal map (DX9+) or DUDV map (DX8-). May be animated.
$bumpframe <int>- The frame to start an animated bumpmap on. Todo: This may not work with the proxy required for the effect.
$bumptransform <matrix>- Transforms the bump map texture.
- The default position is
center .5 .5 scale 1 1 rotate 0 translate 0 0.centerdefines the point of rotation. Only useful ifrotateis being used.scalefits the texture into the material the given number of times.2 1is a 50% scale in the horizontal X axis while the vertical Y axis is still at original scale.rotaterotates the texture counter-clockwise in degrees. Accepts any number, including negatives.translateshifts the texture by the given numbers..5will shift it half-way. 1 will shift it once completely over, which is the same as not moving it at all.
Note:All values must be included!
Bug:Scaling the texture may cause odd issues where the Texture Lock tool in Hammer will not actually lock the texture in place. [todo tested in ?]
Bug:Rotating textures applied on brushes will rotate around the map origin (confirm: Orangebox engine only?). A fix for this is to change the center position in the VMT to the brush's origin. [todo tested in ?]
$envmap <texture>- Adds a cubemap reflection on top of the refraction.
Note:Specular reflections will be drawn even if mat_specularis set to 0$envmapframe <int>- The frame to start an animated cubemap on.
$envmaptint <RGB matrix>- Controls the intensity of the reflection's red, green and blue color channels. Any positive number can be used. Default is
"[1 1 1]", which means 100% intensity.
Note:You must use quotemarks, as there are space characters within the value. $envmapcontrast <normal>- Controls the contrast of the reflection. 0 is natural contrast, while 1 is the full squaring of the color (i.e. color*color).
$envmapsaturation <normal>- Controls the colour saturation of the reflection. 0 is greyscale, while 1 is natural saturation.
$refractamount <float>- Controls the strength of the refraction by multiplying the normal map intensity.
$refracttint <RGB matrix>- Tints the color of the refraction.
$flowmap <texture>- Flowmap to scroll the normal map, which affects the refraction.
$flowmapframe <int>- The frame to start an animated flowmap on.
$flowmapscrollrate <vector2>- The rate at which the normal map scrolls along the flowmap.
$flowmaptexcoordoffset <float>- Todo: Texture offset for the flowmap? Modified by proxies, as seen below.
Example
The Core material used in Episode One, materials/models/props_combine/core_sheet.vmt
"Core"
{
"$normalmap" "Models/props_combine/core_normal"
"$dudvmap" "Models/props_combine/core_dudv"
"$corecolortexture" "models/props_combine/corewarpcolor"
"$flowmap" "models/props_combine/core_flow"
"$model" 1
"$REFRACTAmOUNT" "0.15"
"$FLOWMAPSCROLLRATE" "[.0475 .133]"
// "$envmap" "CustomCubeMaps/core"
"$envmap" "env_cubemap"
"$refracttint" "[0.7 0.7 0.6]"
"$envmaptint" "[0.8 0.6 0.6]"
"$FLOWMAPTEXCOORDOFFSET" "1.0"
"$TempMin" 0
"$TempMax" 1
"core_dx70"
{
"$fallbackmaterial" "models/props_combine/coredx70"
}
"core_dx80"
{
"$normalmap" "dev/water_normal"
"$dudvmap" "dev/water_dudv"
"$bumptransform" "center .5 .5 scale 5 5 rotate 0 translate 0 0"
"$envmapcontrast" "1.0"
}
"Proxies"
{
"Sine"
{
"resultVar" "$FLOWMAPTEXCOORDOFFSET"
"sineperiod" 4
"sinemin" "$TempMin"
"sinemax" "$TempMax"
}
"AnimatedTexture"
{
"animatedtexturevar" "$normalmap"
"animatedtextureframenumvar" "$bumpframe"
"animatedtextureframerate" 29.00
}
}
}