A dynamic cloud and mist rendering method and system for mobile terminal GPU load

By constructing a dome geometry model and cloud markers, setting cloud and fog state parameters, calculating dynamic cloud and fog coordinates at the vertex stage, and adjusting transparency in conjunction with the sun's position, the problem of high cloud and fog rendering resource consumption on mobile devices was solved, improving rendering efficiency and effects.

CN122134899APending Publication Date: 2026-06-02GUANGZHOU SHIJING MEDICAL SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU SHIJING MEDICAL SOFTWARE CO LTD
Filing Date
2026-02-28
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In existing technologies, cloud and fog rendering on mobile devices requires a large amount of GPU resources, resulting in poor rendering effects and easily causing problems such as device overheating and lag.

Method used

Construct a dome geometry model, perform texture mapping and cloud marking, set cloud state parameters, calculate the dynamic coordinates and color fill of the clouds through the vertex stage, and adjust pixel transparency in combination with sun position information to reduce GPU load.

Benefits of technology

It improves cloud and fog rendering efficiency, reduces GPU resource consumption, enhances rendering effects, simulates realistic optical and physical phenomena, and is suitable for low-end devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122134899A_ABST
    Figure CN122134899A_ABST
Patent Text Reader

Abstract

This application discloses a dynamic cloud and fog rendering method and system for mobile GPU load, belonging to the field of real-time rendering technology. The method is as follows: a dome geometric model is constructed on the top of a 3D virtual scene; texture mapping and cloud marking are performed on the dome geometric model to obtain a cloud model; state parameters are set for several layers of fog in the cloud model to obtain control variables for each layer of fog; based on the control variables, the dynamic coordinates of the vertices of each layer of fog in the three color channels are calculated, and each layer of fog is filled with color to obtain the texture features of each layer of fog; the texture features are processed based on the sun's position information to obtain the display color and pixel transparency of each layer of fog; the cloud model is rendered using the display color and pixel transparency. Therefore, by implementing this application, the problem of existing technologies requiring a large amount of GPU resources for cloud and fog rendering, resulting in poor rendering effects, can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of real-time rendering technology, specifically relating to a dynamic cloud and fog rendering method and system for mobile GPU load. Background Technology

[0002] In mobile games or virtual navigation, the flowing clouds we see are created by continuously "translating" a static texture across the screen. The traditional approach involves the phone's GPU (graphics card) calculating "where the cloud should be now" for each pixel on the screen, essentially calculating the displacement of each pixel. If the screen is 4K resolution, the GPU has to perform hundreds of millions of these repetitive mathematical calculations per second. This causes the phone to overheat, drain the battery quickly, and even lag.

[0003] Cloud and fog rendering is divided into vertex stage and pixel stage. In the vertex stage, only a few hundred vertices need to be located to determine the outline of the cloud and fog; in the pixel stage, color needs to be filled into the outline of the cloud and fog. If the screen is 4K resolution, it is necessary to process about several million pixels. The GPU needs to calculate each of these several million pixels one by one to determine what color they are in each frame. Therefore, on low-end devices, it is easy to cause excessive GPU load, resulting in device lag or even crashes. Summary of the Invention

[0004] This application proposes a dynamic cloud and fog rendering method and system for mobile GPU load, which can solve the problem that existing technologies require a large amount of GPU resources for cloud and fog rendering, resulting in poor rendering effects.

[0005] The first aspect of this application provides a dynamic cloud and fog rendering method for mobile GPU load, the method comprising: A dome geometry model is constructed at the top of the 3D virtual scene. Texture mapping and cloud marking are performed on the dome geometry model to obtain the cloud model. State parameters are set for several layers of clouds and fog in the cloud model to obtain control variables for each layer of clouds and fog; wherein, the control variables include time variables and cloud and fog transformation vectors; Based on the control variables, the dynamic coordinates of the vertices of each cloud layer in the three color channels are calculated, and the colors of each cloud layer are filled to obtain the texture features of each cloud layer. The texture features are processed based on the sun's position information to obtain the display color and pixel transparency of each layer of clouds and fog. The cloud model is rendered using the display color and the pixel transparency.

[0006] The above scheme constructs a dome-shaped geometric model that covers the 3D virtual scene to simulate the sky and clouds. Parameter settings are configured for multiple layers of clouds, including the scaling and movement rate of each layer, providing data support for subsequent cloud rendering. Coordinate offset calculations for the clouds are performed at the vertex stage, which yields cloud displacement faster than at the pixel stage, improving rendering efficiency and reducing the GPU resource consumption of subsequent pixel stages. The obtained dynamic coordinates are transmitted via three color channels, and pixel coloring is then performed based on the transmission results to obtain the texture features of each cloud layer, accurately describing the color and layering of the clouds. Finally, the influence of the sun's position and intensity on cloud density is considered, adjusting the pixel transparency of clouds at different locations to simulate realistic optical phenomena and effectively improve the rendering effect.

[0007] In one possible implementation of the first aspect, texture mapping and cloud marking are performed on the dome geometry model to obtain a cloud model, specifically: Make the normal of the dome geometry model face the inner surface so that the dome geometry model covers the 3D virtual scene; The vertex coordinates of the dome geometry model are mapped to a preset two-dimensional texture coordinate system to obtain the original texture coordinates of each vertex. Visibility and light source identification were performed on the dome geometry model to obtain cloud texture information; A cloud model is constructed based on the cloud texture information, the sun position information, and the original texture coordinates.

