Real-time rendering method and system for physical simulation volume cloud

By combining a dynamic noise mixing model and a multi-scattering lighting model with adaptive light travel processing, the problem of high quality and high efficiency in cloud rendering in virtual reality and film and television special effects is solved. It realizes cloud structures and lighting effects with rich shapes and dynamic changes, which are suitable for game engines, film and television production and weather simulation.

CN120912754AActive Publication Date: 2025-11-07北京渲光科技有限公司 +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202511082921.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-04
Publication Date
2025-11-07
Estimated Expiration
2045-08-04

Smart Images

  • Figure CN120912754A_ABST
    Figure CN120912754A_ABST
Patent Text Reader

Abstract

The invention discloses a physical simulation volume cloud real-time rendering method and system, and the method comprises the following steps: constructing a dynamic noise mixing model, and constructing a complex cloud layer through mixing a plurality of noises based on the dynamic noise mixing model; constructing a multi-scattering illumination model, performing single-scattering calculation and multi-scattering approximation on the complex cloud layer by using the multi-scattering illumination model, and performing illumination simulation; on the basis that illumination simulation is completed, a cloud layer density field of the complex cloud layer is divided into a plurality of voxel blocks, light advancing self-adaptive processing is carried out, and volume cloud real-time rendering is completed. On the premise of not sacrificing image quality and rendering efficiency, an advanced cloud modeling theory and an efficient GPU acceleration technology are fused, a diversified cloud body structure is generated by adopting a mixed noise model, and various typical cloud types such as high-altitude cirrus cloud, cumulus cloud and layer cloud can be accurately represented.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of computer graphics, and particularly relates to a real-time rendering method and system for physically simulating volumetric clouds. BACKGROUND

[0002] In the fields of virtual reality, film special effects, game engines, scientific visualization, etc., realistic and dynamically changing cloud and sky rendering plays an irreplaceable role in improving immersion and enhancing environmental narrative capabilities. Especially in open-world games, flight simulators, and weather visualization systems, the sky often occupies a large proportion of the picture, and its light and shadow changes, cloud layer movements, and day-night cycles directly affect users' perceptions and emotions. However, real-time simulation of these complex and variable natural phenomena faces many challenges: how to generate cloud structures with rich shapes and dynamic evolution? How to achieve lighting effects that conform to physical laws? How to achieve real-time rendering while ensuring high quality? These problems have long been key technical difficulties in graphics research and industrial applications.

[0003] Current mainstream cloud modeling techniques mainly include grid-based methods, procedural modeling methods, and texture mapping methods based on land or satellite images. Among them, the grid-based modeling method is easy to control the shape, but it is difficult to represent the softness and dynamic change of the cloud; the procedural method relies on noise functions to generate cloud structure, which can achieve real-time animation, but lacks the realism and diversity of details; and the use of real images as texture maps is limited by the perspective and weather conditions, and cannot be flexibly adapted to different lighting and time changes. In addition, existing real-time volumetric cloud rendering methods usually simplify the model or reduce the sampling rate to improve performance, sacrificing picture quality in exchange for stable frame rate. However, in a vast open world with complex terrain (such as mountains, forests, lakes) and dynamic environment (such as day and night alternation, weather changes), low-quality cloud rendering is obviously not enough to meet the needs of visual realism and artistic expression. Therefore, it is particularly important to develop a real-time volumetric cloud rendering method that can balance high quality and efficiency, and deeply integrate with the weather system. SUMMARY

[0004] The present application aims to solve the deficiencies of the prior art and provides the following solutions:

[0005] A real-time rendering method for physically simulating volumetric clouds, comprising the following steps:

[0006] Constructing a dynamic noise hybrid model, and constructing a complex cloud layer by mixing multiple noises based on the dynamic noise hybrid model;

[0007] Constructing a multi-scattering lighting model, and performing single-scattering calculation and multi-scattering approximation on the complex cloud layer using the multi-scattering lighting model to perform lighting simulation;

[0008] On the basis of completing the light simulation, the cloud density field of the complex cloud layer is divided into a plurality of voxel blocks, and light ray running adaptive processing is performed to complete real-time rendering of the volume cloud.

[0009] Preferably, the method for constructing a complex cloud layer comprises:

[0010] A weather parameter vector is obtained, and a basic noise signal is decomposed in a frequency domain by using fast Fourier transform to obtain low-frequency noise, medium-frequency noise and high-frequency noise:

[0011]

[0012] i∈{Perlin-Worley,Worley high , Curl}

[0013] freq∈{LF,MF,HF}

[0014]

[0015] wherein, represents a noise signal after fast Fourier transform, represents fast Fourier transform, Perlin-Worley represents a basic cloud shape noise, Worley high represents high-frequency Worley noise, Curl represents 2D curl noise, LF represents low frequency, MF represents medium frequency, and HF represents high frequency;

[0016] The low-frequency noise, the medium-frequency noise and the high-frequency noise are superimposed after modulation, and a spatial domain noise is generated by inverse Fourier transform:

[0017]

[0018] wherein, represents a spatial domain noise, represents inverse Fourier transform, α freq represents a mixing weight of each frequency band, represents a minimum weight of each frequency band, represents a maximum weight of each frequency band, represents precipitation intensity, represents wind speed, φ(t) represents a phase shift function, and t represents a time variable, represents a gradient amplitude of the Curl noise;

[0019] Based on the spatial domain noise, the cloud layer is divided into a low-resolution layer and a high-resolution layer, a basic cloud shape is generated based on the low-resolution layer, and dynamic details are added in the basic cloud shape based on the high-resolution layer.

[0020] Based on the density field formula calculated according to the spatial domain noise, the cloud coverage, type and rainfall effect are simulated by the weather parameter vector, and the complex cloud is constructed.

