Cloud layer rendering method and electronic equipment

Through the combination of pyramid structure and noise graph, dynamically adjusting the light step size and pixel value processing, the problem of high consumption of cloud rendering computing resources in the prior art is solved, and realistic cloud image and dynamic effects are achieved.

CN120411331AActive Publication Date: 2025-08-01HONOR DEVICE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411628956.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-08-01
Estimated Expiration
2044-11-13

AI Technical Summary

Technical Problem

The prior art consumes a lot of computing resources when rendering cloud images, and the generated cloud dynamics are not realistic enough, especially the cloud thickness, shape and light and shadow changes are not realistic enough.

Method used

The cloud noise map with a pyramid structure is used to dynamically adjust the light step size, and combine Perlin and Worley noise maps to generate continuous and three-dimensional cloud images. By adjusting the light step size and pixel value processing, the computing resource consumption is reduced and the image authenticity is improved.

Benefits of technology

Generating realistic cloud images reduces the consumption of computing resources by the rendering process, while improving the authenticity and fidelity of cloud dynamics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120411331A_ABST
    Figure CN120411331A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a cloud layer rendering method and electronic equipment, and relates to the technical field of image processing. The method comprises the following steps: receiving and responding to a rendering operation, and obtaining a first cloud layer noise map; a first pyramid structure is established, the first pyramid structure comprises a plurality of second cloud layer noise maps, and the pixel point sizes of the plurality of second cloud layer noise maps are different; controlling the stepping of the first light, adjusting the step length of the first light based on the first pyramid structure in the stepping process of the first light, and processing an initial pixel value of a first pixel point in the first cloud noise map to obtain a target pixel value of the first pixel point; and generating a first cloud layer image based on the target pixel values of the plurality of first pixel points. By adopting the scheme, the step length of the first light can be dynamically reduced or amplified based on a plurality of different pixel point sizes included in the first pyramid structure, so that a vivid cloud layer image can be generated, and the consumption of computing resources in the rendering process of the cloud layer image can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technologies, and in particular, to a cloud rendering method and an electronic device. Background Art

[0002] Currently, there are some scenarios in weather applications (APPs) and game APPs provided by electronic devices that display cloud images, or scenarios that display cloud dynamic effects using cloud images. Cloud dynamic effects refer to the dynamic change process of clouds. The prior art proposes to use the Raymarch algorithm to render and generate a cloud image.

[0003] However, although the prior art can render a relatively realistic cloud image using the Raymarch algorithm, the rendering process requires a large amount of real-time calculation, resulting in a large consumption of computing resources in the electronic device. Summary of the Invention

[0004] Embodiments of this application provide a cloud rendering method and an electronic device, which can not only generate a relatively realistic cloud image, but also reduce the consumption of computing resources in the cloud image rendering process.

[0005] To achieve the above object, the embodiments of this application adopt the following technical solutions:

[0006] In a first aspect, a cloud rendering method is provided. The method includes: first, receiving and responding to a rendering operation to obtain a first cloud noise map; then, establishing a first pyramid structure corresponding to the first cloud noise map, where the first pyramid structure includes a plurality of second cloud noise maps with different pixel point sizes; then, controlling a first ray march, and during the first ray march, adjusting the step length of the first ray based on the first pyramid structure, and processing the initial pixel value of a first pixel point in the first cloud noise map to obtain the target pixel value of the first pixel point; finally, generating a first cloud image based on the target pixel values of a plurality of first pixel points in the first cloud noise map.

[0007] Wherein, the first ray points from the first pixel point to a first preset light source position.

[0008] It can be understood that if the pixel sizes of the multiple second cloud noise maps included in the first pyramid structure are different, the electronic device can dynamically adjust the step size of the first light ray based on the multiple different pixel sizes included in the first pyramid structure. For example, when the first light ray steps in the relatively thick cloud simulated by the first cloud noise map, the electronic device can reduce the step size, and when the first light ray steps in the relatively sparse cloud simulated by the first cloud noise map, the electronic device can increase the step size. When the electronic device controls the first light ray to step according to the reduced step size, it can more comprehensively consider the influence of the cloud passed by the preset light source during the process of irradiating the first pixel on the light and shadow on the first pixel. Thus, the target pixel value of the first pixel can be obtained more accurately, and the more accurate target pixel value of the first pixel can represent the more real light and shadow on the first pixel. The target pixel values of multiple more accurate first pixels can more accurately simulate the light and shadow changes of clouds with different thicknesses. Therefore, the cloud image obtained by using the target pixel values of multiple more accurate first pixels is also more real.

[0009] Secondly, when the electronic device controls the first light ray to step according to the increased step size, it can increase the stepping speed of the first light ray, thereby reducing the calculation amount during the stepping process of the first light ray and reducing the consumption of computing resources in the rendering process of the cloud image. In summary, it can be seen that by adopting this solution, it is possible to generate a relatively realistic cloud image and reduce the consumption of computing resources in the rendering process of the cloud image.

[0010] Combined with the first aspect, in a possible implementation manner, the above-mentioned controlling the first light ray to step, and during the stepping process of the first light ray, adjusting the step size of the first light ray based on the first pyramid structure, and processing the initial pixel value of the first pixel in the first cloud noise map to obtain the target pixel value of the first pixel includes: determining the initial step size corresponding to the first light ray based on the first pyramid structure; determining that the first light ray steps to the first stepping point according to the initial step size; adjusting the initial step size based on the first pyramid structure and the first stepping point to obtain the adjusted step size, and updating the initial pixel value of the first pixel to obtain the updated pixel value; determining that the first light ray steps to the second stepping point according to the adjusted step size, and continuing to adjust the adjusted step size and update the updated pixel value; until the stepping of the first light ray ends, determining that the target pixel value of the first pixel is the updated pixel value.

[0011] This embodiment describes an implementation manner of the electronic device adjusting the step size and updating the pixel value during the stepping process of the first light ray.

[0012] In combination with the first aspect, in another possible implementation, based on the first pyramid structure and the first stepping point, the initial step size is adjusted to obtain an adjusted step size, and the initial pixel value of the first pixel point is updated to obtain an updated pixel value, including: when the first light is blocked at the first stepping point, the initial step size is reduced based on the first pyramid structure to obtain an adjusted step size, and the initial pixel value of the first pixel point is attenuated to obtain an updated pixel value; when the first light is not blocked at the first stepping point, the initial step size is enlarged based on the first pyramid structure to obtain an adjusted step size, and the updated pixel value is determined to be the initial pixel value of the first pixel point.

[0013] It can be understood that when the electronic device blocks the first light at the first stepping point, it means that the cloud layer at the first stepping point in the first cloud noise map is thicker, so the electronic device can reduce the initial step size. The electronic device then controls the first light to step according to the reduced step size, so as to further determine whether there is still a thick cloud layer blocking the first light near the first stepping point. This can more comprehensively consider the influence of the cloud layer passed by the preset light source when irradiating the first pixel point on the light and shadow on the first pixel point. And when the cloud layer at each stepping point (for example, the first stepping point) of the electronic device blocks the first light, the pixel value (for example, the initial pixel value of the first pixel point) is attenuated, so that the target pixel value of the first pixel point can be obtained more accurately. The more accurate target pixel value of the first pixel point can represent the more real light and shadow on the first pixel point. Multiple more accurate target pixel values of the first pixel point can more accurately simulate the light and shadow changes of cloud layers with different thicknesses. Therefore, the cloud image obtained by using multiple more accurate target pixel values of the first pixel point is also more real.

[0014] Secondly, when the electronic device does not block the first light at the first stepping point, it means that the cloud layer at the first stepping point in the first cloud noise map is thinner, so the electronic device can enlarge the initial step size. Stepping according to the enlarged step size can increase the stepping speed of the first light. Thus, the calculation amount in the stepping process of the first light can be reduced, and the consumption of computing resources in the rendering process of the cloud image can be reduced.

[0015] In combination with the first aspect, in another possible implementation, the multiple second cloud noise maps in the first pyramid structure are located at different levels, and the resolution of the second cloud noise map with a higher level in the multiple second cloud noise maps is smaller or larger; the initial step size is equal to the size of a pixel point in the second cloud noise map at the initial level, and the second cloud noise map at the initial level is the one with the largest resolution among the multiple second cloud noise maps.

[0016] Among them, reducing the initial step size based on the first pyramid structure to obtain an adjusted step size includes: determining an updated level based on the initial level, where the updated level is adjacent to the initial level, and the resolution of the second cloud noise map at the updated level is greater than the resolution of the second cloud noise map at the initial level; determining that the adjusted step size is equal to the size of a pixel in the second cloud noise map at the updated level.

[0017] It can be understood that when the resolution of the second cloud noise map at the updated level becomes larger, the size of a pixel in the second cloud noise map at the updated level becomes smaller. The electronic device determines that the adjusted step size is equal to the size of a pixel in the second cloud noise map at the updated level. Therefore, the adjusted step size also becomes smaller. Further, the electronic device controls the first light to step according to the adjusted step size, which is to reduce the step size of the first light. Reducing the step size of the first light can more comprehensively consider the influence of the cloud layer passed by the preset light source when irradiating the first pixel on the light and shadow on the first pixel. Thus, a more accurate target pixel value of the first pixel can be obtained.

[0018] It should be noted that if the electronic device determines that there is no other second cloud noise map in the first pyramid structure with a resolution greater than the resolution of the second cloud noise map at the initial level, it can be determined that the updated level is still the initial level.

[0019] In combination with the first aspect, in another possible implementation, enlarging the initial step size based on the first pyramid structure to obtain an adjusted step size includes: determining an updated level based on the initial level, where the updated level is adjacent to the initial level, and the resolution of the second cloud noise map at the updated level is less than the resolution of the second cloud noise map at the initial level; determining that the adjusted step size is equal to the size of a pixel in the second cloud noise map at the updated level.