[0008] The above scheme first constructs a dome geometric model that can cover the 3D virtual scene to accurately simulate the sky. The vertex coordinates of the dome geometric model are mapped to a 2D texture coordinate system, providing a precise mathematical basis for using 2D textures to drive the cloud morphology on the 3D dome. The constructed cloud model can be used to precisely control the cloud distribution and illumination area.

[0009] In one possible implementation of the first aspect, visibility and light source identification are performed on the dome geometry model to obtain cloud texture information, specifically: The visibility of the dome geometry model is identified using a preset first graphics channel, and the visible and non-visible areas of the dome geometry model are marked. The shape of the cloud distribution is obtained by removing the invisible areas from the dome geometry model; Based on the texture coordinates of the sun, the light source point is marked in the dome geometry model to obtain the sun's position information.

[0010] The above scheme retains only the visible areas and eliminates the invisible areas, thus creating a natural cloud distribution shape visually; marking the light source points provides data support for subsequent adjustments to pixel transparency.

[0011] In one possible implementation of the first aspect, state parameters are set for several layers of cloud fog in the cloud model to obtain the control variables for each layer of cloud fog, specifically: Obtain the system runtime and set it as the time variable for each layer of clouds and fog; Set the corresponding scaling degree for each layer of cloud and fog to obtain the scaling factor for each layer of cloud and fog; By setting the horizontal and vertical movement distances per second for each layer of clouds, the velocity factors of each layer of clouds are obtained; The cloud and fog transformation vector is obtained based on the scaling factor and the velocity factor.

[0012] The above scheme uses system runtime as a unified driving variable to ensure that each layer of clouds can change automatically and continuously over time. Then, by setting scaling and speed factors, it can easily simulate the perspective effect of nearby clouds moving fast and distant clouds moving slowly, as well as the visual effect of different cloud densities and sizes at different altitudes, greatly enhancing the sense of layering and realism of the scene.

[0013] In one possible implementation of the first aspect, based on the control variables, the dynamic coordinates of the vertices of each cloud layer in the three color channels are calculated to fill each cloud layer with color, thereby obtaining the texture features of each cloud layer, specifically: Obtain the original texture coordinates of the vertex, and divide each layer of cloud into R-channel cloud layer, G-channel cloud layer and B-channel cloud layer according to the three color channels; wherein, the three color channels are RGB channels; Based on the original texture coordinates, the dynamic offset of the R-channel cloud layer is calculated using the control variables to obtain the first dynamic coordinates of the R-channel cloud layer. Calculate the second dynamic coordinates of the cloud layer in channel G and channel B based on the control variables; The first dynamic coordinates and the second dynamic coordinates are transmitted to the GPU for color filling to obtain the texture features.

[0014] The above solution packages and merges the dynamic coordinates of the G-channel cloud layer and the B-channel cloud layer for output, enabling the transmission of the dynamic coordinates of the two cloud layers using only one register, reducing hardware overhead and lowering the load on the GPU.

[0015] In one possible implementation of the first aspect, the first dynamic coordinates and the second dynamic coordinates are transmitted to the GPU for color filling to obtain the texture features, specifically as follows: The second dynamic coordinates of the cloud layer in the G channel are used as the first two digits of the output variable, and the second dynamic coordinates of the cloud layer in the B channel are used as the last two digits of the output variable to complete the packaging of the second dynamic coordinates. The packaged second dynamic coordinates and the first dynamic coordinates are transmitted to the GPU. Based on the transmitted content, the pixels in each layer of clouds are linearly interpolated using the linear interpolation method to obtain the pixels after color filling. The texture feature is obtained based on the pixels after color filling.

[0016] In one possible implementation of the first aspect, the texture features are processed based on the sun's position information to obtain the display color and pixel transparency of each layer of clouds, specifically: The display colors of the pixels of each layer of clouds and fog in the three color channels are read from the texture features; wherein, the display colors include the R channel color, G channel color and B channel color; The displayed colors are weighted and fused to obtain the basic cloud density of each layer of clouds and fog; Based on the solar position information provided by the cloud model, the influence of solar projection on cloud density is simulated based on the basic cloud density to obtain the pixel transparency of each layer of clouds.

[0017] The above scheme parses the display color of each layer of clouds and fog by analyzing the received texture features, without performing any complex coordinate calculations, thus achieving low computational resource consumption at the pixel level. Then, by considering the lighting position, the pixel transparency of each layer of clouds and fog is adjusted to simulate realistic optical physical phenomena, making the clouds closer to the sun more transparent and improving the cloud and fog rendering effect.

[0018] The second aspect of this application provides a dynamic cloud and fog rendering system for mobile GPU load, the system comprising: a cloud model construction module, a control variable setting module, a cloud and fog feature extraction module, a rendering parameter extraction module, and a cloud and fog rendering module; Among them, the cloud model construction module is used to build a dome geometry model on the top of the 3D virtual scene, perform texture mapping and cloud marking on the dome geometry model to obtain the cloud model; The control variable setting module is used to set the state parameters of several layers of clouds and fog in the cloud model to obtain the control variables of each layer of clouds and fog; wherein, the control variables include time variables and cloud and fog transformation vectors; The cloud and fog feature extraction module is used to fill each layer of cloud and fog with color based on the control variables by calculating the dynamic coordinates of the vertices of each layer of cloud and fog in the three color channels, thereby obtaining the texture features of each layer of cloud and fog. The rendering parameter extraction module is used to process the texture features based on the sun's position information to obtain the display color and pixel transparency of each layer of clouds and fog. The cloud rendering module is used to render the cloud model using the display color and the pixel transparency.

