Class: VolumetricClouds
Clouds marched through a tileable noise volume instead of meshed. Drawn as one screen-covering triangle after the scene's transparency composites, reading a copy of the scene's depth so a slab wraps around the terrain that rises through it: a low layer becomes a sea of cloud with the peaks standing out of it.
The voxel style steps cell by cell (each texel is one cloud cube, shaded by the face the ray crossed into it); the soft style marches evenly through a filtered volume.
Hierarchy
-
Mesh<BufferGeometry,ShaderMaterial>↳
VolumetricClouds
Constructors
constructor
• new VolumetricClouds(options?, shared?): VolumetricClouds
Parameters
| Name | Type |
|---|---|
options | Partial<VolumetricCloudsOptions> |
shared | VolumetricCloudsSharedUniforms |
Returns
Overrides
Mesh<BufferGeometry, ShaderMaterial>.constructor
Properties
isInitialized
• isInitialized: boolean = false
options
• options: VolumetricCloudsOptions
Methods
configure
▸ configure(options): void
Change the style or the layers in place; the noise is kept.
Parameters
| Name | Type |
|---|---|
options | Partial<VolumetricCloudsOptions> |
Returns
void
dispose
▸ dispose(): void
Returns
void
drawBehindBlended
▸ drawBehindBlended(renderer, scene, camera, layers): void
Draws the half of the deck behind the scene's blended layers, under
their composite: layers is the accumulation's weight target, read for
where they stand. Called with the scene's target bound, just before the
composite; the deck's own draw later this render is the front half.
Parameters
| Name | Type |
|---|---|
renderer | WebGLRenderer |
scene | Scene<Object3DEventMap> |
camera | Camera |
layers | Texture<unknown> |
Returns
void
onBeforeRender
▸ onBeforeRender(renderer, _scene, camera): void
Parameters
| Name | Type |
|---|---|
renderer | WebGLRenderer |
_scene | unknown |
camera | Camera |
Returns
void
Overrides
Mesh.onBeforeRender
setHidden
▸ setHidden(hidden): void
Hide the deck without dropping it (the camera under water).
Parameters
| Name | Type |
|---|---|
hidden | boolean |
Returns
void
setSeed
▸ setSeed(seed): void
Parameters
| Name | Type |
|---|---|
seed | number |
Returns
void
update
▸ update(driftClock): void
Drift the deck with a clock every viewer shares, so two clients see the
same cloud in the same place. Pass a slewed clock (World.shaderClock):
the shared clock itself snaps on every server correction, and the deck
would jump with it.
Parameters
| Name | Type |
|---|---|
driftClock | number |
Returns
void