WorldVertexTransition: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
'''<code>WorldVertexTransition</code>''' is the shader used to blend the vertices of a [[displacement]] surface between two different materials. It combines the two into one by using a mirrored set of shader parameters with "2" in their name.


{{stub}}
The percentage blend of the two textures is defined by Hammer's [[Displacement#Blended displacement materials (alpha channel painting)|alpha painting tool]].


* Used to blend materials on [[Displacement#Blended displacement materials (alpha channel painting)|Displacement]] surfaces (terrain).  
{{note|If a material with this shader is used on a surface that isn't a displacement, the engine will generate a warning in the console claiming that support for this is going away soon (it actually talks about <code>[[WorldTwoTextureBlend]]</code>, presumably WVT's predecessor). It should be noted that this warning has been there for a couple of years though - see [[Valve Time]]!}}
* The percentage blend of each of the two textures is defined by alpha painting in Hammer.
* Two basetextures are vertex lit.


===Basic VMT Syntax===
==Example==
(from <code>ep2/materials/nature/blendgrassdirt01.vmt</code>)
 
WorldVertexTransition
{
[[$basetexture]] nature/dirtfloor006a
[[$surfaceprop]] dirt
$basetexture2 nature/rockfloor005a
$surfaceprop2 rock
   
   
"WorldVertexTransition"
[[%tooltexture]] nature/blendrockgrass004a_tooltexture
{
    "[[$basetexture]]" "nature/forest_grass_01"
    "[[$basetexture2]]" "nature/forest_dirt_02"
    "[[$surfaceprop]]" "dirt"
    "[[$blendmodulatetexture]]" "nature/blendtexture01"
    "%[[detailtype]]" "forest_floor_01"
  }
  }


===Additional Parameters===  
Just about all visual effects can be selectively applied to one sub-material or the other. See the relevant articles for more details.
* Use [[$basetexture2]] and [[$bumpmap2]] to define the second material.
 
{{note|Hammer's material browser won't be able to display a preview of the material unless it's given a <code>[[%tooltexture]]</code>.}}
 
== Supported effects ==
 
*<code>[[$bumpmap]]</code> {{todo|and <code>[[$ssbump]]</code>?}}
*<code>[[$detail]]</code> (whole material only)
*<code>[[$envmap]]</code>
*{{todo|<code>[[$outline]]</code>?}}
*{{todo|<code>[[$seamless_scale]]</code>?}}
*<code>[[$translucent]]</code> and <code>[[$alpha]]</code> (whole material only)
 
== See also ==


{{note|If a material with this shader is used on a ''non-displacement'' surface, the Source engine will generate a warning, saying that support for this is going away soon. However, the warning incorrectly calls the shader "WorldTwoTextureBlend". It should also be noted that this warning has been there for a couple of years - see [[Valve Time]].}}
*<code>[[LightmappedGeneric]]</code>
*<code>[[WorldTwoTextureBlend]]</code>
*<code>[[LightmappedTwoTexture]]</code>


[[Category:List of Shaders]]
[[Category:List of Shaders]]

Revision as of 01:32, 13 July 2008

WorldVertexTransition is the shader used to blend the vertices of a displacement surface between two different materials. It combines the two into one by using a mirrored set of shader parameters with "2" in their name.

The percentage blend of the two textures is defined by Hammer's alpha painting tool.

Note.pngNote:If a material with this shader is used on a surface that isn't a displacement, the engine will generate a warning in the console claiming that support for this is going away soon (it actually talks about WorldTwoTextureBlend, presumably WVT's predecessor). It should be noted that this warning has been there for a couple of years though - see Valve Time!

Example

WorldVertexTransition
{
	$basetexture nature/dirtfloor006a
	$surfaceprop dirt

	$basetexture2 nature/rockfloor005a
	$surfaceprop2 rock

	%tooltexture nature/blendrockgrass004a_tooltexture
}

Just about all visual effects can be selectively applied to one sub-material or the other. See the relevant articles for more details.

Note.pngNote:Hammer's material browser won't be able to display a preview of the material unless it's given a %tooltexture.

Supported effects

See also