In this section, we propose a particle system of cloud, which consists of the structure model, simplification model, and illumination model. Specifically, the shape of cloud is described by the structure model; the computing performance is improved by the simplification model. Light transport in clouds could be described by its illumination model, which conforms to the laws of radiative transfer.
Basic concepts
Particle system is a simulation method for irregular fuzzy object, in which objects are defined as thousands of irregular and randomly distributed particle sets, each particle has a certain life cycle, constantly moving and changing its shape every moment. In this way, the dynamic change of the shape and characteristics of the scene are described by the collection of many particles, not a single particle. The particle system fully embodies the motion and randomness of the irregular fuzzy object, which conforms to the physical nature of the object, and thus can well simulate natural landscapes such as fire, cloud, water, and forest [21]. The basic steps of object modeling with particle system are shown in Fig. 1:
Particle system of cloud
Each operation of the particle system is a process computing model, so it can be combined with any model that describes the motion and characteristics of the object. To truly simulate an object, particles are given the following properties: position, size, speed and direction of movement, color, transparency, and life cycle. The WRF model provides with various options for parameterizations of the boundary layer physics [22]. It provides the user various options for the parameterization of microphysics and cumulus parameterization, such as the composition, size, shape, and concentration of cloud [23].
The common method to simulate cloud in particle system is to set up a sphere and fill the interior of the sphere with particles. In order to ensure the computational efficiency [24], the size of the sphere is limited to a certain extent, and it cannot approach the horizontal distribution of clouds accurately. At the same time, the randomly generated particles are dense in the center of the sphere and sparse in the periphery, which satisfy the objective perception of human beings, but lose the real distribution law of cloud particles. Hence, it is vital to describe the real distribution law of cloud particles according to the WRF model. Among of the WRF data, cloud optical thickness is an important parameter to describe the optical properties of clouds [25]. Its definition is as follows:
$$ \lambda = \Delta h\int {\Gamma \pi {r^{2}}} n(r)dr, $$
(1)
where Γ represents extinction efficiency factor, and the cloud optical thickness λ represents a function of cloud droplet radius, wavelength, and refractive index. Δh represents the thickness of the clouds; n(r) represents the number of particles with radius r per unit volume. In the visible band, when the scale of cloud particles increases to a certain value, Γ goes to 2, then
$$ \lambda = 2\pi \Delta h\int {{r^{2}}} n(r)dr. $$
(2)
Obviously, the cloud optical thickness is related to the droplet concentration per unit volume, droplet radius, and cloud thickness. It is shown that the appearance of clouds with large optical thickness is characterized by thick cloud cover and high concentration of cloud droplet particles. Therefore, the optical thickness of the cloud can be used to approximately represent the thickness of the cloud, which is in line with the visual perception of people. The cloud top height data describe the horizontal and vertical distribution of the cloud, which ensures the accuracy of the cloud distribution. At the same time, the optical thickness approximately reflects the cloud cover. The combination of the two can reflect the objective distribution of cloud particles.
In this paper, a particle generation method with selection criteria is adopted: load the cloud top height data and convert it into a one-dimensional array A. The whole three-dimensional space of cloud distribution is divided into M×N grids horizontally. Generate random number R as the index in A, and calculate the grid where the particles are based on R
$$ \textit{col} = \textit{MOD}(R,\textit{COLS}). $$
(3)
$$ \textit{row} = \textit{floor}(R/\textit{COLS}). $$
(4)
where col and row respectively represents the column and row in the grid. The column and row number of the grid is multiplied by the side length of the grid to get the plane position of the particle.
In the process of generating random numbers, the following methods are used to make the optical thickness interfere with the particle distribution: the random number is generated and used as the index in A to obtain the corresponding cloud optical thickness data after the conversion of the resolution. According to the following formula
$$ M = {\lambda_{i}} \times \frac{K}{{{\lambda_{\max }}}} - \tau, $$
(5)
where λ represents the current cloud optical thickness value, λmax represents the maximum cloud optical thickness, and K is a constant, which is used to control the probability of a random number being selected. τ is a random number from 0 to 1. When M is more than 0, the random number is retained, and when M is less than 0, the random number is generated again until M is more than 0. It can be seen from (5) that where the cloud optical thickness is large, the probability of randomly generated particles being selected is high, and the smaller the cloud optical thickness is, the smaller the probability of being selected is.
Simulation of cloud evolution
In the real world, clouds will drift and spread, due to the influence of natural factors such as high airflow. Therefore, simulating the dynamic behavior of clouds is the key to enhancing the realism of cloud scenes. Cloud motion is affected by four factors: pressure, diffusion, advection, and external forces. Affected by the above factors, cloud particles generate acceleration and thus form dynamic behaviors such as fluttering.
The WRF model data itself contains the evolution of weather over a time series, with an initial velocity and acceleration when the particles are initialized. As the timeline moves forward, the positions of the particles change, allowing the cloud to change dynamically. According to the laws of Newtonian mechanics, in the process of rendering each frame in this paper, the new position of particles is calculated by the following formula
$$ S = {S_{0}} + {V_{0}}T + \frac{1}{2}a{T^{2}}. $$
(6)
Formula (6) is the calculation method of any coordinate component of 3D coordinates system, where S is the coordinate component, S0 is the initial value of the coordinate component, V0 is the velocity component, a is the acceleration component, and T is the time in the current life cycle.
Display with the distance
In the process of displaying complex models, the graphics that need to be highlighted will occupy more pixels on the screen, while those that do not need to be highlighted will not be accurately drawn with a large number of pixels. LOD technology is based on a series of evaluation criteria to select different precision to achieve the object of multi-resolution display [26]. Generally, the LOD technology in the traditional geometric modeling means that the number of vertices in a geometric model is determined by the distance from the object to the viewpoint [27–29]. For the particle system, when the viewpoint is close, more particles are generated; on the contrary, fewer particles. Thus, less running time is occupied and the rendering efficiency is improved. How to formulate the ratio of the number of particles with the distance is the focus of this section. Inspired by the principles of camera imaging, we derived the proportion value between the size of the object on the imaging surface and the actual size, which is taken as the proportion value of the number of vertices in the simplified geometric model to the number of vertices in the original model. The law states that
$$ \eta = 1 - \frac{f}{L}. $$
(7)
In the three-dimensional coordinate system, the direction is considered, (7) is turned into (8)
$$ \eta = 1 - {\left(\frac{f}{L}\right)^{3}}. $$
(8)
According to the characteristics of particle system, the following method can be derived. Then,
When the distance reaches L0, the simplification rate reaches the lower limit, and a further reduction will not be carried out. As for the upper limit of simplification rate, it can be 1 theoretically. However, it is often simplified to stop when only one particle is produced. Since modeling simplification is often hierarchical, the simplification rate η of the m-level model can be expressed as
$$ {\eta_{m}} = 1 - \frac{{{N_{m}}}}{{{N_{0}}}}, $$
(10)
where N0 is the particle number of the initial model and Nm is the number of m-level model. The number of particles generated in the distance Lm can be used as Nm, and the mean number of particles in the distance L0 can be used as N0. The relationship between Nm and Lm can be deduced as follows
$$ {\eta_{m}} = 1 - \frac{{{N_{m}}}}{{{N_{0}}}} = 1 - \frac{{{L_{0}}}}{{{L_{m}}}}. $$
(11)
$$ {N_{m}} = \frac{{{N_{0}} \times {L_{0}}}}{{{L_{m}}}}. $$
(12)
Similar to (8)
$$ {N_{m}} = {N_{0}} \times {\left(\frac{{{L_{0}}}}{{{L_{m}}}}\right)^{3}}. $$
(13)
Illumination model
When light passes through the medium, the energy of light will be attenuated to different degrees due to the absorption and scattering of light by the medium [30]. Clouds observed in the physical world are made up of a huge number of condensed water droplets, which absorb and scatter light as it passes through them. The scattered light will be absorbed and scattered as it passes through other particles. Therefore, the main work of this section is how to simulate the attenuation of light energy by cloud particles, so that the light intensity and direction on different cloud particles are different, and the final expression is the brightness of the particles. The propagation of light is attenuated by increasing distance. The brightness of light is inversely proportional to the distance from the light source. It is shown that
$$ i = \frac{I}{{{d^{2}}}}, $$
(14)
where i is the light intensity at the sampling point, d is the distance, and I is the light intensity. What is obtained here is the brightness value at a sampling point. In order to obtain the brightness value of all the sampling points, it is necessary to integrate and sum the brightness values of all the sampling points, which is described in Fig. 2.
S is the position of the light source, C is the position of the camera (viewpoint), O is the position of the object, t1, t2, t3, and t4 are the four sampling points, where function L(t) is the brightness value at the sampling point t. Function x(t) is the integral curve of the line of sight. The formula can be obtained as follows:
$$ x(t) = {r_{c}} + t \cdot {r_{d}}, $$
(15)
where rc is the line of sight, rd is the direction of sight, and the function x(t) is substituted into L(t) to get
$$ L(t) = \frac{I}{{{{[x(t) - s]}^{2}}}}, $$
(16)
where s is the position of the light source, and the cloud depth is d. We need to obtain the integral from 0 to d of L(t), which can be obtained from the above two equations
$$ L(t) = \frac{I}{{v \cdot {{\left[\arctan \left(\frac{{b + d}}{v}\right) - \arctan \left(\frac{b}{v}\right)\right]}^{2}}}}, $$
(17)
where
$$ v = \frac{1}{{\sqrt {c - {b^{2}}} }},b = {r_{d}} \cdot ({r_{c}} - s),c = {({r_{c}} - s)^{2}}. $$
(18)
The formula for calculating the illumination intensity of each particle is obtained. The particles at the boundary of the cloud are illuminated directly by the light source without any shielding, so these particles should be brighter. Points within the cloud layer are different in depth from the boundary of the cloud cluster, and the light intensity calculated according to formula (17) is also different. According to the light intensity, a corresponding gray value is assigned.