[0021] Preferably, the method for performing the light simulation comprises:

[0022] In combination with Beer-Lambert law and Henyey-Greenstein phase function, a single scattering light model is constructed:

[0023]

[0024] σ t = σ s + σ a

[0025] Wherein, L single represents single scattering light, σ t represents extinction coefficient, σ s represents scattering coefficient, σ a represents absorption coefficient, d represents optical path, g represents anisotropy parameter, and θ represents the angle between light source direction and line of sight direction;

[0026] Based on the single scattering light model, a multiple scattering light model is constructed:

[0027]

[0028] Wherein, L multi represents single scattering light, and κ represents the attenuation rate controlling multiple scattering;

[0029] The density gradient is introduced into the light calculation, the multiple scattering light model is used to dynamically generate the edge darkening effect, and the light simulation is completed:

[0030]

[0031] Wherein, L final represents the final simulated light, represents the density gradient, represents the Euclidean norm of the gradient vector, represents the normalized line of sight direction vector, and saturate(·) represents the function of limiting the value in the range of [0, 1].

[0032] Preferably, the method for performing the light ray marching adaptive processing comprises:

[0033] On the basis of completing the light simulation, the cloud density field of the complex cloud layer is divided into 32*32*32 voxel blocks, and each voxel block stores an empty block mark and density gradient information;

[0034] Optimizing the light by using empty block skipping and importance sampling, and dynamically adjusting the step length by the density change rate, and finally judging whether to terminate early based on the transparency saturation and continuous empty sampling, to complete the adaptive processing of the light travel.

[0035] The application also provides a real-time rendering system for physically simulating a volume cloud, which applies the rendering method of any one of the above, and comprises a cloud construction module, a light simulation module and a light adaptive processing module.

[0036] The cloud construction module is used to construct a dynamic noise hybrid model, and construct a complex cloud layer by mixing a plurality of noises based on the dynamic noise hybrid model.

[0037] The light simulation module is used to construct a multi-scattering light model, and perform single-scattering calculation and multi-scattering approximation on the complex cloud layer by using the multi-scattering light model to perform light simulation.

[0038] The light adaptive processing module divides the cloud density field of the complex cloud layer into a plurality of voxel blocks on the basis of completing the light simulation, and performs adaptive processing of light travel to complete real-time rendering of the volume cloud.

[0039] Preferably, the workflow of the cloud construction module comprises:

[0040] Obtaining a weather parameter vector, and decomposing a basic noise signal in a frequency domain by using fast Fourier transform to obtain low-frequency noise, medium-frequency noise and high-frequency noise:

[0041]

[0042] i∈{Perlin-Worley,Worley high ,Curl}

[0043] freq∈{LF,MF,HF}

[0044]

[0045] Wherein, represents a noise signal after fast Fourier transform, represents fast Fourier transform, Perlin-Worley represents a basic cloud shape noise, Worley high represents high-frequency Worley noise, Curl represents 2D curl noise, LF represents low frequency, MF represents medium frequency, and HF represents high frequency.

[0046] The low-frequency noise, the medium-frequency noise and the high-frequency noise are superimposed after modulation, and a spatial domain noise is generated by inverse Fourier transform:

[0047]

[0048] wherein, represents the spatial domain noise, represents the inverse Fourier transform, α freq represents the mixing weight of each frequency band, represents the minimum weight of each frequency band, represents the maximum weight of each frequency band, represents the precipitation intensity, represents the wind speed, and φ(t) represents a phase shift function, t represents a time variable, represents the gradient amplitude of the Curl noise;

[0049] Based on the spatial domain noise, the cloud layer is divided into a low-resolution layer and a high-resolution layer, and a basic cloud shape is generated based on the low-resolution layer, and dynamic details are added in the basic cloud shape based on the high-resolution layer;

[0050] A density field formula is calculated based on the spatial domain noise, the cloud layer coverage, type and rainfall effect are simulated by the weather parameter vector, and the complex cloud layer is completed.

[0051] Preferably, the workflow of the light simulation module includes:

[0052] A single scattering light model is constructed by combining Beer-Lambert law and Henyey-Greenstein phase function:

[0053]

[0054] wherein, L single represents single scattering light, σ t represents extinction coefficient, σ s represents scattering coefficient, σ a represents absorption coefficient, d represents optical path, g represents anisotropy parameter, and θ represents the angle between light source direction and line of sight direction;

[0055] Based on the single scattering light model, a multiple scattering light model is constructed:

[0056]

[0057] wherein, L multi represents single scattering light, and κ represents the attenuation rate controlling multiple scattering;

[0058] The density gradient is introduced into the light calculation, the edge darkening effect is dynamically generated by using the multi-scattering light model, and the light simulation is completed:

[0059]

[0060] Wherein, L final represents the final simulated light, represents the density gradient, represents the Euclidean norm of the gradient vector, represents the normalized view direction vector, and saturate(·) represents a function of limiting the value in the range of [0, 1].

[0061] Preferably, the working process of the light ray adaptive processing module comprises:

[0062] On the basis of completing the light simulation, the cloud density field of the complex cloud layer is divided into 32*32*32 voxel blocks, and each voxel block stores an empty block mark and density gradient information;

[0063] The light ray is optimized by using empty block skipping and importance sampling, the step size is dynamically adjusted through the density change rate, and finally whether to terminate early is judged based on the transparency saturation and continuous empty sampling, and the light ray travel adaptive processing is completed.

[0064] Compared with the prior art, the beneficial effects of the present application are:

