Method, device and equipment for programmatic modeling of three-dimensional cloud scenes based on atmospheric layering model

Through the three-dimensional cloud landscape programmatic modeling method based on atmospheric stratification modeling, the problem of inconsistent real-time preview and rendering effects in cloud landscape modeling is solved, and the cloud landscape modeling is quickly generated and modified, which improves the reality and convenience of cloud landscape.

CN115222880BActive Publication Date: 2025-08-22NANJING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210750179.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-29
Publication Date
2025-08-22
Estimated Expiration
2042-06-29

AI Technical Summary

Technical Problem

The existing technology is difficult to achieve real-time preview in cloud landscape modeling, with both realism and convenience, and there is a problem of inconsistent rendering effects between the three-dimensional modeling software and the game engine.

Method used

A three-dimensional cloud landscape programmatic modeling method based on the atmospheric stratification model is adopted. By dividing the atmosphere into three layers: low, medium and high, using wind field to represent and calculate convection, a grayscale texture distribution map is generated, and different cloud types are shaped by combining Perlin noise and Worley noise, and a light stepping algorithm is used to render cloud landscape.

Benefits of technology

It realizes rapid generation, real-time preview and modification of cloud scenes, improves the reality and convenience of cloud scenes, reduces manual modeling and rendering time, and the generated cloud scene effects are rich and diverse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115222880B_ABST
    Figure CN115222880B_ABST
Patent Text Reader

Abstract

The present invention discloses a three-dimensional cloud scene program modeling method, device and equipment based on an atmospheric layer model. The method comprises the following steps: (1) using a scene terrain height map as a terrain environment model and dividing the atmosphere into three layers: low, middle and high; (2) calculating the convection properties of each region of the atmosphere according to the wind field, and generating a grayscale texture convection distribution map for each of the three atmospheric layers; (3) judging the cloud type of the corresponding region according to the convection distribution map of each atmospheric layer; (4) shaping the three-dimensional type texture of different volumetric clouds by different superpositions of three-dimensional Perlin noise and Worley noise; (5) filling the corresponding region of the cloud scene range bounding box with the three-dimensional type texture of the corresponding type of cloud according to the cloud type of each region of each atmospheric layer, and rendering the volumetric cloud using a ray marching algorithm shader, and drawing it on the screen in the camera post-processing step. The present invention can preview the cloud scene in real time and has both cloud scene realism and convenience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to volumetric cloud modeling technology, and in particular to a three-dimensional cloud scene programmatic modeling method, device and equipment based on an atmospheric layering model. Background Art

[0002] Volumetric cloud modeling technologies primarily include mesh modeling, computational fluid dynamics (CFD) simulation, and procedural modeling. Procedural modeling is a widely used modeling method in industries such as gaming. It requires minimal user input and, by defining generation rules that describe the modeling objectives, can rapidly and massively generate consistent modeling results. Cloudscape modeling simulates cloud shape characteristics, requiring different morphologies and densities for different cloud types. For example, the visual appearance of dense, fluffy cumulus clouds differs significantly from that of sparse, loose cirrus clouds. Generating cloudscapes purely from noise results in relatively uniform, scene-specific adjustments. Manual creation requires extensive modeling and creation work, while computational fluid dynamics simulations also require lengthy computational time and are difficult to manually modify. Furthermore, when applied to gaming scenarios, there is a gap between 3D modeling software and game engines, making it difficult to ensure consistency between the results created in the modeling software and the final rendering in the game engine. Given these challenges, cloudscape modeling requires a solution that offers real-time preview, combines realistic cloudscapes with ease of creation. Summary of the Invention

[0003] Purpose of the invention: To address the problems existing in the prior art, the present invention provides a method, device, equipment and storage medium for programmatic modeling of three-dimensional cloud scenes based on an atmospheric layering model, which can be previewed in real time and has both cloud scene realism and convenience.

[0004] Technical solution: The method for programming three-dimensional cloudscape modeling based on an atmospheric layering model of the present invention comprises:

[0005] (1) The scene terrain height map is used as the terrain environment model, the atmosphere is divided into three layers: low, medium, and high, and the wind field in each atmospheric layer is represented by a circular area with size and direction;

[0006] (2) Calculate the convection properties of each region of the atmosphere based on the wind field, and generate a grayscale texture convection distribution map for the convection properties of the lower, middle, and upper atmospheric layers respectively;

