WorldVertexTransition: Difference between revisions
Jump to navigation
Jump to search
Note: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: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:The shader LightmappedGeneric does texture blending as well and supports many of the same features as this shader.
Bug:$blendmodulatetexture does not display in hammer despite the shader LightmappedGeneric displaying it correctly. Instead it displays a linear blend. This has been fixed in
[todo tested in ?]
Deprecated (talk | contribs) (Added update template and todo; needs more CS:GO documentation) |
(Added some new commands, Added some caveats, Reworded language to be more exact.) |
||
Line 2: | Line 2: | ||
[[File:Blendmodulate.jpg|thumb|250px|Application without and with <code>[[$blendmodulatetexture]]</code>.]] | [[File:Blendmodulate.jpg|thumb|250px|Application without and with <code>[[$blendmodulatetexture]]</code>.]] | ||
{{Shader|WorldVertexTransition}} It is used to blend | {{Shader|WorldVertexTransition}} 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 [[Displacement#Blended displacement materials (alpha channel painting)|alpha painting tool]]. The blend is normally a linear gradient, but you can control the blend on a per-pixel basis by specifying {{ent|$blendmodulatetexture}} in the material. | |||
==Caveats== | |||
{{note|You can also use {{ent|$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 {{ent|$translucent}} and can have sorting issues with other transparency objects.}} | |||
{{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.}} | {{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.}} | ||
{{note|The shader {{ent|LightmappedGeneric}} does texture blending as well and supports many of the same features as this shader.}} | |||
{{bug|{{ent|$blendmodulatetexture}} does not display in hammer despite the shader {{ent|LightmappedGeneric}} displaying it correctly. Instead it displays a linear blend. This has been fixed in {{GMOD}}}} | |||
{{todo|This shader was significantly upgraded in {{csgo}} with new parameters, a new layer blending mode, drop shadows, and support for layer-specific detail textures and specular masks. Document these.}} | {{todo|This shader was significantly upgraded in {{csgo}} with new parameters, a new layer blending mode, drop shadows, and support for layer-specific detail textures and specular masks. Document these.}} | ||
Line 28: | Line 34: | ||
== Supported Parameters == | == Supported Parameters == | ||
; {{ | ; {{MatParam|$basetexture|texture|}} | ||
: The first texture in the blend. | |||
; {{MatParam|$basetexture2|texture|}} | |||
: The second texture to blend to. | |||
; {{MatParam|$bumpmap|texture|}} | |||
: bumpmap for the first texture. | |||
; {{MatParam|$bumpmap2|texture|}} | |||
: bumpmap for the second texture. | |||
; {{MatParam|$blendmodulate|texture|}} | |||
: Modulate the blending between materials using a special texture. | : Modulate the blending between materials using a special texture. | ||
; {{ | ; {{MatParam|$dettail|texture|}} | ||
: Detail texturing. Applies the same detail texture to both materials. In {{csgo}}, [[$detail#CS:GO_WorldVertexTransition_Parameters|each layer can use their own detail texture.]] | : Detail texturing. Applies the same detail texture to both materials. In {{csgo}}, [[$detail#CS:GO_WorldVertexTransition_Parameters|each layer can use their own detail texture.]] | ||
; {{ | ; {{MatParam|$envmap|texture|}} | ||
: Specular reflections. In {{csgo}}, [[$envmapmask#CS:GO_WorldVertexTransition_Parameters|each layer can have their own specular mask.]] {{todo|Might disable <code>$blendmodulatetexture</code> if both are used.}} | : Specular reflections. In {{csgo}}, [[$envmapmask#CS:GO_WorldVertexTransition_Parameters|each layer can have their own specular mask.]] {{todo|Might disable <code>$blendmodulatetexture</code> if both are used.}} | ||
; {{ | ; {{MatParam|$lightwarptexture|texture|}} | ||
: Per-texel color modification via a warp texture. Applies the lightwarp to both materials. | : Per-texel color modification via a warp texture. Applies the lightwarp to both materials. | ||
; {{ | ; {{MatParam|$seamless_scale|float|}} | ||
: Mitigation for displacement texture stretching. | : Mitigation for displacement texture stretching. | ||
; {{ | ; {{MatParam|$selfillum|bool|}} | ||
: Self-illumination. Applies the self-illumination to both materials. {{todo|Might disable <code>$blendmodulatetexture</code> if both are used.}} | : Self-illumination. Applies the self-illumination to both materials. {{todo|Might disable <code>$blendmodulatetexture</code> if both are used.}} | ||
; {{ | ; {{MatParam|$ssbump|bool|}} | ||
: Self-shadowing bumpmapping. If two bumpmaps are used, both must be self-shadowing bumpmaps in order for this to work properly. | : Self-shadowing bumpmapping. If two bumpmaps are used, both must be self-shadowing bumpmaps in order for this to work properly. | ||
; {{ | ; {{MatParam|$translucent|bool|}} | ||
; {{ | ; {{MatParam|$alpha|float|}} | ||
: Expensive and cheap transparency. Applies the transparency to both materials. | : Expensive and cheap transparency. Applies the transparency to both materials. | ||
; {{ | ; {{MatParam|$vertexalpha|bool|}} | ||
: Causes the material to blend between the primary texture and full transparency. Automatically marks the material as {{ent|$translucent}}. | |||
; {{MatParam|$additive|bool|}} | |||
: Adds the color of the pixels on the surface with the pixels of objects behind it. | |||
; {{MatParam|$phong|bool|}} | |||
: Diffuse reflections. | : Diffuse reflections. | ||
; {{MatParam|%detailtype|string|}} | |||
: Specifies what {{ent|Detail props}} to spawn on the material. The string should be the name of a detail type outlined in "detail.vbsp" or your specified .vbsp file. | |||
== See also == | == See also == |
Revision as of 20:08, 5 September 2020

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.
Remember to check for any notes left by the tagger at this article's talk page.

Application without and with
$blendmodulatetexture
.
WorldVertexTransition
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.
Caveats





Todo: This shader was significantly upgraded in
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
- The first texture in the blend.
$basetexture2
- The second texture to blend to.
$bumpmap
- bumpmap for the first texture.
$bumpmap2
- bumpmap for the second texture.
$blendmodulate
- Modulate the blending between materials using a special texture.
$dettail
- Detail texturing. Applies the same detail texture to both materials. In
, each layer can use their own detail texture.
$envmap
- Specular reflections. In
, each layer can have their own specular mask.
Todo: Might disable$blendmodulatetexture
if both are used. $lightwarptexture
- Per-texel color modification via a warp texture. Applies the lightwarp to both materials.
$seamless_scale
- Mitigation for displacement texture stretching.
$selfillum
- Self-illumination. Applies the self-illumination to both materials. Todo: Might disable
$blendmodulatetexture
if both are used. $ssbump
- 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.
$vertexalpha
- Causes the material to blend between the primary texture and full transparency. Automatically marks the material as $translucent.
$additive
- Adds the color of the pixels on the surface with the pixels of objects behind it.
$phong
- Diffuse reflections.
[[%detailtype|%detailtype]]
- Specifies what Detail props to spawn on the material. The string should be the name of a detail type outlined in "detail.vbsp" or your specified .vbsp file.
See also
- LightmappedGeneric, the standard shader for lightmapped surfaces.
- Lightmapped_4WayBlend, an upgraded displacement blend shader for
.
- LightmappedTwoTexture, a brush shader that multiplies a texture on top of another one.
- WorldTwoTextureBlend, a brush shader that applies a texture on top of another one using $detail.
- Displacement, the surface type this shader is used on.