[0065] The present application combines advanced cloud modeling theory and efficient GPU acceleration technology without sacrificing image quality and rendering efficiency, generates diversified cloud structure by using a hybrid noise model, and can accurately reproduce high-altitude cirrus, cumulus, stratocumulus and other typical cloud types. At the same time, combined with the light projection-based light algorithm, the accurate simulation of complex light effects such as sunlight, scattered light and shadow is realized, so that the cloud body can present a natural and hierarchical visual effect under different time periods and weather conditions. Unlike the traditional method which relies on two-dimensional weather texture, the present application completely programs the sky state, supports dynamic evolution and environment linkage, and truly realizes the concept of "programmable sky". From the performance point of view, the present application realizes a rendering time of only 2 milliseconds per frame on a modern GPU, has low memory occupation, and has high real-time performance and deployability. This technical breakthrough not only significantly improves the realism and artistic expression of cloud rendering, but also provides strong technical support for building a highly immersive virtual environment, and is widely applicable to game engines, film production, flight simulation, weather simulation and other fields. BRIEF DESCRIPTION OF DRAWINGS

[0066] In order to more clearly illustrate the technical solutions of the present application, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description only represent some of the embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of these drawings.

[0067] Figure 1 The method flowchart of the embodiment of the present application is shown in the figure.

[0068] Figure 2 The method flowchart of the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0069] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only represent some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0070] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application will be further described in detail with reference to the drawings and specific embodiments.

[0071] Clouds are composed of tiny droplets, ice crystals or other particles suspended in the atmosphere, and their formation is influenced by air currents, temperature changes and humidity changes, resulting in a variety of shapes and constant changes. Due to the high reflectivity of clouds, light can be scattered in multiple directions, resulting in a change from white to gray or even bright colors, making it extremely challenging to accurately simulate the appearance and dynamic changes of clouds. The theoretical background related to cloud rendering covers the basic principles of atmospheric scattering, light attenuation, etc., which provide the physical basis for cloud modeling and rendering.

[0072] (1) Atmospheric scattering principle: When photons emitted by the sun enter the atmosphere, they interact with particles in the air and scatter. This scattering has a significant impact on the color of light and changes the direction of light propagation. Among them, Rayleigh scattering is suitable for the interaction of photons with particles much smaller than the wavelength of light. The shorter the wavelength of light, the more easily it scatters, which is the reason why the sky appears blue during the day and orange during sunrise and sunset. Mie scattering is suitable for scattering caused by larger particles, which includes Rayleigh scattering as a special case. Its equation is complex and is often solved by approximation methods.

[0073] (2) Phase function: The phase function is a key function that describes the distribution of scattered light in different directions when light scatters in a medium. It determines the probability of a photon scattering from one direction to another, and has a significant impact on the appearance of clouds and lighting effects. In volumetric cloud rendering, particles such as water droplets or ice crystals in the cloud will scatter light, and the phase function helps simulate this scattering process, thereby affecting the visual characteristics of the cloud such as brightness, color and shape. Different phase functions will produce different scattering effects, and thus make the cloud appear different.

[0074] (3) Illumination attenuation theory - Beer-Lambert law: describes the attenuation or disappearance of light in the atmosphere due to exit scattering events, i.e. the transmittance of light in the atmosphere changes exponentially with the propagation distance, and the attenuation value corresponding to the exit scattering event is related to the exit scattering caused by the interaction of photons with air molecules and aerosol particles.

[0075] Embodiment one

[0076] In this embodiment, as shown in Figure 1 , Figure 2 , a real-time rendering method for physically simulating volumetric clouds includes the following steps:

[0077] S1. Construct a dynamic noise mixing model, and construct a complex cloud layer by mixing multiple noises based on the dynamic noise mixing model.

[0078] By mixing multiple noises (Perlin noise, Worley noise, Curl noise), Perlin-Worley is used to generate coherent cloud clusters, Worley high adds debris, and Curl introduces dynamic turbulence, finally generating a complex cloud layer shape and realizing dynamic evolution.

[0079] Perlin-Worley noise: Perlin-Worley is a composite noise generated by superimposing Perlin noise and low-frequency Worley noise, used to simulate the basic shape of the cloud layer; the formula is as follows:

[0080] Perlin-Worley(x,y,z)=Perlin(x,y,z)·(1+Worley low (x,y,z))

[0081]

[0082] Where amp i represents the amplitude of the i-th layer (usually attenuated according to ); Noise gradient represents the interpolation noise based on the grid point gradient; ∈ kRepresents a random feature point in 3D space, the density is controlled by resolution; r k Represents the radius of the feature point (used to control cell size).

[0083] High-frequency Worley noise: high-frequency Worley noise is used to add details to the edges of the cloud layer; the formula is:

[0084]

[0085] Where, Worley high (x,y,z) is generated by 2 i+3 Increase the frequency (i=0 corresponds to frequency 8, i=1 corresponds to frequency 16, i=2 corresponds to frequency 32, more dense cell structure can be generated), and pass through three layers of iteration (i=0,1,2) to increase the complexity of details.

[0086] Curl noise: curl noise is generated by the curl field of 2D Perlin noise (ignoring the vertical component, i.e. y direction), which is used to simulate horizontal wind field disturbance; the formula is as follows:

[0087]

[0088] Where, represents the gradient operator, Perlin x (x,z) represents the Perlin noise value at coordinates (x,z), which represents the disturbance in the x direction; Perlin z (x,z) represents the Perlin noise value at coordinates (x,z), which represents the disturbance in the z direction.

[0089] In this embodiment, the method for constructing complex cloud layers includes:

[0090] Obtain the weather parameter vector Where, w c is the coverage, i.e. the ratio of the cloud layer covering the sky, w c = 0 means no cloud, w c = 1 is fully covered; w t is the cloud type, which can be controlled by an enumeration value (such as 0 for cumulus, 1 for stratus, 2 for rain cloud, etc.), and the height gradient function can be controlled; represents the precipitation intensity, which affects the rain cloud density and the thickening at the bottom; represents the wind speed, which is used to simulate the disturbance intensity of wind on the cloud layer turbulence; in addition , a time variable t needs to be input, which is used for dynamic evolution of noise over time.