[0019] A third aspect of this application provides a terminal device, the device comprising: a terminal device including a processor and a memory, the memory storing a computer program, wherein the processor executes the computer program to implement the steps of a dynamic cloud and fog rendering method for mobile GPU load as described in any one of the embodiments of this application.

[0020] A fourth aspect of this application provides a storage medium that stores computer-readable program code, which, when executed, implements the steps of a dynamic cloud and fog rendering method for mobile GPU load as described in any one of the embodiments of this application. Attached Figure Description

[0021] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0022] Figure 1 This is a schematic diagram illustrating the specific process of a dynamic cloud and fog rendering method for mobile GPU load according to an embodiment of this application; Figure 2 This is a view of the dome geometry model of a dynamic cloud and fog rendering method for mobile GPU load provided in an embodiment of this application; Figure 3 This is a cloud model texture provided in one embodiment of the present application for a dynamic cloud and fog rendering method for mobile GPU load; Figure 4 This is a cloud and fog display image of a dynamic cloud and fog rendering method for mobile GPU load provided in an embodiment of this application; Figure 5 This is a vertex structure diagram of a cloud model for a dynamic cloud and fog rendering method for mobile GPU load provided in an embodiment of this application; Figure 6 This is a rendering of a dome geometry model provided by an embodiment of the dynamic cloud and fog rendering method for mobile GPU load in this application; Figure 7 This is a comparison image of cloud and fog scaling in an embodiment of the present application, which is a dynamic cloud and fog rendering method for mobile GPU load. Figure 8 This is a comparison diagram of the effect of light source interference calculation in a dynamic cloud and fog rendering method for mobile GPU load provided in an embodiment of this application; Figure 9This is a structural diagram of a dynamic cloud and fog rendering system for mobile GPU load provided in one embodiment of this application; Figure 10 This is a structural diagram of a terminal device provided in an embodiment of this application. Detailed Implementation

[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0024] It should be understood that the step numbers used in the text are for ease of description only and are not intended to limit the order in which the steps are performed.

[0025] First Embodiment Because clouds and fog have floating characteristics in VR scenes, rendering them requires calculating not only their color but also their color changes during movement. However, some low-end devices, with their limited GPU performance, are prone to overheating and stuttering during rendering, negatively impacting the user experience. Since the movement of clouds and fog is uniform and linear, and the vertex stage requires less computation and is easily handled by the GPU, this embodiment of the application relocates the UV coordinate offset calculation, originally located at the pixel stage, to the vertex stage. Calculating the displacement at the vertex stage is much faster than calculating it at the pixel stage, thus improving rendering efficiency while maintaining rendering quality on low-end devices.

[0026] like Figure 1 As shown, to address the problem in existing technologies where cloud and fog rendering requires significant GPU resources, resulting in poor rendering quality, the first embodiment of this application provides a detailed flowchart of a dynamic cloud and fog rendering method for mobile GPU load. This embodiment's dynamic cloud and fog rendering method for mobile GPU load includes steps S1 to S5, detailed below: Step S1: Construct a dome geometry model on top of the 3D virtual scene, perform texture mapping and cloud marking on the dome geometry model to obtain a cloud model.

[0027] Since the clouds and fog are located in the sky of the three-dimensional virtual scene, we first construct a cloud layer model that covers the scene to provide a basic environment for cloud and fog calculations.

[0028] First, create a hemispherical or dome-shaped 3D mesh model. Place this model on top of the 3D virtual scene, ensuring the virtual camera is positioned below or inside the geometric center of the hemisphere, resulting in a dome geometry. Then, align the normals of the dome geometry model inwards, ensuring that the line of sight intersects the model's inner surface when looking upwards from the camera's perspective. This "wrapping" spatial structure allows the model to be enveloped, simulating the sky.

[0029] Optionally, to improve the efficiency of subsequent vertex calculations, polygon optimization can be performed on the dome geometry model to control the number of vertices to 257.

[0030] Figure 2 The image shows the front and bottom views of the dome geometry model. The left image is the front view, where the dome geometry model resembles a hat that completely covers the 3D virtual scene; the right image is the bottom view, taken from the apex of the dome, with the top of the model at the center.

[0031] The vertex coordinates of the dome geometry model are mapped to a preset two-dimensional texture coordinate system to obtain the original texture coordinates of each vertex. The two-dimensional texture coordinate system is a 0-to-1 two-dimensional UV coordinate system, where U represents the horizontal axis and V represents the vertical axis. The dome vertices of the dome geometry model correspond to the center of the coordinate system, and the edges correspond to the perimeter. During subsequent rendering, the GPU will accurately project the two-dimensional image pixels onto the three-dimensional curved surface according to this correspondence.

[0032] Then, visibility and light source identification are performed on the dome geometry model to mark key data and obtain cloud texture information. Here, the "marking" is not a physical symbol, but rather data stored using the color channels of the image file.

[0033] In this application, the Alpha channel and B channel are used to mark visible clouds and light sources, respectively.