[0020] It can be understood that when the resolution of the second cloud noise map at the updated level becomes smaller, the size of a pixel in the second cloud noise map at the updated level becomes larger. The electronic device determines that the adjusted step size is equal to the size of a pixel in the second cloud noise map at the updated level. Therefore, the adjusted step size also becomes larger. Further, the electronic device controls the first light to step according to the adjusted step size, which is to enlarge the step size of the first light. Enlarging the step size of the first light can increase the stepping speed of the first light, thereby reducing the computational amount in the stepping process of the first light and reducing the consumption of computing resources in the rendering process of the cloud image.

[0021] In another possible implementation manner in combination with the first aspect, the above method further includes: determining whether the pixel value of the first stepping point is greater than the initial pixel value of the first pixel point, where the fact that the pixel value of the first stepping point is greater than the initial pixel value of the first pixel point indicates that the first stepping point blocks the first light ray, and the fact that the pixel value of the first stepping point is less than or equal to the initial pixel value of the first pixel point indicates that the first stepping point does not block the first light ray.

[0022] This embodiment describes an implementation manner of how an electronic device determines whether the first stepping point blocks the first light ray.

[0023] In another possible implementation manner in combination with the first aspect, in the above method of controlling the first light ray to step based on the first pyramid structure and processing the initial pixel value of the first pixel point in the first cloud noise map during the stepping of the first light ray to obtain the target pixel value of the first pixel point, it includes: when the first pixel point meets the preset sampling condition, controlling the first light ray to step based on the first pyramid structure and processing the initial pixel value of the first pixel point during the stepping of the first light ray to obtain the target pixel value of the first pixel point; where the preset sampling condition includes: the initial pixel value of the first pixel point exceeds the preset numerical range, and the preset numerical range includes the pixel value corresponding to black.

[0024] It can be understood that when the initial pixel value of the first pixel point exceeds the pixel value corresponding to black, it indicates that the first pixel point is a pixel point in the cloud simulated by the first cloud noise map. Therefore, the electronic device can consider the influence of the cloud passed by the preset light source during the process of irradiating the first pixel point on the light and shadow on the first pixel point, and process the initial pixel value of the first pixel point to obtain a more accurate target pixel value of the first pixel point, and the more accurate target pixel value of the first pixel point can represent the more real light and shadow on the first pixel point.

[0025] In another possible implementation manner in combination with the first aspect, the above method further includes: when the first light ray steps to the i-th stepping point and the pixel value of the i-th stepping point is within the preset numerical range, determining that the stepping of the first light ray ends, where the fact that the pixel value of the i-th stepping point is within the preset numerical range indicates that the first light ray penetrates the cloud, the preset numerical range includes the pixel value corresponding to black, and i is a positive integer greater than 1.

[0026] This embodiment describes an implementation manner of how an electronic device determines the end of the stepping of the first light ray.

[0027] In another possible implementation manner in combination with the first aspect, the above obtaining the first cloud noise map includes: seamlessly splicing a plurality of first noise maps to obtain the first cloud noise map, where the plurality of first noise maps include Perlin noise maps and Worley noise maps.

[0028] It can be understood that the Perlin noise map has continuity, so the electronic device can use the Perlin noise map to simulate the continuity of clouds. The Worley noise map has lattice characteristics, so the electronic device can use the Worley noise map to simulate the three-dimensional sense of clouds. In summary, the first cloud noise map generated by the electronic device using the Perlin noise map and the Worley noise map can simulate continuous and three-dimensional clouds, that is to say, the first cloud noise map can simulate clouds with a strong sense of reality.

[0029] Combined with the first aspect, in another possible implementation manner, the above method further includes: offsetting a plurality of first noise maps in the first cloud noise map to obtain a third cloud noise map; establishing a second pyramid structure corresponding to the third cloud noise map; controlling a second ray march based on the second pyramid structure, and during the second ray march, processing an initial pixel value of a second pixel point in the third cloud noise map to obtain a target pixel value of the second pixel point, where the second ray points from the second pixel point to a second preset light source position; generating a second cloud image based on the target pixel values of a plurality of second pixel points in the third cloud noise map; and sequentially displaying the first cloud image and the second cloud image.

[0030] It can be understood that since there are no gaps between the plurality of first noise maps in the first cloud noise map, the edges of the clouds simulated by the third cloud noise map obtained by the electronic device offsetting the plurality of first noise maps are smooth and gentle. Furthermore, there is no problem of edge disconnection in the clouds in the second cloud image generated using the third cloud noise map, which conforms to the shape of real clouds. Secondly, the electronic device offsets the plurality of first noise maps in the first cloud noise map to obtain the third cloud noise map, which reduces the workload of generating a new cloud noise map compared to splicing a plurality of new noise maps to obtain a new cloud noise map.

[0031] Secondly, both the first preset light source position and the second preset light source position can be set according to the possible positions of the preset light source, and the first preset light source position adopted by the first cloud noise map can be different from the second preset light source position adopted by the third cloud noise map. In this way, the plurality of cloud images (including the first cloud image and the second cloud image) obtained by the electronic device rendering clouds for a plurality of different cloud noise maps (including the first cloud noise map and the third cloud noise map) can represent the light and shadow changes of the clouds at different positions of the preset light source, and playing the plurality of cloud images can reflect the dynamic change process of real clouds (i.e., cloud animation).

[0032] In a possible implementation manner in combination with the first aspect, the above method further includes: obtaining a mask image, where the mask image includes a pattern of a preset shape. Among them, obtaining the first cloud noise map includes: obtaining the first cloud noise map based on the preset shape, where the first cloud noise map is used to simulate clouds of the preset shape, and the first cloud image includes clouds of the preset shape.

[0033] It can be understood that the electronic device can also obtain a mask image including a pattern of a preset shape, and then obtain a first cloud noise map for simulating clouds of the preset shape based on the preset shape. Furthermore, the cloud image obtained by using the first cloud noise map can include clouds of the preset shape.

[0034] In a second aspect, an electronic device is provided, and the electronic device includes: a processor, a memory, and a communication interface. The memory and the communication interface are coupled to the processor, and the memory is used to store computer program code, and the computer program code includes computer instructions. Among them, when the processor executes the computer instructions, the electronic device is caused to execute the method described in any one of the first aspects above.

[0035] In a third aspect, a computer-readable storage medium is provided, and computer instructions are stored in the computer-readable storage medium. When the computer instructions run on the electronic device, the electronic device is caused to execute the method described in any one of the first aspects above.

[0036] In a fourth aspect, a computer program product including computer instructions is provided. When the computer instructions run on the electronic device, the electronic device is caused to execute the method described in any one of the first aspects above.

[0037] In a fifth aspect, a device (for example, the device can be a chip system) is provided, and the device includes a processor for supporting the electronic device to implement the cloud rendering method described in the first aspect above. In a possible design, the device further includes a memory for storing necessary program instructions and data of the electronic device. When the device is a chip system, it can be composed of chips or can include chips and other discrete devices.

[0038] Among them, for the technical effects brought by any one of the design manners in the second aspect to the fifth aspect, reference can be made to the technical effects brought by different design manners in the first aspect, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 Figures (a) to (b) in [figure number] are schematic diagrams showing a cloud animation using a captured cloud image provided by the prior art;

[0040] Figure 2 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;

[0041] Figure 3 Schematic diagram of the system architecture of an electronic device provided by an embodiment of the present application;

[0042] Figure 4 Flow schematic of a cloud rendering method provided by an embodiment of the present application Figure 1 ;

[0043] Figure 5 The (a) to (b) in [figure number] are schematic diagrams of the interface for displaying the cloud dynamic effect of an electronic device provided by an embodiment of the present application;

[0044] Figure 6 The (a) to (d) in [figure number] are schematic diagrams of a Perlin noise map provided by an embodiment of the present application;

[0045] Figure 7 The (a) to (d) in [figure number] are schematic diagrams of a Worley noise map provided by an embodiment of the present application;

[0046] Figure 8 The (a) in [figure number] is a schematic diagram of a first cloud noise map provided by an embodiment of the present application;

[0047] Figure 8 The (b) in [figure number] is a schematic diagram of a first pyramid structure corresponding to the first cloud noise map provided by an embodiment of the present application;

[0048] Figure 9 Grid schematic of multiple second cloud noise maps provided by an embodiment of the present application;

[0049] Figure 10 The (a) in [figure number] is a schematic diagram of the step-by-step process of a first light ray provided by an embodiment of the present application;

[0050] Figure 10 The (b) in [figure number] is a schematic diagram of the change in cloud thickness provided by an embodiment of the present application;

[0051] Figure 11 The (a) to (c) in [figure number] are schematic diagrams of multiple cloud images provided by an embodiment of the present application;

[0052] Figure 12 Schematic diagram of the possible positions of the sun provided by an embodiment of the present application;

[0053] Figure 13 Flow schematic of a cloud rendering method provided by an embodiment of the present application Figure 2 ;

[0054] Figure 14 The (a) to (c) in [figure number] are schematic diagrams of rendering clouds of a preset shape provided by an embodiment of the present application;

[0055] Figure 15 Flow schematic of a cloud rendering method provided by an embodiment of the present application Figure 3 ;

[0056] Figure 16 Structural schematic diagram of a chip system provided by an embodiment of the present application. Detailed implementation manners

[0057] Next, the technical solutions in the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0058] The terms "first" and "second" are only used for descriptive purposes, and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present application, unless otherwise stated, the meaning of "a plurality" is two or more.