[0091] By introducing frequency domain noise modulation techniques, combined with multi-resolution noise fusion strategies, dynamically adjusting the noise weights of different frequency bands, thus achieving more fine control of cloud morphology. This method is based on weather parameter vector The noise signal is decomposed in the frequency domain, and the contribution of each frequency band is dynamically modulated by parameters such as wind speed and precipitation intensity, and finally a high-fidelity cloud density field is synthesized in the spatial domain. This embodiment significantly improves the realism of cloud dynamic evolution, while optimizing the computational efficiency through multi-resolution fusion. Specifically, the basic noise signals (Perlin-Worley, Worleyhigh and Curl) are decomposed in the frequency domain using fast Fourier transform to obtain low-frequency noise, medium-frequency noise and high-frequency noise:

[0092]

[0093] i∈{Perlin-Worley,Worley high ,Curl}

[0094] freq∈{LF,MF,HF}

[0095]

[0096] Where, represents the noise signal after fast Fourier transform, represents the fast Fourier transform, Perlin-Worley represents the basic cloud shape noise, combining the continuity of Perlin and the cell structure of Worley; Worley high represents high-frequency Worley noise, used to add details (such as cloud edge fragments); Curl represents 2D curl noise, used to simulate wind-driven turbulent motion; LF represents low frequency, used to control the macroscopic morphology of the cloud (such as the overall shape of the cloud cluster); MF represents medium frequency, used to simulate the internal structure of the cloud (such as turbulence and density gradient); HF represents high frequency, used to add edge fragments and detailed textures;

[0097] After modulating the low-frequency noise, medium-frequency noise and high-frequency noise, they are superimposed and inverse Fourier transformed to generate spatial domain noise:

[0098]

[0099] Where, represents the spatial domain noise, represents the inverse Fourier transform, α freq represents the mixing weight of each frequency band, which can be dynamically adjusted according to the weather parameter vector ; represents the minimum weight of each frequency band, denotes the maximum weight of each frequency band, the maximum and minimum weights are predefined values, such as e j·φ(t) denotes a phase correction term, to avoid phase discontinuity caused by frequency domain modulation, φ(t) denotes a phase offset function, denotes the gradient amplitude of the Curl noise, used to align the disturbance direction of the wind field;

[0100] Based on the spatial domain noise, the cloud layer is divided into a low resolution layer and a high resolution layer, and the basic cloud shape is generated based on the low resolution layer, and dynamic details are added in the basic cloud shape based on the high resolution layer; in this embodiment, the cloud layer is divided into a low resolution layer and a high resolution layer, wherein the low resolution layer can guarantee the performance of the basic shape, and the high resolution layer can add dynamic details, avoiding full resolution calculation, thereby balancing the details and performance of the volumetric cloud.

[0101] (1) Low resolution layer (128 3 3D texture): Perlin-Worley noise is used, specifically, the low frequency component generates the macroscopic basic morphology of the cloud layer (such as the block structure of the cloud). Specifically, in the preprocessing stage, a 32 low resolution Worley 3 texture is generated by the Worley low (x, y, z) formula, a 3D texture is generated by the Perlin(x, y, z) formula, and then the two 3D textures are calculated according to the Perlin-Worley(x, y, z) to obtain a 128 3 resolution Perlin-Worley 3D noise texture. In runtime, the 3D noise texture generated in the preprocessing stage is directly sampled as the basic cloud shape.

[0102] (2) High resolution layer (32 3 3D texture + 128 2 2D texture): medium-high frequency component adds detailed rain turbulence disturbance (such as turbulence on the surface of the cloud layer, and flocculent structure at the bottom of the rain cloud). In the preprocessing stage, a 32 high resolution Worley 3 3D texture is first generated by the Worley high (x, y, z) formula, and then a 128 2 resolution Curl 2D texture is generated by the Curl(x, z) formula. In runtime, the Worley high 3D texture is sampled and modulated by the Curl 2D texture, specifically:

[0103] Detail = Worley high (x, y, z) · Curl(x, z).

[0104] (3) Density field formula based on spatial domain noise calculation:

[0105]

[0106] Where HG represents the vertical density distribution function, which is adjusted according to the cloud type, for cumulus clouds HG(z) = smoothstep(1500, 4000, z), and for stratus clouds g c represents the global coverage, g c = w c ·(1+0.5·sin(t·0.1));β MF Enhance mid-frequency turbulence details by increasing precipitation intensity; β HF Drive high-frequency patch dynamics by wind speed.

[0107] Simulate cloud coverage, type, and rainfall effects by weather parameter vector to complete the construction of complex clouds. In this embodiment:

[0108] (1) Introduce a density multiplication factor in the rain area to enhance the density of the cloud in the rain area:

[0109]

[0110] Where erf is the error function, used to simulate the thickening of the rain cloud at the bottom when z < 1500 meters, Rise quickly to enhance the density of the rain cloud at the bottom.

[0111] (2) GPU calculates and updates Where coverage w c Affected by the humidity and air pressure simulated by the weather system, the rainfall Affected by the weather system and time, wind speed Affected by the weather system, the time phase for driving Curl noise

[0112] S2. Construct a multi-scattering lighting model, and use the multi-scattering lighting model to perform single-scattering calculation and multi-scattering approximation on the complex cloud layer to perform lighting simulation.

[0113] The method for lighting simulation includes:

[0114] In this embodiment, the Beer-Lambert law and the Henyey-Greenstein phase function are combined to construct a single-scattering lighting model:

[0115]