[0034] The alpha channel performs visibility assessment on the dome geometry model, setting the alpha value of the areas where clouds need to be displayed (usually the zenith, the visible area) to close to 1, and setting the alpha value of the areas that don't need to be displayed (the horizon edge, the invisible area) to close to 0. After reading the alpha values, the rendering program removes the edge clouds, thus visually creating a natural cloud distribution shape.

[0035] B channel: Draw a radially gradient dot at the texture coordinates of the sun as the light source point. When the rendering program reads the highlight value of the B channel, it can recognize "this is the sun" and thus trigger subsequent light source interference calculations.

[0036] Based on the labeled results, and according to the visible area, the sun's position information, and the original texture coordinates, a cloud model is created. A noise map with RGB channels separated can also be generated based on the cloud model. The R channel renders large cloud clusters, the G channel renders medium-detail textures, and the B channel renders filamentary cloud textures, specifically as follows... Figure 3 As shown on the left.

[0037] Figure 3 The results of visibility and light source identification are shown. The left image is the cloud texture after removing non-visible areas, and the right image is the cloud masking texture. The sun is located in the upper right blue area. (The image shows the cloud texture.)

[0038] Figure 4 This is a cloud model viewed from below, showing that the overall shape of the clouds is determined by the shape in the right image.

[0039] Figure 5 The image shows the vertex structure of the cloud model. The four vertices of the cloud model are circled in red. Compared to the pixels inside the clouds, the number of vertices is very small, so the GPU resources used in the vertex stage are very small.

[0040] Figure 6 This is a rendering of a dome geometric model covering a 3D virtual scene, in which the user / camera is located in the center.

[0041] Step S2: Set the state parameters for several layers of clouds and fog in the cloud model to obtain the control variables for each layer of clouds and fog.

[0042] In the rendering program, state parameters are set for several layers of clouds and fog in the cloud model to adjust the dynamics of the clouds and fog.

[0043] The parameters set include a time variable and a cloud / fog transformation vector. The system runtime is obtained and set as the time variable for each cloud / fog layer. The cloud / fog transformation vector consists of three vectors corresponding to the three cloud / fog layers, defined as three four-dimensional vectors (x, y, z, w) to store the size scaling factor and movement speed of the three cloud / fog layers.

[0044] The x and y components are scaling factors used to set the scaling degree of each layer of clouds. If the scaling factor is 3, it means that the texture is tiled 3 times on the model, and the clouds look denser; if the value is 0.5, the clouds look larger; if the value is 1, the clouds are not scaled.

[0045] The z and w components are velocity factors used to set the distance per second that each layer of cloud or fog moves in the horizontal and vertical directions. For example, (0.1, 0) indicates that the cloud or fog only drifts slowly to the right.

[0046] Figure 7The image shows a comparison between images with and without a scaling factor. The z and w components on the left side are 1, while those on the right side are 3, meaning the cloud is scaled by a factor of 3, resulting in a more compact display.

[0047] Step S3: Based on the control variables, calculate the dynamic coordinates of the vertices of each cloud layer in the three color channels, fill each cloud layer with color, and obtain the texture features of each cloud layer.

[0048] This step is the vertex stage, where the vertices of each layer of clouds are located and the dynamic offset of the clouds is calculated to obtain the texture features of each layer of clouds.

[0049] First, the original texture coordinates of the vertices of each cloud layer are read and denoted as UV_origin. Based on the preset RGB channels, each cloud layer is divided into R-channel cloud layers, G-channel cloud layers, and B-channel cloud layers, and the dynamic coordinates of each channel cloud layer are calculated.

[0050] The dynamic coordinates UV_R of the cloud layer in the R channel are calculated using a preset formula. The specific calculation formula is as follows: UV_R = UV_origin * CloudRUV.xy + Time * CloudRUV.zw; In the formula, CloudRUV.xy is the scaling factor of the cloud layer in the R channel, CloudRUV.zw is the velocity factor of the cloud layer in the R channel, and Time is the time variable.

[0051] Unlike existing technologies, in order to reduce register usage, the dynamic coordinates of the G-channel cloud layer and the B-channel cloud layer are packaged into a four-dimensional variable for transmission, enabling the transmission of motion data of the two cloud layers using only one interpolation register, thus reducing hardware overhead.

[0052] The formulas for calculating the dynamic coordinates of cloud layers in channels G and B are the same as those for cloud layers in channel R, and the packaging formula is as follows: o.uv_CloudGB.xy = UV_origin * CloudGUV.xy + Time* CloudGUV.zw; o.uv_CloudGB.zw = UV_origin * CloudBUV.xy + Time* CloudBUV.zw; In the formula, CloudGUV.xy and CloudBUV.xy are the scaling factors for the G-channel cloud layer and the B-channel cloud layer, respectively; CloudGUV.zw and CloudBUV.zw are the speed factors for the G-channel cloud layer and the B-channel cloud layer, respectively; and o.uv_CloudGB is the output variable after packaging.

[0053] The packaged output variables and the dynamic coordinates of the cloud layers in the R channel are transmitted to the GPU. Based on the vertex positions of the clouds, linear interpolation is used to interpolate the pixels within each cloud layer to obtain the color-filled pixels. This operation is entirely completed by the hardware fixed pipeline and does not consume the rendering program's computing power, thus avoiding significant GPU usage.