[0059] Currently, the prior art proposes that an electronic device can use the Raymarch algorithm to render and generate multiple different cloud images. The process of an electronic device using the Raymarch algorithm to render and generate a cloud image may include: emitting a ray from a camera to each pixel on the screen, gradually stepping along the ray direction at a certain step size, and calculating the density of the cloud; at each step point, accumulating transparency and color, calculating the absorption and scattering effects when the ray travels inside the cloud, and simulating the attenuation when the ray passes through the cloud; when exiting the cloud or reaching the maximum number of steps, terminate the stepping, and mix the cloud color with the background color to obtain the final pixel color; generating a cloud image using the pixel colors of multiple pixels. Further, the electronic device plays multiple cloud images to achieve the display of cloud animation effects.

[0060] Among them, in the prior art, the electronic device can adopt a fixed step size or dynamically determine the step size according to the Signed Distance Fields (SDFs). If the fixed step size is set too large, the number of attenuation times when the light passes through the cloud layer will be reduced, and the resulting final pixel color will be inaccurate. If the fixed step size is set too small, there will be a problem that the stepping speed is too slow. Furthermore, if the light may not have passed through the cloud layer when the maximum number of steps is reached and the stepping stops, the resulting final pixel color will be inaccurate; or, if the stepping stops when the light passes through the cloud layer, the number of steps in the entire stepping process is too large, resulting in a large amount of computation. In summary, in the prior art, when the electronic device adopts a fixed step size, there are problems that the resulting final pixel color is inaccurate or the amount of computation is too large. The inaccurate resulting final pixel color further causes the cloud layer light and shadow in the cloud layer image containing multiple pixel colors to be unrealistic, so the cloud layer image is also unrealistic. The cloud layer animation shown by multiple unrealistic cloud layer images is also unrealistic.

[0061] Secondly, although the electronic device in the prior art can solve the problem of inaccurate resulting final pixel color by dynamically determining the step size according to the SDFs, however, the process of dynamically determining the step size according to the SDFs is complex and there is a problem of large computation. This leads to a large consumption of computing resources.

[0062] In addition, the prior art also proposes that the electronic device uses the captured cloud layer image to display the cloud layer animation. However, in the cloud layer animation displayed by using the captured cloud layer image, the cloud layer only changes in position, and the thickness, shape, and light and shadow of the cloud layer do not change, and the cloud layer animation is not realistic enough.

[0063] Exemplarily, referring to Figure 1 (a) and (b) in Figure 1 is a schematic diagram of using the captured cloud layer image to display the cloud layer animation provided by the prior art. As shown in Figure 1 (a) and (b), the positions of the cloud layers in the two cloud layer images change, but the thickness, shape, and light and shadow of the cloud layer do not change. At this time, when the electronic device continuously plays these two cloud layer images, it can only show that the cloud layer is moving, but the thickness, shape, and light and shadow of the cloud layer do not change, which is different from the real cloud layer change. Therefore, it can be seen that the cloud layer animation shown by continuously playing these two cloud layer images is not realistic enough.

[0064] In view of the above problems, an embodiment of the present application provides a cloud rendering method. After an electronic device obtains a first cloud noise map, a first pyramid structure corresponding to the first cloud noise map is established. The pixel sizes of the multiple second cloud noise maps included in the first pyramid structure are different. Then, the electronic device can dynamically adjust the step length of the first light ray based on the multiple different pixel sizes included in the first pyramid structure. For example, when the first light ray steps in the thicker cloud simulated by the first cloud noise map, the electronic device can reduce the step length, and when the first light ray steps in the sparser cloud simulated by the first cloud noise map, the electronic device can increase the step length. When the electronic device controls the first light ray to step according to the reduced step length, it can more comprehensively consider the influence of the cloud passed through during the process of the preset light source irradiating the first pixel on the light and shadow on the first pixel. As a result, a more accurate target pixel value of the first pixel can be obtained, and the more accurate target pixel value of the first pixel can represent the more realistic light and shadow on the first pixel. The target pixel values of multiple more accurate first pixels can more accurately simulate the light and shadow changes of clouds with different thicknesses. Therefore, the cloud image obtained by using the target pixel values of multiple more accurate first pixels is also more realistic.

[0065] Secondly, when the electronic device controls the first light ray to step according to the increased step length, it can increase the step speed of the first light ray, thereby reducing the calculation amount during the stepping process of the first light ray, and thus reducing the consumption of computing resources during the rendering process of the cloud image. In summary, adopting this solution can not only generate a more realistic cloud image but also reduce the consumption of computing resources during the rendering process of the cloud image.

[0066] An embodiment of the present application provides a cloud rendering method, which can be applied to an electronic device, such as a tablet computer, a personal computer (PC), a laptop computer, a mobile phone, a vehicle-mounted device, or a wearable device (such as a smart bracelet), etc. The embodiment of the present application does not impose any restrictions on the specific type of the electronic device.

[0067] Take the electronic device being a mobile phone as an example. Figure 2 The structural schematic diagram of the electronic device provided by the present application is shown.

[0068] As Figure 2As shown in the figure, the mobile phone may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, a headphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera [1-N] 293, a display screen [1-N] 294, and a subscriber identification module (SIM) card interface 295, etc. Among them, the sensor module 280 may include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0069] The processor 210 may be used to execute each function or step performed by the mobile phone in the above method embodiments.

[0070] The display screen 240 is used to display interfaces, etc. The display screen 240 includes a display panel. The display panel may adopt a liquid crystal display (LCD), a light-emitting diode (LED), an organic light-emitting diode (OLED), etc.

[0071] Among them, if the display screen 240 in the embodiments of the present application integrates a touch sensor, the display screen 240 may be referred to as a touch screen. The touch sensor may also be referred to as a "touch control panel". That is to say, the display screen 240 may include a display panel and a touch panel. The touch sensor 231 is used to detect a touch operation acting on or near it. After the touch sensor detects a touch operation (such as the above user operation), it can trigger the driver of the kernel layer of the mobile phone to periodically scan the touch parameters generated by the touch operation. Then, the driver of the kernel layer transmits the touch parameters to the relevant modules in the upper layer, so that the relevant modules can determine the touch event corresponding to the touch parameters. In the embodiments of the present application, taking the display screen 240 as a display screen integrated with a touch sensor (i.e., a touch screen) as an example, the method provided in the embodiments of the present application is described.

[0072] It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the mobile phone. In other embodiments, the mobile phone may include more or fewer components than shown, or some components may be combined or separated, or arranged differently. The components shown in the illustrations may be implemented in hardware, software, or a combination of software and hardware.

[0073] The software system of the mobile phone can adopt a layered architecture, event-driven architecture, micro-core architecture, micro-service architecture, or cloud architecture. Taking the system as an example, the structure of the software system of a mobile phone is illustrated. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through interfaces. In some embodiments, Figure 3 As shown, The system is divided into four layers: the application layer, the application framework layer (also called the framework layer), the Android runtime and system libraries, and the kernel layer. The layers communicate with each other through software interfaces.

[0074] The application layer can include a series of APPs. This series of APPs can be divided into system APPs that come with the phone and third-party APPs that users download to the phone. For example, Figure 3 As shown, the system APP may include a weather APP, etc.

[0075] The framework layer provides the application programming interface (API) and programming framework for the APP in the application layer. The application framework layer includes some predefined functions. For example, Figure 3 As shown, the framework layer may include a view system, a package manager, a content provider, a resource manager, an input system, and the like.

[0076] Among them, the view system is used to construct the display interface of the APP. The activity manager can be used to manage the life cycle of each APP. An APP usually runs in the operating system in the form of an activity. The activity manager can schedule the activity process of the APP to manage the life cycle of each APP. The content provider is used to store and obtain data and make this data accessible to the APP. This data can include videos, images, audio, incoming and outgoing calls, browsing history and bookmarks, phone books, etc. The resource manager provides various resources for the APP, such as localized strings, icons, pictures, layout files, video files, etc. The input system is used to monitor the input module of the mobile phone (such as the touch screen driver) and convert the parameters input by the input module into usable events and pass them to the relevant modules in the upper layer (for example, the APP in the upper layer).

[0077] The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system. The core library consists of two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core library of Android.

[0078] The application layer and the framework layer run in the virtual machine. The virtual machine executes the Java files in the application layer and the framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0079] The system library can include multiple functional modules. For example, as Figure 3 shown, the system library can include a surface manager, media libraries, etc. Among them, the surface manager is used to manage the display subsystem and provides the fusion of two-dimensional (2D) layers and three-dimensional (3D) layers for multiple APPs. The media library supports the playback and recording of multiple common audio and video formats, as well as static image files, etc.

[0080] The kernel layer is the layer between the hardware and the software. The kernel layer at least includes a touch screen driver, a display driver, a graphics processor driver, a sensor driver, etc., and the embodiments of the present application do not make any restrictions on this.

[0081] In the embodiments of the present application, the system library may further include a graphics engine. The graphics engine can be used for drawing. For example, it can render 2D graphics or 3D graphics. Exemplarily, when any APP such as a weather APP and a game APP needs to display a cloud image, it can call the graphics engine to render and generate a cloud image. After any APP receives the cloud image returned by the graphics engine, it can control the display screen 240 to display the cloud image through the display driver.

[0082] Based on the above hardware architecture and software architecture, taking the electronic device as a mobile phone as an example, the cloud rendering method provided by the embodiments of the present application will be introduced below.

[0083] Refer to Figure 4 As shown, it is a flowchart of a cloud rendering method provided by an embodiment of the present application. As Figure 4 shown, the specific process may include S401 - S413.

[0084] S401. The mobile phone receives and responds to a rendering operation to obtain a first cloud noise map.

