Difference between revisions of "WorldVertexTransition"

From Valve Developer Community
Jump to: navigation, search
m (Misc fixes)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
[[File:Blendmodulate.jpg|thumb|250px|Application without and with <code>[[$blendmodulatetexture]]</code>.]]
 
[[File:Blendmodulate.jpg|thumb|250px|Application without and with <code>[[$blendmodulatetexture]]</code>.]]
  
'''<code>WorldVertexTransition</code>''' is the [[shader]] used to blend the vertices of a [[displacement]] surface between two different materials. It handles two at once by using a mirrored set of parameters with "2" in their name.
+
{{Shader|WorldVertexTransition}} It is used to blend the vertices of a [[displacement]] surface between two different materials. 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 [[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!
+
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 {{ent|$blendmodulatetexture}}. This command makes the material look considerably better for very little [[budget|cost]] - use it often!
  
{{note|This shader now '''only''' works on displacements.}}
+
{{note|This shader now '''only''' works on displacements. If used on a regular brush, VBSP will generate and pack a {{ent|LightmappedGeneric}} version of the material automatically, discarding the secondary texture.}}
  
 
==Example==
 
==Example==
Line 20: 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.
+
* Some 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>.
 
* The Hammer material browser won't be able to display a preview of the material unless it's given a <code>[[%tooltexture]]</code>.
  
== Supported effects ==
+
== Supported Parameters ==
  
* <code>[[$blendmodulatetexture]]</code>
+
; {{ent|$blendmodulatetexture}} {{EP1 add}}
* <code>[[$seamless_scale]]</code>
+
: Modulate the blending between materials using a special texture.
* <code>[[$bumpmap]]</code>
+
; {{ent|$bumpmap}}
* <code>[[$ssbump]]</code> (whole material only)
+
: Bumpmapping.
* <code>[[$detail]]</code> (whole material only)
+
; {{ent|$detail}}
* <code>[[$envmap]]</code> (might disable <code>[[$blendmodulatetexture]]</code> if both used)
+
: Detail texturing. Applies the same detail texture to both materials.
* {{todo|<code>[[$outline]]</code>?}}
+
; {{ent|$envmap}}
* <code>[[$translucent]]</code> and <code>[[$alpha]]</code> (whole material only)
+
: Specular reflections. {{todo|Might disable <code>$blendmodulatetexture</code> if both are used.}}
 +
; {{ent|$lightwarptexture}} {{EP1 add}}
 +
: Per-texel color modification via a warp texture. Applies the lightwarp to both materials.
 +
; {{ent|$seamless_scale}} {{EP2 add}}
 +
: Mitigation for displacement texture stretching.
 +
; {{ent|$selfillum}}
 +
: Self-illumination. Applies the self-illumination to both materials. {{todo|Might disable <code>$blendmodulatetexture</code> if both are used.}}
 +
; {{ent|$ssbump}} {{EP2 add}}
 +
: Self-shadowing bumpmapping. If two bumpmaps are used, both must be self-shadowing bumpmaps in order for this to work properly.
 +
; {{ent|$translucent}}
 +
; {{ent|$alpha}}
 +
: Expensive and cheap transparency. Applies the transparency to both materials.
 +
; {{ent|$phong}} {{CSGO only}}
 +
: Diffuse reflections.
  
 
== See also ==
 
== See also ==
  
* <code>[[LightmappedGeneric]]</code>
+
* [[LightmappedGeneric]], the standard shader for lightmapped surfaces.
* <code>[[Lightmapped_4WayBlend]]</code>
+
* [[Lightmapped_4WayBlend]], an upgraded displacement blend shader for {{csgo}}.
* <code>[[WorldTwoTextureBlend]]</code>
+
* [[LightmappedTwoTexture]], a brush shader that multiplies a texture on top of another one.
* <code>[[LightmappedTwoTexture]]</code>
+
* [[WorldTwoTextureBlend]], a brush shader that applies a texture on top of another one using $detail.
* [[Displacement]]
+
* [[Displacement]], the surface type this shader is used on.
  
 
[[Category:Shaders]]
 
[[Category:Shaders]]
 
==Tutorials about Func_wall (Russian)==
 
Lessons created by [https://vk.com/project_source Project-S]
 
 
*[https://www.youtube.com/watch?v=VhZNHzQoFNI Func_Wall + Func_LOD (на Русском)]
 

Latest revision as of 18:32, 18 August 2019

Application without and with $blendmodulatetexture.

WorldVertexTransition is a material shader available in all Source games. It is used to blend the vertices of a displacement surface between two different materials. 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:This shader now only works on displacements. If used on a regular brush, VBSP will generate and pack a LightmappedGeneric version of the material automatically, discarding the secondary texture.

Example

WorldVertexTransition
{
	$basetexture nature/dirtfloor006a
	$surfaceprop dirt

	$basetexture2 nature/rockfloor005a
	$surfaceprop2 rock

	%tooltexture nature/blendrockgrass004a_tooltexture
}
  • Some 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 Parameters

$blendmodulatetexture (New with Half-Life 2: Episode One / Source 2006)
Modulate the blending between materials using a special texture.
$bumpmap
Bumpmapping.
$detail
Detail texturing. Applies the same detail texture to both materials.
$envmap
Specular reflections. To do: Might disable $blendmodulatetexture if both are used.
$lightwarptexture (New with Half-Life 2: Episode One / Source 2006)
Per-texel color modification via a warp texture. Applies the lightwarp to both materials.
$seamless_scale (New with Half-Life 2: Episode Two / Source 2007)
Mitigation for displacement texture stretching.
$selfillum
Self-illumination. Applies the self-illumination to both materials. To do: Might disable $blendmodulatetexture if both are used.
$ssbump (New with Half-Life 2: Episode Two / Source 2007)
Self-shadowing bumpmapping. If two bumpmaps are used, both must be self-shadowing bumpmaps in order for this to work properly.
$translucent
$alpha
Expensive and cheap transparency. Applies the transparency to both materials.
$phong (Only in Counter-Strike: Global Offensive)
Diffuse reflections.

See also