[0116] where the Beer-Lambert index term The Henyey-Greenstein phase function is used to simulate the directionality of single scattering, especially suitable for Mie scattering of water droplets in cloud layers; L single represents single-scattered lighting; σ t represents the extinction coefficient, σ s represents the scattering coefficient, σ a represents the absorption coefficient; d represents the optical path, i.e., the path length of the light ray propagating in the cloud layer, which is related to the sampling step and the density field; g represents the anisotropy parameter, which is used to control the scattering directionality, g ∈ [-1, 1], g > 0 represents forward scattering (such as sunlight penetrating the cloud layer), and g < 0 represents backward scattering; θ represents the included angle between the light source direction and the line of sight direction, which determines the distribution of scattered light intensity.

[0117] Based on the single-scattering lighting model, a fast scattering approximation is introduced to simplify the complex integral scattering process into an empirical formula related to the optical path, avoiding the high computational overhead of the traditional diffusion equation, and at the same time realizing the artistic controllable scattering intensity through the κ parameter, to construct a multi-scattering lighting model:

[0118]

[0119] where L multi represents single-scattered lighting; represents the proportion of scattering events to total extinction events, which is usually σ s >>σ a Therefore is close to 1; κ represents the attenuation rate of multiple scattering, κ ∈ [0.5, 1.0], which can be adjusted through experiments to balance the realism and performance (such as κ = 0.5 for sunny days and κ = 1.0 for overcast days). The diffusion approximation term is used to simulate the energy diffusion of light rays after multiple scattering in the cloud layer, where the longer the optical path d, the faster the attenuation of scattered light intensity.

[0120] The density gradient is introduced into the lighting calculation, and the multi-scattering lighting model is used to dynamically generate the edge darkening effect, completing the lighting simulation:

[0121]

[0122] where L final represents the final simulated lighting; represents the density gradient, i.e., the gradient vector of the cloud density field, reflecting the direction of density change; represents the Euclidean norm of the gradient vector, denotes the normalized line-of-sight direction vector, the dot product term is used to measure the degree of alignment between the density gradient and the line-of-sight direction, and when the line-of-sight direction is consistent with the direction of the density gradient (e.g., looking towards the edge of a cloud layer), the dot product value is maximum, resulting in a decrease in brightness, simulating the darkening of the cloud layer edge due to the self-shadowing effect; saturate(·) represents a function that limits the value to the range [0, 1], i.e., when the independent variable of the function is less than 0, saturate(·) = 0; when the independent variable of the function is greater than 1, saturate(·) = 1; when the independent variable of the function is greater than 0 and less than 1, the value of saturate(·) remains unchanged.

[0123] In this embodiment, the phase functions used are all Henyey-Greenstein phase functions, although Henyey-Greenstein phase functions are widely used in cloud rendering, and can conveniently adjust the scattering properties of clouds to achieve the desired rendering effect, but it is not completely physically accurate because clouds usually do not exhibit the scattering distribution described by the Henyey-Greenstein phase function.

[0124] (1) HG+D phase function: it combines the Henyey-Greenstein phase function and the Dirac phase function, and can more accurately simulate the Mie scattering process by linear interpolation between the two. The HG+D phase function can more accurately reflect the scattering properties of cloud particles, especially for cloud particles of different sizes, it can better simulate the interaction of light and cloud particles, making the rendering effect of the cloud closer to the real physical phenomenon.

[0125] (2) Phase function optimization: integrating the Henyey-Greenstein and HG+D methods together, this can both retain the artistic flexibility of the TTHG method and introduce the physical accuracy of the HG+D method.

[0126] The specific lighting processing steps will be introduced as follows:

[0127] (1) Single scattering calculation: ① Sampling the density field: along the line-of-sight direction, the density ρ and the optical path d of the current sampling point are obtained; ② Attenuation calculation: according to σ t and d, the exponential attenuation term is calculated ③ Phase function: calculate the Henyey-Greenstein phase function value, combined with the angle θ between the light source direction and the line-of-sight; ④ Single scattering intensity: integrate the attenuation term and the phase function to obtain L single .

[0128] (2) Multiple scattering approximation: ① Scattering ratio calculation: according to Determine the scattering contribution weight; ② Diffusion term calculation: substitute the empirical formula Adjust K to match the scene requirements; ③ Synthesize multi-scattering light intensity: multiply the diffusion term with the single-scattering light intensity to obtain L multi .

[0129] (3) Edge darkening processing: In this embodiment, the calculation method of the density gradient includes: calculating the density gradient of the current sampling point by the central difference method Similarly, we can get And Reduce the gradient calculation frequency for low-frequency cloud layer area (such as stratocumulus), thereby further optimizing the performance; ② View direction alignment: calculate the normalized direction And Dot product; ③ Darkening coefficient adjustment: use the saturate function to limit the range of dot product value to generate the darkening coefficient; ④ Final light intensity synthesis: apply the darkening coefficient to L multi , and finally obtain L final .

[0130] S3. On the basis of completing the light simulation, the cloud layer density field of the complex cloud layer is divided into a plurality of voxel blocks, and light ray marching adaptive processing is performed to complete real-time rendering of the volume cloud.

[0131] In this embodiment, the method of light ray marching adaptive processing includes:

[0132] (1) Optimization target: Ray Marching is the core step of volume cloud rendering, but its calculation cost is directly related to the number of samplings; the traditional method uses fixed step length, resulting in waste of calculation resources in empty areas or uniform areas; the core target of adaptive Ray Marching optimization is: ① Reduce redundant sampling: reduce the number of samplings by dynamically adjusting the step length and skipping empty areas; ② Maintain visual quality: maintain high-precision sampling in detail areas (such as cloud layer edges); ③ Real-time performance improvement: realize rendering time within 2ms.