[0085] In response to the rendering operation, the mobile phone can obtain a first cloud noise map, and this first cloud noise map can be used to generate a cloud image. Optionally, the first cloud noise map can be referred to as the first texture.

[0086] In some embodiments, the rendering operation can be used to trigger a cloud image, or the rendering operation can be used to trigger a cloud animation effect. If the rendering operation is used to trigger a cloud image, then in response to this rendering operation, the mobile phone can generate a cloud image based on the first cloud noise map; wherein, the process of the mobile phone generating a cloud image based on the first cloud noise map may include S403 - S412. If the rendering operation is used to trigger a cloud animation effect, then in response to this rendering operation, the mobile phone can generate multiple cloud images based on the first cloud noise map, and display the cloud animation effect by playing the multiple cloud images; wherein, the process of the mobile phone generating multiple cloud images based on the first cloud noise map may include S402 - S412.

[0087] Exemplarily, as Figure 5 shown in (a) of [reference], the mobile phone displays a desktop interface 510, and the desktop interface 510 includes an icon 511 of a weather APP. Then, the mobile phone can receive a click operation of the user on the icon 511 of the weather APP. The click operation on the icon 511 of the weather APP belongs to a rendering operation and is used to trigger a cloud animation effect. In response to the click operation on the icon 511 of the weather APP, the mobile phone can execute S402 - S413 to obtain multiple cloud images; and then play the multiple cloud images in the main interface 520 of the weather APP to display the cloud animation effect in the main interface 520.

[0088] In some embodiments, the electronic device can seamlessly splice multiple first noise maps to obtain a first cloud noise map. Optionally, the multiple first noise maps may include multiple Perlin noise maps and multiple Worley noise maps. The parameters of the multiple Perlin noise maps may be different, and the parameters of the multiple Worley noise maps may also be different.

[0089] For example, multiple Perlin noise maps may include a Perlin noise map of a first frequency and a Perlin noise map of a second frequency. The first frequency is greater than the second frequency. Optionally, the Perlin noise map of the first frequency may be referred to as a high-frequency Perlin noise map, and the Perlin noise map of the second frequency may be referred to as a low-frequency Perlin noise map.

[0090] For example, multiple Worley noise maps include a Worley noise map of a third frequency and a Perlin noise map of a fourth frequency. The third frequency is greater than the fourth frequency. Optionally, the Worley noise map of the third frequency may be referred to as a high-frequency Worley noise map, and the Worley noise map of the fourth frequency may be referred to as a low-frequency Worley noise map.

[0091] It can be understood that, as shown in (a) of Figure 6 , the Perlin noise map has continuity, so the mobile phone can use the Perlin noise map to simulate the continuity of clouds. As shown in (a) of Figure 7 , the Worley noise map has a lattice feature, so the mobile phone can use the Worley noise map to simulate the three-dimensional sense of clouds. In summary, the first cloud noise map generated by the mobile phone using the Perlin noise map and the Worley noise map can simulate continuous and three-dimensional clouds, that is, the first cloud noise map can simulate clouds with a strong sense of reality. The first cloud noise map can also simulate clouds of different thicknesses and different shapes. Optionally, the cloud noise map (including the first cloud noise map and the second cloud noise map) may also be referred to as a cloud thickness map.

[0092] Secondly, compared with Figure 6 the low-frequency Perlin noise map shown in (b) of Figure 6 , the high-frequency Perlin noise map shown in (a) of Figure 6 represents denser clouds. For example, as shown in (c) of Figure 6 , the mobile phone seamlessly stitches the same high-frequency Perlin noise map to obtain a stitched high-frequency Perlin noise map; as shown in (d) of

[0093] , the mobile phone seamlessly stitches the same low-frequency Perlin noise map to obtain a stitched low-frequency Perlin noise map. It can be seen that the stitched high-frequency Perlin noise map is denser than the stitched low-frequency Perlin noise map. Figure 7 the low-frequency Worley noise map shown in (b) of Figure 7 , the high-frequency Worley noise map shown in (a) ofFigure 7 As shown in (c) in [reference], the mobile phone seamlessly stitches the Worley noise maps of the same high frequency to obtain a stitched high-frequency Worley noise map; as Figure 7 shown in (d) in [reference], the mobile phone seamlessly stitches the Worley noise maps of the same low frequency to obtain a stitched low-frequency Worley noise map. It can be seen that the stitched high-frequency Worley noise map is denser than the stitched low-frequency Worley noise map.

[0094] In summary, the mobile phone can use Perlin noise maps of different frequencies and Worley noise maps of different frequencies to generate a first cloud layer noise map, and the first cloud layer noise map can represent clouds of different densities. Furthermore, a cloud image including clouds of different densities can be generated using the first cloud layer noise map.

[0095] It should be noted that Figure 6 (c) and (d) in [reference] illustrate seamless stitching using a Perlin noise map as an example, and Figure 7 (c) and (d) in [reference] also illustrate seamless stitching using a Worley noise map as an example, neither of which is used to limit the actual seamless stitching process. The electronic device seamlessly stitches multiple different Perlin noise maps and multiple different Worley noise maps during the actual cloud rendering process.

[0096] Optionally, the multiple first noise maps may include: a first other noise map with continuity and a second other noise map with lattice characteristics. Among them, the first other noise map is different from the Perlin noise map, and the second other noise map is different from the Worley noise map.

[0097] In some embodiments, the size of the first cloud layer noise map may be a preset size or determined based on the size of the target display area. The target display area is used to display the cloud image. For example, taking the case where the size of the first cloud layer noise map is determined based on the size of the target display area as an example to introduce the process of the mobile phone generating the first cloud layer noise map, the mobile phone can also obtain the size of the target display area in response to the rendering operation. Then, the mobile phone can seamlessly stitch the multiple first noise maps based on the size of the target display area to obtain the first cloud layer noise map, and the size ratio of the first cloud layer noise map may be equal to the size ratio of the target display area.

[0098] In some embodiments, since the densities of clouds in different weathers are different, and the densities of clouds at different times are also different. Therefore, the mobile phone can also obtain a preset weather and a preset time period, and then obtain the first cloud layer noise map corresponding to the preset weather and the preset time period. The first cloud layer noise map corresponding to the preset weather and the preset time period can represent the density of real clouds under the preset weather and the preset time period.

[0099] Among them, the mobile phone obtaining the first cloud noise map corresponding to the preset weather and preset time period may include: the mobile phone first obtains a plurality of Perlin noise maps and a plurality of Worley noise maps according to the preset weather and preset time period; then seamlessly splices the plurality of Perlin noise maps and the plurality of Worley noise maps to obtain the first cloud noise map.

[0100] Exemplarily, as shown in (a) of Figure 8 , the mobile phone obtains the first cloud noise map 810. The first cloud noise map 810 simulates clouds with different densities, and there are no gaps between the plurality of first noise maps in the first cloud noise map 810.

[0101] S402. The mobile phone establishes a first pyramid structure corresponding to the first cloud noise map.

[0102] The mobile phone can obtain a first pyramid structure including multiple levels based on the first cloud noise map. Among them, the first pyramid structure may include a plurality of second cloud noise maps located at different levels, and the resolution of the second cloud noise map with a higher level in the first pyramid structure is smaller or larger.

[0103] It should be noted that in the following embodiments, the example where the resolution of the second cloud noise map with a higher level in the first pyramid structure is smaller is used for introduction and description.

[0104] In some embodiments, the mobile phone can generate a plurality of second cloud noise maps based on the first cloud noise map. Then, use the plurality of second cloud noise maps to form a first pyramid structure. Among them, the multiple between the resolutions of every two adjacent levels of the second cloud noise maps may be equal to the first multiple. For example, taking the first multiple equal to 2 as an example, the resolution of the second cloud noise map in the first layer is 2 times the resolution of the second cloud noise map in the second layer, and the resolution of the second cloud noise map in the second layer is 2 times the resolution of the second cloud noise map in the third layer, etc.

[0105] Optionally, the pixel value of each pixel point in the j-th layer may be equal to the minimum value of the pixel values of a plurality of associated pixel points in the j-1-th layer, where the plurality of associated pixel points in the j-1-th layer correspond to each pixel point in the j-th layer, and j is a positive integer greater than 1. Each pixel point in the j-th layer is a pixel point in the second cloud noise map of the j-th layer. The plurality of associated pixel points in the j-1-th layer are pixel points in the second cloud noise map of the j-1-th layer.

[0106] Optionally, the resolution of the second cloud layer noise map of the first layer may be equal to the resolution of the first cloud layer noise map, or the resolution of the second cloud layer noise map of the first layer may be less than the resolution of the first cloud layer noise map. Among them, if the resolution of the second cloud layer noise map of the first layer is equal to the resolution of the first cloud layer noise map, the second cloud layer noise map of the first layer is the first cloud layer noise map.

[0107] Exemplarily, as Figure 8 shown in (b) of, the mobile phone can obtain the first pyramid structure 820 corresponding to the first cloud layer noise map 810. The first pyramid structure 820 includes: the second cloud layer noise map 821 of the first layer, the second cloud layer noise map 822 of the second layer, the second cloud layer noise map 823 of the third layer, and the second cloud layer noise map 824 of the fourth layer. The higher the level in the first pyramid structure 820, the smaller the resolution of the second cloud layer noise map.

[0108] For example, taking the first multiple equal to 2 as an example, the resolution of the second cloud layer noise map 821 of the first layer can be 512*512, the resolution of the second cloud layer noise map 822 of the second layer can be 256*256, the resolution of the second cloud layer noise map 823 of the third layer can be 128*128, and the resolution of the second cloud layer noise map 824 of the fourth layer can be 64*64.

