Clouds are shaded via gradient lighting, taking the sun and viewer direction into account. The gradient shading computation is done per-vertex. Interestingly, a per-pixel gradient computation gave inferior results as clouds tended to get overlit. In addition rim lighting is applied on a per-pixel basis to capture the effects of a special form of light scattering typically seen when looking at clouds being lit by the sun from behind. For more information on setting up 3D clouds in the Sandbox Editor, please see the Setting Up Weather Effects tutorial.
Clouds use "Soft Clipping" to gradually fade in/out at the near and far clipping plane. This prevents rendering artifacts in the far distance and flickering due to cloud particles entering/leaving the view cone near the camera during a flythrough. Additionally, clouds blend softly against opaque scene geometry. No manual setup is required to enable this feature!
Clouds rendered in CRYENGINE.
For the gradient lighting the engine internally calculates a bright and a dark color and interpolates between the two based on the current viewer, sun and cloud position.
The bright color is calculated from the current HDR Sun color multiplier. The dark color is from the current HDR Sky color multiplier.
The values for sun and sky color as well as the two color multipliers can be altered in the editor's Time of Day window.
Param | Description |
---|---|
CloudAngularAtten | Defines the angular attenuation factor for rim lighting. The smaller the value the more wide-spread the rim lighting effect for clouds (partially) covering the sun from the viewer's point of view. |
CloudBacklightingScale | Defines how much the to scale rim lighting. The higher the value the more cloud edges will glow. |
CloudOutlineSlope | Defines the slope of the ramp function used to blend in rim lighting. The higher the value the harder the transition. |
CloudOutlineThreshold | Defines the cloud's opacity threshold value below which the rim lighting effect is applied. The higher the threshold the more rim lighting will "grow" inwards. |
HDRBrightnessAdjust | Controls brightness of clouds in HDR (relative to LDR). |
e_Clouds r_CloudsDebug
Enable clouds rendering
Toggles debugging mode for clouds.Usage: r_CloudsDebug [0/1/2]
Usage: r_CloudsDebug = 1: render just screen imposters
Usage: r_CloudsDebug = 2: render just non-screen imposters
Default is 0 (off)