[0133] (2) On the basis of completing the light simulation, the cloud layer density field of the complex cloud layer is divided into 32x32x32 voxel blocks, and each voxel block stores empty block marker and density gradient information: ① 1bit stores the empty block marker, if the maximum density p max <0.001, it is marked as empty; ② 3x8bit stores the density gradient to store the density change direction (for dynamic step length adjustment); the voxel block division is completed in the pre-computation stage, and the voxel block data is stored in the 3D texture offline.

[0134] (3)Optimize the ray by empty block skipping and importance sampling: ①Empty block skipping is to step directly to the next non-empty block boundary when the ray enters an empty block, skipping the intermediate sampling; ②Importance sampling is to predict the position of the high-density area in the block according to the pre-computed density gradient, reduce the sampling of the uniform area, and preferentially cover the high-density area.

[0135] (4) And dynamically adjust the step size by the density change rate: the greater the density change rate (such as the edge of the cloud layer), the smaller the step size, in order to capture the details; the smaller the change rate (such as the uniform area inside the cloud layer), the larger the step size.

[0136]

[0137] where Δ current is the current step size, is the density change rate along the direction of ray marching (s). When adjusting the step size, prevent the step size from being too large, and limit the step size range Δ new ∈ [5, 200].

[0138] Finally, based on the transparency saturation and continuous empty sampling, judge whether to terminate early, complete the adaptive processing of ray marching: there are two early termination conditions, transparency saturation and continuous empty sampling; ①Transparency saturation:

[0139]

[0140] where ρ i is the density of the i-th sampling, Δ i is the corresponding step size; when the cumulative transparency ∑ α > 0.99, the ray cannot further contribute color, and the sampling is terminated. ②Continuous empty sampling: if the density ρ < 0.001 for N ρ consecutive times (such as N ρ = 5), it is considered to enter an empty area, and the ray is terminated, completing the adaptive processing of ray marching.

[0141] Example two

[0142] In this embodiment, the traditional noise function (e.g. Pelin / Worley / Curl) is essentially a static mathematical function, although it can be modulated by parameters to simulate dynamic effects, but it lacks the physical basis of real atmospheric motion (e.g. thermal convection, turbulent energy cascade), and cannot accurately express the sinking air flow caused by precipitation (thickening at the bottom of the rain cloud), and the nonlinear relationship between wind speed and turbulent intensity (e.g. when the wind speed doubles, the turbulent energy increases by about 4 times). This embodiment solves the simplified Navier-Stokes equation to directly simulate key physical processes in air movement, such as buoyancy effect (warm air rises, cold air sinks), vorticity evolution (generation, diffusion and dissipation of turbulent vortex), and energy conservation (momentum transfer driven by wind speed). This embodiment generates physically realistic turbulent fields, and generates new noise Alternative embodiment one Curl noise

[0143] 1. Fluid control equation:

[0144]

[0145] where, is the vorticity field, is the core output of the fluid control equation, used to replace the Curl noise; represents the advection term, represents the velocity field, is obtained by Helmholtz decomposition reconstruction; Nabla operator is a vector differential operator; represents the vorticity transported with the velocity field (similar to "wind blowing vortex"); represents the viscous dissipation term, v represents the turbulent viscosity coefficient, which is dynamically adjusted by the wind speed , that is, For the viscosity term, when the wind speed increases, the viscosity v decreases, allowing smaller scale turbulence to exist, and the greater the wind speed, the more turbulent the turbulence. describes the diffusion process of vorticity (that is, the transfer of turbulent energy from large eddies to small eddies); represents the buoyancy source term, β buoy represents the buoyancy intensity coefficient, which is related to the precipitation intensity , will enhance the buoyancy effect (enhance the sinking air flow), and promote the thickening at the bottom of the rain cloud, T represents the temperature disturbance field (initialized as Perlin noise), is the gravity direction, fixed vertically downward, i.e., (0, -1, 0); for the buoyancy source term, when T > 0, a counterclockwise vortex is generated (simulate updraft, warm air up when the vortex is formed); when T < 0, a clockwise vortex is generated (simulate downdraft).

[0146] 2. New noise generation:

[0147]

[0148] where, represents the hydrodynamic noise generated by the dynamic vorticity field (the strength is determined by , and the polarity is determined by sign(ω y )). The three-dimensional vector represents the vorticity field, and represents the strength and direction of fluid rotation, which is calculated by the fluid control equation. is the vorticity module, the larger the value, the stronger the turbulence. represents the logarithmic compression, which nonlinearly compresses the vorticity value (such as 0.1-100) to a visually friendly range (about 0-4.6), avoiding numerical explosion. ω y is the vertical vorticity component of the vorticity field , reflecting the rotation around the horizontal axis, ω y > 0 indicates counterclockwise rotation, warm air rising (cumulus development); ω y < 0 indicates clockwise rotation, cold air descending (rain cloud thickening). sign represents the sign function, sign(ω y ) is used to extract the direction information of the vertical component of vorticity, sign(ω y ) = +1 indicates updraft, and sign(ω y ) = -1 indicates downdraft.

[0149] 3. Noise mixing: mix the hydrodynamic noise with high-frequency Worley noise:

[0150]

[0151] where, is the final high-frequency noise, which is a weighted fusion of physical noise and traditional noise , is the high-frequency Worley noise; γ is the physical noise mixing weight, γ = β buoy . When heavy precipitation, β buoy increases, γ increases, at this time is dominated by physics (real air flow structure); when no precipitation, β buoy and γ are 0, at this time is dominated by Dominant (retaining procedural details).

[0152] Embodiment three

[0153] In this embodiment, a real-time rendering system for physically simulating volumetric clouds comprises a cloud layer construction module, a light simulation module and a ray adaptive processing module.

[0154] The cloud layer construction module is configured to construct a dynamic noise hybrid model and construct a complex cloud layer by mixing multiple noises based on the dynamic noise hybrid model.

