A method and system for real-time rendering of physically simulated volumetric clouds
By combining a dynamic noise mixing model and a multi-scattering lighting model with adaptive light travel processing, the problem of high-quality real-time rendering in complex environments that is difficult to achieve by existing cloud rendering methods is solved, and efficient and realistic cloud volumetric rendering is realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 北京渲光科技有限公司
- Filing Date
- 2025-08-04
- Publication Date
- 2026-05-26
Smart Images

Figure CN120912754B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer graphics technology, specifically relating to a real-time rendering method and system for physically simulated volumetric clouds. Background Technology
[0002] In fields such as virtual reality, film and television special effects, game engines, and scientific visualization, realistic and dynamically changing cloud and sky rendering plays an irreplaceable role in enhancing immersion and environmental storytelling. Especially in open-world games, flight simulators, and weather visualization systems, the sky often occupies a large proportion of the screen, and its lighting changes, cloud movement, and day-night cycle directly affect the user's perception and emotions. However, simulating these complex and ever-changing natural phenomena in real time faces many challenges: How to generate cloud structures with rich forms and dynamic evolution? How to achieve lighting effects that conform to physical laws? How to achieve real-time rendering while ensuring high quality? These questions have long been key technical challenges in graphics research and industrial applications.
[0003] Current mainstream cloud modeling technologies mainly include mesh-based methods, procedural modeling methods, and texture mapping methods based on land or satellite images. While mesh-based modeling is easy to control in terms of shape, it struggles to represent the softness and dynamic changes of clouds. Procedural methods rely on noise functions to generate cloud structures; although they can achieve real-time animation, they lack realism and diversity in detail. Using real images as texture maps is limited by viewpoint and weather conditions, and cannot flexibly adapt to different lighting and temporal changes. Furthermore, existing real-time volumetric cloud rendering methods often improve performance by simplifying models or reducing sampling rates, sacrificing image quality for frame rate stability. However, in a vast open world with complex terrain (such as mountains, forests, and lakes) and dynamic environments (such as day-night cycles and weather changes), low-quality cloud rendering alone clearly cannot meet the demands for visual realism and artistic expression. Therefore, developing a real-time volumetric cloud rendering method that can balance high quality and efficiency, and deeply integrate with weather systems, is particularly important. Summary of the Invention
[0004] This invention aims to address the shortcomings of existing technologies and provides the following solutions:
[0005] A real-time rendering method for physically simulated volumetric clouds includes the following steps:
[0006] A dynamic noise mixing model is constructed, and a complex cloud layer is constructed based on the dynamic noise mixing model by mixing multiple noises;
[0007] A multi-scattering illumination model is constructed, and the multi-scattering illumination model is used to perform single-scattering calculations and multi-scattering approximations on the complex cloud layer to simulate illumination.
[0008] Based on the completed lighting simulation, the cloud density field of the complex cloud layer is divided into several voxel blocks, and adaptive light travel processing is performed to complete the real-time rendering of volumetric clouds.
[0009] Preferred methods for constructing complex cloud layers include:
[0010] Obtain the weather parameter vector and use Fast Fourier Transform to decompose the fundamental noise signal in the frequency domain to obtain low-frequency noise, mid-frequency noise, and high-frequency noise:
[0011]
[0012] i∈{Perlin-Worley,Worley high Curl}
[0013] freq∈{LF,MF,HF}
[0014]
[0015] in, This represents the noise signal after Fast Fourier Transform. Perlin-Worley represents the basic cloud shape noise, and Worley represents the Fast Fourier Transform. high LF represents high-frequency Worley noise, MF represents mid-frequency noise, and HF represents high-frequency noise.
[0016] The low-frequency noise, the mid-frequency noise, and the high-frequency noise are modulated and superimposed, and then spatial domain noise is generated by inverse Fourier transform:
[0017]
[0018] in, Represents spatial domain noise. Indicates the inverse Fourier transform, α freq This represents the mixing weights for each frequency band. This represents the minimum weight for each frequency band. This indicates the maximum weight of each frequency band. Indicates precipitation intensity. Let φ(t) represent wind speed, φ(t) represent the phase shift function, and t represent the time variable. This represents the gradient magnitude of 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 to the basic cloud shape based on the high-resolution layer.
[0020] Based on the spatial domain noise calculation density field formula, the complex cloud layer is constructed by simulating cloud coverage, type, and rainfall effect through the weather parameter vector.
[0021] Preferably, the method for performing the lighting simulation includes:
[0022] By combining Beer-Lambert's law and the Henyey-Greenstein phase function, a single-scattering illumination model is constructed:
[0023]
[0024] σ t =σ s +σ a
[0025] Among them, L single Indicates single-scattered illumination, σ t σ represents the extinction coefficient. s σ represents the scattering coefficient. a denoted by , where d represents the absorption coefficient, g represents the anisotropy parameter, and θ represents the angle between the light source direction and the line of sight.
[0026] Based on the single-scattering illumination model, a multi-scattering illumination model is constructed:
[0027]
[0028] Among them, L multi κ represents single-scattered illumination, and κ represents the decay rate controlling multiple scattering.
[0029] The density gradient is incorporated into the lighting calculation, and the multi-scattering lighting model is used to dynamically generate an edge darkening effect to complete the lighting simulation:
[0030]
[0031] Among them, L final This represents the final simulated lighting. Represents the density gradient. The Euclidean norm of the gradient vector. This represents the normalized line-of-sight vector, and saturate(·) represents a function that restricts the value to the range [0,1].
[0032] Preferably, the method for performing the adaptive processing of light travel includes:
[0033] Based on the completed illumination simulation, the cloud density field of the complex cloud layer is divided into 32×32×32 voxel blocks, and each voxel block stores empty block markers and density gradient information;
[0034] The light beam is optimized by using empty block jumps and importance sampling, and the step size is dynamically adjusted by the density change rate. Finally, the adaptive processing of light beam travel is completed by determining whether to terminate early based on transparency saturation and continuous empty sampling.
[0035] The present invention also provides a real-time rendering system for physically simulated volumetric clouds, wherein the rendering system applies the rendering method described above and includes: a cloud layer construction module, a lighting simulation module, and a light adaptive processing module;
[0036] The cloud construction module is used to construct a dynamic noise mixing model, and to construct complex cloud layers by mixing multiple types of noise based on the dynamic noise mixing model;
[0037] The illumination simulation module is used to construct a multi-scatter illumination model and to perform single-scatter calculations and multi-scatter approximations on the complex cloud layer using the multi-scatter illumination model to simulate illumination.
[0038] Based on the completed lighting simulation, the adaptive light processing module divides the cloud density field of the complex cloud layer into several voxel blocks and performs adaptive light travel processing to complete the real-time rendering of volumetric clouds.
[0039] Preferably, the workflow of the cloud construction module includes:
[0040] Obtain the weather parameter vector and use Fast Fourier Transform to decompose the fundamental noise signal in the frequency domain to obtain low-frequency noise, mid-frequency noise, and high-frequency noise:
[0041]
[0042] i∈{Perlin-Worley,Worley high Curl}
[0043] freq∈{LF,MF,HF}
[0044]
[0045] in, This represents the noise signal after Fast Fourier Transform. Perlin-Worley represents the basic cloud shape noise, and Worley represents the Fast Fourier Transform. high LF represents high-frequency Worley noise, MF represents mid-frequency noise, and HF represents high-frequency noise.
[0046] The low-frequency noise, the mid-frequency noise, and the high-frequency noise are modulated and superimposed, and then spatial domain noise is generated by inverse Fourier transform:
[0047]
[0048] in, Represents spatial domain noise. Indicates the inverse Fourier transform, α freq This represents the mixing weights for each frequency band. This represents the minimum weight for each frequency band. This indicates the maximum weight of each frequency band. Indicates precipitation intensity. Let φ(t) represent wind speed, φ(t) represent the phase shift function, and t represent the time variable. This represents the gradient magnitude of Curl noise;
[0049] 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 to the basic cloud shape based on the high-resolution layer.
[0050] Based on the spatial domain noise calculation density field formula, the complex cloud layer is constructed by simulating cloud coverage, type, and rainfall effect through the weather parameter vector.
[0051] Preferably, the workflow of the lighting simulation module includes:
[0052] By combining Beer-Lambert's law and the Henyey-Greenstein phase function, a single-scattering illumination model is constructed:
[0053]
[0054] Among them, L single Indicates single-scattered illumination, σ t σ represents the extinction coefficient. s σ represents the scattering coefficient. a denoted by , where d represents the absorption coefficient, g represents the anisotropy parameter, and θ represents the angle between the light source direction and the line of sight.
[0055] Based on the single-scattering illumination model, a multi-scattering illumination model is constructed:
[0056]
[0057] Among them, L multi κ represents single-scattered illumination, and κ represents the decay rate controlling multiple scattering.
[0058] The density gradient is incorporated into the lighting calculation, and the multi-scattering lighting model is used to dynamically generate an edge darkening effect to complete the lighting simulation:
[0059]
[0060] Among them, L final This represents the final simulated lighting. Represents the density gradient. The Euclidean norm of the gradient vector. This represents the normalized line-of-sight vector, and saturate(·) represents a function that restricts the value to the range [0,1].
[0061] Preferably, the workflow of the light adaptive processing module includes:
[0062] Based on the completed illumination simulation, the cloud density field of the complex cloud layer is divided into 32×32×32 voxel blocks, and each voxel block stores empty block markers and density gradient information;
[0063] The light beam is optimized by using empty block jumps and importance sampling, and the step size is dynamically adjusted by the density change rate. Finally, the adaptive processing of light beam travel is completed by determining whether to terminate early based on transparency saturation and continuous empty sampling.
[0064] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0065] This invention, without sacrificing image quality and rendering efficiency, integrates advanced cloud modeling theory with efficient GPU acceleration technology. It employs a hybrid noise model to generate diverse cloud structures, accurately reproducing various typical cloud types such as cirrus, cumulus, and stratus. Simultaneously, combined with a ray-casting-based lighting algorithm, it accurately simulates complex lighting effects such as sunlight, diffused light, and shadows, enabling clouds to present natural and layered visual effects under different time periods and weather conditions. Unlike traditional methods that rely on two-dimensional weather textures, this invention allows for fully programmatic configuration of sky states, supporting dynamic evolution and environmental interaction, truly realizing the concept of a "programmable sky." From a performance perspective, this invention achieves a rendering time of only 2 milliseconds per frame on modern GPUs, with low memory consumption and extremely high real-time performance and deployability. This technological breakthrough not only significantly enhances the realism and artistic expression of cloud rendering but also provides strong technical support for building highly immersive virtual environments, with wide applicability in game engines, film and television production, flight simulation, meteorological simulation, and many other fields. Attached Figure Description
[0066] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0067] Figure 1 This is a schematic diagram of the method flow according to an embodiment of the present invention;
[0068] Figure 2 This is a flowchart of a method according to an embodiment of the present invention. Detailed Implementation
[0069] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0070] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0071] Clouds are composed of tiny droplets, ice crystals, or other particles suspended in the atmosphere. Their formation is influenced by airflow, temperature changes, and humidity variations, resulting in diverse and constantly changing shapes. Due to their high reflectivity, clouds scatter light in multiple directions, exhibiting a range of colors from white to gray and even vibrant hues. This makes accurately simulating the appearance and dynamic changes of clouds extremely challenging. The theoretical background related to cloud rendering encompasses fundamental principles such as atmospheric scattering and light attenuation, providing 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 are scattered. This scattering has a significant impact on the color of light and changes the direction of light propagation. Rayleigh scattering applies to situations where photons interact with particles much smaller than the wavelength of light. The shorter the wavelength of light, the easier it is to scatter, which is why the sky appears blue during the day and orange at sunrise and sunset. Mie scattering applies to scattering caused by larger particles and covers the special case of Rayleigh scattering. Its equations are complex and are often solved using approximation methods.
[0073] (2) Phase Function: The phase function is a key function describing the distribution of scattered light in different directions when light is scattered in a medium. It determines the probability of photons scattering from one direction to another, significantly impacting the appearance and lighting effects of clouds. In volumetric cloud rendering, particles such as water droplets or ice crystals in the cloud scatter light, and the phase function helps simulate this scattering process, thus affecting the cloud's brightness, color, shape, and other visual characteristics. Different phase functions produce different scattering effects, resulting in different cloud appearances.
[0074] (3) Light attenuation theory - Beer-Yam Brown law: describes the phenomenon of light attenuation or disappearance in the atmosphere due to outgoing scattering events. That is, the transmittance of light in the atmosphere changes exponentially with the propagation distance. The attenuation value corresponding to the outgoing scattering event is related to the outgoing scattering caused by the interaction of photons with air molecules and aerosol particles.
[0075] Example 1
[0076] In this embodiment, as Figure 1 , Figure 2 As shown, a real-time rendering method for physically simulated volumetric clouds includes the following steps:
[0077] S1. Construct a dynamic noise mixing model, and based on the dynamic noise mixing model, construct complex cloud layers by mixing multiple types of noise.
[0078] By mixing multiple noise sources (Perlin noise, Worley noise, Curl noise), coherent clouds are generated using Perlin-Worley and Worley noise. high By adding fragments and introducing dynamic turbulence using Curl, complex cloud formations are ultimately generated and dynamically evolved.
[0079] Perlin-Worley noise: Perlin-Worley noise is a composite noise generated by superimposing Perlin noise with low-frequency Worley noise, used to simulate the basic shape of clouds; the formula is as follows:
[0080] Perlin-Worley(x,y,z)=Perlin(x,y,z)·(1+Worley low (x,y,z))
[0081]
[0082] Among them, amp i Represents the amplitude of the i-th layer (usually expressed as follows): (to attenuate); Noise gradient Represents interpolation noise based on grid point gradients; ∈ kThis represents random feature points in 3D space, with density 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 detail to cloud edges; the formula is:
[0084]
[0085] Among them, Worley high (x,y,z) are passed through 2 i+3 Increasing the frequency (i=0 corresponds to frequency 8, i=1 corresponds to frequency 16, i=2 corresponds to frequency 32, which can generate more dense cell structures) and increasing the detail complexity through three-level iteration (i=0,1,2).
[0086] Curl noise: Curl noise is generated from the curl field of 2D Perlin noise (ignoring the vertical component, i.e., the y-direction), and is used to simulate horizontal wind field disturbances; the formula is as follows:
[0087]
[0088] in, Represents the gradient operator, Perlin x (x, z) represents the Perlin noise value at coordinates (x, z), indicating the perturbation in the x-direction; Perlin z (x, z) represents the Perlin noise value at coordinates (x, z), indicating the perturbation in the z direction.
[0089] In this embodiment, the method for constructing complex cloud layers includes:
[0090] Obtain weather parameter vector Among them, w c It refers to the cloud cover rate, that is, the ratio of the sky covered by clouds, w c =0 indicates no clouds, w c =1 means complete coverage; w t It represents the cloud type, and the height gradient function can be controlled by enumerating values (such as 0 for cumulus, 1 for stratus, 2 for nimbus, etc.). Indicates precipitation intensity. It affects the density of rain clouds and the thickening of their base; Indicates wind speed, used to simulate the intensity of wind disturbance on cloud turbulence; excluding In addition, a time variable t needs to be input to show the dynamic evolution of the noise over time.
[0091] By introducing frequency domain noise modulation technology and combining it with a multi-resolution noise fusion strategy, the noise weights of different frequency bands are dynamically adjusted, thereby achieving more precise control over cloud morphology. This method is based on weather parameter vectors. 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. Finally, a high-fidelity cloud density field is synthesized in the spatial domain. This embodiment significantly improves the realism of cloud dynamic evolution and optimizes computational efficiency through multi-resolution fusion. Specifically, the basic noise signal (Perlin-Worley, Worleyhigh, and Curl) is decomposed in the frequency domain using Fast Fourier Transform to obtain low-frequency noise, mid-frequency noise, and high-frequency noise:
[0092]
[0093] i∈{Perlin-Worley,Worley high Curl}
[0094] freq∈{LF,MF,HF}
[0095]
[0096] in, This represents the noise signal after Fast Fourier Transform. This represents the Fast Fourier Transform, and Perlin-Worley represents the basic cloud shape noise, combining the continuity of Perlin with the cellular structure of Worley; Worley high The 'F' indicates high-frequency Worley noise, used to add details (such as fragments at the edge of clouds); 'Curl' indicates 2D curl noise, used to simulate wind-driven turbulent motion; 'LF' indicates low frequency, used to control the macroscopic morphology of clouds (such as the overall shape of cloud clusters); 'MF' indicates mid-frequency, used to simulate the internal structure of clouds (such as turbulence and density gradients); and 'HF' indicates high frequency, used to add edge fragments and detailed textures.
[0097] Low-frequency noise, mid-frequency noise, and high-frequency noise are modulated and superimposed, and spatial domain noise is generated through inverse Fourier transform:
[0098]
[0099] in, Represents spatial domain noise. Indicates the inverse Fourier transform, α freq The mixing weights for each frequency band can be represented by weather parameter vectors. Dynamic adjustment; This represents the minimum weight for each frequency band. This represents the maximum weight for each frequency band. The maximum and minimum weights are predefined values, such as... e j·φ(t) The term represents the phase correction term. To avoid phase discontinuities caused by frequency domain modulation, φ(t) represents the phase offset function. This represents the gradient magnitude of Curl noise, used to align the direction of wind field disturbances;
[0100] Based on 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 to the basic cloud shape based on the high-resolution layer. In this embodiment, the cloud layer is divided into two resolution layers, low and high. The low-resolution layer can ensure the performance of the basic shape, while the high-resolution layer can add dynamic details and avoid full-resolution calculation, thus balancing the detail and performance of the volumetric cloud.
[0101] (1) Low resolution layer (128) 3 (3D texture): Perlin-Worley noise is used, specifically the low-frequency components. Generate the macroscopic basic morphology of clouds (such as the blocky structure of clouds). Specifically, in the preprocessing stage, Worley... low Formula generation for (x, y, z) 32 3 Worley resolution low The texture is generated using the Perlin(x, y, z) formula to create a 3D texture. Then, the two 3D textures are calculated according to the Perlin-Worley(x, y, z) formula to obtain 128. 3 Perlin-Worley 3D noise texture at resolution. At runtime, the 3D noise texture generated during the preprocessing stage is directly sampled as the base cloud shape.
[0102] (2) High-resolution layer (32) 3 3D texture +128 2 2D textures): using mid-to-high frequency components Add detailed rain turbulence perturbations (such as turbulence at the cloud surface and flocculent structures at the base of the rain cloud). In the preprocessing stage, first use Worley... high Formula generation for (x, y, z) 32 3 Worley resolution high 3D texture, then generated using the Curl(x, z) formula 128 2 A Curl 2D texture of [resolution]. At runtime, for Worley... high 3D textures are sampled and modulated using Curl2D textures, specifically:
[0103] Detail = Worley high (x, y, z)·Curl(x, z).
[0104] (3) Formula for calculating density field based on spatial domain noise:
[0105]
[0106] Where HG represents the vertical density distribution function, which is adjusted according to the cloud type. For cumulus, HG(z) = smoothstep(1500, 4000, z), and for stratus, HG(z) = smoothstep(1500, 4000, z). g c G represents global coverage. c =w c ·(1+0.5·sin(t·0.1)); β MF Enhance mid-frequency turbulence details through precipitation intensity; β HF The dynamics of high-frequency fragments are driven by wind speed.
[0107] Through weather parameter vectors Simulate cloud coverage, type, and rainfall effects to construct a complex cloud layer. In this embodiment:
[0108] (1) Introduce a density multiplication factor into the rainfall area to enhance the cloud density in the rainfall area:
[0109]
[0110] Where erf is the error function used to simulate the thickening at the base of the rain cloud; when z < 1500 meters, It rises rapidly, thereby increasing the density at the base of the rain cloud.
[0111] (2) The GPU calculates and updates every frame. Among them, coverage w c Rainfall is affected by humidity and air pressure simulated by weather systems. Wind speed is affected by weather systems and time. The time phase used to drive Curl noise is affected by weather systems.
[0112] S2. Construct a multi-scattering illumination model and use it to perform single-scattering calculations and multi-scattering approximations on complex clouds to simulate illumination.
[0113] Methods for performing lighting simulation include:
[0114] In this embodiment, a single-scattering illumination model is constructed by combining the Beer-Lambert law and the Henyey-Greenstein phase function:
[0115]
[0116] Among them, the Beer-Lambert index term The Henyey-Greenstein phase function is used to simulate the attenuation of light due to scattering and absorption, and is particularly suitable for simulating the directionality of single scattering, especially for Mie scattering of water droplets in clouds; L single Indicates single-scattered illumination; σ t σ represents the extinction coefficient. s σ represents the scattering coefficient. a θ represents the absorption coefficient; d represents the optical path length, which is the path length of light propagating in the cloud and is related to the sampling step size and density field; g represents the anisotropy parameter, which is used to control the scattering directionality, g∈[-1,1], g>0 indicates forward scattering (such as sunlight penetrating the cloud), and g<0 indicates backscattering; θ represents the angle between the direction of the light source and the direction of the line of sight, which determines the distribution of the scattered light intensity.
[0117] Based on the single-scattering illumination model, a fast scattering approximation is introduced to simplify the complex integral scattering process into an empirical formula related to the optical path length, avoiding the high computational cost of the traditional diffusion equation. Simultaneously, the κ parameter enables artistically controllable scattering intensity, thus constructing a multi-scattering illumination model.
[0118]
[0119] Among them, L multi Indicates single-scattered light illumination; This represents the proportion of scattering events to total extinction events, typically σ in clouds. s >>σ a ,therefore Approximate to 1; κ represents the decay rate controlling multiple scattering, κ∈[0.5, 1.0], which can be adjusted experimentally to balance realism and performance (e.g., κ = 0.5 for sunny days, κ = 1.0 for cloudy days). Diffusion approximation term This is used to simulate the energy diffusion of light after multiple scatterings within clouds, where the longer the optical path length d, the faster the intensity of the scattered light decays.
[0120] By incorporating density gradients into lighting calculations and utilizing a multiscattering lighting model to dynamically generate edge darkening effects, lighting simulation is achieved.
[0121]
[0122] Among them, L final This represents the final simulated lighting; This represents the density gradient, i.e., the gradient vector of the cloud density field, which reflects the direction of density change; The Euclidean norm of the gradient vector. Represents the normalized line-of-sight vector, dot product term Used to measure the alignment between the density gradient and the viewing direction. When the viewing direction is consistent with the density gradient direction (such as looking towards the edge of the cloud), the dot product value is the largest, resulting in a decrease in brightness, simulating the darkening of the cloud edge due to the self-shadowing effect; saturate(·) represents a function that restricts the value to the range [0,1]. That is, 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 but less than 1, the value of saturate(·) remains unchanged.
[0123] In this embodiment, the phase functions used are all Henyey-Greenstein phase functions. Although the Henyey-Greenstein phase function is widely used for cloud rendering and can easily adjust the scattering characteristics of clouds to achieve the desired rendering effect, it is not 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 through linear interpolation between the two, it can more accurately simulate the Mie scattering process. The HG+D phase function can more accurately reflect the scattering characteristics of cloud particles, especially for cloud particles of different sizes. It can better simulate the interaction between light and cloud particles, making the rendering effect of clouds closer to the real physical phenomenon.
[0125] (2) Phase function optimization: The Henyey-Greenstein and HG+D methods are combined, which retains the artistic flexibility of the TTHG method and introduces the physical accuracy of the HG+D method.
[0126] The specific lighting processing steps will be described below:
[0127] (1) Single scattering calculation: ① Sampling density field: Step the light along the line of sight to obtain the density ρ and optical path d at the current sampling point; ② Calculate attenuation: Based on σ t And d calculate the exponential decay term ③ Phase function: Calculate the Henyey-Greenstein phase function value, combining it with the angle θ between the light source direction and the line of sight; ④ Single scattered light intensity: Integrate the attenuation term and the phase function to obtain L. single .
[0128] (2) Multiple Scattering Approximation: ① Scattering Ratio Calculation: Based on ① Determine the scattering contribution weights; ② Calculate the diffusion term: substitute into the empirical formula. Adjust κ to match scene requirements; ③ Synthesize multi-scattered light intensity: Multiply the diffusion term by the single-scattered light intensity to obtain L. multi .
[0129] (3) Edge darkening processing: ① In this embodiment, the density gradient calculation method includes: calculating the density gradient of the current sampling point by means of the central difference method. Similarly, we can find and ① Reduce the gradient calculation frequency for low-frequency cloud regions (such as stratus clouds) to further optimize performance; ② Line-of-sight alignment: calculate normalized direction. and ③ Perform dot product; ④ Darkening coefficient adjustment: Use the saturate function to limit the range of dot product values and generate the darkening coefficient; ⑤ Final light intensity synthesis: Apply the darkening coefficient to L multi Finally, L was obtained. final .
[0130] S3. Based on the completed lighting simulation, the cloud density field of the complex cloud layer is divided into several voxel blocks, and adaptive processing of light travel is performed to complete the real-time rendering of volumetric clouds.
[0131] In this embodiment, the method for adaptive light propagation processing includes:
[0132] (1) Optimization goals: Ray Marching is the core step in volumetric cloud rendering, but its computational cost is directly related to the number of samples. Traditional methods use a fixed step size, which leads to wasted computational resources in empty or uniform regions. The core goals of adaptive ray Marching optimization are: ① Reduce redundant sampling: Reduce the number of samples by dynamically adjusting the step size and skipping empty regions; ② Maintain visual quality: Maintain high-precision sampling in detailed regions (such as cloud edges); ③ Improve real-time performance: Achieve a rendering time of less than 2ms.
[0133] (2) Based on the completed illumination simulation, the cloud density field of the complex cloud layer is divided into 32×32×32 voxel blocks. Each voxel block stores an empty block marker and density gradient information: ① 1 bit stores the empty block marker. If the maximum density ρ in the block is... max <0.001, then marked as empty; ②3×8bit storage of density gradient to store the direction of density change within the block (for dynamic step size adjustment), voxel block division is completed in the pre-computation stage, voxel block data is generated offline and stored in 3D texture.
[0134] (3) Optimize the light by using empty block skipping and importance sampling: ① Empty block skipping means that when the light enters an empty block, it directly steps to the next non-empty block boundary and skips intermediate sampling; ② Importance sampling means that within a non-empty block, based on the pre-calculated density gradient, the location of high-density regions within the block is predicted, reducing the sampling of uniform regions and prioritizing the coverage of high-density regions.
[0135] (4) The step size is dynamically adjusted by the density change rate: the larger the density change rate (such as the edge of the cloud), the smaller the step size is to capture details; the smaller the change rate (such as the uniform area inside the cloud), the larger the step size is.
[0136]
[0137] Where, Δ current It is the current step size. It is the rate of change of density along the direction of light travel (s). When adjusting the step size, to prevent the step size from becoming too large, the step size range Δ can be limited. new ∈[5,200].
[0138] Finally, based on transparency saturation and continuous empty sampling, an early termination is determined to complete the adaptive processing of ray propagation. There are two conditions for early termination: transparency saturation and continuous empty sampling. ① Transparency saturation:
[0139]
[0140] Where, ρ i It is the density of the i-th sample, Δ i This corresponds to the step size; when the cumulative transparency ∑ α When the value is greater than 0.99, the light cannot contribute any more color, and sampling is terminated. ② Continuous empty sampling: If N consecutive ρ Times (e.g., N) ρ =5) If the sampling density ρ < 0.001, it is considered to have entered an empty region, the light is terminated, and the adaptive processing of light travel is completed.
[0141] Example 2
[0142] In this embodiment, traditional noise functions (such as Pelin / Worley / Curl) are essentially static mathematical functions. Although they can simulate dynamic effects through parameter modulation, they lack the physical basis of real atmospheric motion (such as thermal convection and turbulent energy cascades), and cannot accurately express the descending airflow caused by precipitation (thickening at the bottom of rain clouds), or the nonlinear relationship between wind speed and turbulence intensity (e.g., turbulent energy increases approximately fourfold when wind speed doubles). This embodiment directly simulates key physical processes in air motion by solving simplified Navier-Stokes equations, such as buoyancy effects (warm air rises, cold air sinks), vorticity evolution (generation, diffusion, and dissipation of turbulent vortices), and energy conservation (momentum transfer driven by wind speed). This embodiment generates a physically realistic turbulent field and generates new noise. Curl noise in alternative embodiment 1 As a high-frequency dynamic noise source. Specifically:
[0143] 1. Fluid governing equations:
[0144]
[0145] in, It is a vortex field. It is the core output of the fluid control equations, used to replace Curl noise; Represents the advection term. Represents the velocity field. Depend on Obtained through Helmholtz decomposition and reconstruction; Nabla operator It is a vector differential operator; Indicates vorticity With velocity field Transportation (similar to "wind-blown vortex"); This represents the viscous dissipation term, where v represents the turbulent viscosity coefficient, determined by wind speed. Dynamic adjustment, i.e. For viscosity, wind speed As the viscosity v increases, the viscosity decreases, allowing for smaller-scale turbulence; the higher the wind speed, the more intense the turbulence. Describing vorticity The diffusion process (i.e., the transfer of turbulent energy from large eddies to small eddies); β represents the buoyancy source term. buoy This represents the buoyancy strength coefficient, which is related to the precipitation intensity. related, It will enhance the buoyancy effect (strengthening downdrafts), causing the base of the rain cloud to thicken. T represents the temperature disturbance field (initialized as Perlin noise). The direction of gravity is fixed vertically downwards, i.e. (0, -1, 0); for the buoyancy source term, when T > 0, a counterclockwise vortex is generated (simulating an updraft, where warm air forms a vortex as it rises); when T < 0, a clockwise vortex is generated (simulating a downdraft).
[0146] 2. New noise generation:
[0147]
[0148] in, This represents the hydrodynamic noise generated by the dynamic vortex field (intensity determined by...). The polarity is determined by sign(ω) y (Determined). Three-dimensional vector The vortex field represents the intensity and direction of fluid rotation, and is calculated from the fluid control equations. It is the vorticity modulus; the larger the value, the stronger the turbulence. This indicates logarithmic compression, which non-linearly compresses vorticity values (e.g., 0.1-100) to a visually friendly range (approximately 0-4.6) to avoid numerical explosion. ω y It is a vortex field The vertical vorticity component reflects rotation about the horizontal axis, ω. y >0 indicates counterclockwise rotation, with warm air rising (cumulus cloud development); ω y <0 indicates clockwise rotation, with cold air descending (rain clouds 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 an updraft, sign(ω) y = -1 indicates a descending airflow.
[0149] 3. Noise mixing: Combining fluid dynamics noise Mixed with high-frequency Worley noise:
[0150]
[0151] in, It is ultimately high-frequency noise, which is physical noise. Compared with traditional noise Weighted fusion, It is high-frequency Worley noise; γ is the physical noise mixing weight, γ = β buoy During periods of high precipitation, β buoy As γ increases, the γ value increases. Dominated by physics (real airflow structure); in the absence of precipitation, β buoy When γ is 0, at this time Depend on Dominate (retain procedural details).
[0152] Example 3
[0153] In this embodiment, a real-time rendering system for physically simulated volumetric clouds includes: a cloud layer construction module, a lighting simulation module, and a light adaptive processing module.
[0154] The cloud building module is used to build dynamic noise mixing models and construct complex clouds by mixing multiple types of noise based on these models.
[0155] The workflow of the cloud layer construction module includes: acquiring weather parameter vectors and using Fast Fourier Transform to decompose the fundamental noise signal in the frequency domain to obtain low-frequency noise, mid-frequency noise, and high-frequency noise.
[0156]
[0157] i∈{Perlin-Worley,Worley high Curl}
[0158] freq∈{LF, MF, HF}
[0159]
[0160] in, This represents the noise signal after Fast Fourier Transform. Perlin-Worley represents the basic cloud shape noise, and Worley represents the Fast Fourier Transform. high High-frequency Worley noise is represented by , Curl by 2D curl noise, LF by low frequency, MF by mid-frequency, and HF by high frequency. Low-frequency, mid-frequency, and high-frequency noise are modulated and superimposed, and spatial domain noise is generated through inverse Fourier transform.
[0161]
[0162] in, Represents spatial domain noise. Indicates the inverse Fourier transform, α freq This represents the mixing weights for each frequency band. This represents the minimum weight for each frequency band. This indicates the maximum weight of each frequency band. Indicates precipitation intensity. Let φ(t) represent wind speed, φ(t) represent the phase shift function, and t represent the time variable. The gradient magnitude of Curl noise is represented; based on spatial domain noise, the cloud layer is divided into low-resolution layer and high-resolution layer, and a basic cloud shape is generated based on the low-resolution layer, and dynamic details are added to the basic cloud shape based on the high-resolution layer; the density field formula is calculated based on spatial domain noise, and the cloud coverage, type and rainfall effect are simulated through weather parameter vectors to complete the construction of complex cloud layers.
[0163] The illumination simulation module is used to build a multi-scatter illumination model and use the multi-scatter illumination model to perform single-scatter calculations and multi-scatter approximations on complex clouds to simulate illumination.
[0164] The workflow of the lighting simulation module includes: constructing a single-scattering lighting model by combining Beer-Lambert's law and the Henyey-Greenstein phase function.
[0165]
[0166] Among them, L single Indicates single-scattered illumination, σ t σ represents the extinction coefficient. s σ represents the scattering coefficient. a Let d represent the absorption coefficient, d represent the optical path length, g represent the anisotropy parameter, and θ represent the angle between the light source direction and the viewing direction. Based on the single-scattering illumination model, a multi-scattering illumination model is constructed:
[0167]
[0168] Among them, L multi Let represent single-scattered illumination, and k represent the attenuation rate controlling multiple scattering. The density gradient is introduced into the illumination calculation, and an edge darkening effect is dynamically generated using a multi-scattered illumination model to complete the illumination simulation.
[0169]
[0170] Among them, L final This represents the final simulated lighting. Represents the density gradient. The Euclidean norm of the gradient vector. This represents the normalized line-of-sight vector, and saturate(·) represents a function that restricts the value to the range [0,1].
[0171] Based on the lighting simulation, the adaptive ray processing module divides the cloud density field of complex clouds into several voxel blocks and performs adaptive ray propagation processing to complete the real-time rendering of volumetric clouds.
[0172] The workflow of the adaptive light processing module includes: based on the completed lighting simulation, the cloud density field of the complex cloud layer is divided into 32×32×32 voxel blocks, and each voxel block stores empty block markers and density gradient information; the light is optimized by using empty block skipping and importance sampling, and the step size is dynamically adjusted by the density change rate. Finally, based on transparency saturation and continuous empty sampling, it is determined whether to terminate early to complete the adaptive light travel processing.
[0173] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. A real-time rendering method for physically simulated volumetric clouds, characterized in that, Includes the following steps: A dynamic noise mixing model is constructed, and a complex cloud layer is constructed based on the dynamic noise mixing model by mixing multiple noises; A multi-scattering illumination model is constructed, and the multi-scattering illumination model is used to perform single-scattering calculations and multi-scattering approximations on the complex cloud layer to simulate illumination. Based on the completed lighting simulation, the cloud density field of the complex cloud layer is divided into several voxel blocks, and adaptive light travel processing is performed to complete the real-time rendering of volumetric clouds. Methods for constructing complex cloud layers include: Obtain the weather parameter vector and use Fast Fourier Transform to decompose the fundamental noise signal in the frequency domain to obtain low-frequency noise, mid-frequency noise, and high-frequency noise: in, This represents the noise signal after Fast Fourier Transform. Represents the Fast Fourier Transform. Perlin - Worley Indicates the noise of the basic cloud shape. Worleyhigh Indicates high frequency Worley noise, Curl Indicates 2D curl noise. LF Indicates low frequency. MF Indicates intermediate frequency, HF Indicates high frequency; The low-frequency noise, the mid-frequency noise, and the high-frequency noise are modulated and superimposed, and then spatial domain noise is generated by inverse Fourier transform: in, Represents spatial domain noise. Indicates the inverse Fourier transform. This represents the mixing weights for each frequency band. This represents the minimum weight for each frequency band. This indicates the maximum weight of each frequency band. Indicates precipitation intensity. Indicates wind speed. Represents the phase offset function. t Represents a time variable. express Curl The gradient magnitude of the noise; 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 to the basic cloud shape based on the high-resolution layer. Based on the spatial domain noise calculation density field formula, the complex cloud layer is constructed by simulating cloud coverage, type, and rainfall effect through the weather parameter vector.
2. The real-time rendering method for physically simulated volumetric clouds according to claim 1, characterized in that, The method for performing the lighting simulation includes: By combining Beer-Lambert's law and the Henyey-Greenstein phase function, a single-scattering illumination model is constructed: in, Indicates single-scattered illumination. Indicates the extinction coefficient. Represents the scattering coefficient. Indicates the absorption coefficient. d Indicates optical path length. Represents the anisotropy parameter, θ Indicates the angle between the direction of the light source and the direction of the line of sight; Based on the single-scattering illumination model, a multi-scattering illumination model is constructed: in, Indicates single-scattered illumination. This indicates the decay rate that controls multiple scattering; The density gradient is incorporated into the lighting calculation, and the multi-scattering lighting model is used to dynamically generate an edge darkening effect to complete the lighting simulation: in, This represents the final simulated lighting. Represents the density gradient. The Euclidean norm of the gradient vector. This represents the normalized view direction vector. This represents a function that restricts values to the range [0,1].
3. The real-time rendering method for physically simulated volumetric clouds according to claim 2, characterized in that, The method for performing the aforementioned adaptive ray propagation processing includes: Based on the completed illumination simulation, the cloud density field of the complex cloud layer is divided into 32×32×32 voxel blocks, and each voxel block stores empty block markers and density gradient information; The light beam is optimized by using empty block jumps and importance sampling, and the step size is dynamically adjusted by the density change rate. Finally, the adaptive processing of light beam travel is completed by determining whether to terminate early based on transparency saturation and continuous empty sampling.
4. A real-time rendering system for physically simulated volumetric clouds, wherein the rendering system applies the rendering method according to any one of claims 1-3, characterized in that, include: Cloud layer construction module, lighting simulation module, and adaptive light processing module; The cloud construction module is used to construct a dynamic noise mixing model, and to construct complex cloud layers by mixing multiple types of noise based on the dynamic noise mixing model; The illumination simulation module is used to construct a multi-scatter illumination model and to perform single-scatter calculations and multi-scatter approximations on the complex cloud layer using the multi-scatter illumination model to simulate illumination. Based on the lighting simulation, the adaptive light processing module divides the cloud density field of the complex cloud layer into several voxel blocks and performs adaptive light travel processing to complete real-time volumetric cloud rendering. The workflow of the cloud construction module includes: Obtain the weather parameter vector and use Fast Fourier Transform to decompose the fundamental noise signal in the frequency domain to obtain low-frequency noise, mid-frequency noise, and high-frequency noise: in, This represents the noise signal after Fast Fourier Transform. Represents the Fast Fourier Transform. Perlin - Worley Indicates the noise of the basic cloud shape. Worleyhigh Indicates high frequency Worley noise, Curl Indicates 2D curl noise. LF Indicates low frequency. MF Indicates intermediate frequency, HF Indicates high frequency; The low-frequency noise, the mid-frequency noise, and the high-frequency noise are modulated and superimposed, and then spatial domain noise is generated by inverse Fourier transform: in, Represents spatial domain noise. Indicates the inverse Fourier transform. This represents the mixing weights for each frequency band. This represents the minimum weight for each frequency band. This indicates the maximum weight of each frequency band. Indicates precipitation intensity. Indicates wind speed. Represents the phase offset function. t Represents a time variable. express Curl The gradient magnitude of the noise; 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 to the basic cloud shape based on the high-resolution layer. Based on the spatial domain noise calculation density field formula, the complex cloud layer is constructed by simulating cloud coverage, type, and rainfall effect through the weather parameter vector.
5. The real-time rendering system for physically simulated volumetric clouds according to claim 4, characterized in that, The workflow of the lighting simulation module includes: By combining Beer-Lambert's law and the Henyey-Greenstein phase function, a single-scattering illumination model is constructed: in, Indicates single-scattered illumination. Indicates the extinction coefficient. Represents the scattering coefficient. Indicates the absorption coefficient. d Indicates optical path length. Represents the anisotropy parameter, θ Indicates the angle between the direction of the light source and the direction of the line of sight; Based on the single-scattering illumination model, a multi-scattering illumination model is constructed: in, Indicates single-scattered illumination. This indicates the decay rate that controls multiple scattering; The density gradient is incorporated into the lighting calculation, and the multi-scattering lighting model is used to dynamically generate an edge darkening effect to complete the lighting simulation: in, This represents the final simulated lighting. Represents the density gradient. The Euclidean norm of the gradient vector. This represents the normalized view direction vector. This represents a function that restricts values to the range [0,1].
6. The real-time rendering system for physically simulated volumetric clouds according to claim 5, characterized in that, The workflow of the adaptive light processing module includes: Based on the completed illumination simulation, the cloud density field of the complex cloud layer is divided into 32×32×32 voxel blocks, and each voxel block stores empty block markers and density gradient information; The light beam is optimized by using empty block jumps and importance sampling, and the step size is dynamically adjusted by the density change rate. Finally, the adaptive processing of light beam travel is completed by determining whether to terminate early based on transparency saturation and continuous empty sampling.