[0007] (3) Determine the cloud type of the corresponding area based on the convection distribution map of each atmospheric layer. The cloud types include stratus, cirrus and cumulus.

[0008] (4) The three-dimensional textures of three types of volumetric clouds, namely cirrus, cumulus and stratus, are shaped by different superpositions of three-dimensional Perlin noise and Worley noise;

[0009] (5) According to the cloud type in each area of ​​each atmospheric layer, the corresponding area of ​​the cloud scene range bounding box is filled with the three-dimensional type texture of the corresponding type of cloud, and the volumetric cloud is rendered using the ray marching algorithm shader and drawn on the screen in the camera post-processing step.

[0010] Furthermore, the circular area used to represent the wind field in step (1) has the following parameters: center point C, radius R, wind direction D and wind intensity I, wherein the center point C and radius R are size parameters of the wind field, and the wind direction D and wind intensity I are direction parameters of the wind field.

[0011] Furthermore, step (2) specifically includes:

[0012] (2-1) Perform wind field coverage detection on each pixel point in the low, middle and upper atmospheric layers in turn;

[0013] (2-2) Calculate the single wind field convection Conv0 of each pixel point according to the following formula:

[0014]

[0015] Where α is the basic influence intensity coefficient of the wind field, p represents the coordinate of the atmospheric pixel point, n represents the number of wind fields covering p, i represents the wind field number covering p, dist() represents the Euclidean distance between two points, and C i represents the center point of wind field i, R i Indicates the radius of wind field i, I i represents the intensity of wind field i;

[0016] (2-3) The convection between wind fields at each pixel is calculated according to the following formula:

[0017]

[0018] Where β is the influence intensity coefficient between wind farms, j represents the wind farm number covering p, C j represents the center point of wind field j, R j represents the radius of wind field j, I j represents the wind field j intensity, D i ,D j They represent wind directions of wind field i and j respectively, and dot() represents dot product operation;

[0019] (2-4) The terrain convection of each pixel is calculated according to the following formula:

[0020]

[0021] Where m represents the number of wind fields on the windward slope, k represents the wind field number when the current pixel’s atmosphere is the lower atmosphere and the regional terrain is the wind field number on the windward slope, and D k , I k Indicates the wind direction and intensity of the wind field k;

[0022] (2-5) Sum all convection properties of each pixel and normalize them to the range of [0,1] to obtain the normalized convection property Conv of each pixel;

[0023] Conv=saturate(Conv0+Conv1+Conv2)

[0024] (2-6) The normalized convection properties Conv of all pixels in the three atmospheric layers are used to generate a grayscale texture convection distribution map.

[0025] Furthermore, the specific method for determining the windward slope is: calculating the gradient of the terrain, determining whether the angle between the rising direction of the terrain gradient and the wind direction of the wind field is less than a preset angle threshold, and if so, determining that the current terrain is a windward slope.

[0026] Furthermore, the method for determining the cloud type in step (3) is as follows: in the upper atmosphere, the cloud type of the area where the convection is less than the first threshold is determined to be stratus cloud, the cloud type of the area where the convection is between the first threshold and the second threshold is determined to be cirrus cloud, and the cloud type of the area where the convection is greater than the second threshold is determined to be cumulus cloud; in the middle atmosphere and the lower atmosphere, the cloud type of the area where the convection is less than the third threshold is determined to be stratus cloud, and the cloud type of the area where the convection is greater than the third threshold is determined to be cumulus cloud, and the first threshold, the second threshold and the third threshold are different values.

[0027] Furthermore, step (5) specifically includes:

[0028] (5-1) Using a cuboid as a cloudscape bounding box, and filling the corresponding area of ​​the cloudscape bounding box with a 3D texture of the corresponding type of cloud according to the cloud type of each region of the atmosphere;

[0029] (5-2) Use the ray-stepping shader to draw the area within the bounding box of each cloud scene area. When drawing each pixel in the area, it moves along a ray emitted by the camera and samples a three-dimensional texture at each point along the ray to obtain the volume cloud density. Then, with this point as the origin, it steps toward the light source to perform a step calculation of the lighting, gradually accumulating the light energy, and drawing the three lighting effects of the cloud on light absorption, outward scattering, and inward scattering.

[0030] The three-dimensional cloud scene program modeling device based on the atmospheric layer model of the present invention comprises:

[0031] The atmospheric layering module uses the scene terrain height map as a terrain environment model, divides the atmosphere into three layers: low, medium, and high, and represents the wind field in each atmospheric layer as a circular area with size and direction;

[0032] The convection calculation module is used to calculate the convection of each area of ​​the atmosphere based on the wind field, and generate a grayscale texture convection distribution map for the convection of the lower, middle and upper atmospheric layers respectively;

[0033] a cloud type determination module, configured to determine the cloud type of the corresponding area based on the convection distribution map of each atmospheric layer, wherein the cloud type of the area where the convection property is less than a first threshold is determined to be stratus cloud, the cloud type of the area where the convection property is between the first threshold and the second threshold is determined to be cirrus cloud, and the cloud type of the area where the convection property is greater than the second threshold is determined to be cumulus cloud;

[0034] The cloud shaping module creates three-dimensional textures of volumetric clouds: cirrus, cumulus, and stratus by superimposing three-dimensional Perlin noise and Worley noise.

[0035] The cloud drawing module is used to fill the corresponding area of ​​the cloud scene range bounding box with the three-dimensional type texture of the corresponding type of cloud according to the cloud type in each area of ​​each atmospheric layer, and use the ray marching algorithm shader to render the volumetric cloud and draw it on the screen in the camera post-processing step.

[0036] The three-dimensional cloud scene program modeling device based on the atmospheric layer model of the present invention includes:

[0037] one or more processors;

[0038] a memory for storing one or more programs;

[0039] When the one or more programs are executed by the one or more processors, the one or more processors implement the above method.

[0040] The storage medium of the present invention contains computer-executable instructions, and the computer-executable instructions are used to perform the above method when executed by a computer processor.

[0041] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages:

[0042] 1. Based on the atmospheric layering model and the real cloud generation principle, the generation logic is easy to understand and the threshold for use is low. The generated volumetric clouds include three different forms, and the overall scene effect is rich;

[0043] 2. Use procedural modeling methods and complete the entire modeling and rendering process in the game engine, which can quickly generate large quantities and preview modifications in real time, saving a lot of time on manual modeling and waiting for rendering. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a flow chart of the method for programmatic modeling of three-dimensional cloud scenes based on the atmospheric layering model provided by the present invention;

[0045] Figure 2 It is a schematic diagram of the relationship between wind field topography and convection in the present invention;

[0046] Figure 3 is an example rendering of a cloudscape generated by the present invention;

[0047] Figure 4 It is a comparison of convection diagram, type diagram, and generated effect diagram under two different input conditions;

[0048] Figure 5 This is the wind farm input interactive interface diagram;

[0049] Figure 6 This is a diagram of the volumetric cloud type threshold control interface;

[0050] Figure 7 This is a diagram of the interactive interface between layered height control and 3D voxel storage;

[0051] Figure 8 This is the lighting effect control interactive interface diagram;

[0052] Figure 9 The present invention provides a schematic structural diagram of a three-dimensional cloud scene program modeling device based on an atmospheric layering model. DETAILED DESCRIPTION

[0053] Example 1

[0054] This embodiment provides a three-dimensional cloud scene program modeling method based on the atmospheric layer model. Figure 1 Shown, including:

[0055] (1) The scene terrain height map is used as the terrain environment model, and the atmosphere is divided into three layers: low, medium, and high. The wind field in each atmospheric layer is represented by a circular area with size and direction, such as Figure 5 As shown in the wind farm input interactive interface, users can construct different wind farm inputs by adjusting the number of wind farms, center position, size and wind direction.

[0056] This embodiment represents the atmospheric environment within a range of 20*20*10km using a terrain height map and three layers of wind fields: low, medium, and high, and provides this to the user as an input interface. The terrain is represented by a terrain height map, which is mainly used to calculate the convection between the terrain and the low-level wind field. In each layer of the atmosphere, a circular area with size and direction is used to simplify the representation of a wind field. Each wind field has the following parameters: center point C, radius R, wind direction D, and wind intensity I. Center point C and radius R are the size parameters of the wind field, defining the range of the wind field. Wind direction D and wind intensity I are the direction parameters of the wind field, defining the moving direction and speed of the wind field. Zero to multiple wind fields can be defined in each layer.

[0057] (2) The convection properties of each region of the atmosphere are calculated based on the wind field, and a grayscale textured convection distribution map is generated for the convection properties of the low, middle and high atmospheric layers respectively.

