$moss enable: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{langsp}}
{{langsp}}
[[File:MOSS.png|thumb|right|Moss shader example, for <code>$moss_texture</code> used <code>xen/moss00_d</code>.]]
[[File:MOSS.png|thumb|right|Moss shader example with [[LightmappedGeneric]], for <code>$moss_texture</code> used <code>xen/moss00_d</code>.]]
This shader was created during development of Xen for {{bms|4}} and is designed to simulate presence of moss on surface. Instead of using texture itself for moss, this shader takes color that most of the texture consists of and then applies color to surface according to the parameters specified in <code>.vmt</code>.
[[File:MOSS25.png|thumb|right|Moss shader example with [[VertexLitGeneric]], for <code>$moss_texture</code> used <code>xen/bubblemoss</code>.]]
{{warning| This shader was never used by developers in {{bms|4}} campaign, may be incomplete and incompatible with other shaders, use carefully.}}
This is procedural moss implementation, which is triplanar projection shader that allows you to project additional texture that mixes with [[normalmap]]. This shader available for [[VertexLitGeneric]] and [[LightmappedGeneric]] shaders. It was created during development of [[Xen]] for {{bms|4}} and was designed to simulate presence of moss on surface.
{{todo| Take the rocks model and materials from the game files and document how this shader works with models.}}
 
For [[VertexLitGeneric]], it uses specified texture. For [[LightmappedGeneric]], instead of using texture itself for moss, this shader takes color that most of the texture consists of and then applies color to surface according to the parameters specified in <code>.vmt</code>.
All parameters works in the same way for both shaders.
 
In {{bms|4}} was used for <code>models\props_xen\moss_test\sphereofchon.mdl</code> and <code>models\props_xen\moss_test\test_moss001.mdl</code> models. Both using <code>models/props_xen/moss_test/bubblemoss</code> texture. This shader was never used by developers in {{bms|4}} campaign, may be incomplete and incompatible with other shaders, use carefully.}}
{{back | Black Mesa Level Creation}}
{{back | Black Mesa Level Creation}}


== Parameters and Effects ==
== Parameters and Effects ==
{{MatParam|$moss_enable|int|Toggle moss between enabled and disabled state. 1 - enabled, 0 - disabled.}}
{{MatParam|$moss_enable|int|Toggle moss between enabled and disabled state. 1 - enabled, 0 - disabled.}}
{{MatParam|$moss_texture|texture|Defines a [[diffuse]] texture that will use moss for color.
{{MatParam|$moss_texture|texture|For [[LightmappedGeneric]], defines a [[diffuse]] texture that will use moss for color. For [[VertexLitGeneric]], defines a [[diffuse]] texture that will use moss and mix with [[normalmap]].
{{expand|title=Examples.|
{{expand|title=Examples.|
<br>
<br>
<gallery mode=packed heights=410px>
<gallery mode=packed heights=410px>
File:moss1.png |<code>metal/metalgrate013a</code>
File:moss1.png |<code>metal/metalgrate013a</code> ([[LightmappedGeneric]])
File:moss2.png |<code>dev/dev_ram_512_red </code>
File:moss2.png |<code>dev/dev_ram_512_red </code> ([[LightmappedGeneric]])
File:moss3.png |<code>xen/moss00_d</code>
File:moss3.png |<code>xen/moss00_d</code> ([[LightmappedGeneric]])
</gallery>
</gallery>
}}
}}
}}
}}
{{MatParam|$moss_ref_direction|vector3|Defines direction for moss, the numbers can be negative.
{{MatParam|$moss_ref_direction|vector3|Defines direction for moss, the numbers can be negative. Works in the same way for [[VertexLitGeneric]].
{{expand|title=Examples.|
{{expand|title=Examples.|
<br>
<br>
Line 28: Line 32:
}}
}}
}}
}}
{{MatParam|$moss_angle_theta|float|Inner angle value for [[displacement]] surfaces. Results depend on <code>$moss_angle_phi</code> and <code>$moss_angle_falloff</code>.
{{MatParam|$moss_angle_theta|float|Inner angle value. With [[LightmappedGeneric]], works only properly only for [[displacement]] surfaces. Results depend on <code>$moss_angle_phi</code> and <code>$moss_angle_falloff</code>. Works in similar way for [[VertexLitGeneric]].
{{expand|title=Examples.|
{{expand|title=Examples.|
<br>
<br>
Line 38: Line 42:
}}
}}
}}
}}
{{MatParam|$moss_angle_phi|float|Outer angle value for [[displacement]] surfaces. Results depend on <code>$moss_angle_theta</code> and <code>$moss_angle_falloff</code>.
{{MatParam|$moss_angle_phi|float|Outer angle value. With [[LightmappedGeneric]], works only properly only for [[displacement]] surfaces. Results depend on <code>$moss_angle_theta</code> and <code>$moss_angle_falloff</code>. Works in similar way for [[VertexLitGeneric]].
{{expand|title=Examples.|
{{expand|title=Examples.|
<br>
<br>
Line 48: Line 52:
}}
}}
}}
}}
{{MatParam|$moss_angle_falloff|float|Falloff value for [[displacement]] surfaces. Results depend on <code>$moss_angle_theta</code> and <code>$moss_angle_phi</code>.
{{MatParam|$moss_angle_falloff|float|Falloff value. With [[LightmappedGeneric]], works only properly only for [[displacement]] surfaces. Results depend on <code>$moss_angle_phi</code> and <code>$moss_angle_theta</code>. Works in similar way for [[VertexLitGeneric]].
{{expand|title=Examples.|
{{expand|title=Examples.|
<br>
<br>

Revision as of 09:27, 1 June 2024

English (en)Translate (Translate)
Moss shader example with LightmappedGeneric, for $moss_texture used xen/moss00_d.
Moss shader example with VertexLitGeneric, for $moss_texture used xen/bubblemoss.

This is procedural moss implementation, which is triplanar projection shader that allows you to project additional texture that mixes with normalmap. This shader available for VertexLitGeneric and LightmappedGeneric shaders. It was created during development of Xen for Black Mesa Black Mesa and was designed to simulate presence of moss on surface.

For VertexLitGeneric, it uses specified texture. For LightmappedGeneric, instead of using texture itself for moss, this shader takes color that most of the texture consists of and then applies color to surface according to the parameters specified in .vmt. All parameters works in the same way for both shaders.

In Black Mesa Black Mesa was used for models\props_xen\moss_test\sphereofchon.mdl and models\props_xen\moss_test\test_moss001.mdl models. Both using models/props_xen/moss_test/bubblemoss texture. This shader was never used by developers in Black Mesa Black Mesa campaign, may be incomplete and incompatible with other shaders, use carefully.}}

Black Mesa Level Creation

Parameters and Effects

$moss_enable $moss_texture $moss_ref_direction $moss_angle_theta $moss_angle_phi $moss_angle_falloff $moss_scale $moss_scale_turn_on_absolute

Issues

Incompatible with new specular shader

New specular shader doesn't blending with moss shader.

See also