FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
visual::sky::CloudLayer Class Reference

Public Member Functions

 CloudLayer (std::uint32_t seed, double cover, double altitude=1500.0, double thickness=1.0, int size=kSize)
 
const std::vector< float > & Texels () const
 The noise texture, RGBA float per texel (base, detail, 0, 0), row-major (row along y), Size() x Size().
 
int Size () const
 Texels per side of the noise texture.
 
double Cover () const
 
double Altitude () const
 
double BasePeriod () const
 Tile size of the base channel [m].
 
double DetailPeriod () const
 Tile size of the detail channel [m].
 
double DetailWeight () const
 Weight of the detail channel in the noise.
 
double Threshold () const
 Noise value where the cloud starts (edge 0 of the density smoothstep).
 
double Softness () const
 Width of the cloud edge in noise units (narrower for finer textures, whose detail then shows at the edges).
 
double MaxOpticalDepth () const
 Optical depth of the densest cloud (thicker layers for higher coverage, times the thickness).
 
double DepthWidth () const
 Noise range over which the optical depth grows to its maximum (wider for overcast, so that it keeps texture).
 
double Noise (double x, double y, const CloudDrift &drift) const
 
double OpticalDepth (double x, double y, const CloudDrift &drift) const
 Vertical optical depth of the layer at a horizontal position (see Noise()).
 
double OpticalDepthOfNoise (double noise) const
 Optical depth from a noise value.
 
double MeanTransmittance () const
 Mean of exp(-optical depth) over the base tile: the share of the direct sun that gets through on average.
 
double CoveredFraction () const
 Share of the base tile covered by cloud (optical depth above 0.3).
 

Static Public Attributes

static constexpr int kSize = 256
 Texels per side of the noise texture by default (Visual.CloudResolution = "Normal").
 

Constructor & Destructor Documentation

◆ CloudLayer()

visual::sky::CloudLayer::CloudLayer ( std::uint32_t  seed,
double  cover,
double  altitude = 1500.0,
double  thickness = 1.0,
int  size = kSize 
)
Parameters
[in]seedSeed of the noise.
[in]coverShare of the sky with cloud, in [0, 1].
[in]altitudeAltitude of the layer [m].
[in]thicknessScale of the optical depth (1: fair-weather cumulus; 3-5: dark storm clouds).
[in]sizeTexels per side of the noise texture, a power of two >= kSize. Each doubling adds one octave to both channels: the same cloud field with detail half the size.

Member Function Documentation

◆ Noise()

double visual::sky::CloudLayer::Noise ( double  x,
double  y,
const CloudDrift &  drift 
) const

The noise (base + weight (detail - 0.5)) at a horizontal position.

Parameters
[in]x,yWorld position (NED) [m].
[in]driftOffsets of the channels.

The documentation for this class was generated from the following file: