Cloud rendering method, device, storage medium and electronic device
By obtaining multiple channel texture information of the target map, cloud masks are generated and mixed processing is solved, and the cloud rendering cost and poor effect is achieved, achieving low-cost and efficient cloud rendering effect on mobile terminal devices.
Patent Information
- Application Number
- CN202210689819.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-17
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-06-17
AI Technical Summary
In the prior art, cloud rendering methods are costly and have poor results in virtual reality, making it difficult to achieve efficient real-time light and shadow rendering on the mobile terminal.
By obtaining multiple channel texture information of the target map, multiple target cloud masks are generated and mixed processing is performed. The self-shading of the cloud model follows real-time lighting changes, enhancing the transparency and lighting occlusion effect of the cloud layer, and using the light source position to generate masks to adjust the cloud rendering results.
It realizes low-cost and efficient cloud rendering on the mobile side, improves the virtual reality effect, and is suitable for cloud rendering of mobile terminal devices.
Smart Images

Figure CN115131489B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular, to a cloud rendering method, device, storage medium and electronic device. Background Art
[0002] In a virtual scene, it is often necessary to display cloud effects that follow weather changes to enhance virtual reality. In related technologies, the methods for rendering cloud effects mainly include the following: First, according to the three-dimensional texture and ray tracing method, realistic volumetric clouds are rendered, but this method consumes a large amount of rendering performance and is difficult to apply to mobile devices; Second, clouds are rendered through a particle system and various cloud texture maps of different shapes, but this method is difficult to simulate the effect of high-density clouds and the real-time shadow rendering effect is poor; Third, a high-definition sky image generated by real photography or design software is used as a texture map to make a sky sphere, but the resource package designed by this method is extremely large and it is difficult to apply to mobile devices; Fourth, a procedural material cloud is made based on a single-layer noise texture map, but the cloud effect obtained by this method does not support real-time shadow effects.
[0003] Therefore, how to perform cloud rendering in a virtual scene to adapt to real-time shadows and enhance the virtual reality effect has become one of the important problems in the related field. For the above problems, no effective solution has been proposed yet.
[0004] It should be noted that the information disclosed in the above background art section is only used to enhance the understanding of the background of the present disclosure, and thus may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention
[0005] Embodiments of the present invention provide a cloud rendering method, device, storage medium and electronic device to at least solve the technical problems of high rendering cost and poor virtual reality effect of the cloud rendering method provided in the related technology.
[0006] According to one aspect of the embodiments of the present invention, a cloud rendering method is provided, including:
[0007] Obtaining texture information of multiple channels in a target texture map, where the target texture map is used to render a virtual cloud model; generating multiple target cloud masks based on the texture information; and performing a blending process on the multiple target cloud masks to obtain a first cloud rendering result corresponding to the virtual cloud model.
[0008] Optionally, the multiple channels include: a first color channel, a second color channel, and a third color channel, and the texture information includes: a first noise texture, a second noise texture, and a bottom shadow form texture corresponding to the virtual cloud model, wherein the first color channel is used to store the first noise texture, the second color channel is used to store the second noise texture, and the third color channel is used to store the bottom shadow form texture.
[0009] Optionally, generating multiple target cloud masks based on the texture information includes: generating multiple initial cloud masks based on the texture information; performing cloud mask calculations on the multiple initial cloud masks to obtain multiple target cloud masks.
[0010] Optionally, the multiple initial cloud masks include: a first initial cloud mask, a second initial cloud mask, a third initial cloud mask, and a fourth initial cloud mask. Generating multiple initial cloud masks based on the texture information includes: generating the first initial cloud mask based on the bottom shadow form texture, wherein the first initial cloud mask is used to determine the bottom cumulus cloud layer of the virtual cloud model; generating the second initial cloud mask, the third initial cloud mask, and the fourth initial cloud mask based on the first noise texture and the second noise texture, wherein the second initial cloud mask is used to determine the main noise layer of the virtual cloud model, the third initial cloud mask is used to determine the additional noise layer of the virtual cloud model, and the fourth initial cloud mask is used to determine the light-receiving coloring layer of the virtual cloud model.
[0011] Optionally, the multiple target cloud masks include: a first target cloud mask, a second target cloud mask, a third target cloud mask, and a fourth target cloud mask. Performing cloud mask calculations on the multiple initial cloud masks to obtain multiple target cloud masks includes: performing cloud mask calculations on the first initial cloud mask, the second initial cloud mask, the third initial cloud mask, and the fourth initial cloud mask to obtain the first target cloud mask, the second target cloud mask, the third target cloud mask, and the fourth target cloud mask; wherein, the first target cloud mask is used to simulate the effect of the self-shadow of the virtual cloud model following the real-time light change, the second target cloud mask is used to render the transparency of the virtual cloud model, the third target cloud mask is used to simulate the occlusion of the input light intensity when the virtual cloud model is a multi-layer cloud, and the fourth target cloud mask is used to transition the boundary between the virtual cloud model and the virtual associated model, and the virtual associated model is a virtual model obscured by the virtual cloud model.
[0012] Optionally, performing a blending process on the multiple target cloud masks to obtain a first cloud rendering result includes: in response to the virtual cloud model being a single-layer cloud, performing a blending process on the first target cloud mask, the second target cloud mask, and the fourth target cloud mask based on a first light intensity to obtain the first cloud rendering result, wherein the first light intensity is the original light intensity.
[0013] Optionally, blending multiple target cloud layer masks to obtain a first cloud layer rendering result includes: in response to the virtual cloud layer model being a multi-layer cloud, blending the first target cloud layer mask, the second target cloud layer mask, and the fourth target cloud layer mask based on the first illumination intensity to obtain a first processing result, and blending the first target cloud layer mask, the second target cloud layer mask, and the fourth target cloud layer mask based on the second illumination intensity to obtain a second processing result, wherein the first processing result is a rendering result of the top layer cloud with the highest altitude in the multi-layer cloud, and the second processing result is a rendering result of the remaining layers of cloud in the multi-layer cloud except the top layer cloud, the first illumination intensity is the original illumination intensity, and the second illumination intensity is determined by the first illumination intensity and the third target cloud layer mask; and the first cloud layer rendering result is determined using the first processing result and the second processing result.
[0014] Optionally, the above-mentioned cloud layer rendering method also includes: generating a fifth target cloud layer mask using the light source position, wherein the grayscale corresponding to the fifth target cloud layer mask is determined by the distance relative to the light source position; calculating a third light intensity using the first light intensity, the current light color and the fifth target cloud layer mask, wherein the first light intensity is the original light intensity; and adjusting the first cloud layer rendering result to a second cloud layer rendering result based on the third light intensity.
[0015] According to another aspect of an embodiment of the present invention, a cloud layer rendering device is provided, comprising:
[0016] An acquisition module is used to obtain texture information of multiple channels in a target map, wherein the target map is used to render a virtual cloud layer model; a generation module is used to generate multiple target cloud layer masks based on the texture information; and a rendering module is used to blend the multiple target cloud layer masks to obtain a first cloud layer rendering result corresponding to the virtual cloud layer model.
[0017] Optionally, the generating module is further configured to: generate a plurality of initial cloud masks based on texture information; and perform cloud mask calculation on the plurality of initial cloud masks to obtain a plurality of target cloud masks.
[0018] Optionally, the multiple initial cloud masks include: a first initial cloud mask, a second initial cloud mask, a third initial cloud mask and a fourth initial cloud mask, and the above-mentioned generation module is further used to: generate the first initial cloud mask based on the bottom shadow morphological texture, wherein the first initial cloud mask is used to determine the bottom cumulus cloud layer of the virtual cloud model; generate the second initial cloud mask, the third initial cloud mask and the fourth initial cloud mask based on the first noise texture and the second noise texture, wherein the second initial cloud mask is used to determine the main noise layer of the virtual cloud model, the third initial cloud mask is used to determine the additional noise layer of the virtual cloud model, and the fourth initial cloud mask is used to determine the light-receiving coloring layer of the virtual cloud model.
[0019] Optionally, the multiple target cloud masks include: a first target cloud mask, a second target cloud mask, a third target cloud mask, and a fourth target cloud mask. The generating module is further configured to: perform cloud mask calculation on the first initial cloud mask, the second initial cloud mask, the third initial cloud mask, and the fourth initial cloud mask to obtain the first target cloud mask, the second target cloud mask, the third target cloud mask, and the fourth target cloud mask. Among them, the first target cloud mask is used to simulate the effect that the self-shadow of the virtual cloud model follows the real-time illumination change, the second target cloud mask is used to render the transparency of the virtual cloud model, the third target cloud mask is used to simulate the occlusion of the input illumination intensity when the virtual cloud model is a multi-layer cloud, and the fourth target cloud mask is used to transition the boundary between the virtual cloud model and the virtual associated model, and the virtual associated model is a virtual model occluded by the virtual cloud model.
[0020] Optionally, the rendering module is further configured to: in response to the virtual cloud model being a single-layer cloud, perform mixing processing on the first target cloud mask, the second target cloud mask, and the fourth target cloud mask based on the first illumination intensity to obtain a first cloud rendering result, where the first illumination intensity is the original illumination intensity.
[0021] Optionally, the rendering module is further configured to: in response to the virtual cloud model being a multi-layer cloud, perform mixing processing on the first target cloud mask, the second target cloud mask, and the fourth target cloud mask based on the first illumination intensity to obtain a first processing result, and perform mixing processing on the first target cloud mask, the second target cloud mask, and the fourth target cloud mask based on the second illumination intensity to obtain a second processing result. Among them, the first processing result is the rendering result of the top layer cloud with the highest height in the multi-layer cloud, the second processing result is the rendering result of the remaining layers of clouds except the top layer cloud in the multi-layer cloud, the first illumination intensity is the original illumination intensity, and the second illumination intensity is determined by the first illumination intensity and the third target cloud mask; use the first processing result and the second processing result to determine the first cloud rendering result.
[0022] Optionally, the cloud rendering device further includes: an adjustment module, configured to generate a fifth target cloud mask using the light source position, where the gray scale corresponding to the fifth target cloud mask is determined by the distance relative to the light source position; calculate a third illumination intensity using the first illumination intensity, the current illumination color, and the fifth target cloud mask, where the first illumination intensity is the original illumination intensity; adjust the first cloud rendering result to a second cloud rendering result based on the third illumination intensity.
[0023] According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the cloud rendering method in any one of the above when running.
[0024] According to another aspect of the embodiments of the present invention, an electronic device is further provided, including: a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the cloud rendering method in any one of the above.
[0025] In at least some embodiments of the present invention, by obtaining texture information of multiple channels in a target texture map, where the target texture map is used to render a virtual cloud model, generating multiple target cloud masks based on the texture information, and adopting a method of mixing and processing the multiple target cloud masks, a first cloud rendering result corresponding to the virtual cloud model is obtained, achieving the purpose of rendering a cloud rendering result by mixing and processing multiple cloud masks based on the texture information of the texture map, thereby realizing the technical effect of rendering a more realistic cloud effect at a lower cost, and further solving the technical problems of high rendering cost and poor virtual reality effect of the rendering result in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The drawings described herein are used to provide a further understanding of the present invention, and constitute a part of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention, and do not constitute an improper limitation of the present invention. In the drawings:
[0027] Figure 1 is a hardware structure block diagram of a mobile terminal of a cloud rendering method according to an embodiment of the present invention;
[0028] Figure 2 is a flowchart of a cloud rendering method according to an embodiment of the present invention;
[0029] Figure 3 is a schematic diagram of an optional mask acquisition process according to an embodiment of the present invention;
[0030] Figure 4 is a schematic diagram of an optional target cloud mask according to an embodiment of the present invention;
[0031] Figure 5 is a schematic diagram of another optional target cloud mask according to an embodiment of the present invention;
[0032] Figure 6 is a schematic diagram of another optional target cloud mask according to an embodiment of the present invention;
[0033] Figure 7 is a schematic diagram of another optional target cloud mask according to an embodiment of the present invention;
[0034] Figure 8 is a schematic diagram of an optional cloud rendering result according to an embodiment of the present invention;
[0035] Figure 9 It is a structural block diagram of a cloud rendering device according to an embodiment of the present invention;
[0036] Figure 10 It is a structural block diagram of an optional cloud rendering device according to an embodiment of the present invention;
[0037] Figure 11 It is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed implementation manners
[0038] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0040] According to one embodiment of the present invention, an embodiment of a cloud rendering method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.
[0041] The cloud rendering method in one embodiment of the present invention can run on a terminal device or a server. The terminal device can be a local terminal device. When the cloud rendering method runs on the server, the method can be implemented and executed based on a cloud interaction system, where the cloud interaction system includes a server and client devices.
[0042] In an optional embodiment, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a gaming method based on cloud computing. In the cloud game operation mode, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the cloud layer rendering method are completed on the cloud game server. The role of the client device is to receive and send data and present the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, TV, computer, PDA, etc.; but the terminal device for information processing is the cloud game server in the cloud. When playing the game, the player operates the client device to send operation instructions to the cloud game server. The cloud game server runs the game according to the operation instructions, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.
[0043] In an optional embodiment, the terminal device can be a local terminal device. Taking a game as an example, the local terminal device stores the game program and is used to present the game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, conventionally downloading and installing the game program through an electronic device and running it. The local terminal device can provide the graphical user interface to the player in various ways, for example, it can be rendered and displayed on the terminal display, or provided to the player through holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present the graphical user interface, the graphical user interface including the game screen, and the processor is used to run the game, generate the graphical user interface, and control the display of the graphical user interface on the display screen.
[0044] In a possible implementation, an embodiment of the present invention provides a cloud layer rendering method, which provides a graphical user interface through a terminal device, wherein the terminal device can be the local terminal device mentioned above, or the client device in the cloud interaction system mentioned above.
[0045] Taking a mobile terminal running in a local terminal device as an example, the mobile terminal can be a smart phone (such as an Android phone, iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, abbreviated as MID), a PAD, a game console and other terminal devices. Figure 1 This is a hardware structure diagram of a mobile terminal for a cloud layer rendering method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1Only one processor 102 is shown (the processor 102 may include, but is not limited to, processing devices such as a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microcontroller unit (MCU), a field-programmable gate array (FPGA), a neural network processor (NPU), a tensor processing unit (TPU), an artificial intelligence (AI)-type processor, etc.) and a memory 104 for storing data. Optionally, the above mobile terminal may further include a transmission device 106 for communication functions, an input / output device 108, and a display device 110. Those of ordinary skill in the art can understand that Figure 1 The structure shown is only illustrative and does not limit the structure of the above mobile terminal. For example, the mobile terminal may further include more or fewer components than Figure 1 shown therein, or have a different configuration from Figure 1 that shown.
[0046] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the cloud rendering method in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, implements the above cloud rendering method. The memory 104 may include a high-speed random access memory and may further include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the mobile terminal through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0047] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one instance, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0048] The input in the input / output device 108 can come from multiple Human Interface Devices (HIDs). For example: keyboards and mice, gamepads, other dedicated game controllers (such as: steering wheels, fishing rods, dance pads, remote controls, etc.). Some HIDs can provide output functions in addition to input functions. For example: force feedback and vibration of gamepads, audio output of controllers, etc.
[0049] The display device 110 can be, for example, a Head-Up Display (HUD), a touchscreen Liquid Crystal Display (LCD), and a touch display (also known as a "touchscreen" or "touch display screen"). The LCD enables the user to interact with the user interface of the mobile terminal. In some embodiments, the above mobile terminal has a Graphical User Interface (GUI), and the user can perform human-computer interaction with the GUI through finger contacts and / or gestures on the touch-sensitive surface. The human-computer interaction function here optionally includes the following interactions: creating web pages, drawing, word processing, creating electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. The executable instructions for performing the above human-computer interaction functions are configured / stored in a computer program product or readable storage medium executable by one or more processors.
[0050] In this embodiment, a cloud rendering method running on the above mobile terminal is provided. Figure 2 It is a flowchart of a cloud rendering method according to an embodiment of the present invention, as Figure 2 shown. The method includes the following steps:
[0051] Step S21, obtaining texture information of multiple channels in a target texture map, where the target texture map is used to render a virtual cloud model;
[0052] The above target texture map can be a preset texture map for rendering a virtual cloud model. In an actual application scenario, the target texture map can be a noise resource texture map pre-made by artists. The target texture map can include multiple channels (such as RGB channels), and texture information can be stored in each channel of the multiple channels.
[0053] Step S22, generating multiple target cloud masks based on the texture information;
[0054] Based on the texture information of multiple channels in the above target texture map, the above multiple target cloud masks (Masks) can be generated, and the multiple target cloud masks can be used to render a virtual cloud model.
[0055] Specifically, generating multiple target cloud masks based on texture information further includes other method steps, which can be referred to in the further introduction of the embodiments of the present invention below and will not be elaborated here.
[0056] Step S23: Perform a blending process on the multiple target cloud masks to obtain a first cloud rendering result corresponding to the virtual cloud model.
[0057] Performing a blending process on the above multiple target cloud masks may be to perform multiple blending calculations and / or multiple result processes on the multiple target cloud masks. The calculation objects of each blending calculation may be some or all of the multiple target cloud masks among the multiple target cloud masks, and the processing objects of each result process may be the calculation results of each blending calculation.
[0058] By performing a blending process on the multiple target cloud masks, a first cloud rendering result corresponding to the above virtual cloud model can be obtained. In an actual application scenario, this first cloud rendering result can exhibit a better cloud virtual reality effect.
[0059] Specifically, performing a blending process on the multiple target cloud masks to obtain a first cloud rendering result corresponding to the virtual cloud model further includes other method steps, which can be referred to in the further introduction of the embodiments of the present invention below and will not be elaborated here.
[0060] In at least some embodiments of the present invention, by obtaining texture information of multiple channels in a target texture map, where the target texture map is used to render a virtual cloud model, generating multiple target cloud masks based on the texture information, and adopting a method of performing a blending process on the multiple target cloud masks, a first cloud rendering result corresponding to the virtual cloud model is obtained, achieving the purpose of rendering a cloud rendering result through the blending process of multiple cloud masks based on the texture information of the texture map, thereby realizing the technical effect of rendering a more realistic cloud effect at a lower cost, and further solving the technical problems of high rendering cost and poor virtual reality effect of the cloud rendering result in the related art.
[0061] The above method of the embodiments of the present invention will be further introduced below.
[0062] Optionally, in the above cloud rendering method, the multiple channels include: a first color channel, a second color channel, and a third color channel, and the texture information includes: a first noise texture, a second noise texture, and a bottom shadow form texture corresponding to the virtual cloud model, where the first color channel is used to store the first noise texture, the second color channel is used to store the second noise texture, and the third color channel is used to store the bottom shadow form texture.
[0063] The multiple channels of the above-mentioned target texture map may include: the above-mentioned first color channel (such as the R channel in the RGB channel), the above-mentioned first color channel (such as the G channel in the RGB channel), and the above-mentioned first color channel (such as the B channel in the RGB channel).
[0064] The above-mentioned texture information may include the above-mentioned first noise texture, the above-mentioned second noise texture, and the bottom shadow form texture corresponding to the above-mentioned virtual cloud model. The first noise texture and the second noise texture are usually different noise textures. Through these two different noise textures, the richness of the cloud form can be enhanced, and clouds with approximate shapes can be avoided. The bottom shadow state texture corresponding to the above-mentioned virtual cloud model can be used to render the light and shadow effect of the cloud, increase the volume sense of the cloud model, and thus enhance virtual reality.
[0065] For example, when rendering the cloud effect Cloud01 in the virtual game scene A, the Perlin Noise algorithm, the Fractal Noise algorithm, and the Voronoi Noise algorithm can be used to generate two different noise textures, denoted as Noise01 and Noise02; it is also necessary to obtain the bottom shadow form texture Shadow01 pre-made by the art staff.
[0066] Generating the resource texture Tax based on the noise texture Noise01, the noise texture Noise02, and the bottom shadow form texture Shadow01 may include: depositing the above-mentioned noise texture Noise01 into the R channel of the resource texture Tex; depositing the noise texture Noise02 into the G channel of the resource texture Tex; and depositing the bottom shadow form texture Shadow01 into the B channel of the resource texture Tex.
[0067] Optionally, in step S22, generating multiple target cloud masks based on the texture information may include the following execution steps:
[0068] Step S221, generating multiple initial cloud masks based on the texture information;
[0069] Step S222, performing cloud mask calculation on the multiple initial cloud masks to obtain multiple target cloud masks.
[0070] Still taking the rendering of the cloud effect Cloud01 in the virtual game scene A as an example, based on the resource texture Tax, multiple initial cloud masks can be generated, and through cloud mask calculation, multiple target cloud masks can be further generated.
[0071] Optionally, in step S221, the multiple initial cloud masks include: the first initial cloud mask, the second initial cloud mask, the third initial cloud mask, and the fourth initial cloud mask. Generating multiple initial cloud masks based on the texture information may include the following execution steps:
[0072] Step S2211: Generate a first initial cloud mask based on the bottom shadow form texture, where the first initial cloud mask is used to determine the bottom cumulus layer of the virtual cloud model.
[0073] Step S2212: Generate a second initial cloud mask, a third initial cloud mask, and a fourth initial cloud mask based on the first noise texture and the second noise texture, where the second initial cloud mask is used to determine the main noise layer of the virtual cloud model, the third initial cloud mask is used to determine the additional noise layer of the virtual cloud model, and the fourth initial cloud mask is used to determine the light-receiving shading layer of the virtual cloud model.
[0074] When rendering the cloud effect Cloud01 in the virtual game scene A, based on the resource texture Tax, the following four initial cloud masks can be generated: the Overcast Swirl mask (equivalent to the above-mentioned first initial cloud mask), the Main Clouds mask (equivalent to the above-mentioned second initial cloud mask), the Variation Clouds mask (equivalent to the above-mentioned third initial cloud mask), and the Shading Clouds mask (equivalent to the above-mentioned fourth initial cloud mask).
[0075] Specifically, generate the Overcast Swirl mask based on the bottom shadow form texture Shadow01 in the texture resource Tex. This Overcast Swirl mask is used to render the bottom cumulus layer in the virtual cloud model.
[0076] Specifically, generate the MainClouds mask, the Variation Clouds mask, and the Shading Clouds mask based on the noise texture Noise01 and the noise texture Noise02 in the texture resource Tex. Among them, the Main Clouds mask is the main noise layer of the cloud obtained by multiplying the noise texture Noise01 and the noise texture Noise02. The Variation Clouds mask is the additional cloud noise layer obtained by mapping the result of multiplying the noise texture Noise01 and the noise texture Noise02 to the numerical interval [0.5, 1]. The Shading Clouds mask is the light-receiving shading layer of the cloud obtained by offsetting and multiplying and superimposing the noise texture Noise01 and the noise texture Noise02 according to the real-time direction of light in the virtual game scene A.
[0077] It should be noted that the numerical range corresponding to the Variation Clouds mask is relatively smaller than that of the Main Clouds mask, which can be used to render a softer effect of the virtual cloud model. The Shading Clouds mask takes into account the influence of the real-time lighting direction (which can reflect weather changes) in the virtual game scene A on the cloud effect, and can be used to render the bottom self-shadow effect of the virtual cloud model affected by real-time lighting.
[0078] It should be noted that by generating the Main Clouds mask through the noise texture Noise01 and the noise texture Noise02, a more chaotic noise pattern can be obtained. This Main Clouds mask can be used to simulate the "fluffy" cloud effect in the real scene. In addition, based on this Main Clouds mask, other cloud masks involved in the actual application scenario can be further calculated.
[0079] It should be noted that the Shading Clouds mask is a mask generated based on the noise texture Noise01 and the noise texture Noise02 for simulating the cloud self-shadow effect. That is to say, the light and dark relationship in this Shading Clouds mask is associated with the shape of the noise texture. The Overcast Swirl mask is used to render the bottom cumulonimbus layer in the virtual cloud model, and this Overcast Swirl mask can be an optional mask in the actual application scenario. Figure 3 is a schematic diagram of an optional mask acquisition process according to an embodiment of the present invention. As Figure 3 shown, through the material resources in the preset game engine (which can be UE4 here), the texture resource Tex for rendering the cloud effect Cloud01 can be obtained (including the noise texture Noise01, the noise texture Noise02, and the bottom shadow form texture Shadow01 stored in each channel of the texture resource Tex).
[0080] Still as Figure 3 shown, in the preset game engine, through functions such as multiplication calculation, superposition calculation, and offset calculation, four initial cloud masks for rendering the cloud effect Cloud01 can be generated: the Overcast Swirl mask, the MainClouds mask, the Variation Clouds mask, and the Shading Clouds mask.
[0081] It should be noted that during the process of calculating and generating the above four initial cloud masks, the textures in each channel of the texture resource Tex are independent of each other and can be controlled separately, thereby improving the diversity of the above four initial cloud masks generated.
[0082] Optionally, in step S222, the multiple target cloud masks include: a first target cloud mask, a second target cloud mask, a third target cloud mask, and a fourth target cloud mask. The cloud mask calculation of the multiple initial cloud masks to obtain the multiple target cloud masks may include the following implementation steps:
[0083] Step S2221, perform cloud mask calculation on the first initial cloud mask, the second initial cloud mask, the third initial cloud mask, and the fourth initial cloud mask to obtain the first target cloud mask, the second target cloud mask, the third target cloud mask, and the fourth target cloud mask;
[0084] Among them, the first target cloud mask is used to simulate the effect of the self-shadow of the virtual cloud model following the real-time illumination change, the second target cloud mask is used to render the transparency of the virtual cloud model, the third target cloud mask is used to simulate the occlusion of the input illumination intensity when the virtual cloud model is a multi-layer cloud, and the fourth target cloud mask is used to transition the boundary between the virtual cloud model and the virtual associated model, where the virtual associated model is a virtual model obscured by the virtual cloud model.
[0085] Still taking the rendering of the cloud effect Cloud01 in the virtual game scene A as an example, performing cloud mask calculation on the four initial cloud masks can obtain four target cloud masks.
[0086] Figure 4 It is a schematic diagram of an optional target cloud mask according to an embodiment of the present invention. Based on the ShadingClouds mask, a cloud shading mask (as shown in Figure 4 ) for simulating the effect of the self-shadow of the virtual cloud model following the real-time illumination change can be calculated through an offset calculation function, denoted as Mask1 (equivalent to the above-mentioned first target cloud mask).
[0087] Figure 5 It is a schematic diagram of another optional target cloud mask according to an embodiment of the present invention. Based on the Main Clouds mask obtained by multiplying the noise texture Noise01 and the noise texture Noise02, determine the cloud transparency mask (as shown in Figure 5 ) and denote it as Mask2 (equivalent to the above-mentioned second target cloud mask).
[0088] Figure 6 It is a schematic diagram of another optional target cloud mask according to an embodiment of the present invention. Based on the VariationClouds mask, remap the transparency mask Mask2 to a smaller value range. For example, if the value range of the transparency mask Mask2 is [0, 1], map the value of the transparency mask Mask2 to [0.5, 1] to obtain the cloud soft shadow mask (as shown in Figure 6As shown in the figure, it is denoted as Mask3 (equivalent to the above-mentioned third target cloud mask).
[0089] Figure 7 It is a schematic diagram of another optional target cloud mask according to an embodiment of the present invention. Based on the OvercastSwirl mask, a cloud mask calculation is performed to obtain a mixed mask that is not affected by the transparency mask and is reciprocal to the transparency mask (as Figure 7 shown in the figure), denoted as Mask4 (equivalent to the above-mentioned fourth target cloud mask).
[0090] It should be noted that the specific process of the above cloud mask calculation can be a mixed calculation based on some or all of the Overcast Swirl mask, Main Clouds mask, Variation Clouds mask, and Shading Clouds mask.
[0091] It should be noted that the process of generating Mask1, Mask2, Mask3, and Mask4 based on the Overcast Swirl mask, Main Clouds mask, VariationClouds mask, and Shading Clouds mask is an optional calculation process, and does not limit the corresponding relationship between the Overcast Swirl mask, Main Clouds mask, Variation Clouds mask, and Shading Clouds mask and Mask1, Mask2, Mask3, and Mask4. Other achievable calculation methods can be selected in actual application scenarios. Optionally, in step S23, the process of mixing multiple target cloud masks to obtain the first cloud rendering result may include the following execution steps:
[0092] Step S231, in response to the virtual cloud model being a single-layer cloud, mix the first target cloud mask, the second target cloud mask, and the fourth target cloud mask based on the first light intensity to obtain the first cloud rendering result, where the first light intensity is the original light intensity.
[0093] The above first light intensity is the original light intensity related to the real-time light situation of the scene when making the virtual cloud model in the actual application scenario.
[0094] Still taking the rendering of the cloud effect Cloud01 in the virtual game scene A as an example, when the cloud model corresponding to the cloud effect Cloud01 is a single-layer cloud, mixing Mask1, Mask2, and Mask4 in the target cloud mask can obtain the corresponding single-layer cloud rendering result (equivalent to the above first cloud rendering result).
[0095] Specifically, the rendered result of a single-layer cloud can be represented by the output cloud layer coloring MaskC1. The method for obtaining the output cloud layer coloring MaskC1 through blending can be to use the blending mask Mask4 as a coefficient to perform a blending calculation on the transparency mask Mask2 and the cloud layer coloring mask Mask1, as shown in the following formula (1):
[0096] MaskC1 = Mask4 × Mask2 + (1 - Mask4) × Mask1 Formula (1)
[0097] In the above formula (1), Mask1, Mask2, and Mask4 in the target cloud mask are associated with the original light intensity.
[0098] Optionally, in step S23, the steps for obtaining the first cloud layer rendering result by performing a blending process on multiple target cloud masks may include the following:
[0099] Step S232: In response to the virtual cloud model being a multi-layer cloud, based on the first light intensity, perform a blending process on the first target cloud mask, the second target cloud mask, and the fourth target cloud mask to obtain a first processing result, and based on the second light intensity, perform a blending process on the first target cloud mask, the second target cloud mask, and the fourth target cloud mask to obtain a second processing result. Among them, the first processing result is the rendering result of the top layer cloud with the highest height in the multi-layer cloud, and the second processing result is the rendering result of the remaining cloud layers except the top layer cloud in the multi-layer cloud. The first light intensity is the original light intensity, and the second light intensity is determined by the first light intensity and the third target cloud mask;
[0100] Step S233: Use the first processing result and the second processing result to determine the first cloud layer rendering result.
[0101] Still taking the rendering of the cloud effect Cloud01 in the virtual game scene A as an example, when the cloud model corresponding to the cloud effect Cloud01 is a two-layer cloud, the calculation method of the output cloud layer coloring MaskD1 (equivalent to the above first processing result) of the higher layer cloud in the two-layer cloud can be as shown in the following formula (2):
[0102] MaskD1 = Mask4 × Mask2 + (1 - Mask4) × Mask1 Formula (2)
[0103] In the above formula (2), Mask1, Mask2, and Mask4 in the target cloud mask are associated with the original light intensity.
[0104] When calculating the output cloud layer coloring MaskD2 of the lower cloud layer in the above double-layer cloud, it is necessary to consider the occlusion of the light intensity by the higher cloud layer above. Multiplying the original light intensity by the cloud layer soft shadow mask Mask3 can obtain the input light intensity corresponding to the lower cloud layer above.
[0105] Based on the input light intensity corresponding to the lower cloud layer above, the output cloud layer coloring MaskD2 of the lower cloud layer (equivalent to the second processing result above) can be calculated according to the method of the following formula (3):
[0106] MaskD2 = Mask4 × Mask2 + (1 - Mask4) × Mask1 Formula (3)
[0107] In the above formula (3), Mask1, Mask2, and Mask4 in the target cloud layer mask are associated with the input light intensity corresponding to the lower cloud layer.
[0108] Figure 8 It is a schematic diagram of an optional cloud layer rendering result according to an embodiment of the present invention. Superimposing the output cloud layer coloring MaskD1 of the higher cloud layer above and the output cloud layer coloring MaskD2 of the lower cloud layer can obtain the cloud layer rendering result of the above double-layer cloud (as Figure 8 shown).
[0109] It is easy to notice that by adjusting the light intensity through the cloud layer soft shadow mask to simulate the occlusion of the higher cloud layer by the lower cloud layer in the multi-layer cloud, the virtual reality effect of the virtual cloud model rendering result can be enhanced.
[0110] Optionally, the above cloud layer rendering method may further include the following execution steps:
[0111] Step S24, generating a fifth target cloud layer mask using the light source position, where the gray scale corresponding to the fifth target cloud layer mask is determined by the distance relative to the light source position;
[0112] Step S25, calculating the third light intensity using the first light intensity, the current light color, and the fifth target cloud layer mask, where the first light intensity is the original light intensity;
[0113] Step S26, adjusting the first cloud layer rendering result to the second cloud layer rendering result based on the third light intensity.
[0114] In an actual application scenario, the above light source position can be the position of a light source (such as the sun, moon, stars, glowing flying objects, etc.) in a virtual game scene. Taking this light source position as the center, a circular grayscale gradient mask (the grayscale gets stronger the farther away from the center) is generated, denoted as Mask5 (equivalent to the above-mentioned fifth target cloud mask). The above current light color can be the color of the light source in the virtual game scene. The above first light intensity can be the original light intensity of the light source in the virtual game scene. Based on this first light intensity, this current light color, and the above circular grayscale gradient mask Mask5, the real-time light intensity of the light source (equivalent to the above-mentioned third light intensity) can be calculated.
[0115] Based on the above third light intensity, the first cloud rendering result can be adjusted to the second cloud rendering result. When the first cloud rendering result is the output cloud coloring of the virtual cloud model, the output cloud coloring can be multiplied by the third light intensity to obtain the adjusted output cloud coloring. Specifically, for example: in a certain virtual game scene, the center position of the circular mask MaskY is determined according to the position of the sun. By controlling the radius, coloring intensity, and edge grayscale threshold of the circular mask MaskY, the circular mask MaskY can be generated. This circular mask MaskY can be used to calculate the real-time light intensity of the sun in this virtual game scene. By adjusting the cloud rendering result in this virtual game scene with the real-time light intensity, the visual performance of the adjusted cloud rendering result can be that the clouds near the sun are brighter, and the clouds farther away from the sun are darker.
[0116] It is easy to notice that the light source (including the light source position, light color, etc.) in the above virtual game scene can be changed in real time, and the light source information can be obtained in real time from the real-time weather system associated with this virtual game scene to enhance the virtual display effect of cloud rendering. Through the above circular grayscale gradient mask, the effect of gradually changing light intensity can be displayed on the sky sphere of the virtual game scene, enhancing the sense of volume in the coloring effect of the virtual cloud model.
[0117] It should be noted that through the method provided by the embodiments of the present invention, the color display parameter of the Overcast Swirl mask can also be increased to increase the cumulus cloud shadow effect, which is suitable for rendering the effect of overcast clouds in a virtual game scene.
[0118] It is easy to notice that compared with the cloud rendering method provided by the related art, through the method provided by the embodiments of the present invention, the performance consumption required for rendering the virtual cloud model based on one texture resource is less, which is convenient for mobile applications.
[0119] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0120] In this embodiment, a cloud rendering device is further provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0121] Figure 9 is a structural block diagram of a cloud rendering device according to an embodiment of the present invention. As Figure 9 shown, the device includes: an acquisition module 91, configured to acquire texture information of multiple channels in a target texture map, where the target texture map is used to render a virtual cloud model; a generation module 92, configured to generate multiple target cloud masks based on the texture information; a rendering module 93, configured to perform a blending process on the multiple target cloud masks to obtain a first cloud rendering result corresponding to the virtual cloud model.
[0122] Optionally, the above generation module 92 is further configured to: generate multiple initial cloud masks based on the texture information; perform cloud mask calculation on the multiple initial cloud masks to obtain multiple target cloud masks.
[0123] Optionally, the multiple initial cloud masks include: a first initial cloud mask, a second initial cloud mask, a third initial cloud mask, and a fourth initial cloud mask. The above generation module 92 is further configured to: generate the first initial cloud mask based on the bottom shadow form texture, where the first initial cloud mask is used to determine the bottom cumulus cloud layer of the virtual cloud model; generate the second initial cloud mask, the third initial cloud mask, and the fourth initial cloud mask based on the first noise texture and the second noise texture, where the second initial cloud mask is used to determine the main noise layer of the virtual cloud model, the third initial cloud mask is used to determine the additional noise layer of the virtual cloud model, and the fourth initial cloud mask is used to determine the light-receiving coloring layer of the virtual cloud model.
[0124] Optionally, the multiple target cloud masks include: a first target cloud mask, a second target cloud mask, a third target cloud mask, and a fourth target cloud mask. The generating module 92 is further configured to: perform cloud mask calculation on the first initial cloud mask, the second initial cloud mask, the third initial cloud mask, and the fourth initial cloud mask to obtain the first target cloud mask, the second target cloud mask, the third target cloud mask, and the fourth target cloud mask. Among them, the first target cloud mask is used to simulate the effect of the self-shadow of the virtual cloud model following the real-time illumination change, the second target cloud mask is used to render the transparency of the virtual cloud model, the third target cloud mask is used to simulate the occlusion of the input illumination intensity when the virtual cloud model is a multi-layer cloud, and the fourth target cloud mask is used to transition the boundary between the virtual cloud model and the virtual associated model, where the virtual associated model is a virtual model occluded by the virtual cloud model.
[0125] Optionally, the rendering module 93 is further configured to: in response to the virtual cloud model being a single-layer cloud, perform a mixing process on the first target cloud mask, the second target cloud mask, and the fourth target cloud mask based on the first illumination intensity to obtain a first cloud rendering result, where the first illumination intensity is the original illumination intensity.
[0126] Optionally, the rendering module 93 is further configured to: in response to the virtual cloud model being a multi-layer cloud, perform a mixing process on the first target cloud mask, the second target cloud mask, and the fourth target cloud mask based on the first illumination intensity to obtain a first processing result, and perform a mixing process on the first target cloud mask, the second target cloud mask, and the fourth target cloud mask based on the second illumination intensity to obtain a second processing result. Among them, the first processing result is the rendering result of the top layer cloud with the highest height in the multi-layer cloud, the second processing result is the rendering result of the remaining layers of the cloud except the top layer cloud in the multi-layer cloud, the first illumination intensity is the original illumination intensity, and the second illumination intensity is determined by the first illumination intensity and the third target cloud mask; use the first processing result and the second processing result to determine the first cloud rendering result.
[0127] Optionally, Figure 10 is a structural block diagram of an optional cloud rendering device according to an embodiment of the present invention. As Figure 10 shown, in addition to including all the modules shown Figure 9 shown, the device further includes: an adjustment module 94, configured to generate a fifth target cloud mask using the light source position, where the gray scale corresponding to the fifth target cloud mask is determined by the distance relative to the light source position; calculate a third illumination intensity using the first illumination intensity, the current illumination color, and the fifth target cloud mask, where the first illumination intensity is the original illumination intensity; adjust the first cloud rendering result to a second cloud rendering result based on the third illumination intensity.
[0128] It should be noted that the above-mentioned modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: all the above-mentioned modules are located in the same processor; or, the above-mentioned modules are respectively located in different processors in any combination form.
[0129] Optionally, in this embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drive, read-only memory (ROM for short), random access memory (RAM for short), mobile hard disk, magnetic disk or optical disc and other various media that can store computer programs.
[0130] Optionally, in this embodiment, the above computer-readable storage medium may be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.
[0131] Optionally, in this embodiment, the above computer-readable storage medium may be set to store a computer program for executing the following steps:
[0132] Obtain the texture information of multiple channels in the target texture map, where the target texture map is used to render the virtual cloud model; generate multiple target cloud masks based on the texture information; perform a blending process on the multiple target cloud masks to obtain the first cloud rendering result corresponding to the virtual cloud model.
[0133] Optionally, the multiple channels include: a first color channel, a second color channel, and a third color channel, and the texture information includes: a first noise texture, a second noise texture, and a bottom shadow morphology texture corresponding to the virtual cloud model, where the first color channel is used to store the first noise texture, the second color channel is used to store the second noise texture, and the third color channel is used to store the bottom shadow morphology texture.
[0134] Optionally, generating multiple target cloud masks based on the texture information includes: generating multiple initial cloud masks based on the texture information; performing cloud mask calculation on the multiple initial cloud masks to obtain multiple target cloud masks.
[0135] Optionally, the multiple initial cloud masks include: a first initial cloud mask, a second initial cloud mask, a third initial cloud mask, and a fourth initial cloud mask. Generating the multiple initial cloud masks based on texture information includes: generating the first initial cloud mask based on the bottom shadow form texture, where the first initial cloud mask is used to determine the bottom cumulus layer of the virtual cloud model; generating the second initial cloud mask, the third initial cloud mask, and the fourth initial cloud mask based on the first noise texture and the second noise texture, where the second initial cloud mask is used to determine the main noise layer of the virtual cloud model, the third initial cloud mask is used to determine the additional noise layer of the virtual cloud model, and the fourth initial cloud mask is used to determine the light-receiving shading layer of the virtual cloud model.
[0136] Optionally, the multiple target cloud masks include: a first target cloud mask, a second target cloud mask, a third target cloud mask, and a fourth target cloud mask. Performing cloud mask calculation on the multiple initial cloud masks to obtain the multiple target cloud masks includes: performing cloud mask calculation on the first initial cloud mask, the second initial cloud mask, the third initial cloud mask, and the fourth initial cloud mask to obtain the first target cloud mask, the second target cloud mask, the third target cloud mask, and the fourth target cloud mask; where the first target cloud mask is used to simulate the effect of the self-shadow of the virtual cloud model following the real-time light change, the second target cloud mask is used to render the transparency of the virtual cloud model, the third target cloud mask is used to simulate the occlusion of the input light intensity when the virtual cloud model is a multi-layer cloud, and the fourth target cloud mask is used to transition the boundary between the virtual cloud model and the virtual associated model, and the virtual associated model is a virtual model obscured by the virtual cloud model.
[0137] Optionally, performing a blending process on the multiple target cloud masks to obtain a first cloud rendering result includes: in response to the virtual cloud model being a single-layer cloud, performing a blending process on the first target cloud mask, the second target cloud mask, and the fourth target cloud mask based on the first light intensity to obtain the first cloud rendering result, where the first light intensity is the original light intensity.
[0138] Optionally, performing blending processing on multiple target cloud masks to obtain a first cloud rendering result includes: in response to the virtual cloud model being a multi-layer cloud, performing blending processing on the first target cloud mask, the second target cloud mask, and the fourth target cloud mask based on a first light intensity to obtain a first processing result, and performing blending processing on the first target cloud mask, the second target cloud mask, and the fourth target cloud mask based on a second light intensity to obtain a second processing result, where the first processing result is the rendering result of the top layer cloud with the highest altitude in the multi-layer cloud, the second processing result is the rendering result of the remaining layers of the cloud except the top layer cloud in the multi-layer cloud, the first light intensity is the original light intensity, and the second light intensity is determined by the first light intensity and the third target cloud mask; determining the first cloud rendering result by using the first processing result and the second processing result.
[0139] Optionally, the above cloud rendering method further includes: generating a fifth target cloud mask by using the light source position, where the gray scale corresponding to the fifth target cloud mask is determined by the distance relative to the light source position; calculating a third light intensity by using the first light intensity, the current light color, and the fifth target cloud mask, where the first light intensity is the original light intensity; and adjusting the first cloud rendering result to a second cloud rendering result based on the third light intensity.
[0140] In at least some embodiments of the present invention, by obtaining texture information of multiple channels in a target texture map, where the target texture map is used to render a virtual cloud model, generating multiple target cloud masks based on the texture information, and adopting a method of performing blending processing on the multiple target cloud masks, a first cloud rendering result corresponding to the virtual cloud model is obtained, achieving the purpose of rendering a cloud rendering result through blending processing of multiple cloud masks based on the texture information of the texture map, thereby realizing the technical effect of rendering a more realistic cloud effect at a lower cost, and further solving the technical problems of high rendering cost and poor virtual reality effect of the cloud rendering result in the related art.
[0141] Through the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software or by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present invention.
[0142] In an exemplary embodiment of the present invention, a program product capable of implementing the above method of this embodiment is stored on a computer-readable storage medium. In some possible implementation manners, various aspects of the embodiments of the present invention can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section.
[0143] The program product for implementing the above method according to an embodiment of the present invention can be a portable compact disc read-only memory (CD-ROM) and includes program code, and can run on a terminal device, such as a personal computer. However, the program product of the embodiments of the present invention is not limited thereto. In the embodiments of the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device.
[0144] The above program product can adopt any combination of one or more computer-readable media. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0145] It should be noted that the program code contained on the computer-readable storage medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0146] An embodiment of the present invention also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0147] Optionally, the above electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above processor, and the input / output device is connected to the above processor.
[0148] Optionally, in this embodiment, the above processor can be configured to execute the following steps through the computer program:
[0149] Obtain the texture information of multiple channels in the target texture map, where the target texture map is used to render the virtual cloud model; generate multiple target cloud masks based on the texture information; perform blending processing on the multiple target cloud masks to obtain the first cloud rendering result corresponding to the virtual cloud model.
[0150] Optionally, the multiple channels include: a first color channel, a second color channel, and a third color channel, and the texture information includes: a first noise texture, a second noise texture, and a bottom shadow morphology texture corresponding to the virtual cloud model, where the first color channel is used to store the first noise texture, the second color channel is used to store the second noise texture, and the third color channel is used to store the bottom shadow morphology texture.
[0151] Optionally, generating multiple target cloud masks based on the texture information includes: generating multiple initial cloud masks based on the texture information; performing cloud mask calculation on the multiple initial cloud masks to obtain multiple target cloud masks.
[0152] Optionally, the multiple initial cloud masks include: a first initial cloud mask, a second initial cloud mask, a third initial cloud mask, and a fourth initial cloud mask. Generating multiple initial cloud masks based on the texture information includes: generating the first initial cloud mask based on the bottom shadow morphology texture, where the first initial cloud mask is used to determine the bottom cumulus cloud layer of the virtual cloud model; generating the second initial cloud mask, the third initial cloud mask, and the fourth initial cloud mask based on the first noise texture and the second noise texture, where the second initial cloud mask is used to determine the main noise layer of the virtual cloud model, the third initial cloud mask is used to determine the additional noise layer of the virtual cloud model, and the fourth initial cloud mask is used to determine the light-receiving shading layer of the virtual cloud model.
[0153] Optionally, the multiple target cloud masks include: a first target cloud mask, a second target cloud mask, a third target cloud mask, and a fourth target cloud mask. Performing cloud mask calculation on the multiple initial cloud masks to obtain multiple target cloud masks includes: performing cloud mask calculation on the first initial cloud mask, the second initial cloud mask, the third initial cloud mask, and the fourth initial cloud mask to obtain the first target cloud mask, the second target cloud mask, the third target cloud mask, and the fourth target cloud mask; where the first target cloud mask is used to simulate the effect of the self-shadow of the virtual cloud model following the real-time light change, the second target cloud mask is used to render the transparency of the virtual cloud model, the third target cloud mask is used to simulate the occlusion of the input light intensity when the virtual cloud model is a multi-layer cloud, and the fourth target cloud mask is used to transition the boundary between the virtual cloud model and the virtual associated model, and the virtual associated model is a virtual model obscured by the virtual cloud model.
[0154] Optionally, mixing multiple target cloud masks to obtain a first cloud rendering result includes: in response to the virtual cloud model being a single-layer cloud, mixing the first target cloud mask, the second target cloud mask, and the fourth target cloud mask based on a first light intensity to obtain the first cloud rendering result, where the first light intensity is the original light intensity.
[0155] Optionally, mixing multiple target cloud masks to obtain a first cloud rendering result includes: in response to the virtual cloud model being a multi-layer cloud, mixing the first target cloud mask, the second target cloud mask, and the fourth target cloud mask based on a first light intensity to obtain a first processing result, and mixing the first target cloud mask, the second target cloud mask, and the fourth target cloud mask based on a second light intensity to obtain a second processing result, where the first processing result is the rendering result of the top layer cloud with the highest height in the multi-layer cloud, the second processing result is the rendering result of the remaining layers of the cloud except the top layer cloud in the multi-layer cloud, the first light intensity is the original light intensity, and the second light intensity is determined by the first light intensity and the third target cloud mask; determining the first cloud rendering result using the first processing result and the second processing result.
[0156] Optionally, the above cloud rendering method further includes: generating a fifth target cloud mask using the light source position, where the gray scale corresponding to the fifth target cloud mask is determined by the distance relative to the light source position; calculating a third light intensity using the first light intensity, the current light color, and the fifth target cloud mask, where the first light intensity is the original light intensity; adjusting the first cloud rendering result to a second cloud rendering result based on the third light intensity.
[0157] In at least some embodiments of the present invention, by obtaining texture information of multiple channels in a target texture map, where the target texture map is used to render a virtual cloud model, generating multiple target cloud masks based on the texture information, and adopting a method of mixing multiple target cloud masks to obtain a first cloud rendering result corresponding to the virtual cloud model, the purpose of rendering a cloud rendering result through mixing multiple cloud masks based on the texture information of the texture map is achieved, thereby realizing the technical effect of rendering a more realistic cloud effect at a lower cost, and further solving the technical problems of high rendering cost and poor virtual reality effect of the cloud rendering method provided in the related art.
[0158] Figure 11 is a schematic diagram of an electronic device according to an embodiment of the present invention. As Figure 11 shown, the electronic device 1100 is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention.
[0159] As Figure 11As shown, the electronic device 1100 is presented in the form of a general computing device. The components of the electronic device 1100 may include, but are not limited to: the at least one processor 1110 described above, the at least one memory 1120 described above, a bus 1130 connecting different system components (including the memory 1120 and the processor 1110), and a display 1140.
[0160] Among them, the above-mentioned memory 1120 stores program codes, and the program codes can be executed by the processor 1110, so that the processor 1110 executes the steps according to various exemplary embodiments of the present invention described in the above method part of the embodiments of the present invention.
[0161] The memory 1120 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 11201 and / or a cache storage unit 11202, and may further include a read-only storage unit (ROM) 11203, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories.
[0162] In some instances, the memory 1120 may further include a program / utility 11204 having a set (at least one) of program modules 11205. Such program modules 11205 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. The implementation of a network environment may be included in each or some combination of these examples. The memory 1120 may further include a memory remotely provided with respect to the processor 1110, and these remote memories may be connected to the electronic device 1100 through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0163] The bus 1130 may represent one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, an accelerated graphics port, a processor 1110, or a local bus using any bus structure in a variety of bus structures.
[0164] The display 1140 may be, for example, a touch-screen liquid crystal display (LCD), and the liquid crystal display enables a user to interact with the user interface of the electronic device 1100.
[0165] Optionally, the electronic device 1100 can also communicate with one or more external devices 1200 (such as a keyboard, a pointing device, a Bluetooth device, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 1100, and / or communicate with any device that enables the electronic device 1100 to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 1150. Moreover, the electronic device 1100 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 1160. As Figure 11 shown, the network adapter 1160 communicates with other modules of the electronic device 1100 through the bus 1130. It should be understood that although Figure 11 not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 1100, which can include but are not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0166] The above-mentioned electronic device 1100 can also include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply, and / or a camera.
[0167] Those of ordinary skill in the art can understand that Figure 11 the structure shown is only schematic and does not limit the structure of the above-mentioned electronic device. For example, the electronic device 1100 can also include more or fewer components than those shown in Figure 11 the figure, or have a configuration different from that shown in Figure 11 the figure. The memory 1120 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the cloud rendering method in the embodiments of the present invention. The processor 1110 executes various functional applications and data processing by running the computer program stored in the memory 1120, that is, implements the above-mentioned cloud rendering method.
[0168] The serial numbers of the above-mentioned embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0169] In the above-mentioned embodiments of the present invention, the descriptions of each embodiment have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0170] In several embodiments provided by the present invention, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of units or modules can be in electrical or other forms.
[0171] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0172] In addition, in each embodiment of the present invention, the functional units 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-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0173] If the above-mentioned 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 computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, 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 computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The foregoing storage medium includes: USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs and other various media that can store program codes.
[0174] The above is only the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A cloud rendering method, characterized in that, Including: Obtain the texture information of multiple channels in the target texture map, where the target texture map is used to render a virtual cloud model; Generate multiple initial cloud masks based on the texture information, where the multiple initial cloud masks include: a first initial cloud mask, a second initial cloud mask, a third initial cloud mask, and a fourth initial cloud mask. The first initial cloud mask is used to determine the bottom cumulus layer of the virtual cloud model, the second initial cloud mask is used to determine the main noise layer of the virtual cloud model, the third initial cloud mask is used to determine the additional noise layer of the virtual cloud model, and the fourth initial cloud mask is used to determine the light-receiving shading layer of the virtual cloud model; Perform cloud mask calculation on the multiple initial cloud masks to obtain multiple target cloud masks, where the multiple target cloud masks include: a first target cloud mask, a second target cloud mask, a third target cloud mask, and a fourth target cloud mask. The first target cloud mask is used to simulate the effect of the self-shadow of the virtual cloud model following the real-time lighting change, the second target cloud mask is used to render the transparency of the virtual cloud model, the third target cloud mask is used to simulate the occlusion of the input light intensity when the virtual cloud model is a multi-layer cloud, and the fourth target cloud mask is used to transition the boundary between the virtual cloud model and the virtual associated model, where the virtual associated model is a virtual model obscured by the virtual cloud model; Perform a blending process on the multiple target cloud masks to obtain a first cloud rendering result corresponding to the virtual cloud model.
2. The cloud rendering method according to claim 1, wherein The multiple channels include: a first color channel, a second color channel, and a third color channel. The texture information includes: a first noise texture, a second noise texture, and a bottom shadow morphology texture corresponding to the virtual cloud model. Among them, the first color channel is used to store the first noise texture, the second color channel is used to store the second noise texture, and the third color channel is used to store the bottom shadow morphology texture.
3. The cloud rendering method according to claim 2, wherein, Generating the multiple initial cloud masks based on the texture information includes: Generate the first initial cloud mask based on the bottom shadow morphology texture; Generate the second initial cloud mask, the third initial cloud mask, and the fourth initial cloud mask based on the first noise texture and the second noise texture.
4. The cloud rendering method according to claim 3, wherein Performing cloud mask calculation on the multiple initial cloud masks to obtain the multiple target cloud masks includes: Perform cloud mask calculation on the first initial cloud mask, the second initial cloud mask, the third initial cloud mask, and the fourth initial cloud mask to obtain the first target cloud mask, the second target cloud mask, the third target cloud mask, and the fourth target cloud mask.
5. The cloud rendering method according to claim 4, wherein Performing a blending process on the multiple target cloud masks to obtain the first cloud rendering result includes: In response to the virtual cloud layer model being a single-layer cloud, perform a blending process on the first target cloud layer mask, the second target cloud layer mask, and the fourth target cloud layer mask based on a first light intensity to obtain the first cloud layer rendering result, where the first light intensity is the original light intensity.
6. The cloud rendering method according to claim 4, wherein Performing a blending process on the multiple target cloud layer masks to obtain the first cloud layer rendering result includes: In response to the virtual cloud layer model being a multi-layer cloud, perform a blending process on the first target cloud layer mask, the second target cloud layer mask, and the fourth target cloud layer mask based on a first light intensity to obtain a first processing result, and perform a blending process on the first target cloud layer mask, the second target cloud layer mask, and the fourth target cloud layer mask based on a second light intensity to obtain a second processing result, where the first processing result is the rendering result of the top layer cloud with the highest height in the multi-layer cloud, the second processing result is the rendering result of the remaining layers of the cloud except the top layer cloud in the multi-layer cloud, the first light intensity is the original light intensity, and the second light intensity is determined by the first light intensity and the third target cloud layer mask; Use the first processing result and the second processing result to determine the first cloud layer rendering result.
7. The cloud rendering method according to claim 1, wherein The cloud layer rendering method further includes: Generate a fifth target cloud layer mask using the light source position, where the gray scale corresponding to the fifth target cloud layer mask is determined by the distance relative to the light source position; Calculate a third light intensity using the first light intensity, the current light color, and the fifth target cloud layer mask, where the first light intensity is the original light intensity; Adjust the first cloud layer rendering result to a second cloud layer rendering result based on the third light intensity.
8. A cloud rendering device, characterized in that, Includes: An acquisition module for acquiring texture information of multiple channels in a target texture map, where the target texture map is used to render a virtual cloud layer model; A generation module, configured to generate a plurality of initial cloud masks based on the texture information, wherein the plurality of initial cloud masks include: a first initial cloud mask, a second initial cloud mask, a third initial cloud mask, and a fourth initial cloud mask. The first initial cloud mask is used to determine the bottom cumulus cloud layer of the virtual cloud model; the second initial cloud mask is used to determine the main noise layer of the virtual cloud model; the third initial cloud mask is used to determine the additional noise layer of the virtual cloud model; the fourth initial cloud mask is used to determine the light-receiving shading layer of the virtual cloud model. Perform cloud mask calculation on the plurality of initial cloud masks to obtain a plurality of target cloud masks, wherein the plurality of target cloud masks include: a first target cloud mask, a second target cloud mask, a third target cloud mask, and a fourth target cloud mask. The first target cloud mask is used to simulate the effect of the self-shadow of the virtual cloud model following the real-time light change; the second target cloud mask is used to render the transparency of the virtual cloud model; the third target cloud mask is used to simulate the occlusion of the input light intensity when the virtual cloud model is a multi-layer cloud; the fourth target cloud mask is used to transition the boundary between the virtual cloud model and the virtual associated model, and the virtual associated model is a virtual model obscured by the virtual cloud model; A rendering module, configured to perform a blending process on the plurality of target cloud masks to obtain a first cloud rendering result corresponding to the virtual cloud model.
9. A computer-readable storage medium, characterized in that, The computer program is stored in the storage medium, wherein the computer program is configured to execute the cloud rendering method described in any one of claims 1 to 7 when running.
10. An electronic device, comprising a memory and a processor, characterized in that, The computer program is stored in the memory, and the processor is configured to run the computer program to execute the cloud rendering method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for processing cloud mask map
CN108230430A
Display control method and device in game
CN114359467A