[0058] Regarding convection, this embodiment considers areas without wind farm coverage to be non-convective. Areas covered by only one wind farm have weak convection, and areas where multiple wind farms intersect have strong convection. In addition to the mutual influence between wind farms, low-level wind farms interact with the terrain. On the windward side of the slope, where the angle between the rising terrain gradient and the wind direction is small, strong convection will also occur. Figure 2 The specific convection calculation includes the following steps:

[0059] (2-1) Conduct wind field coverage detection for the lower, middle and upper atmospheric layers in sequence;

[0060] (2-2) Calculate the single wind field convection Conv0 of each pixel point according to the following formula:

[0061]

[0062] Where α is the basic influence intensity coefficient of the wind field, p represents the coordinate of the atmospheric pixel point, n represents the number of wind fields covering p, i represents the wind field number covering p, dist() represents the Euclidean distance between two points, and C i represents the center point of wind field i, R i Indicates the radius of wind field i, I i Indicates the intensity of wind field i. In general, to weaken the influence of a single wind field, α is set to a small value, which can make the wind field have weak convection.

[0063] (2-3) The convection between wind fields at each pixel is calculated according to the following formula:

[0064]

[0065] Where β is the influence intensity coefficient between wind farms, j represents the wind farm number covering p, C jrepresents the center point of wind field j, R j represents the radius of wind field j, I j represents the wind field j intensity, D i ,D j Represent the wind directions of wind fields i and j respectively, and dot() represents the dot product operation; Since the intersection of two wind fields should have a stronger influence, β is generally set to a larger value, so that the influence of convection intensity mainly comes from the influence between wind fields, while the influence of a single wind field is weaker;

[0066] (2-4) The terrain convection of each pixel is calculated according to the following formula:

[0067]

[0068] Where m represents the number of wind fields on the windward slope, k represents the wind field number when the current pixel’s atmosphere is the lower atmosphere and the regional terrain is the wind field number on the windward slope, and D k , I k Indicates the wind direction and intensity of wind field k; saturate() means truncating the calculated result between 0 and 1; the method for determining a windward slope is: calculating the gradient of the terrain, and determining whether the angle between the rising direction of the gradient of the terrain and the wind direction of the wind field is less than a preset angle threshold. If so, the current terrain is determined to be a windward slope; (2-5) Sum all the convection properties of each pixel and normalize them to the range of [0,1] to obtain the normalized convection property Conv of each pixel;

[0069] Conv=saturate(Conv0+Conv1+Conv2)

[0070] (2-6) The normalized convection properties Conv of all pixels in the three atmospheric layers are used to generate a grayscale texture convection distribution map.

[0071] (3) The cloud type of the corresponding area is determined according to the convection distribution map of each atmospheric layer. The determination method is as follows: in the upper atmosphere, the cloud type of the area where the convection is less than the first threshold is determined to be stratus cloud, the cloud type of the area where the convection is between the first threshold and the second threshold is determined to be cirrus cloud, and the cloud type of the area where the convection is greater than the second threshold is determined to be cumulus cloud; in the middle and lower atmosphere, the cloud type of the area where the convection is less than the third threshold is determined to be stratus cloud, and the cloud type of the area where the convection is greater than the third threshold is determined to be cumulus cloud. The first threshold, the second threshold and the third threshold are different values, such as Figure 6 Shown is an interactive interface for adjusting the convective threshold for classifying volumetric cloud types.

[0072] Taking the upper atmosphere as an example, the two-dimensional type density t′ of the three types of clouds St , t′ Ci , t′ CuThe specific calculation method is as follows:

[0073]

[0074]

[0075]

[0076] Where Conv represents the convection value finally obtained in step 2, b1 represents the first threshold, and b2 represents the second threshold, both of which are in the range of [0, 1].

[0077] Then, the three-dimensional type density is generated from the two-dimensional type density. The two-dimensional type density is modified with the height signal function, which is shown in the following formula:

[0078]

[0079] Where y is the height of the sampling point, low is the starting height of the layer where the sampling point is located, and high is the ending height of the layer.

[0080] The density of the three cloud types at a pixel with three-dimensional coordinates (x, y, z) is calculated as follows:

[0081] t St (x,y,z)=t′ St (x,z)·HS(y)

[0082] t Ci (x,y,z)=t′ Ci (x,z)·HS(y)