[0155] The workflow of the cloud layer construction module comprises: obtaining a weather parameter vector and decomposing a basic noise signal in a frequency domain by using a fast Fourier transform to obtain a low-frequency noise, a medium-frequency noise and a high-frequency noise:

[0156]

[0157] i∈{Perlin-Worley, Worley high , Curl}

[0158] freq∈{LF, MF, HF}

[0159]

[0160] wherein, represents a noise signal after fast Fourier transform, represents a fast Fourier transform, Perlin-Worley represents a basic cloud shape noise, Worley high represents a high-frequency Worley noise, Curl represents a 2D curl noise, LF represents a low frequency, MF represents a medium frequency, and HF represents a high frequency; the low-frequency noise, the medium-frequency noise and the high-frequency noise are modulated and superimposed, and a spatial domain noise is generated by an inverse Fourier transform:

[0161]

[0162] wherein, represents a spatial domain noise, represents an inverse Fourier transform, a freq represents a mixing weight of each frequency band, represents a minimum weight of each frequency band, represents a maximum weight of each frequency band, represents a precipitation intensity, represents a wind speed, and φ(t) represents a phase shift function, t represents a time variable, Gradient magnitude of Curl noise; based on spatial domain noise, the cloud layer is divided into a low-resolution layer and a high-resolution layer, and a basic cloud shape is generated based on the low-resolution layer, and dynamic details are added in the basic cloud shape based on the high-resolution layer; a density field formula is calculated based on the spatial domain noise, cloud coverage, type and rainfall effect are simulated based on a weather parameter vector, and complex cloud layer construction is completed.

[0163] The light simulation module is used to construct a multi-scattering light model, and to perform single-scattering calculation and multi-scattering approximation on the complex cloud layer by using the multi-scattering light model to perform light simulation.

[0164] The workflow of the light simulation module includes: combining Beer-Lambert law and Henyey-Greenstein phase function to construct a single-scattering light model:

[0165]

[0166] wherein L single represents single-scattering light, sigma t represents extinction coefficient, sigma s represents scattering coefficient, sigma a represents absorption coefficient, d represents optical path, g represents anisotropy parameter, and theta represents the included angle between light source direction and line of sight direction; based on the single-scattering light model, a multi-scattering light model is constructed:

[0167]

[0168] wherein L multi represents single-scattering light, k represents attenuation rate controlling multiple scattering; density gradient is introduced into light calculation, and edge darkening effect is dynamically generated by using the multi-scattering light model, and light simulation is completed:

[0169]

[0170] wherein L final represents final simulated light, represents density gradient, represents Euclidean norm of gradient vector, represents normalized line of sight direction vector, and saturate(·) represents a function of limiting value in the range of [0, 1].

[0171] The ray adaptive processing module divides the cloud density field of the complex cloud layer into a plurality of voxel blocks on the basis of completing light simulation, and performs ray marching adaptive processing to complete real-time rendering of the volume cloud.

[0172] The workflow of the ray adaptive processing module comprises the following steps: on the basis of completing the illumination simulation, cloud layer density fields of complex cloud layers are divided into 32*32*32 voxel blocks, each voxel block stores an empty block mark and density gradient information; the rays are optimized by using empty block skipping and importance sampling, and the step length is dynamically adjusted through the density change rate, and finally it is judged whether to terminate early based on the transparency saturation and continuous empty sampling, and the ray marching adaptive processing is completed.

[0173] The above-described embodiments are merely descriptions of the preferred modes of the present application and are not intended to limit the scope of the present application. Various modifications and improvements to the technical solutions of the present application made by those of ordinary skill in the art without departing from the design spirit of the present application shall fall within the protection scope of the present application as defined by the claims.

Claims

1. A method of real-time rendering of a physically simulated volumetric cloud, characterized in that, The method comprises the following steps: A dynamic noise mixing model is constructed, and a complex cloud layer is constructed by mixing multiple noises based on the dynamic noise mixing model; A multi-scattering light model is constructed, and single-scattering calculation and multi-scattering approximation are performed on the complex cloud layer by using the multi-scattering light model to perform light simulation; On the basis of completing the light simulation, the cloud density field of the complex cloud layer is divided into a plurality of voxel blocks, and light ray marching adaptive processing is performed to complete real-time rendering of the volume cloud.

2. The method of claim 1, wherein, The method for constructing a complex cloud layer comprises: A weather parameter vector is obtained, and a basic noise signal is decomposed in a frequency domain by using fast Fourier transform to obtain low-frequency noise, medium-frequency noise and high-frequency noise: i e {Perlin-Worley, Worley high Curl} freq∈{LF,MF,HF} wherein, represents the noise signal after fast Fourier transform, represents a fast Fourier transform, Perlin-Worley represents a base cloud shape noise, Worley high represents a high frequency Worley noise, Curl represents a 2D curl noise, LF represents a low frequency, MF represents a medium frequency, and HF represents a high frequency; The low-frequency noise, the medium-frequency noise and the high-frequency noise are superimposed after modulation, and a spatial domain noise is generated by inverse Fourier transform: wherein denotes spatial domain noise, denotes an inverse Fourier transform, a freq denotes a mixing weight for each frequency band, denotes a minimum weight for each frequency band, denotes a maximum weight for each frequency band, denotes a precipitation intensity, denotes a wind speed, φ(t) denotes a phase offset function, and t denotes a time variable, denotes a gradient amplitude of a Curl noise; Based on the spatial domain noise, the cloud layer is divided into a low-resolution layer and a high-resolution layer, and a basic cloud shape is generated based on the low-resolution layer, and dynamic details are added in the basic cloud shape based on the high-resolution layer; A density field formula is calculated based on the spatial domain noise, the cloud coverage, the type and the rainfall effect are simulated by using the weather parameter vector, and the complex cloud layer is constructed.

