$moss enable: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 74: Line 74:
}}
}}
}}
}}
{{MatParam|$moss_scale|float|Scale for moss. Deprecated and non-functional. Use [[$seamless_scale]] instead, it will scale the moss texture.
{{MatParam|$moss_scale|float|Scale for moss. Deprecated and non-functional. Use [[$seamless_scale]] instead.}}
{{MatParam|$moss_scale_turn_on_absolute|bool|Toggle moss scale between enabled and disabled state. 1 - enabled, 0 - disabled. Affects nothing at least in {{bms|4|nt=2}}.|deprecated=1}}
{{MatParam|$seamless_scale|float|This parameter scales texture for this shader.
{{expand|title=Examples.|
{{expand|title=Examples.|
<br>
<gallery mode=packed heights=310px>
<gallery mode=packed heights=310px>
File:20240602164627_1.jpg|<code>$seamless_scale 0</code>
File:20240602164627_1.jpg|<code>$seamless_scale 0</code>
Line 82: Line 83:
</gallery>
</gallery>
}}
}}
|deprecated=1}}
}}
{{MatParam|$moss_scale_turn_on_absolute|bool|Toggle moss scale between enabled and disabled state. 1 - enabled, 0 - disabled. Affects nothing at least in {{bms|4|nt=2}}.|deprecated=1}}


==Bugs/Limitations==
==Bugs/Limitations==

Revision as of 11:02, 8 January 2025

English (en)Translate (Translate)

$moss_enable is a material shader parameter available in Black Mesa Black Mesa.

Moss shader example with LightmappedGeneric, for $moss_texture used xen/moss00_d.
Moss shader example with VertexLitGeneric, for $moss_texture used models/props_xen/moss_test/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, LightmappedGeneric and Lightmapped_4WayBlend 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 the specified texture. For LightmappedGeneric and Lightmapped_4WayBlend, instead of using the texture itself for moss, this shader takes color that most of the texture consists of and then applies color to the surface according to the parameters specified in .vmt. All parameters works in the same way for both shaders.

In Black Mesa Black Mesa it was used for models\props_xen\moss_test\sphereofchon.mdl and models\props_xen\moss_test\test_moss001.mdl models. Both using the models/props_xen/moss_test/bubblemoss texture. The final version of the game doesn't use this shader in any of the maps. May be incompatible with some shaders (as it was with $phong).

Note.pngNote:There is no Hammer Hammer preview for this shader.
Black Mesa Level Creation

Parameters and Effects

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

Bugs/Limitations

Incompatible with new specular shader

New specular shader doesn't blend with moss shader.

See also