[0054] Based on the pixels after color filling, the texture features of each layer of clouds and fog are obtained.

[0055] Step S4: Process the texture features based on the sun's position information to obtain the display color and pixel transparency of each layer of clouds.

[0056] This step is the pixel stage. In the pixel stage, texture sampling is performed to obtain the display color and light source interference calculation is performed to render each layer of clouds and fog.

[0057] From the texture features of each layer of clouds transmitted from the database, the display colors on the three channels are read, including the R channel color, G channel color, and B channel color. Because this step does not require any coordinate calculations such as addition, subtraction, multiplication, or division, the colors can be directly extracted, greatly reducing the GPU load.

[0058] Then, a linear interpolation function is used to multiply and mix the display colors of each channel according to preset weights to obtain the basic cloud density of each layer of fog.

[0059] When a pixel is close to the sun, the cloud density is reduced, causing the pixel's transparency to decrease. Visually, this appears as if thick clouds are "melted through" by the strong light as they approach the sun, becoming transparent, thus simulating a real optical phenomenon. Therefore, to make the rendered scene more realistic, this embodiment also uses light source interference calculations to simulate the sun's projection effect to adjust the basic cloud density, obtaining the most realistic pixel transparency for each layer of clouds.

[0060] Specifically, a cloud model is sampled to obtain the sun's position information. The final pixel transparency is calculated using a formula simulating the sun's projection. The specific formula is as follows: FinalAlpha = Mask.a * (Density_base - Mask.b * LightIntensity); In the formula, FinalAlpha is the final output pixel transparency; Mask.a is the Alpha value previously marked in the Alpha channel, used to control the overall outline and edge fade range of the clouds in the sky; Density_base is the base cloud density; Mask.b is the previously sampled value in the B channel, which is specifically used to mark the grayscale distribution of solar halos or strong light sources; LightIntensity is the solar interference intensity factor, used to control the on / off state or intensity of the "strong light penetration" effect. When this value is 1, it indicates that the solar penetration effect is enabled, and the clouds in the solar region will become transparent.

[0061] Figure 8 The image shows a comparison of rendering with and without light source interference calculation. The left side shows the rendering effect after performing light source interference calculation, while the right side shows the rendering effect without performing light source interference calculation. It can be seen that the left side takes into account that sunlight can penetrate the clouds, so it is more in line with the actual situation.

[0062] Step S5: Render the cloud model using the display color and the pixel transparency.

[0063] The final displayed color and pixel transparency are output to the frame buffer, combined with other objects in the 3D virtual scene for blending, and the cloud model is rendered. Finally, a multi-layered, dynamic cloud and fog effect that interacts with sunlight is presented on the user's screen.

[0064] Implementing the embodiments of this application has the following beneficial effects: This application embodiment constructs a dome-shaped geometric model that covers a 3D virtual scene to simulate the sky and clouds. Parameter constraints are imposed on multiple layers of clouds, setting the scaling size and movement rate of each layer to provide data support for subsequent cloud rendering. Coordinate offset calculations for the clouds are performed at the vertex stage, which yields cloud displacement faster than at the pixel stage, improving rendering efficiency and reducing the GPU resource consumption of subsequent pixel stages. The obtained dynamic coordinates are transmitted via three color channels, and pixel coloring is performed based on the transmission results to obtain the texture features of each cloud layer, accurately describing the color and layering of the clouds. Finally, the influence of the sun's position and intensity on cloud density is considered, adjusting the pixel transparency of clouds at different locations. This transforms the clouds from static textures into dynamic, interactive entities that dynamically interact with scene lighting, simulating realistic optical and physical phenomena and effectively improving rendering quality. Furthermore, this application embodiment is highly adaptable, requiring no AI acceleration chips and easily achieving high-frame-rate cloud effects on traditional devices.

[0065] Second Embodiment Furthermore, in order to implement the dynamic cloud and fog rendering system for mobile GPU load corresponding to the above method embodiments, and to achieve the corresponding functions and technical effects, Figure 9 A structural diagram of a dynamic cloud and fog rendering system for mobile GPU workloads is provided. For ease of explanation, only the parts relevant to this embodiment are shown. The dynamic cloud and fog rendering system for mobile GPU workloads provided in this application embodiment includes: The cloud model construction module 201 is used to construct a dome geometry model on the top of the 3D virtual scene, perform texture mapping and cloud marking on the dome geometry model to obtain the cloud model.

[0066] In this embodiment of the application, since the clouds and fog are located in the sky of the three-dimensional virtual scene, a cloud layer model covering the scene is first constructed to provide a basic environment for cloud and fog calculation.

[0067] First, create a hemispherical or dome-shaped 3D mesh model. Place this model on top of the 3D virtual scene, ensuring the virtual camera is positioned below or inside the geometric center of the hemisphere, resulting in a dome geometry. Then, align the normals of the dome geometry model inwards, ensuring that the line of sight intersects the model's inner surface when looking upwards from the camera's perspective. This "wrapping" spatial structure allows the model to be enveloped, simulating the sky.

[0068] Optionally, to improve the efficiency of subsequent vertex calculations, polygon optimization can be performed on the dome geometry model to control the number of vertices to 257.