[0083] t Cu (x,y,z)=t′ Cu (x,z)·HS(y)(4) uses different superpositions of 3D Perlin noise and Worley noise to shape the 3D textures of three types of volume clouds: cirrus, cumulus, and stratus. Figure 7 Shown is an interactive interface diagram for controlling the layer height and storing the generated three-dimensional texture.

[0084] Perlin noise can simulate the fluffy texture of volumetric clouds, while Worley noise can simulate the circular rolling outline. By superimposing multiple noises and configuring different scaling and frequency parameters, volumetric clouds with different morphological characteristics can be shaped.

[0085] The steps of generating three-dimensional Perlin noise specifically include: subdividing the texture space into several equal-sized cubic lattices, pseudo-randomly generating a gradient vector at each lattice vertex; for each sampling point (x, y, z), finding the positions of the eight adjacent lattice vertices, constructing the distance vector from the lattice vertex to the sampling point, and performing a dot product with the gradient vector on the lattice vertex to obtain the noise influence value of each lattice vertex on the sampling point; using an easing function to interpolate and average the noise influence values ​​of the eight lattice vertices as the final noise value; wherein the easing function is S(t) = 6t 5 -15t 4 +10t 3 , t represents time; in this embodiment, a lattice divided into 8*8*8 is used to generate three-dimensional Perlin noise, which is used as the main noise parameter and stored in the first channel of the noise texture; the result of sampling noise at the coordinates (x, y, z) in the noise texture is expressed as Perlin(x, y, z);

[0086] The steps for generating three-dimensional Worley noise specifically include: subdividing the texture space into several equal-sized cubic lattices, pseudo-randomly placing a feature point in each lattice, and each lattice must have only one feature point. For each sampling point (x, y, z), the feature point with the shortest Euclidean distance to the sampling point is found among the 27 neighboring feature points in the cell where the sample point is located and the 26 surrounding cells, and this shortest Euclidean distance is used as the noise value. For cells at the edge of the texture, the edge cells on the other side of the entire texture are used as their neighboring cells to ensure that the texture can be tiled. In this embodiment, three Worley textures with partitions of 12*12*12, 8*8*8, and 4*4*4 are used as noise details, stored in the second, third, and fourth channels of the noise texture, respectively. The results of sampling noise with coordinates (x, y, z) are represented as Worley1(x, y, z), Worley2(x, y, z), and Worley3(x, y, z), respectively.

[0087] Cirrus, stratus, and cumulus clouds can be generated by superimposing 3D Perlin noise with 3D Worley noise as follows:

[0088] Prepare separately for stratus, cirrus and cumulus clouds:

[0089] ① 4-dimensional scaling vector s, used to scale the sampling point coordinates when sampling on the noise texture of the four channels. Different frequencies of noise can be set for three different types of clouds.

[0090] ② The 4-dimensional weight vector w, which satisfies the 4-dimensional value sum to 1, is used to perform dot product with the noise texture with 4 channels, so that the three different forms of clouds can obtain the weighted average of 4 noise values ​​with different weights;

[0091] ③Density multiplier k and offset b, for different cloud forms, different linear adjustments are made to the final density;

[0092] Finally, the density of each type of cloud at the pixel with coordinates (x, y, z) is calculated as follows:

[0093] v(x,y,z)=k(w x ·Perlin(s x ·x,s x ·y,s x ·z)+w y ·Worley1(s y ·x,s y ·y,s y z)

[0094] +w z ·Worley2(s z ·x,s z ·y,s z ·z)+w w ·Worley2(s w ·x,s w ·y,s w ·z))+b

[0095] In the formula, the vector subscripts x, y, z, and w represent the four dimensions of the scaling vector s and the weight vector w. This step obtains three values ​​for the three clouds, named v St ,v Ci ,v Cu .

[0096] Combined with the cloud type density t at (x, y, z) in step (3) St , t Ci , t Cu , multiplied by the density calculation results of each type of cloud to obtain the final voxel density;

[0097] d=t St ·v St +t Ci ·v Ci +t Cu ·v Cu

[0098] For specific rendering parameters of stratus, cirrus, and cumulus clouds, please refer to the document "Convincing Cloud Rendering An Implementation of Real-Time Dynamic Volumetric Clouds in Frostbite".

