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.
[[File:Lightwarp snow.jpg|thumb|Application with and without <code>[[$blendmodulatetexture]]</code>.]]


The percentage blend of the two textures is defined by Hammer's [[Displacement#Blended displacement materials (alpha channel painting)|alpha painting tool]].
'''<code>WorldVertexTransition</code>''' is the [[shader]] used to blend the vertices of a [[displacement]] surface between two different [[albedo]]s. It handles two at once by using a mirrored set of parameters with "2" in their name.


{{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 pattern of the blend is defined by Hammer's [[Displacement#Blended displacement materials (alpha channel painting)|alpha painting tool]]. The blend is normally a linear gradient, but it can also be "stamped" by a texture specified with <code>[[$blendmodulatetexture]]</code>. This command makes the material look considerably better for very little [[budget|cost]] - use it often!
 
{{note|This shader now '''only''' works on displacements.}}


==Example==
==Example==
Line 18: Line 20:
  }
  }


Just about all visual effects can be selectively applied to one sub-material or the other. See the relevant articles for more details.
* Just about all visual effects can be selectively applied to one sub-material or the other. See the relevant articles for more details.
 
* The Hammer material browser won't be able to display a preview of the material unless it's given a <code>[[%tooltexture]]</code>.
{{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 ==
== Supported effects ==


* <code>[[$blendmodulatetexture]]</code>
* <code>[[$blendmodulatetexture]]</code>
* {{TODO|<code>[[$seamless_scale]]</code>?}}
* {{todo|<code>[[$seamless_scale]]</code>?}}
* <code>[[$bumpmap]]</code> {{TODO|and <code>[[$ssbump]]</code>?}}
* <code>[[$bumpmap]]</code> ({{todo|and <code>[[$ssbump]]</code>?}})
* <code>[[$detail]]</code> (whole material only)
* <code>[[$detail]]</code> (whole material only)
* <code>[[$envmap]]</code>
* <code>[[$envmap]]</code>
* {{TODO|<code>[[$outline]]</code>?}}
* {{todo|<code>[[$outline]]</code>?}}
* <code>[[$translucent]]</code> and <code>[[$alpha]]</code> (whole material only)
* <code>[[$translucent]]</code> and <code>[[$alpha]]</code> (whole material only)


== See also ==
== See also ==


*<code>[[LightmappedGeneric]]</code>
* <code>[[LightmappedGeneric]]</code>
*<code>[[WorldTwoTextureBlend]]</code>
* <code>[[WorldTwoTextureBlend]]</code>
*<code>[[LightmappedTwoTexture]]</code>
* <code>[[LightmappedTwoTexture]]</code>
* [[Displacement]]


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

Revision as of 11:25, 18 August 2009

Application with and without $blendmodulatetexture.

WorldVertexTransition is the shader used to blend the vertices of a displacement surface between two different albedos. It handles two at once by using a mirrored set of parameters with "2" in their name.

The pattern of the blend is defined by Hammer's alpha painting tool. The blend is normally a linear gradient, but it can also be "stamped" by a texture specified with $blendmodulatetexture. This command makes the material look considerably better for very little cost - use it often!

Note.pngNote:This shader now only works on displacements.

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.
  • The Hammer material browser won't be able to display a preview of the material unless it's given a %tooltexture.

Supported effects

See also