UnlitTwoTexture: Difference between revisions
No edit summary |
SirYodaJedi (talk | contribs) m (→Example) |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 10: | Line 10: | ||
== Parameters == | == Parameters == | ||
{{MatParamDef|$basetexture|texture|}} | {{MatParamDef|$basetexture|texture|}} | ||
The first Texture that is used, how it is used depends on the effects which are enabled. | |||
By default <code>$basetexture</code> will be multiplied with <code>$texture2</code>. | The first Texture that is used, how it is used depends on the effects which are enabled. By default <code>$basetexture</code> will be multiplied with <code>$texture2</code>. | ||
{{MatParamDef|$frame|int|The frame to start an animated <code>$texture2</code> on.}} | {{MatParamDef|$frame|int|The frame to start an animated <code>$texture2</code> on.}} | ||
{{MatParamDef|$basetexturetransform|matrix|Transforms the texture before use in the material. {{VMT UVtransform}} }} | {{MatParamDef|$basetexturetransform|matrix|Transforms the texture before use in the material. {{VMT UVtransform}} }} | ||
{{MatParamDef|$texture2|texture|}} | {{MatParamDef|$texture2|texture|}} | ||
Second Texture that is used in different ways depending on which effects are used. | |||
By default <code>$basetexture</code> will be multiplied with <code>$texture2</code>. | Second Texture that is used in different ways depending on which effects are used. By default <code>$basetexture</code> will be multiplied with <code>$texture2</code>. | ||
{{note|First texture is applied via {{ent|$basetexture}}.}} | {{note|First texture is applied via {{ent|$basetexture}}.}} | ||
{{MatParamDef|$frame2|int|The frame to start an animated <code>$texture2</code> on.}} | {{MatParamDef|$frame2|int|The frame to start an animated <code>$texture2</code> on.}} | ||
{{MatParamDef|$texture2transform|matrix|Transforms the texture before use in the material. {{VMT UVtransform}} }} | {{MatParamDef|$texture2transform|matrix|Transforms the texture before use in the material. {{VMT UVtransform}} }} | ||
{{MatParamDef|$color|RGB matrix|tints the result, on brushes.}} | {{MatParamDef|$color|RGB matrix|tints the result, on brushes.}} | ||
{{MatParamDef|$color2|RGB matrix|tints the result, on models.}} | {{MatParamDef|$color2|RGB matrix|tints the result, on models.}} | ||
{{MatParamDef|$beachfoam|bool|Introduced with Dangerzone, adds animated wave-like effects using a special texture|only={{csgo}}}} | {{MatParamDef|$beachfoam|bool|Introduced with Dangerzone, adds animated wave-like effects using a special texture|only={{csgo}}}} | ||
{{important|This parameter is intended to be used with {{ent|$additive}}.}} | {{important|This parameter is intended to be used with {{ent|$additive}}.}} | ||
On the Dangerzone Wave Model, both <code>$texture2</code> and <code>$basetexture</code> use the 'Beachwaves' Texture. | On the Dangerzone Wave Model, both <code>$texture2</code> and <code>$basetexture</code> use the 'Beachwaves' Texture. | ||
{{todo|Do both Parameters need to use the same Texture?}} | {{todo|Do both Parameters need to use the same Texture?}} | ||
The 'Beachwaves' Texture uses the RGB channels for different purposes. | The 'Beachwaves' Texture uses the RGB channels for different purposes. | ||
<small>{{todo|Find a better Name for the Texture...}}</small> | <small>{{todo|Find a better Name for the Texture...}}</small> | ||
* Red Channel : Waves Albedo Texture | * Red Channel : Waves Albedo Texture | ||
{{todo|Can this be tinted using $color/$color2?}} | {{todo|Can this be tinted using $color/$color2?}} | ||
| Line 36: | Line 48: | ||
* Blue Channel : Distortion/Noise for the Red Channel | * Blue Channel : Distortion/Noise for the Red Channel | ||
{{todo|Further documentation required.}} | {{todo|Further documentation required.}} | ||
{{MatParamDef|$CrosshairMode|bool| Enables "Crosshair mode" using <code>$basetexture</code> for the Crosshair|only={{csgo}}}} | {{MatParamDef|$CrosshairMode|bool| Enables "Crosshair mode" using <code>$basetexture</code> for the Crosshair|only={{csgo}}}} | ||
<code>$texture2</code> is used for a framebuffer texture. | |||
<code>$texture2</code> is used for a framebuffer texture. | |||
The result will be blended between <code>Crosshair Texture + CrosshairTint</code> and <code>Crosshair Texture * CrosshairTint</code> using <code>Average Luminance of $texture2 * $CrosshairColorAdapt</code> | The result will be blended between <code>Crosshair Texture + CrosshairTint</code> and <code>Crosshair Texture * CrosshairTint</code> using <code>Average Luminance of $texture2 * $CrosshairColorAdapt</code> | ||
{{MatParamDef|$CrosshairTint|RGB matrix| Tints the <code>$basetexture</code> when using <code>$CrosshairMode</code>|only={{csgo}}}} | {{MatParamDef|$CrosshairTint|RGB matrix| Tints the <code>$basetexture</code> when using <code>$CrosshairMode</code>|only={{csgo}}}} | ||
{{MatParamDef|$CrosshairColorAdapt|float|Used for multiplying the average Luminance of <code>$texture2</code> <br>{{note|Default Value <code>"0.4"</code>}}|only={{csgo}}}} | {{MatParamDef|$CrosshairColorAdapt|float|Used for multiplying the average Luminance of <code>$texture2</code> <br>{{note|Default Value <code>"0.4"</code>}}|only={{csgo}}}} | ||
{{MatParamDef|$translucent|bool|[[$translucent]] is a [[Expensive|expensive]] translucency using a full [[Alpha]] mask, for very fine gradients. Uses [[$basetexture]] as the source alpha, and blends [[$texture2]]'s alpha over whatever is opaque.</code>|since={{l4d}}}} | {{MatParamDef|$translucent|bool|[[$translucent]] is a [[Expensive|expensive]] translucency using a full [[Alpha]] mask, for very fine gradients. Uses [[$basetexture]] as the source alpha, and blends [[$texture2]]'s alpha over whatever is opaque.</code>|since={{l4d}}}} | ||
=== Example === | |||
The following are some stock VMTs from various games: | |||
{{hl2}} {{path|models/props_combine/portalball001_sheet|vmt}} | |||
<syntaxhighlight> | <syntaxhighlight> | ||
"UnlitTwoTexture" | "UnlitTwoTexture" | ||
| Line 69: | Line 84: | ||
} | } | ||
} | |||
</syntaxhighlight> | |||
{{hls}} {{file|liquids/!greenslime|vmt}} | |||
<syntaxhighlight> | |||
"UnlitTwoTexture" | |||
{ | |||
"$basetexture" "liquids/toxic_anim" | |||
// "$texture2" "liquids/toxic_anim" | |||
"$texture2" "liquids/!radio" | |||
"$texture2scale" 1 | |||
// "$additive" 1 | |||
"$tex2offset" "[0 0]" | |||
"%compilewater" 1 | |||
"$bottommaterial" "liquids/!greenslime_beneath" | |||
"$surfaceprop" "water" | |||
"$fogenable" 1 | |||
"$fogcolor" "{96 255 0}" | |||
"$fogstart" 1.00 | |||
"$fogend" 400.00 | |||
"Proxies" | |||
{ | |||
"LinearRamp" | |||
{ | |||
"resultVar" "$tex2offset[0]" | |||
"rate" 0.001 | |||
} | |||
"LinearRamp" | |||
{ | |||
"resultVar" "$tex2offset[1]" | |||
"rate" -0.01 | |||
} | |||
"TextureTransform" | |||
{ | |||
"translateVar" "$tex2offset" | |||
"resultVar" "$texture2transform" | |||
} | |||
"AnimatedTexture" | |||
{ | |||
"animatedtexturevar" "$basetexture" | |||
"animatedtextureframenumvar" "$frame" | |||
"animatedtextureframerate" 12 | |||
} | |||
} | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{csgo}} {{path|models/props/hr_massive/beachwaves/beachwaves|vmt}} | {{csgo}} {{path|models/props/hr_massive/beachwaves/beachwaves|vmt}} | ||
<syntaxhighlight> | <syntaxhighlight> | ||
UnlitTwoTexture | UnlitTwoTexture | ||
Latest revision as of 18:30, 17 November 2025
- Two base textures are multiplied together and can be transformed independently. (Just like the Multiply blending mode in typical image editors.)
- Unrelated to WorldVertexTransition, which is used for making alpha fading transitions between two base textures on displacements.
$detailblendmode 8 on UnlitGeneric.Parameters
The first Texture that is used, how it is used depends on the effects which are enabled. By default $basetexture will be multiplied with $texture2.
- 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 ?]
Second Texture that is used in different ways depending on which effects are used. By default $basetexture will be multiplied with $texture2.
- 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 ?]
On the Dangerzone Wave Model, both $texture2 and $basetexture use the 'Beachwaves' Texture.
The 'Beachwaves' Texture uses the RGB channels for different purposes.
- Red Channel : Waves Albedo Texture
- Green Channel : Distortion/Noise for the Red Channel
- Blue Channel : Distortion/Noise for the Red Channel
$basetexture for the Crosshair$texture2 is used for a framebuffer texture.
The result will be blended between Crosshair Texture + CrosshairTint and Crosshair Texture * CrosshairTint using Average Luminance of $texture2 * $CrosshairColorAdapt
$basetexture when using $CrosshairMode$texture2 "0.4"Example
The following are some stock VMTs from various games:
![]()
models/props_combine/portalball001_sheet.vmt
"UnlitTwoTexture"
{
"$basetexture" "models/props_combine/portalball001_sheet"
"$texture2" "models/props_combine/portalball001b_sheet"
"$model" 1
"$nocull" "1"
"$additive" "1"
"Proxies"
{
"TextureScroll"
{
"texturescrollvar" "$texture2transform"
"texturescrollrate" -.2
"texturescrollangle" 60
}
}
}
![]()
liquids/!greenslime.vmt
"UnlitTwoTexture"
{
"$basetexture" "liquids/toxic_anim"
// "$texture2" "liquids/toxic_anim"
"$texture2" "liquids/!radio"
"$texture2scale" 1
// "$additive" 1
"$tex2offset" "[0 0]"
"%compilewater" 1
"$bottommaterial" "liquids/!greenslime_beneath"
"$surfaceprop" "water"
"$fogenable" 1
"$fogcolor" "{96 255 0}"
"$fogstart" 1.00
"$fogend" 400.00
"Proxies"
{
"LinearRamp"
{
"resultVar" "$tex2offset[0]"
"rate" 0.001
}
"LinearRamp"
{
"resultVar" "$tex2offset[1]"
"rate" -0.01
}
"TextureTransform"
{
"translateVar" "$tex2offset"
"resultVar" "$texture2transform"
}
"AnimatedTexture"
{
"animatedtexturevar" "$basetexture"
"animatedtextureframenumvar" "$frame"
"animatedtextureframerate" 12
}
}
}
![]()
models/props/hr_massive/beachwaves/beachwaves.vmt
UnlitTwoTexture
{
"$beachfoam" "1"
"$basetexture" "models/props/hr_massive/beachwaves/beachwaves"
"$texture2" "models/props/hr_massive/beachwaves/beachwaves"
"$additive" "1"
}
![]()
effects/smoke_plumes_anim.vmt
UnLitTwoTexture
{
"%tooltexture" "effects/smoke_plumes_00"
$basetexture "effects/smoke_plumes_scroll"
$texture2 "effects/smoke_plumes_00"
$translucent 1
$nocull 1
$no_fullbright 1
$nofog 1
$scale "[1 1]"
$scroll "[2 2]"
Proxies
{
LinearRamp
{
resultVar "$scroll[0]"
rate -.01
}
LinearRamp
{
resultVar "$scroll[1]"
rate .035
}
TextureTransform
{
scaleVar $scale
translateVar $scroll
resultVar $basetexturetransform
}
}
}