[0099] (5) According to the cloud type in each area of ​​each atmospheric layer, fill the corresponding area of ​​the cloud scene range bounding box with the three-dimensional type texture of the corresponding type of cloud, and use the ray marching algorithm shader to render the volume cloud, and draw it on the screen in the camera post-processing step. Figure 8 The figure shows the interactive interface for controlling the illumination parameters in this embodiment, which can adjust the absorption value, scattering value, absorption color, etc. of the cloud to light. Figure 3 The following is the final cloud scene rendering obtained in this implementation case: Figure 4 Shown are different intermediate process diagrams and the final cloud scene effect diagram obtained by setting different inputs in this implementation case.

[0100] This step specifically includes:

[0101] (5-1) Using a cuboid as a cloudscape bounding box, and filling the corresponding area of ​​the cloudscape bounding box with a 3D texture of the corresponding type of cloud according to the cloud type of each region of the atmosphere;

[0102] (5-2) Use the ray-stepping shader to draw the area within the bounding box of each cloud scene area. When drawing each pixel in the area, it moves along a ray emitted by the camera and samples a three-dimensional texture at each point along the ray to obtain the volume cloud density. Then, with this point as the origin, it steps toward the light source to perform a step calculation of the lighting, gradually accumulating the light energy, and drawing the three lighting effects of the cloud on light absorption, outward scattering, and inward scattering.

[0103] Example 2

[0104] This embodiment provides a three-dimensional cloud scene programmatic modeling device based on an atmospheric layer model. The device can be implemented in software and / or hardware. The device can be configured in a terminal device and includes:

[0105] The atmospheric layering module uses the scene terrain height map as a terrain environment model, divides the atmosphere into three layers: low, medium, and high, and represents the wind field in each atmospheric layer as a circular area with size and direction;

[0106] The convection calculation module is used to calculate the convection of each area of ​​the atmosphere based on the wind field, and generate a grayscale texture convection distribution map for the convection of the lower, middle and upper atmospheric layers respectively;

[0107] a cloud type determination module, configured to determine the cloud type of the corresponding area based on the convection distribution map of each atmospheric layer, wherein the cloud type of the area where the convection property is less than a first threshold is determined to be stratus cloud, the cloud type of the area where the convection property is between the first threshold and the second threshold is determined to be cirrus cloud, and the cloud type of the area where the convection property is greater than the second threshold is determined to be cumulus cloud;

[0108] The cloud shaping module creates three-dimensional textures of volumetric clouds: cirrus, cumulus, and stratus by superimposing three-dimensional Perlin noise and Worley noise.

[0109] The cloud drawing module is used to fill the corresponding area of ​​the cloud scene range bounding box with the three-dimensional type texture of the corresponding type of cloud according to the cloud type in each area of ​​each atmospheric layer, and use the ray marching algorithm shader to render the volumetric cloud and draw it on the screen in the camera post-processing step.

[0110] The device provided in the embodiment of the present invention can be used to execute the method provided in the first embodiment, and has the corresponding functions and beneficial effects of executing the method.

[0111] It is worth noting that in the embodiment of the above-mentioned device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0112] Example 3

[0113] Figure 9 This is a schematic diagram of the structure of the device provided in the third embodiment of the present invention. This embodiment of the present invention provides services for the implementation of the method in the first embodiment, and can be configured with the device in the second embodiment. Figure 9 A block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 9 The device 12 shown is only an example and should not bring any limitation to the functionality and scope of use of the embodiments of the present invention.

[0114] like Figure 9 As shown, device 12 is implemented as a general-purpose computing device. Components of device 12 may include, but are not limited to, one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components, including system memory 28 and processing unit 16.

[0115] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0116] Device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by device 12, including volatile and non-volatile media, removable and non-removable media.

[0117] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 3 Not shown, often called a "hard drive"). Although Figure 9 Not shown, a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.

[0118] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally implement the functions and / or methods of the embodiments described herein.

[0119] The device 12 may also communicate with one or more external devices 14 (e.g., a keyboard, a pointing device, a display 24, etc.), one or more devices that enable a user to interact with the device 12, and / or any device that enables the device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may occur through an input / output (I / O) interface 22. Furthermore, the device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) through a network adapter 20. Figure 9 As shown, network adapter 20 communicates with the other modules of device 12 via bus 18. It should be understood that although not shown, other hardware and / or software modules may be used in conjunction with device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0120] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28 , such as implementing the quotation method considering carbon costs provided in the first embodiment of the present invention.

[0121] Example 4