[0109] It can be understood that if the higher the level of the multiple second cloud layer noise maps, the smaller the resolution of the second cloud layer noise map, then the smaller the size of the pixel points in the second cloud layer noise map with a higher level. The multiple between the sizes of the pixel points in every two adjacent second cloud layer noise maps can be equal to the second multiple.

[0110] For example, as Figure 9 shown in the grid schematic diagram of multiple second cloud layer noise maps, the resolution of the second cloud layer noise map of the first layer among these multiple second cloud layer noise maps can be 8*8, the resolution of the second cloud layer noise map of the second layer can be 4*4, and the resolution of the second cloud layer noise map of the third layer can be 2*2. The size of one pixel point in the second cloud layer noise map of the second layer is equal to the size of 4 pixel points in the second cloud layer noise map of the first layer, and the size of one pixel point in the second cloud layer noise map of the third layer is equal to the size of 16 pixel points in the second cloud layer noise map of the first layer. Secondly, the pixel value of one pixel point in the second cloud layer noise map of the second layer can be equal to the minimum value of the pixel values of 4 pixel points in the second cloud layer noise map of the first layer, and the pixel value of one pixel point in the second cloud layer noise map of the third layer is equal to the minimum value of the pixel values of 4 pixel points in the second cloud layer noise map of the second layer.

[0111] It should be noted that the resolutions of the multiple second cloud layer noise maps actually used by the mobile phone can all be greater than Figure 9The resolution of the second cloud noise map shown.

[0112] In the embodiments of the present application, the pixel value of a pixel point in the cloud noise map may refer to the color value of each pixel point, and this color value can be represented by a color model (for example, the RGBA model). The RGBA model includes: the value of the red (R) channel, the value of the green (G) channel, the value of the blue (B) channel, and the value of the alpha (A) channel.

[0113] S403. The mobile phone determines a first sampling point that meets the preset sampling conditions from the first cloud noise map.

[0114] Optionally, the pixel points in the first cloud noise map may be referred to as first pixel points. The mobile phone can determine whether each first pixel point in the first cloud noise map meets the preset sampling conditions. If the first pixel point meets the preset sampling conditions, then it can be determined that the first pixel point is a first sampling point. If the first pixel point does not meet the preset sampling conditions, then it can be determined that the first pixel point is not a first sampling point. Furthermore, the mobile phone can determine multiple first sampling points, and execute S404 - S410 for each first sampling point to determine the target pixel value of each first sampling point.

[0115] Among them, the preset sampling conditions may include: the initial pixel value of the first pixel point exceeds the preset numerical range. The preset numerical range may include the pixel value corresponding to black. The initial pixel value of the first pixel point may refer to the pixel value of the first pixel point in the first cloud noise map.

[0116] It can be understood that the pixel points within the cloud represented by the first cloud noise map all meet the preset sampling conditions, that is, the pixel points within the cloud represented by the first cloud noise map are all first sampling points.

[0117] It should be noted that in the following embodiments, the process of the mobile phone determining the target pixel value of each first sampling point is introduced by taking one first sampling point as an example.

[0118] S404. The mobile phone determines the initial step length corresponding to the first light ray based on the first pyramid structure, where the first light ray points from the first sampling point to the first preset light source position.

[0119] The mobile phone can control the first light step based on the first pyramid structure, and during the process of the first light step, process the initial pixel value of the first pixel point to obtain the target pixel value of the first pixel point. Among them, the mobile phone controlling the first light step based on the first pyramid structure may include: first determining the initial step length corresponding to the first light based on the first pyramid structure, so that the first light first steps according to the initial step length; then adjusting the initial step length so that the first light continues to step according to the adjusted step length until the step of the first light ends. Optionally, the step length can be referred to as the step distance.

[0120] In some embodiments, the initial step length may be equal to the size of a pixel point in the second cloud noise map at the initial level, and the second cloud noise map at the initial level is the one with the largest resolution among multiple second cloud noise maps. Among them, if the resolution of the second cloud noise map with a higher level in the first pyramid structure is smaller, the second cloud noise map at the initial level may refer to the second cloud noise map of the first layer. For example, the second cloud noise map 821 of the first layer.

[0121] Optionally, if the second cloud noise map at the initial level is the one with the largest resolution among multiple second cloud noise maps, the mobile phone can set the resolution of the second cloud noise map at the initial level to be less than the preset resolution, so that the resolution of the second cloud noise map at the initial level is smaller. Since the resolution of the second cloud noise map at the initial level is smaller, the size of a pixel point in the second cloud noise map at the initial level is larger, and the initial step length is also larger. The first light starts to step according to the larger initial step length, which can reduce the number of steps required for the first light to penetrate the cloud layer.

[0122] In some embodiments, the first preset light source position may be set according to the possible positions of the preset light source; among them, the preset light source may be the sun.

[0123] Exemplarily, taking Figure 10 a cloud image shown in (a) as an example, the step process of the first light will be described. As Figure 10 shown in (a), if a pixel point 1001 in the cloud image meets the preset sampling condition, the mobile phone can determine that the pixel point 1001 is the first sampling point. Then, the mobile phone can determine the first light corresponding to the first sampling point, and the first light points from the pixel point 1001 to the first preset light source position 1010. The first preset light source position 1010 is a possible position where the sun appears.

[0124] It should be noted that during the process of the mobile phone executing the cloud rendering method, the first light steps on the first cloud noise map. Figure 10(a) in it is only used to illustrate the stepping process of the first light ray and cannot represent the actual stepping process of the first light ray on the first cloud noise map. Secondly, the first sampling point is a pixel point in the first cloud noise map, Figure 10 and the pixel point shown in (a) in it cannot represent the real first sampling point either.

[0125] S405. The mobile phone determines that the first light ray steps to the first stepping point according to the initial step length.

[0126] After the direction of the first light ray (i.e., pointing from the first sampling point to the first preset light source position) is determined, the mobile phone determines that the first light ray starts from the first sampling point and steps to the first stepping point according to the initial step length. Then, the mobile phone can adjust the step length at the first stepping point to continue stepping according to the adjusted step length, and can also update the initial pixel value of the first sampling point at the first stepping point. Among them, the first stepping point is a pixel point in the first cloud noise map.

[0127] S406. The mobile phone determines whether the first stepping point blocks the first light ray.

[0128] After the mobile phone determines the first stepping point, it can obtain the pixel value of the first stepping point. The pixel value of the first stepping point refers to the pixel value of the first stepping point in the first cloud noise map. The mobile phone can determine whether the first stepping point blocks the first light ray based on the pixel value of the first stepping point. If the first stepping point blocks the first light ray, the mobile phone can execute S407 - S408 to reduce the step length and attenuate the pixel value. If the first stepping point does not block the first light ray, the mobile phone can execute S410 to increase the step length and keep the pixel value unchanged.

[0129] In some embodiments, the mobile phone can determine whether the pixel value of the first stepping point is greater than the initial pixel value of the first sampling point. Among them, the pixel value of the first stepping point being greater than the initial pixel value of the first sampling point indicates that the first stepping point blocks the first light ray. The pixel value of the first stepping point being less than or equal to the initial pixel value of the first sampling point indicates that the first stepping point does not block the first light ray. For example, taking the pixel point 1001 shown in (a) in it as the first sampling point, Figure 10 the mobile phone can determine whether the pixel value of the first stepping point 1002 is greater than the initial pixel value of the first sampling point.

[0130] S407. The mobile phone reduces the initial step length based on the first pyramid structure to obtain the adjusted step length.

[0131] When the mobile phone blocks the first light at the first stepping point, it indicates that the cloud layer at the first stepping point in the first cloud layer noise map is relatively thick, and the mobile phone can reduce the initial step size. Then the mobile phone controls the first light to step according to the reduced step size, so as to further determine whether there is still a relatively thick cloud layer blocking the first light near the first stepping point. For example, taking the cloud image shown in (a) of Figure 10 as an example to illustrate that the thickness of the cloud layer is different, as shown in (b) of Figure 10 , the thickness of the cloud layer on the same horizontal line in the cloud image is different. Therefore, it can be known that the thickness of the cloud layer represented by the multiple stepping points reached by the first light when stepping in the first cloud layer noise map can also be different. Furthermore, whether the multiple stepping points reached by the first light block the first light is also different.

[0132] In some embodiments, the mobile phone can determine an updated level based on the initial level, where the updated level is adjacent to the initial level, and the resolution of the second cloud layer noise map located at the updated level is greater than the resolution of the second cloud layer noise map located at the initial level. Then, the mobile phone can determine that the adjusted step size is equal to the size of a pixel point in the second cloud layer noise map located at the updated level. Since the resolution of the second cloud layer noise map at the updated level becomes larger, the size of a pixel point in the second cloud layer noise map at the updated level becomes smaller, and the adjusted step size also becomes smaller.

[0133] It should be noted that if the mobile phone determines that there is no other second cloud layer noise map in the first pyramid structure whose resolution is greater than the resolution of the second cloud layer noise map located at the initial level, it can determine that the updated level is still the initial level.

[0134] For example, the second cloud layer noise map located at the initial level can be the second cloud layer noise map 821 of the first layer shown in (b) of Figure 8 . If the mobile phone determines that there is no other second cloud layer noise map in the first pyramid structure whose resolution is greater than the resolution of the second cloud layer noise map of the first layer, the mobile phone can determine that the updated level is still the first layer.

[0135] S408. The mobile phone attenuates the initial pixel value of the first sampling point to obtain an updated pixel value.

[0136] The first sampling point is the first pixel point in the first cloud layer noise map that meets the preset sampling condition. Therefore, the initial pixel value of the first sampling point is the pixel value of the first sampling point in the first cloud layer noise map. Since the first stepping point blocks the first light, the mobile phone needs to attenuate the initial pixel value of the first sampling point to obtain an updated pixel value.