3. The method of claim 2, wherein, The method for performing the light simulation comprises: A single-scattering light model is constructed by combining the Beer-Lambert law and the Henyey-Greenstein phase function: σ t = σ s + σ a where L single represents single scattered light illumination, σ t represents extinction coefficient, σ s represents scattering coefficient, σ a represents absorption coefficient, d represents optical path, g represents anisotropy parameter, and θ represents the angle between the light source direction and the line of sight direction. A multi-scattering light model is constructed based on the single-scattering light model: where L multi represents single scattered light illumination, and k represents the rate of attenuation controlling multiple scattering; A density gradient is introduced into light calculation, and an edge darkening effect is dynamically generated by using the multi-scattering light model, and the light simulation is completed: where L final denotes the final simulated lighting, denotes the density gradient, denotes the Euclidean norm of the gradient vector, denotes the normalized line of sight direction vector, saturate(·) denotes a function that limits the value to the range [0, 1].

4. The method of claim 3, wherein, The method for performing the light ray marching adaptive processing comprises: On the basis of completing the light simulation, the cloud density field of the complex cloud layer is divided into 32×32×32 voxel blocks, and each voxel block stores an empty block marker and density gradient information; Optimization of light rays is performed by using empty block skipping and importance sampling, and the step length is dynamically adjusted by using the density change rate, and finally, it is judged whether to terminate early based on the transparency saturation and continuous empty sampling, and the light ray marching adaptive processing is completed.

5. A real-time rendering system of physical simulation volumetric clouds, said rendering system applying the rendering method of any one of claims 1 to 4, characterized in that, It comprises: a cloud layer construction module, a light simulation module and a light ray adaptive processing module; The cloud layer construction module is used to construct a dynamic noise mixing model, and a complex cloud layer is constructed by mixing multiple noises based on the dynamic noise mixing model; The light simulation module is used to construct a multi-scattering light model, and single-scattering calculation and multi-scattering approximation are performed on the complex cloud layer by using the multi-scattering light model to perform light simulation; The light ray adaptive processing module divides the cloud density field of the complex cloud layer into a plurality of voxel blocks on the basis of completing the light simulation, and performs light ray marching adaptive processing to complete real-time rendering of the volume cloud.

6. The real-time rendering system of a physical simulation volumetric cloud according to claim 5, wherein, The working process of the cloud layer construction module comprises: A weather parameter vector is obtained, and a basic noise signal is decomposed in a frequency domain by using fast Fourier transform to obtain low-frequency noise, medium-frequency noise and high-frequency noise: i e {Perlin-Worley, Worley high Curl} freq∈{LF,MF,HF} wherein, represents a noise signal after fast Fourier transform, represents a fast Fourier transform, Perlin-Worley represents a base cloud shape noise, Worley high represents a high frequency Worley noise, Curl represents a 2D curl noise, LF represents a low frequency, MF represents a medium frequency, and HF represents a high frequency; The low-frequency noise, the medium-frequency noise and the high-frequency noise are superimposed after modulation, and a spatial domain noise is generated by inverse Fourier transform: wherein, denotes spatial domain noise, denotes inverse Fourier transform, a freq denotes mixing weight of each frequency band, denotes minimum weight of each frequency band, denotes maximum weight of each frequency band, denotes precipitation intensity, denotes wind speed, φ(t) denotes phase shift function, t denotes time variable, denotes gradient amplitude of Curl noise; Based on the spatial domain noise, the cloud layer is divided into a low-resolution layer and a high-resolution layer, and a basic cloud shape is generated based on the low-resolution layer, and dynamic details are added in the basic cloud shape based on the high-resolution layer; Based on the spatial domain noise, a density field formula is calculated, the cloud coverage, type and rainfall effect are simulated by the weather parameter vector, and the complex cloud layer is completed.

7. The real-time rendering system of a physically simulated volumetric cloud according to claim 6, wherein, The workflow of the light simulation module includes: Combining Beer-Lambert law with Henyey-Greenstein phase function, a single scattering light model is constructed: σ t = σ s + σ a where L single represents single scattered light illumination, σ t represents extinction coefficient, σ s represents scattering coefficient, σ a represents absorption coefficient, d represents optical path, g represents anisotropy parameter, and θ represents the angle between the light source direction and the line of sight direction; Based on the single scattering light model, a multi-scattering light model is constructed: where L multi represents single scattered light illumination, and k represents the rate of attenuation controlling multiple scattering; The density gradient is introduced into the light calculation, the multi-scattering light model is used to dynamically generate the edge darkening effect, and the light simulation is completed: where L final denotes the final simulated lighting, denotes the density gradient, denotes the Euclidean norm of the gradient vector, denotes the normalized line-of-sight direction vector, saturate(·) denotes a function that limits the value to the range [0, 1].

8. The real-time rendering system of a physical simulation volumetric cloud according to claim 7, characterized in that, The workflow of the ray adaptive processing module includes: On the basis of completing the light simulation, the cloud density field of the complex cloud layer is divided into 32×32×32 voxel blocks, each voxel block stores empty block markers and density gradient information; Optimizing the ray by using empty block skipping and importance sampling, and dynamically adjusting the step size by the density change rate, finally judging whether to terminate early based on the transparency saturation and continuous empty sampling, the ray marching adaptive processing is completed.

Citation Information

Patent Citations

  • Implementation method and device of thundercloud effect, storage medium and electronic device

    CN114445531A

  • Sea wave simulation method and device based on Gerstner model and storage medium

    CN116090251A

  • Volume cloud modeling and rendering method based on meteorological data

    CN116228984A

  • Large-scale cloud scene simulation method based on noise and particles

    CN117689805A

  • Realistic volume cloud construction method and device, equipment and medium

    CN117710557A