[0122] The fourth embodiment of the present invention further provides a storage medium containing computer-executable instructions, which are used to execute the method described in the first embodiment when executed by a computer processor.

[0123] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or components, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by an instruction execution system, device or device or used in combination with it.

[0124] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0125] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0126] The computer program code for performing the operations of the present invention can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0127] Of course, the computer-executable instructions of a storage medium provided by an embodiment of the present invention are not limited to the above method operations, but can also execute related operations in the method provided by any embodiment of the present invention.

[0128] The above disclosure is only a preferred embodiment of the present invention and cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.

Claims

1. A three-dimensional cloud scene program modeling method based on an atmospheric layer model, characterized in that The method includes: (1) The scene terrain height map is used as the terrain environment model, the atmosphere is divided into three layers: low, medium, and high, and the wind field in each atmospheric layer is represented by a circular area with size and direction; (2) Calculate the convection properties of each region of the atmosphere based on the wind field, and generate a grayscale texture convection distribution map for the convection properties of the lower, middle, and upper atmospheric layers respectively; (3) Determine the cloud type of the corresponding area based on the convection distribution map of each atmospheric layer. The cloud types include stratus, cirrus and cumulus. (4) The three-dimensional textures of three types of volumetric clouds, namely cirrus, cumulus and stratus, are shaped by different superpositions of three-dimensional Perlin noise and Worley noise; (5) According to the cloud type in each area of ​​each atmospheric layer, fill the corresponding area of ​​the cloud scene range bounding box with the three-dimensional type texture of the corresponding type of cloud, and use the ray marching algorithm shader to render the volume cloud, and draw it on the screen in the camera post-processing step; Step (2) specifically includes: (2-1) Perform wind field coverage detection on each pixel point in the low, middle and upper atmospheric layers in turn; (2-2) Calculate the single wind field convection Conv0 of each pixel point according to the following formula: Where α is the basic influence intensity coefficient of the wind field, p represents the coordinate of the atmospheric pixel point, n represents the number of wind fields covering p, i represents the wind field number covering p, dist() represents the Euclidean distance between two points, and C i represents the center point of wind field i, R i Indicates the radius of wind field i, I i represents the intensity of wind field i; (2-3) The convection between wind fields at each pixel is calculated according to the following formula: Where β is the influence intensity coefficient between wind farms, j represents the wind farm number covering p, C j represents the center point of wind field j, R j represents the radius of wind field j, I j represents the wind field j intensity, D i ,D j They represent wind directions of wind field i and j respectively, and dot() represents dot product operation; (2-4) The terrain convection of each pixel is calculated according to the following formula: Where m represents the number of wind fields on the windward slope, k represents the wind field number when the current pixel’s atmosphere is the lower atmosphere and the regional terrain is the wind field number on the windward slope, and D k , I k Indicates the wind direction and intensity of wind field k, and saturate() means truncating the calculated result between 0 and 1; (2-5) Sum all convection properties of each pixel and normalize them to the range of [0,1] to obtain the normalized convection property Conv of each pixel; Conv=saturate(Conv0+Conv1+Conv2) (2-6) The normalized convection properties Conv of all pixels in the three atmospheric layers are used to generate a grayscale texture convection distribution map.

2. The method for programmatic modeling of three-dimensional cloud scenes based on an atmospheric layering model according to claim 1, wherein: The circular area used to represent the wind field in step (1) has the following parameters: center point C, radius R, wind direction D and wind intensity I, wherein the center point C and radius R are size parameters of the wind field, and the wind direction D and wind intensity I are direction parameters of the wind field.

3. The method for programmatic modeling of three-dimensional cloud scenes based on an atmospheric layering model according to claim 2, wherein: The specific method for determining the windward slope is: calculating the gradient of the terrain, determining whether the angle between the rising direction of the terrain gradient and the wind direction of the wind field is less than a preset angle threshold, and if so, determining that the current terrain is a windward slope.

4. The method for programmatic modeling of three-dimensional cloud scenes based on an atmospheric layering model according to claim 1, wherein: The method for determining the cloud type in step (3) is as follows: in the upper atmosphere, the cloud type of the area where the convection is less than the first threshold is determined to be stratus cloud, the cloud type of the area where the convection is between the first threshold and the second threshold is determined to be cirrus cloud, and the cloud type of the area where the convection is greater than the second threshold is determined to be cumulus cloud; in the middle atmosphere and the lower atmosphere, the cloud type of the area where the convection is less than the third threshold is determined to be stratus cloud, and the cloud type of the area where the convection is greater than the third threshold is determined to be cumulus cloud, and the first threshold, the second threshold and the third threshold are different values.