[0137] Further, after the mobile phone obtains the adjusted step size and the updated pixel value, it can continue to execute S405 - S409 based on the adjusted step size and the updated pixel value until the stepping of the first light ray ends. For example, taking the second stepping point as an example to introduce the process of the mobile phone executing S405 - S409 based on the adjusted step size and the updated pixel value, the mobile phone first determines that the first light ray steps to the second stepping point according to the adjusted step size; then, it determines whether the second stepping point blocks the first light ray; if the second stepping point blocks the first light ray, it reduces the adjusted step size based on the first pyramid structure to obtain the adjusted step size, and also attenuates the updated pixel value of the first sampling point to obtain the updated pixel value; if the second stepping point does not block the first light ray, it enlarges the adjusted step size based on the first pyramid structure to obtain the adjusted step size, and determines that the updated pixel value remains unchanged.

[0138] In some embodiments, the mobile phone can attenuate the initial pixel value of the first sampling point according to a preset ratio to obtain the updated pixel value. For example, the preset ratio can be 10%, 20%, etc. Taking the preset ratio of 10% as an example, the mobile phone can attenuate the initial pixel value of the first sampling point by 10% to obtain the updated pixel value, and the updated pixel value is 90% of the initial pixel value of the first sampling point.

[0139] S409. The mobile phone enlarges the initial step size based on the first pyramid structure to obtain the adjusted step size, and determines that the updated pixel value is the initial pixel value of the first sampling point.

[0140] When the first stepping point does not block the first light ray on the mobile phone, it means that the cloud layer at the first stepping point in the first cloud noise map is thinner, so the mobile phone can enlarge the initial step size. Then the mobile phone controls the first light ray to step according to the enlarged step size, so as to further step to a position farther from the first stepping point to determine whether the position farther from the first stepping point blocks the first light ray. When the first stepping point does not block the first light ray on the mobile phone, it can also determine that the updated pixel value is the initial pixel value of the first sampling point, that is, keep the initial pixel value of the first sampling point unchanged.

[0141] Further, after the mobile phone obtains the adjusted step size and the updated pixel value, it can continue to execute S405 - S409 based on the adjusted step size and the updated pixel value until the stepping of the first light ray ends.

[0142] In some embodiments, the mobile phone can determine an updated level based on an initial level. Among them, the updated level is adjacent to the initial level, and the resolution of the second cloud noise map located at the updated level is smaller than the resolution of the second cloud noise map located at the initial level. Then, the mobile phone can determine that the adjusted step size is equal to the size of a pixel point in the second cloud noise map located at the updated level. Wherein, as the resolution of the second cloud noise map at the updated level becomes smaller, the size of a pixel point in the second cloud noise map at the updated level becomes larger, and the adjusted step size also becomes larger.

[0143] For example, the second cloud noise map located at the initial level can be Figure 8 the second cloud noise map 821 of the first layer shown in (b) of [reference], and the mobile phone can determine that the resolution of the second cloud noise map of the second layer in the first pyramid structure is greater than the resolution of the second cloud noise map of the first layer, that is, determine that the updated level is the second layer, and the second cloud noise map located at the updated level is the second cloud noise map 822 of the second layer.

[0144] Exemplarily, taking the first sampling point as Figure 10 the pixel point 1001 shown in (a) of [reference] as an example, the stepping process of the first light ray will be described. As Figure 10 shown in (a) of [reference], the mobile phone determines that the first light ray corresponding to this first sampling point (i.e., pixel point 1001) steps to the first stepping point 1002 according to the initial step size. When the mobile phone determines that there is an occlusion of the first light ray at the first stepping point 1002, it can reduce the initial step size to obtain the adjusted step size, and then control the first light ray to step to the second stepping point 1003 according to the adjusted step size. After that, the first light ray steps to the third stepping point 1004 and the fourth stepping point 1005 in sequence.

[0145] S410. When the mobile phone determines that the first light ray exits the cloud layer, it determines that the target pixel value of the first sampling point is the updated pixel value.

[0146] The mobile phone can obtain the target pixel value of the first sampling point when determining the end of the stepping of the first light ray. The target pixel value of the first sampling point is the updated pixel value newly obtained by the mobile phone. Among them, the mobile phone determining the end of the stepping of the first light ray can include: the mobile phone determining that the first light ray exits the cloud layer.

[0147] In some embodiments, the mobile phone can determine the end of the stepping of the first light ray when the first light ray steps to the i-th stepping point and the pixel value of the i-th stepping point falls within a preset numerical range. Wherein, the pixel value of the i-th stepping point falling within the preset numerical range can indicate that the first light ray exits the cloud layer, and the preset numerical range includes the pixel value corresponding to black. i is a positive integer greater than 1.

[0148] Exemplarily, taking the pixel point 1001 shown in (a) of Figure 10 as an example, the stepping process of the first light ray will be described. After the first light ray steps to the fourth stepping point 1005, an updated step size and an updated pixel value can be obtained. Then, the first light ray steps to the fifth stepping point 1006 according to the updated step size. If the pixel value of the fifth stepping point 1006 falls within the preset numerical range, the mobile phone can determine that the stepping of the first light ray ends, or it can be said that the first light ray penetrates the cloud layer. At this time, the mobile phone can determine that the target pixel value of the first sampling point is the updated pixel value obtained after the first light ray steps to the fourth stepping point 1005.

[0149] It should be noted that since the first light ray steps in the 2D first cloud noise map, the stepping process of the first light ray described in the above embodiments can be referred to as a stepping process using the 2D Raymarch algorithm. Compared with the first light ray stepping in three-dimensional space, the calculation amount of the first light ray stepping in the 2D first cloud noise map is less, so as to reduce the consumption of computing resources in the rendering process of the cloud image.

[0150] S411. The mobile phone generates a cloud image corresponding to the first cloud noise map based on the target pixel values of multiple first sampling points in the first cloud noise map.

[0151] The mobile phone can determine multiple first sampling points from all pixel points included in the first cloud noise map, and perform the above S404 - S410 on each first sampling point among the multiple first sampling points to obtain the target pixel value of each first sampling point. After the mobile phone obtains the target pixel values of the multiple first sampling points, it can generate a cloud image corresponding to the first cloud noise map based on the target pixel values of the multiple first sampling points in the first cloud noise map.

[0152] It should be noted that the cloud image corresponding to the first cloud noise map is equivalent to the first cloud image in the invention content.

[0153] In some embodiments, the mobile phone can update the initial pixel values of multiple first sampling points in the first cloud noise map by using the target pixel values of the multiple first sampling points, and can also update the initial pixel values of other pixel points in the first cloud noise map except the multiple first sampling points to preset pixel values to obtain the cloud image corresponding to the first cloud noise map.

[0154] Among them, the preset pixel value can be the pixel value corresponding to a preset color. For example, the pixel value corresponding to blue.

[0155] Exemplarily, as shown in (a) of Figure 11 , the mobile phone obtains the cloud image 1101 corresponding to the first cloud noise map.

[0156] It should be noted that the background color outside the clouds in the cloud image 1101 can be blue. Figure 11 (a) in is not shown.

[0157] It can be understood that the mobile phone dynamically updates the step size of the first light based on the first pyramid structure. When there is an occlusion of the first light at a stepping point, the step size can be reduced. Stepping according to the reduced step size can further determine whether there are thicker clouds blocking the first light near the stepping point. In this way, the influence of the clouds passed by the preset light source when irradiating the first sampling point on the light and shadow on the first pixel can be considered more comprehensively. Thus, the target pixel value of the first pixel can be obtained more accurately. The more accurate target pixel value of the first pixel can represent the more real light and shadow on the first pixel. The target pixel values of multiple more accurate first pixels can more accurately simulate the light and shadow changes of clouds with different thicknesses. Therefore, the cloud image obtained using the target pixel values of multiple more accurate first pixels is also more realistic.

[0158] Secondly, when the mobile phone dynamically updates the step size of the first light based on the first pyramid structure, when there is no occlusion of the first light at a stepping point, the step size can be enlarged. Stepping according to the enlarged step size can increase the stepping speed of the first light, thereby reducing the calculation amount in the light stepping process and also reducing the calculation amount for generating the cloud image.

[0159] In some embodiments, if the rendering operation is used to trigger the cloud image, after the mobile phone obtains the cloud image corresponding to the first cloud noise map, the cloud rendering process can be ended. If the rendering operation is used to trigger the cloud dynamic effect, the mobile phone can continue to execute S412 - S413 to generate and sequentially display multiple cloud images. The mobile phone shows the cloud dynamic effect by sequentially displaying multiple cloud images.

[0160] It should be noted that in the following embodiments, the case where the rendering operation is used to trigger the cloud dynamic effect is taken as an example for description.

[0161] S412. The mobile phone offsets multiple first noise maps included in the first cloud noise map to obtain at least one offset cloud noise map.

[0162] The mobile phone needs to use multiple cloud noise maps to render multiple cloud images corresponding to the multiple cloud noise maps, and then show the cloud dynamic effect by sequentially displaying the multiple cloud images. After the mobile phone obtains the first cloud noise map, since there is no gap between the multiple first noise maps included in the first cloud noise map, the mobile phone can offset the multiple first noise maps in the first cloud noise map to generate a new cloud noise map (i.e., the offset cloud noise map). The multiple cloud noise maps can include the first cloud noise map and the offset cloud noise map. Optionally, the offset cloud noise map can be referred to as the offset texture.

[0163] It should be noted that the offset cloud noise map is equivalent to the third cloud noise map in the above-mentioned invention content.

