Cloud: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
{{LanguageBar}}
{{LanguageBar}}


'''{{code|Cloud}}''' draws a [[$basetexture]] without lighting, masked by [[$cloudalphatexture]].<br>
'''{{code|Cloud}}''' draws a [[$basetexture]] without lighting, masked by [[$cloudalphatexture]].<br>
Line 15: Line 14:


== Supported Parameters ==
== Supported Parameters ==
{{MatParam|$basetexture|texture|Defines an albedo texture.}}
{{MatParamDef|$basetexture|texture|Defines an albedo texture.}}
{{MatParam|$frame|integer|Frame Parameter for [[$basetexture]].}}
{{MatParamDef|$frame|integer|Frame Parameter for [[$basetexture]].}}
{{MatParam|$cloudalphatexture|texture|Defines an Alpha-Texture. The entire Texture, both RGB Values and Alpha, are multiplied with the [[$basetexture]].<br>
{{MatParamDef|$cloudalphatexture|texture|Defines an Alpha-Texture. The entire Texture, both RGB Values and Alpha, are multiplied with the [[$basetexture]].<br>
The Alpha Texture has a different texture-transform than the [[$basetexture]], bringing variety to the Result.}}
The Alpha Texture has a different texture-transform than the [[$basetexture]], bringing variety to the Result.}}
{{MatParam|$cloudscale|vector2|Two-Dimensional Scalar for the [[$basetexturetransform]]. Works similar to [[$detailscale]] on other Shaders}}
{{MatParamDef|$cloudscale|vector2|Two-Dimensional Scalar for the [[$basetexturetransform]]. Works similar to [[$detailscale]] on other Shaders}}
{{MatParam|$maskscale|vector2|Two-Dimensional Scalar for the [[$cloudalphatexture]]. Unlike [[$basetexture]], this one does not have a related matrix texture-transform-parameter}}
{{MatParamDef|$maskscale|vector2|Two-Dimensional Scalar for the [[$cloudalphatexture]]. Unlike [[$basetexture]], this one does not have a related matrix texture-transform-parameter}}
{{MatParam|$additive|boolean|Causes the Shader to render additively instead of blending via the alpha. Fog is only applied to the Alpha, not RGB Values, so using this Parameter effectively disables Fog.}}
{{MatParamDef|$additive|boolean|Causes the Shader to render additively instead of blending via the alpha. Fog is only applied to the Alpha, not RGB Values, so using this Parameter effectively disables Fog.}}

Latest revision as of 12:07, 23 August 2025

English (en)Translate (Translate)

Cloud draws a $basetexture without lighting, masked by $cloudalphatexture.
As the name implies its used for rendering Clouds.
It does this by multiplying $basetexture with $cloudalphatexture, including Alpha.
This works similar to $detail's $detailblendmode 8, except the Alpha is also multiplied.
Unlike other Shaders, the RGB Values are not affected by Fog. The Alpha IS however!
By default, this Shader uses Alpha Blending ( $translucent ).
Using $additive, this can be reconfigured to draw additively instead.

Todo: The $cloudalphatexture uses a second Texture Coordinate.

Either this Shader is supposed to be used on Brushes ( utilising the Lightmap Coordinates somehow ),

or it's supposed to be used on planes created via the MeshBuilder.

Supported Parameters

Defines an albedo texture.
Frame Parameter for $basetexture.
Defines an Alpha-Texture. The entire Texture, both RGB Values and Alpha, are multiplied with the $basetexture.
The Alpha Texture has a different texture-transform than the $basetexture, bringing variety to the Result.
Two-Dimensional Scalar for the $basetexturetransform. Works similar to $detailscale on other Shaders
Two-Dimensional Scalar for the $cloudalphatexture. Unlike $basetexture, this one does not have a related matrix texture-transform-parameter
Causes the Shader to render additively instead of blending via the alpha. Fog is only applied to the Alpha, not RGB Values, so using this Parameter effectively disables Fog.