This article's documentation is for anything that uses the Source engine. Click here for more information.

WorldVertexTransition: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 49: Line 49:
{{MatParam|$vertexalpha|bool| Causes the material to blend between the primary texture and full transparency. Automatically marks the material as {{ent|$translucent}}. Requires <code>$vertexcolor</code> to be set to 1.}}
{{MatParam|$vertexalpha|bool| Causes the material to blend between the primary texture and full transparency. Automatically marks the material as {{ent|$translucent}}. Requires <code>$vertexcolor</code> to be set to 1.}}
{{MatParam|$additive|bool| Adds the color of the pixels on the surface with the pixels of objects behind it.}}
{{MatParam|$additive|bool| Adds the color of the pixels on the surface with the pixels of objects behind it.}}
{{MatParam|$phong|bool|only={{csgo}}}| Diffuse reflections.}}
{{MatParam|$phong|bool|only={{csgo}}{{mapbase}}| Diffuse reflections.}}
{{MatParam|$phong_exp|only={{lw}}|float|{{confirm|Is this for LW's Blinn–Phong reflections?}}}}
{{MatParam|$phong_exp2|only={{lw}}|float|{{confirm|Is this for LW's Blinn–Phong reflections?}}}}
{{MatParam|$layertint1|color255|only={{csgo}}| SRGB tint layer 1.}}
{{MatParam|$layertint1|color255|only={{csgo}}| SRGB tint layer 1.}}
{{MatParam|$layertint2|color255|only={{csgo}}}| SRGB tint layer 2.}}
{{MatParam|$layertint2|color255|only={{csgo}}}| SRGB tint layer 2.}}

Revision as of 23:04, 7 April 2024

Broom icon.png
This article or section needs to be updated to include current information regarding the subject.
Remember to check for any notes left by the tagger at this article's talk page.
Application without and with $blendmodulatetexture.

WorldVertexTransition is a s0 available in all Source Source games. It is a shader functionally similar to LightmappedGeneric primarily used to perform a per-vertex linear blend between two textures on a displacement surface. Many of the parameter definitions for the secondary material are the same as the first material except with a "2" at the end. ex: $basetexture2

You can choose which texture you would like to appear on a vertex using Hammer's alpha painting tool. The blend is normally a linear gradient, but you can control the blend on a per-pixel basis by specifying $blendmodulatetexture in the material.

Icon-Important.pngImportant:In Black Mesa Black Mesa this shader was missed in the deferred renderer update. Instead, use LightmappedGeneric, which, in Black Mesa Black Mesa, has all the features of WorldVertexTransition.

Caveats

Note.pngNote:You can also use $vertexalpha to create a material that fades out. This uses the first $basetexture then fades out with the blend. Unfortunately, it is treated the same as a material with $translucent and can have sorting issues with other transparency objects.
Note.pngNote: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.
Note.pngNote:The shader LightmappedGeneric does texture blending as well and supports many of the same features as this shader.
Confirm:Does WorldVertexTransition support any features that LightmappedGeneric does not?
Icon-Bug.pngBug:$blendmodulatetexture does not display in hammer despite the shader LightmappedGeneric displaying it correctly. Instead it displays a linear blend. This has been fixed in Garry's Mod  [todo tested in ?]
Todo: This shader was significantly upgraded in Counter-Strike: Global Offensive with new parameters, a new layer blending mode, drop shadows, and support for layer-specific detail textures and specular masks. Document these.

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

$basetexture $basetexture2 $bumpmap $bumpmap2 $blendmodulatetexture $detail $envmap $lightwarptexture $seamless_scale $selfillum $ssbump $translucent $alpha $vertexalpha $additive $phong $phong_exp $phong_exp2 $layertint1 $layertint2 [[%detailtype|%detailtype]]

See also