[0164] In some embodiments, since the first cloud noise map is composed of multiple first noise maps, the mobile phone can offset the multiple first noise maps in the first cloud noise map according to a preset direction and a preset number of offsets to obtain an offset cloud noise map. For example, the preset direction can be up, down, left, or right. The preset number of offsets can be any positive number such as 1, 2, or 3. The preset number of offsets refers to the number of noise maps, etc.

[0165] Exemplarily, taking the preset direction as left and the preset number of offsets equal to 2 as an example, the mobile phone can offset the multiple first noise maps in the first cloud noise map as a whole to the left by two first noise maps to obtain an offset cloud noise map. Among them, the two leftmost first noise maps in the first cloud noise map move to the rightmost in the offset cloud noise map.

[0166] In some embodiments, after the mobile phone offsets the first cloud noise map to obtain an offset cloud noise map, it can continue to offset the offset cloud noise map to generate the next offset cloud noise map. Thus, the mobile phone can obtain multiple different offset cloud noise maps.

[0167] It can be understood that since there is no gap between the multiple first noise maps in the first cloud noise map, the edges of the clouds simulated by the offset cloud noise map obtained by the mobile phone offsetting the multiple first noise maps are all smooth and gentle. Furthermore, there is no problem of edge disconnection in the cloud image generated by using the offset cloud noise map, which conforms to the shape of real clouds. Secondly, the mobile phone offsets the multiple first noise maps in the first cloud noise map to obtain an offset cloud noise map, which reduces the workload of generating multiple cloud noise maps compared with splicing multiple new noise maps to obtain a new cloud noise map.

[0168] In the embodiments of the present application, after the mobile phone obtains each offset cloud noise map, it can perform a cloud rendering process on the offset cloud noise map to obtain a cloud image corresponding to the offset cloud noise map.

[0169] It should be noted that when the mobile phone performs a cloud rendering process on the offset cloud noise map, it can refer to the cloud rendering process performed on the first cloud noise map described in S402 - S411 above.

[0170] For example, taking an offset cloud noise map as an example, the process of the mobile phone performing cloud rendering on the offset cloud noise map may include: first, establishing a second pyramid structure corresponding to the offset cloud noise map; controlling a second ray march based on the second pyramid structure, and during the second ray march, processing the initial pixel value of a second pixel point in a third cloud noise map to obtain the target pixel value of the second pixel point, where the second ray points from the second pixel point to a second preset light source position; generating a cloud image corresponding to the offset cloud noise map based on the target pixel values of multiple second pixel points in the offset cloud noise map.

[0171] It should be noted that for the details of the second pyramid structure, reference may be made to the description of the first pyramid structure in S402 above; for the details of controlling the second ray march based on the second pyramid structure and processing the initial pixel value of the second pixel point in the third cloud noise map during the second ray march to obtain the target pixel value of the second pixel point, reference may be made to the description of the first ray march process in S403 - S410 above; for the details of generating a cloud image corresponding to the offset cloud noise map based on the target pixel values of multiple second pixel points in the offset cloud noise map, reference may be made to the description of generating a cloud image corresponding to the first cloud noise map based on the target pixel values of multiple first sampling points in the first cloud noise map in S411 above, which will not be elaborated here.

[0172] In some embodiments, the preset light source positions adopted by the mobile phone for multiple different cloud noise maps may be different. For example, the first preset light source position adopted for the first cloud noise map is different from the second preset light source position adopted for an offset cloud noise map, that is, the first preset light source position and the second preset light source position may be different positions where the preset light source may appear. Thus, the multiple cloud images obtained by the mobile phone performing cloud rendering on multiple different cloud noise maps can represent the light and shadow changes of the clouds at different positions of the preset light source.

[0173] Exemplarily, taking the preset light source as the sun as an example, as Figure 12 shown, the points on curve 1201 can all be the positions where the sun may appear. Therefore, the first preset light source position and the second light source position can be two different points on curve 1201.

[0174] Exemplarily, taking the preset light source positions adopted by the mobile phone for multiple different cloud noise maps being different and the preset light source being the sun as an example, as Figure 11As shown in (a) to (c) therein, the mobile phone can obtain multiple cloud images of the sun at different positions. These multiple cloud images can include the cloud image 1101 corresponding to the first cloud noise map, the cloud image 1102 corresponding to an offset cloud noise map, and the cloud image 1103 corresponding to another offset cloud noise map. It can be seen that the sun in the multiple cloud images is at different positions, so the light and shadow of the clouds in the multiple cloud images are different. By playing these multiple cloud images, the mobile phone can display the light and shadow changes of the clouds caused by the change of the sun's position.

[0175] It should be noted that the cloud image 1101, the cloud image 1102, and the cloud image 1103 are in color. The background color outside the clouds in the cloud image 1102 can be blue, and the background color outside the clouds in the cloud image 1103 can be blue. Figure 11 None of (a) to (c) therein is shown.

[0176] S413. After the mobile phone generates multiple cloud images, it sequentially displays the multiple cloud images. Among them, the multiple cloud images include: the cloud image corresponding to the first cloud noise map and the cloud image corresponding to the offset cloud noise map.

[0177] After the mobile phone generates multiple cloud images, it can sequentially display the multiple cloud images. The mobile phone loops and plays the multiple cloud images in the target display area.

[0178] It should be noted that the cloud image corresponding to the offset cloud noise map is equivalent to the second cloud image in the invention content.

[0179] Exemplarily, as Figure 5 shown in (b) therein, the main interface 520 of the weather APP can include a target display area 521, and the mobile phone can play multiple cloud images in the target display area 521.

[0180] It should be noted that Figure 5 shown in (b) therein is a schematic diagram of the mobile phone displaying a cloud image.

[0181] It can be understood that the mobile phone simulates the change of the cloud shape and the change of the cloud thickness through multiple cloud noise maps (including the first cloud noise map and at least one offset cloud noise map). By playing the multiple cloud images obtained by rendering the clouds for the multiple cloud noise maps, the change of the cloud shape and the change of the cloud thickness can be exhibited, that is, the dynamic change process of the clouds (i.e., the cloud dynamic effect) can be displayed. Secondly, according to the above analysis, it can be known that each cloud image obtained by the mobile phone is relatively real. Therefore, playing multiple cloud images can reflect the real dynamic change process of the clouds.

[0182] In some embodiments, the mobile phone can also obtain a preset shape input by the user, and then generate a cloud image including clouds in the preset shape. As Figure 13 shown, a cloud rendering method provided by an embodiment of the present application may further include S1301, and S401 in this method may include S1302.

[0183] S1301. The mobile phone obtains a mask image, and the mask image includes a pattern in a preset shape.

[0184] Before receiving the rendering operation, the mobile phone can receive the mask image input by the user. Among them, some contents in the mask image are invisible, and the mask image can be divided into a visible area and an invisible area. The pattern in the preset shape belongs to the visible area.

[0185] S1302. The mobile phone obtains a first cloud noise map based on the preset shape, where the first cloud noise map is used to simulate the clouds in the preset shape, and the cloud image corresponding to the first cloud noise map includes clouds in the preset shape.

[0186] After receiving the mask image, the mobile phone can receive and respond to the rendering operation to obtain a first cloud noise map for simulating the clouds in the preset shape. Then, the mobile phone can perform cloud rendering on the first cloud noise map to obtain a cloud image corresponding to the first cloud noise map, and the cloud image includes clouds in the preset shape.

[0187] Further, after obtaining the first cloud noise map for simulating the clouds in the preset shape, the mobile phone offsets a plurality of first noise maps included in the first cloud noise map to obtain an offset cloud noise map, and the offset cloud noise map can also be used to simulate the offset cloud noise map. Then, after obtaining the cloud image corresponding to the first cloud noise map and the cloud image corresponding to the offset cloud noise map, the mobile phone plays the cloud image corresponding to the first cloud noise map and the cloud image corresponding to the offset cloud noise map, and can display the dynamic change process of the clouds in the preset shape.

[0188] Exemplarily, as Figure 14 shown in (a), the mobile phone can obtain a mask image 1410, and the mask image 1410 includes a puppy pattern 1411. The area other than the puppy pattern 1411 in the mask image 1410 is an invisible area. Then, as Figure 14 shown in (b), the mobile phone can obtain a first cloud noise map 1420 based on the puppy shape. The mobile phone performs cloud rendering on the first cloud noise map 1420 to obtain a cloud image 1430 corresponding to the first cloud noise map 1420. As Figure 14 shown in (c), the cloud image 1430 includes clouds in the shape of a puppy.

[0189] It should be noted that the cloud image 1430 is in color.Figure 14 (c) in it is not shown.

[0190] In some embodiments, the mobile phone can first determine a plurality of first noise maps based on a preset shape, and the plurality of first noise maps can be stitched together to form a cloud layer of the preset shape; then, the plurality of first noise maps are seamlessly stitched to obtain a first cloud layer noise map for simulating the cloud layer of the preset shape.

[0191] Alternatively, the mobile phone can save a plurality of fourth cloud layer noise maps corresponding to a plurality of shapes, and the mobile phone can obtain a first cloud layer noise map corresponding to the preset shape from the plurality of fourth cloud layer noise maps.

[0192] It should be noted that the steps performed by the mobile phone described in the above embodiments can all be performed by a graphics engine in the mobile phone.

[0193] Referring to Figure 15 shown, it is a schematic flowchart of a cloud layer rendering method provided by an embodiment of the present application. As Figure 15 shown, the display method may further include the following S1501 - S1504.

[0194] S1501. The mobile phone receives and responds to a rendering operation to obtain a first cloud layer noise map.

[0195] S1502. The mobile phone establishes a first pyramid structure corresponding to the first cloud layer noise map. The first pyramid structure includes a plurality of second cloud layer noise maps, and the pixel point sizes of the plurality of second cloud layer noise maps are different.