[0069] The vertex coordinates of the dome geometry model are mapped to a preset two-dimensional texture coordinate system to obtain the original texture coordinates of each vertex. The two-dimensional texture coordinate system is a 0-to-1 two-dimensional UV coordinate system, where U represents the horizontal axis and V represents the vertical axis. The dome vertices of the dome geometry model correspond to the center of the coordinate system, and the edges correspond to the perimeter. During subsequent rendering, the GPU will accurately project the two-dimensional image pixels onto the three-dimensional curved surface according to this correspondence.

[0070] Then, visibility and light source identification are performed on the dome geometry model to mark key data and obtain cloud texture information. Here, the "marking" is not a physical symbol, but rather data stored using the color channels of the image file.

[0071] In this application, the Alpha channel and B channel are used to mark visible clouds and light sources, respectively.

[0072] The alpha channel performs visibility assessment on the dome geometry model, setting the alpha value of the areas where clouds need to be displayed (usually the zenith, the visible area) to close to 1, and setting the alpha value of the areas that don't need to be displayed (the horizon edge, the invisible area) to close to 0. After reading the alpha values, the rendering program removes the edge clouds, thus visually creating a natural cloud distribution shape.

[0073] B channel: Draw a radially gradient dot at the texture coordinates of the sun as the light source point. When the rendering program reads the highlight value of the B channel, it can recognize "this is the sun" and thus trigger subsequent light source interference calculations.

[0074] Based on the labeled results, and according to the visible area, the sun's position information, and the original texture coordinates, a cloud model is created. A noise map with RGB channels separated can also be generated based on the cloud model. The R channel renders large cloud clusters, the G channel renders medium-detail textures, and the B channel renders filamentary cloud textures, specifically as follows... Figure 3 As shown on the left.

[0075] The control variable setting module 202 is used to set the state parameters of several layers of clouds and fog in the cloud model to obtain the control variables of each layer of clouds and fog; wherein, the control variables include time variables and cloud and fog transformation vectors.

[0076] In this embodiment of the application, in the rendering program, state parameters are set for several layers of clouds and fog in the cloud model to adjust the dynamics of the clouds and fog.

[0077] The parameters set include a time variable and a cloud / fog transformation vector. The system runtime is obtained and set as the time variable for each cloud / fog layer. The cloud / fog transformation vector consists of three vectors corresponding to the three cloud / fog layers, defined as three four-dimensional vectors (x, y, z, w) to store the size scaling factor and movement speed of the three cloud / fog layers.

[0078] The x and y components are scaling factors used to set the scaling degree of each layer of clouds. If the scaling factor is 3, it means that the texture is tiled 3 times on the model, and the clouds look denser; if the value is 0.5, the clouds look larger; if the value is 1, the clouds are not scaled.

[0079] The z and w components are velocity factors used to set the distance per second that each layer of cloud or fog moves in the horizontal and vertical directions. For example, (0.1, 0) indicates that the cloud or fog only drifts slowly to the right.

[0080] The cloud and fog feature extraction module 203 is used to fill each layer of cloud and fog with color according to the control variables by calculating the dynamic coordinates of the vertices of each layer of cloud and fog in the three color channels, so as to obtain the texture features of each layer of cloud and fog.

[0081] In this embodiment of the application, this step is the vertex stage, in which the vertices of each layer of clouds are located and the dynamic offset of the clouds is calculated to obtain the texture features of each layer of clouds.

[0082] First, the original texture coordinates of the vertices of each cloud layer are read and denoted as UV_origin. Based on the preset RGB channels, each cloud layer is divided into R-channel cloud layers, G-channel cloud layers, and B-channel cloud layers, and the dynamic coordinates of each channel cloud layer are calculated.

[0083] The dynamic coordinates UV_R of the cloud layer in the R channel are calculated using a preset formula. The specific calculation formula is as follows: UV_R = UV_origin * CloudRUV.xy + Time * CloudRUV.zw; In the formula, CloudRUV.xy is the scaling factor of the cloud layer in the R channel, CloudRUV.zw is the velocity factor of the cloud layer in the R channel, and Time is the time variable.

[0084] Unlike existing technologies, in order to reduce register usage, the dynamic coordinates of the G-channel cloud layer and the B-channel cloud layer are packaged into a four-dimensional variable for transmission, enabling the transmission of motion data of the two cloud layers using only one interpolation register, thus reducing hardware overhead.

[0085] The formulas for calculating the dynamic coordinates of cloud layers in channels G and B are the same as those for cloud layers in channel R, and the packaging formula is as follows: o.uv_CloudGB.xy = UV_origin * CloudGUV.xy + Time* CloudGUV.zw; o.uv_CloudGB.zw = UV_origin * CloudBUV.xy + Time* CloudBUV.zw; In the formula, CloudGUV.xy and CloudBUV.xy are the scaling factors for the G-channel cloud layer and the B-channel cloud layer, respectively; CloudGUV.zw and CloudBUV.zw are the speed factors for the G-channel cloud layer and the B-channel cloud layer, respectively; and o.uv_CloudGB is the output variable after packaging.

[0086] The packaged output variables and the dynamic coordinates of the cloud layers in the R channel are transmitted to the GPU. Based on the vertex positions of the clouds, linear interpolation is used to interpolate the pixels within each cloud layer to obtain the color-filled pixels. This operation is entirely completed by the hardware fixed pipeline and does not consume the rendering program's computing power, thus avoiding significant GPU usage.

