$moss enable: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 5: Line 5:
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 {{bms|4}} and was designed to simulate presence of moss on surface.
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 {{bms|4}} and was designed to simulate presence of moss on surface.


For [[VertexLitGeneric]], it uses specified texture. For [[LightmappedGeneric]] and [[Lightmapped_4WayBlend]], 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>.
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 <code>.vmt</code>.
All parameters works in the same way for both shaders.
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. 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]]).
In {{bms|4}} it 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 the <code>models/props_xen/moss_test/bubblemoss</code> 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|There is no {{hammer|4}} preview for this shader.}}
{{note|There is no {{hammer|4}} preview for this shader.}}
{{back | Black Mesa Level Creation}}
{{back | Black Mesa Level Creation}}
Line 34: Line 34:
}}
}}
}}
}}
{{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]].
{{MatParam|$moss_angle_theta|float|Inner angle value. With [[LightmappedGeneric]], works properly only on [[displacement]] surfaces. Results depend on <code>$moss_angle_phi</code> and <code>$moss_angle_falloff</code>. Works in a similar way for [[VertexLitGeneric]].
{{expand|title=Examples.|
{{expand|title=Examples.|
<br>
<br>
Line 44: Line 44:
}}
}}
}}
}}
{{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]].
{{MatParam|$moss_angle_phi|float|Outer angle value. With [[LightmappedGeneric]], works properly only on [[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 54: Line 54:
}}
}}
}}
}}
{{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]].
{{MatParam|$moss_angle_falloff|float|Falloff value. With [[LightmappedGeneric]], works properly only on [[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>
Line 64: Line 64:
}}
}}
}}
}}
{{MatParam|$moss_blend_factor|float|Moss blend factor. Use values from 0 to 1, other works incorrectly.
{{MatParam|$moss_blend_factor|float|Moss blend factor. Use values from 0 to 1, others do not work correctly.
{{expand|title=Examples.|
{{expand|title=Examples.|
<br>
<br>
Line 87: Line 87:
==Bugs/Limitations==
==Bugs/Limitations==
====Incompatible with new specular shader====
====Incompatible with new specular shader====
New specular shader doesn't blending with moss shader.
New specular shader doesn't blend with moss shader.
<gallery mode=nolines heights=256px widths=384px>
<gallery mode=nolines heights=256px widths=384px>
Black Mesa Screenshot 2024.01.14 - 11.48.45.07=.jpg|An example with [[LightmappedGeneric]]. The specular should be yellow and not white.
Black Mesa Screenshot 2024.01.14 - 11.48.45.07=.jpg|An example with [[LightmappedGeneric]]. The specular should be yellow instead of white.
Black Mesa Screenshot 2024.06.01 - 18.51.17.26=.jpg|An example with [[VertexLitGeneric]]. The specular should be green and not white.
Black Mesa Screenshot 2024.06.01 - 18.51.17.26=.jpg|An example with [[VertexLitGeneric]]. The specular should be green instead of white.
</gallery>
</gallery>



Revision as of 05:19, 9 November 2024

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

Bugs/Limitations

Incompatible with new specular shader

New specular shader doesn't blend with moss shader.

See also