[0196] S1503. The mobile phone controls the first light to step, and during the process of the first light stepping, adjusts the step size of the first light based on the first pyramid structure, and processes the initial pixel value of the first pixel point in the first cloud layer noise map to obtain the target pixel value of the first pixel point, where the first light points from the first pixel point to the first preset light source position.

[0197] S1504. The mobile phone generates a first cloud layer image based on the target pixel values of the plurality of first pixel points in the first cloud layer noise map.

[0198] It can be understood that in order to implement the above functions, the above - mentioned electronic device includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.

[0199] In the embodiments of the present application, the above-mentioned electronic device can be divided into functional modules according to the above method examples. For example, each functional module can be corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiments of the present invention is illustrative, only a logical function division, and there can be other division methods in actual implementation.

[0200] The embodiments of the present application further provide an electronic device, which includes: a memory and one or more processors; the memory is coupled to the processor; wherein, computer program code is stored in the memory, and the computer program code includes computer instructions. When the computer instructions are executed by the processor, the electronic device is caused to execute the cloud rendering method provided in the foregoing embodiments.

[0201] The embodiments of the present application further provide a computer-readable storage medium, which includes computer instructions. When the computer instructions run on an electronic device, the electronic device is caused to execute the cloud rendering method provided in the foregoing embodiments.

[0202] The embodiments of the present application further provide a computer program product, which includes executable instructions. When the computer program product runs on an electronic device, the electronic device is caused to execute the cloud rendering method provided in the foregoing embodiments.

[0203] The embodiments of the present application further provide a chip system, as Figure 16 shown, the chip system 1600 includes at least one processor 1601 and at least one interface circuit 1602. The processor 1601 and the interface circuit 1602 can be interconnected by a line. For example, the interface circuit 1602 can be used to receive signals from other devices (such as the memory of an electronic device). Again, for example, the interface circuit 1602 can be used to send signals to other devices (such as the processor 1601).

[0204] Exemplarily, the interface circuit 1602 can read the instructions stored in the memory and send the instructions to the processor 1601. When the instructions are executed by the processor 1601, the chip system can be caused to execute each step in the above embodiments. Of course, the chip system can also include other discrete devices, and the embodiments of the present application do not make specific limitations thereto.

[0205] From the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0206] In several embodiments provided in the present application, it should be understood that the disclosed device / equipment and method can be implemented in other ways. For example, the device / equipment embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical or other forms.

[0207] The unit described as a separated component may or may not be physically separated. The component displayed as a unit may be a physical unit or multiple physical units, that is, it can be located in one place or distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0208] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0209] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: USB flash drive, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other various media that can store program codes.

[0210] The above content is only a specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application shall be covered by the protection scope of this application.

Claims

1. A cloud rendering method, characterized in that, Applied to an electronic device, the method includes: Receiving and responding to a rendering operation to obtain a first cloud noise map; Establishing a first pyramid structure corresponding to the first cloud noise map, the first pyramid structure including a plurality of second cloud noise maps, and pixel sizes of the plurality of second cloud noise maps being different; Controlling a first light ray to step, and during the stepping of the first light ray, adjusting a step length of the first light ray based on the first pyramid structure, and processing an initial pixel value of a first pixel in the first cloud noise map to obtain a target pixel value of the first pixel, wherein the first light ray points from the first pixel to a first preset light source position; Generating a first cloud image based on the target pixel values of the plurality of first pixels in the first cloud noise map.

2. The method according to claim 1, characterized in that, The controlling the first light ray to step, and during the stepping of the first light ray, adjusting the step length of the first light ray based on the first pyramid structure, and processing the initial pixel value of the first pixel in the first cloud noise map to obtain the target pixel value of the first pixel includes: Determining an initial step length corresponding to the first light ray based on the first pyramid structure; Determining that the first light ray steps to a first stepping point according to the initial step length; Adjusting the initial step length based on the first pyramid structure and the first stepping point to obtain an adjusted step length, and updating the initial pixel value of the first pixel to obtain an updated pixel value; Determining that the first light ray steps to a second stepping point according to the adjusted step length, and continuously adjusting the adjusted step length and updating the updated pixel value; Until the stepping of the first light ray ends, determining that the target pixel value of the first pixel is the updated pixel value.

3. The method according to claim 2, wherein The adjusting the initial step length based on the first pyramid structure and the first stepping point to obtain the adjusted step length, and updating the initial pixel value of the first pixel to obtain the updated pixel value includes: In a case where the first light ray is blocked at the first stepping point, shrinking the initial step length based on the first pyramid structure to obtain the adjusted step length, and attenuating the initial pixel value of the first pixel to obtain the updated pixel value; In a case where the first light ray is not blocked at the first stepping point, enlarging the initial step length based on the first pyramid structure to obtain the adjusted step length, and determining that the updated pixel value is the initial pixel value of the first pixel.

4. The method according to claim 3, characterized in that, The plurality of second cloud noise maps in the first pyramid structure are at different levels, and the higher the level of the plurality of second cloud noise maps, the smaller or larger the resolution; the initial step length is equal to the size of a pixel in the second cloud noise map at the initial level, and the second cloud noise map at the initial level is the one with the largest resolution among the plurality of second cloud noise maps; Wherein, the shrinking the initial step length based on the first pyramid structure to obtain the adjusted step length includes: Determine an updated level based on the initial level, wherein the updated level is adjacent to the initial level, and the resolution of the second cloud noise map located at the updated level is greater than the resolution of the second cloud noise map located at the initial level; Determine that the adjusted step size is equal to the size of a pixel point in the second cloud noise map located at the updated level.

5. The method according to claim 4, characterized in that, The amplifying the initial step size based on the first pyramid structure to obtain the adjusted step size includes: Determine an updated level based on the initial level, wherein the updated level is adjacent to the initial level, and the resolution of the second cloud noise map located at the updated level is less than the resolution of the second cloud noise map located at the initial level; Determine that the adjusted step size is equal to the size of a pixel point in the second cloud noise map located at the updated level.

6. The method according to any one of claims 3-5, characterized in that, The method further includes: Judge whether the pixel value of the first stepping point is greater than the initial pixel value of the first pixel point, wherein the pixel value of the first stepping point being greater than the initial pixel value of the first pixel point indicates that the first stepping point blocks the first light ray, and the pixel value of the first stepping point being less than or equal to the initial pixel value of the first pixel point indicates that the first stepping point does not block the first light ray.

7. The method according to any one of claims 1 to 6, characterized in that The controlling the first light ray to step based on the first pyramid structure and processing the initial pixel value of the first pixel point in the first cloud noise map during the stepping of the first light ray to obtain the target pixel value of the first pixel point includes: When the first pixel point meets the preset sampling condition, control the first light ray to step based on the first pyramid structure, and process the initial pixel value of the first pixel point during the stepping of the first light ray to obtain the target pixel value of the first pixel point; Wherein, the preset sampling condition includes: the initial pixel value of the first pixel point exceeds a preset numerical range, and the preset numerical range includes the pixel value corresponding to black.

8. The method according to any one of claims 2-7, characterized in that The method further includes: When the first light ray steps to the i-th stepping point and the pixel value of the i-th stepping point is within the preset numerical range, determine that the stepping of the first light ray ends, wherein the pixel value of the i-th stepping point being within the preset numerical range indicates that the first light ray penetrates the cloud layer, the preset numerical range includes the pixel value corresponding to black, and i is a positive integer greater than 1.

9. The method according to any one of claims 1-8, characterized in that, The obtaining the first cloud noise map includes: Seamlessly splice a plurality of first noise maps to obtain the first cloud noise map, wherein the plurality of first noise maps include Perlin noise maps and Worley noise maps.

10. The method according to claim 9, characterized in that, The method further includes: Offset the plurality of first noise maps in the first cloud noise map to obtain a third cloud noise map; Establish a second pyramid structure corresponding to the third cloud noise map; Control the second light ray stepping based on the second pyramid structure, and during the process of the second light ray stepping, process the initial pixel value of the second pixel in the third cloud noise map to obtain the target pixel value of the second pixel, where the second light ray points from the second pixel to a second preset light source position; Generate a second cloud image based on the target pixel values of the multiple second pixels in the third cloud noise map; Display the first cloud image and the second cloud image in sequence.

11. The method according to any one of claims 1-8, characterized in that, The method further includes: Obtain a mask image, where the mask image includes a pattern of a preset shape; Wherein, the obtaining of the first cloud noise map includes: Based on the preset shape, obtain the first cloud noise map, where the first cloud noise map is used to simulate a cloud of the preset shape, and the first cloud image includes a cloud of the preset shape.

12. An electronic device, characterized in that, The electronic device includes: a processor, a memory, and a communication interface; the memory and the communication interface are coupled to the processor, the memory is used to store computer program code, and the computer program code includes computer instructions; wherein, when the processor executes the computer instructions, the electronic device is caused to execute the method according to any one of claims 1-11.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions; when the computer instructions run on an electronic device, the electronic device is caused to execute the method according to any one of claims 1-11.

14. A chip system, characterized in that, The chip system includes a processor and an interface circuit, and the processor and the interface circuit can be interconnected through a line; wherein, the interface circuit is used to receive a signal from an electronic device and send the signal to the processor, and the signal includes computer instructions; when the processor executes the computer instructions, the chip system is caused to execute the method according to any one of claims 1-11.

Citation Information

Patent Citations

  • Scene reconstruction and rendering method based on point cloud, storage medium and electronic equipment

    CN114898028A

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

    CN117710557A

  • Volume cloud rendering method and device and electronic equipment

    CN118379409A

  • Method and apparatus for rendering weather in virtual environment, device, medium and program

    US20230039131A1