[0087] Based on the pixels after color filling, the texture features of each layer of clouds and fog are obtained.

[0088] The rendering parameter extraction module 204 is used to process the texture features based on the sun's position information to obtain the display color and pixel transparency of each layer of clouds.

[0089] In this embodiment of the application, this step is the pixel stage. At the pixel stage, texture sampling is performed to obtain the display color and light source interference calculation is performed to realize the rendering of each layer of clouds and fog.

[0090] From the texture features of each layer of clouds transmitted from the database, the display colors on the three channels are read, including the R channel color, G channel color, and B channel color. Because this step does not require any coordinate calculations such as addition, subtraction, multiplication, or division, the colors can be directly extracted, greatly reducing the GPU load.

[0091] Then, a linear interpolation function is used to multiply and mix the display colors of each channel according to preset weights to obtain the basic cloud density of each layer of fog.

[0092] When a pixel is close to the sun, the cloud density is reduced, causing the pixel's transparency to decrease. Visually, this appears as if thick clouds are "melted through" by the strong light as they approach the sun, becoming transparent, thus simulating a real optical phenomenon. Therefore, to make the rendered scene more realistic, this embodiment also uses light source interference calculations to simulate the sun's projection effect to adjust the basic cloud density, obtaining the most realistic pixel transparency for each layer of clouds.

[0093] Specifically, a cloud model is sampled to obtain the sun's position information. The final pixel transparency is calculated using a formula simulating the sun's projection. The specific formula is as follows: FinalAlpha = Mask.a * (Density_base - Mask.b * LightIntensity); In the formula, FinalAlpha is the final output pixel transparency; Mask.a is the Alpha value previously marked in the Alpha channel, used to control the overall outline and edge fade range of the clouds in the sky; Density_base is the base cloud density; Mask.b is the previously sampled value in the B channel, which is specifically used to mark the grayscale distribution of solar halos or strong light sources; LightIntensity is the solar interference intensity factor, used to control the on / off state or intensity of the "strong light penetration" effect. When this value is 1, it indicates that the solar penetration effect is enabled, and the clouds in the solar region will become transparent.

[0094] The cloud rendering module 205 is used to render the cloud model using the display color and the pixel transparency.

[0095] The final displayed color and pixel transparency are output to the frame buffer, combined with other objects in the 3D virtual scene for blending, and the cloud model is rendered. Finally, a multi-layered, dynamic cloud and fog effect that interacts with sunlight is presented on the user's screen.

[0096] Implementing the embodiments of this application has the following beneficial effects: This application embodiment constructs a dome-shaped geometric model that covers a 3D virtual scene to simulate the sky and clouds. Parameter constraints are imposed on multiple layers of clouds, setting the scaling size and movement rate of each layer to provide data support for subsequent cloud rendering. Coordinate offset calculations for the clouds are performed at the vertex stage, which yields cloud displacement faster than at the pixel stage, improving rendering efficiency and reducing the GPU resource consumption of subsequent pixel stages. The obtained dynamic coordinates are transmitted via three color channels, and pixel coloring is performed based on the transmission results to obtain the texture features of each cloud layer, accurately describing the color and layering of the clouds. Finally, the influence of the sun's position and intensity on cloud density is considered, adjusting the pixel transparency of clouds at different locations. This transforms the clouds from static textures into dynamic, interactive entities that dynamically interact with scene lighting, simulating realistic optical and physical phenomena and effectively improving rendering quality. Furthermore, this application embodiment is highly adaptable, requiring no AI acceleration chips and easily achieving high-frame-rate cloud effects on traditional devices.

