This article's documentation is for anything that uses the Source engine. Click here for more information.

VolumeCloud: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(27 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Shader|VolumeCloud}} It takes three input materials and creates a cloud effect. It can be applied to [[models]], and requires further testing for compatibility with proxies and parameters.
{{this is a|pixel shader|name=VolumeCloud}} It takes three input materials and creates a cloud effect. It can be applied to [[models]], and requires further testing for compatibility with proxies and parameters.


[[File:volumecloud_example.jpg|thumb|Volume Cloud applied to various mesh]]
[[File:volumecloud_example.jpg|thumb|Volume Cloud applied to various mesh]]
Line 11: Line 11:
== Supported Parameters ==
== Supported Parameters ==


;{{ent|$basetexture}}
{{MatParamDef|$basetexture|texture|First cloud texture.}}
: the first texture.
{{MatParamDef|$basetexture2|texture|Second cloud texture.}}
;{{ent|$basetexture2}}
{{MatParamDef|$basetexture3|texture|Third cloud texture.}}
: the second texture.
{{MatParamDef|$refractamount|float|How strong the refraction effect should be when the material is partially cloaked. ''Default 2''.}}
;{{ent|$basetexture3}}
{{MatParamDef|$time|float|Speed of cloud movement depends on this. This value is set in the code. ''Default: ''[[List Of Material Proxies|CurrentTime]]. {{note|For example, you can set it to: ''CurrentTime/6''. This will make the clouds move slower.}} {{warning|Writing a static $time value to vmt will cause clouds to freeze.}} }}
: the third texture.
{{MatParamDef|$basetexturespeed|float|First texture movement speed.|only={{gmod}}}}
 
{{MatParamDef|$basetexture2speed|float|Second texture movement speed.|only={{gmod}}}}
{{MatParamDef|$basetexture3speed|float|Third texture movement speed.|only={{gmod}}}}


=== See also ===
=== See also ===
Line 23: Line 24:
*{{ent|UnlitGeneric}}, A fullbright shader useful for skybox elements
*{{ent|UnlitGeneric}}, A fullbright shader useful for skybox elements
*{{ent|VertexLitGeneric}}, the standard shader for models
*{{ent|VertexLitGeneric}}, the standard shader for models
* {{ent|Cloud}}, a similar shader
[[Category:Shaders]]

Latest revision as of 11:48, 23 August 2025

VolumeCloud is a Pixel shader available in all Source Source games. It takes three input materials and creates a cloud effect. It can be applied to models, and requires further testing for compatibility with proxies and parameters.

Volume Cloud applied to various mesh

As the shader is intended to simulate moving cloud cover it does not receive shadows. The effect works best with mostly white, transparent noise but also works with non-transparent textures.

The various texture layers all rotate counter clockwise around the "center" of the UV map. Each layer has additive blending on the others, which allows the depth effect to look seamless with white clouds that layer upon each-other. All three base textures are required to be defined, each one in the sequence rotating at a lower speed.

Todo: Are "VolumeCloud" and "VolumeClouds" (the second one is found in Episode Two materials) shaders serve the same purpose ?

Supported Parameters

First cloud texture.
Second cloud texture.
Third cloud texture.
How strong the refraction effect should be when the material is partially cloaked. Default 2.
Speed of cloud movement depends on this. This value is set in the code. Default: CurrentTime.
Note.pngNote:For example, you can set it to: CurrentTime/6. This will make the clouds move slower.
Warning.pngWarning:Writing a static $time value to vmt will cause clouds to freeze.
$basetexturespeed <float> (only in Garry's Mod)
First texture movement speed.
$basetexture2speed <float> (only in Garry's Mod)
Second texture movement speed.
$basetexture3speed <float> (only in Garry's Mod)
Third texture movement speed.

See also