5. The method for programmatic modeling of three-dimensional cloud scenes based on an atmospheric layering model according to claim 1, wherein: Step (5) specifically includes: (5-1) Using a cuboid as a cloudscape bounding box, and filling the corresponding area of ​​the cloudscape bounding box with a 3D texture of the corresponding type of cloud according to the cloud type of each region of the atmosphere; (5-2) Use the ray-stepping shader to draw the area within the bounding box of each cloud scene area. When drawing each pixel in the area, it moves along a ray emitted by the camera and samples a three-dimensional texture at each point along the ray to obtain the volume cloud density. Then, with this point as the origin, it steps toward the light source to perform a step calculation of the lighting, gradually accumulating the light energy, and drawing the three lighting effects of the cloud on light absorption, outward scattering, and inward scattering.

6. A three-dimensional cloud scene program modeling device based on an atmospheric layer model, characterized in that include: The atmospheric layering module uses the scene terrain height map as a terrain environment model, divides the atmosphere into three layers: low, medium, and high, and represents the wind field in each atmospheric layer as a circular area with size and direction; The convection calculation module is used to calculate the convection of each area of ​​the atmosphere based on the wind field, and generate a grayscale texture convection distribution map for the convection of the lower, middle and upper atmospheric layers respectively; a cloud type determination module, configured to determine the cloud type of the corresponding area based on the convection distribution map of each atmospheric layer, wherein the cloud type of the area where the convection property is less than a first threshold is determined to be stratus cloud, the cloud type of the area where the convection property is between the first threshold and the second threshold is determined to be cirrus cloud, and the cloud type of the area where the convection property is greater than the second threshold is determined to be cumulus cloud; The cloud shaping module creates three-dimensional textures of volumetric clouds: cirrus, cumulus, and stratus by superimposing three-dimensional Perlin noise and Worley noise. The cloud drawing module is used to fill the corresponding area of ​​the cloud scene bounding box with the three-dimensional type texture of the corresponding cloud type according to the cloud type in each area of ​​each atmospheric layer, and use the ray marching algorithm shader to render the volumetric cloud and draw it on the screen in the camera post-processing step; The convection calculation module is specifically used to perform the following steps: (2-1) Perform wind field coverage detection on each pixel point in the low, middle and upper atmospheric layers in turn; (2-2) Calculate the single wind field convection Conv0 of each pixel point according to the following formula: Where α is the basic influence intensity coefficient of the wind field, p represents the coordinate of the atmospheric pixel point, n represents the number of wind fields covering p, i represents the wind field number covering p, dist() represents the Euclidean distance between two points, and C i represents the center point of wind field i, R i Indicates the radius of wind field i, I i represents the intensity of wind field i; (2-3) The convection between wind fields at each pixel is calculated according to the following formula: Where β is the influence intensity coefficient between wind farms, j represents the wind farm number covering p, C j represents the center point of wind field j, R j represents the radius of wind field j, I j represents the wind field j intensity, D i ,D j They represent wind directions of wind field i and j respectively, and dot() represents dot product operation; (2-4) The terrain convection of each pixel is calculated according to the following formula: Where m represents the number of wind fields on the windward slope, k represents the wind field number when the current pixel’s atmosphere is the lower atmosphere and the regional terrain is the wind field number on the windward slope, and D k , I k Indicates the wind direction and intensity of wind field k, and saturate() means truncating the calculated result between 0 and 1; (2-5) Sum all convection properties of each pixel and normalize them to the range of [0,1] to obtain the normalized convection property Conv of each pixel; Conv=saturate(Conv0+Conv1+Conv2) (2-6) The normalized convection properties Conv of all pixels in the three atmospheric layers are used to generate a grayscale texture convection distribution map.

7. A three-dimensional cloud scene program modeling device based on an atmospheric layer model, characterized in that: include: one or more processors; a memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

8. A storage medium containing computer-executable instructions, characterized in that: The computer executable instructions are used to perform the method according to any one of claims 1 to 5 when executed by a computer processor.

Citation Information

Patent Citations

  • Comprehensive simulation method for realistic cloud layer

    CN101706967A

  • Open graphics library (OpenGL)-based real cloudland virtualization method

    CN102867326A