[0097] Furthermore, Figure 10 This is a structural diagram of a terminal device provided in one embodiment of this application. Figure 10 As shown, the terminal device 3 of this embodiment includes: at least one processor 30 (in... Figure 10 (Only one is shown in the image) and a memory 31 and a computer program 32 stored in the memory 31 and executable on the at least one processor, wherein when the processor 30 executes the computer program 32, it can implement the steps of a dynamic cloud and fog rendering method for mobile GPU load as described in any one of the embodiments of this application.

[0098] The terminal device 3 may be a computing device such as a desktop computer, a cloud server, or a laptop computer, and the computing device may include, but is not limited to, a processor 30 and a memory 31. Figure 10 This is merely an example of terminal device 3 and does not constitute a limitation on terminal device 3. It may include more or fewer components than those shown in the figure.

[0099] This application provides a storage medium that stores computer-readable program code. When the computer-readable program code is executed, it implements the steps of the above-described dynamic cloud and fog rendering method for mobile GPU load.

[0100] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the scope of protection of this application. In particular, it should be noted that any modifications, equivalent substitutions, or improvements made by those skilled in the art within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A dynamic cloud and fog rendering method for mobile GPU load, characterized in that, include: A dome geometry model is constructed at the top of the 3D virtual scene. Texture mapping and cloud marking are performed on the dome geometry model to obtain the cloud model. State parameters are set for several layers of clouds and fog in the cloud model to obtain control variables for each layer of clouds and fog; wherein, the control variables include time variables and cloud and fog transformation vectors; Based on the control variables, the dynamic coordinates of the vertices of each cloud layer in the three color channels are calculated, and the colors of each cloud layer are filled to obtain the texture features of each cloud layer. The texture features are processed based on the sun's position information to obtain the display color and pixel transparency of each layer of clouds and fog. The cloud model is rendered using the display color and the pixel transparency.

2. The dynamic cloud and fog rendering method for mobile GPU load according to claim 1, characterized in that, The process of performing texture mapping and cloud marking on the dome geometry model to obtain the cloud model is as follows: Make the normal of the dome geometry model face the inner surface so that the dome geometry model covers the 3D virtual scene; The vertex coordinates of the dome geometry model are mapped to a preset two-dimensional texture coordinate system to obtain the original texture coordinates of each vertex. Visibility and light source identification were performed on the dome geometry model to obtain cloud texture information; A cloud model is constructed based on the cloud texture information, the sun position information, and the original texture coordinates.

3. The dynamic cloud and fog rendering method for mobile GPU load according to claim 2, characterized in that, The process of performing visibility and light source identification on the dome geometry model to obtain cloud texture information specifically involves: The visibility of the dome geometry model is identified using a preset first graphics channel, and the visible and non-visible areas of the dome geometry model are marked. The shape of the cloud distribution is obtained by removing the invisible areas from the dome geometry model; Based on the texture coordinates of the sun, the light source point is marked in the dome geometry model to obtain the sun's position information.

4. The dynamic cloud and fog rendering method for mobile GPU load according to claim 1, characterized in that, The process of setting state parameters for several layers of cloud fog in the cloud model to obtain the control variables for each layer of cloud fog is as follows: Obtain the system runtime and set it as the time variable for each layer of clouds and fog; Set the corresponding scaling degree for each layer of cloud and fog to obtain the scaling factor for each layer of cloud and fog; By setting the horizontal and vertical movement distances per second for each layer of clouds, the velocity factors of each layer of clouds are obtained; The cloud and fog transformation vector is obtained based on the scaling factor and the velocity factor.

5. The dynamic cloud and fog rendering method for mobile GPU load according to claim 1, characterized in that, The process involves calculating the dynamic coordinates of the vertices of each cloud layer in the three color channels based on the control variables, and then color-filling each cloud layer to obtain its texture features. Specifically: Obtain the original texture coordinates of the vertex, and divide each layer of cloud into R-channel cloud layer, G-channel cloud layer and B-channel cloud layer according to the three color channels; wherein, the three color channels are RGB channels; Based on the original texture coordinates, the dynamic offset of the R-channel cloud layer is calculated using the control variables to obtain the first dynamic coordinates of the R-channel cloud layer. Calculate the second dynamic coordinates of the cloud layer in channel G and channel B based on the control variables; The first dynamic coordinates and the second dynamic coordinates are transmitted to the GPU for color filling to obtain the texture features.

6. The dynamic cloud and fog rendering method for mobile GPU load according to claim 5, characterized in that, The step of transmitting the first dynamic coordinates and the second dynamic coordinates to the GPU for color filling to obtain the texture features is specifically as follows: The second dynamic coordinates of the cloud layer in the G channel are used as the first two digits of the output variable, and the second dynamic coordinates of the cloud layer in the B channel are used as the last two digits of the output variable to complete the packaging of the second dynamic coordinates. The packaged second dynamic coordinates and the first dynamic coordinates are transmitted to the GPU. Based on the transmitted content, the pixels in each layer of clouds are linearly interpolated using the linear interpolation method to obtain the pixels after color filling. The texture feature is obtained based on the pixels after color filling.

7. The dynamic cloud and fog rendering method for mobile GPU load according to claim 1, characterized in that, The process of processing the texture features based on the sun's position information to obtain the display color and pixel transparency of each layer of clouds and fog is as follows: The display colors of the pixels of each layer of clouds and fog in the three color channels are read from the texture features; wherein, the display colors include the R channel color, G channel color and B channel color; The displayed colors are weighted and fused to obtain the basic cloud density of each layer of clouds and fog; Based on the solar position information provided by the cloud model, the influence of solar projection on cloud density is simulated based on the basic cloud density to obtain the pixel transparency of each layer of clouds.

8. A dynamic cloud and fog rendering system for mobile GPU load, characterized in that, include: Cloud model construction module, control variable setting module, cloud and fog feature extraction module, rendering parameter extraction module, and cloud and fog rendering module; Among them, the cloud model construction module is used to build a dome geometry model on the top of the 3D virtual scene, perform texture mapping and cloud marking on the dome geometry model to obtain the cloud model; The control variable setting module is used to set the state parameters of several layers of clouds and fog in the cloud model to obtain the control variables of each layer of clouds and fog; wherein, the control variables include time variables and cloud and fog transformation vectors; The cloud and fog feature extraction module is used to fill each layer of cloud and fog with color based on the control variables by calculating the dynamic coordinates of the vertices of each layer of cloud and fog in the three color channels, thereby obtaining the texture features of each layer of cloud and fog. The rendering parameter extraction module is used to process the texture features based on the sun's position information to obtain the display color and pixel transparency of each layer of clouds and fog. The cloud rendering module is used to render the cloud model using the display color and the pixel transparency.

9. A terminal device, characterized in that, It includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the steps of the dynamic cloud and fog rendering method for mobile GPU load as described in any one of claims 1 to 7.

10. A storage medium, characterized in that, The storage medium stores computer-readable program code, which, when executed, implements the steps of a dynamic cloud and fog rendering method for mobile GPU load as described in any one of claims 1 to 7.