Image processing method and device, storage medium and electronic equipment

CN119963714AActive Publication Date: 2025-05-09NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411997134.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-09
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

The cloud layer effect generated by the existing image processing methods is relatively single, resulting in poor cloud image generation effect.

Method used

By obtaining the cloud map corresponding to the cloud surface model in the virtual scene, mask maps are drawn in multiple map channels of the cloud surface map, and each mask map indicates a cloud display effect; based on the texture sampling coordinates corresponding to the vertices in the cloud surface model, each mask map is sampled to obtain the pixel values ​​sampled by the vertices in each mask map; obtain the color parameters set for each mask map; based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, the cloud surface model is rendered to obtain the cloud image.

Benefits of technology

It realizes the generation of cloud images with multiple cloud display effects, which improves the flexibility and diversity of cloud images, and significantly improves the generation effect of cloud images through multi-level color change effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119963714A_ABST
    Figure CN119963714A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image processing method and device, a storage medium and electronic equipment. A cloud layer map corresponding to a cloud layer patch model in a virtual scene is obtained, mask maps are drawn in a plurality of map channels of the cloud layer map, and each mask map indicates a cloud layer display effect; based on texture sampling coordinates corresponding to vertexes in the cloud layer patch model, sampling each mask image to obtain pixel values sampled by the vertexes in each mask image; acquiring color parameters set for each mask image; and rendering the cloud layer patch model based on the pixel values sampled by the vertexes in the mask images and the color parameters corresponding to the mask images to obtain a cloud layer image. Therefore, the cloud layer image with various cloud layer display effects can be generated, the flexibility and diversity of cloud layer image generation are improved, multi-layer color change of the cloud layer effect can be realized based on the color parameters corresponding to the mask images, and the cloud layer image generation effect is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to an image processing method, device, storage medium and electronic device. Background Art

[0002] With the rapid development of life and technology, people often use game applications for entertainment. In some games, it is often necessary to generate scenes with cloud effects. In existing image processing methods for achieving cloud effects, customized cloud effects are often achieved by directly drawing cloud texture maps.

[0003] In the process of research and practice of the prior art, it is found that the cloud layer effect generated by the existing image processing method is relatively simple, resulting in poor cloud layer image generation effect. Summary of the invention

[0004] The embodiments of the present application provide an image processing method, device, storage medium and electronic device, which can generate cloud images with a variety of cloud display effects, improve the flexibility and diversity of cloud image generation, and based on the color parameters corresponding to each mask image, realize multi-level color changing of cloud effects, effectively improving the generation effect of cloud images.

[0005] The present application provides an image processing method, including:

[0006] Obtaining a cloud layer map corresponding to a cloud layer model in a virtual scene, wherein a plurality of map channels of the cloud layer map are drawn with mask maps, and each mask map indicates a cloud layer display effect;

[0007] Based on the texture sampling coordinates corresponding to the vertices in the cloud layer model, sampling each of the mask images to obtain the pixel values ​​sampled by the vertices in each of the mask images;

[0008] Obtaining color parameters set for each of the mask images;

[0009] Based on the pixel values ​​sampled by the vertices in the mask images and the color parameters corresponding to the mask images, the cloud layer model is rendered to obtain a cloud layer image.

[0010] Accordingly, an embodiment of the present application provides an image processing device, including:

[0011] A first acquisition unit is used to acquire a cloud layer map corresponding to a cloud layer model in a virtual scene, wherein a plurality of map channels of the cloud layer map are drawn with mask maps, and each mask map indicates a cloud layer display effect;

[0012] A sampling unit, configured to sample each of the mask images based on texture sampling coordinates corresponding to vertices in the cloud layer sheet model, to obtain pixel values ​​sampled by the vertices in each of the mask images;

[0013] A second acquisition unit, used for acquiring color parameters set for each of the mask images;

[0014] A rendering unit is used to render the cloud layer model based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map to obtain a cloud layer image.

[0015] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for loading by a processor to execute the steps in any image processing method provided in the embodiment of the present application.

[0016] In addition, an embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores an application program, and the processor is used to run the application program in the memory to implement the image processing method provided in the embodiment of the present application.

[0017] An embodiment of the present application also provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps in the image processing method provided in the embodiment of the present application.

[0018] The embodiment of the present application obtains a cloud layer map corresponding to a cloud layer patch model in a virtual scene, wherein mask maps are drawn in multiple map channels of the cloud layer map, and each mask map indicates a cloud layer display effect; based on the texture sampling coordinates corresponding to the vertices in the cloud layer patch model, each mask map is sampled to obtain the pixel values ​​sampled by the vertices in each mask map; the color parameters set for each mask map are obtained; based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, the cloud layer patch model is rendered to obtain a cloud layer image. In this way, by drawing a mask map indicating a cloud display effect in multiple map channels of the cloud map, and setting corresponding color parameters for each mask map, the cloud layer model can be rendered according to the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, and a cloud image with the cloud display effects indicated by each mask map in the cloud map can be obtained, thereby improving the flexibility and diversity of the generated cloud image, and based on the color parameters corresponding to each mask map, multi-level color changing of the cloud effect can be achieved, effectively improving the generation effect of the cloud image. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 It is a schematic diagram of an implementation scenario of an image processing method provided in an embodiment of the present application;

[0021] Figure 2 It is a flowchart of an image processing method provided in an embodiment of the present application;

[0022] Figure 3a This is a schematic diagram of a cloud display effect of an image processing method provided in an embodiment of the present application;

[0023] Figure 3b is a schematic diagram of ambient light occlusion information of an image processing method provided in an embodiment of the present application;

[0024] Figure 3c is a schematic diagram of a noise image of an image processing method provided in an embodiment of the present application;

[0025] Figure 4a is a schematic diagram of cloud layer effect of an image processing method provided in an embodiment of the present application;

[0026] Figure 4b It is a schematic diagram of a self-luminous effect of an image processing method provided in an embodiment of the present application;

[0027] Figure 4c is a schematic diagram of self-luminous parameter settings of an image processing method provided in an embodiment of the present application;

[0028] Figure 4d is a schematic diagram of light transmission effect of an image processing method provided in an embodiment of the present application;

[0029] Figure 5 is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application;

[0030] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0032] The embodiments of the present application provide an image processing method, device, storage medium and electronic device. The image processing device can be integrated in an electronic device, which can be a server or a terminal.

[0033] Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. Terminals may include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. Terminals and servers can be directly or indirectly connected via wired or wireless communications, and this application does not limit this.

[0034] See also Figure 1 , taking the image processing device integrated into an electronic device as an example, Figure 1 A schematic diagram of an implementation scenario of the image processing method provided in an embodiment of the present application, wherein the electronic device can be a terminal or a server, and the electronic device can obtain a cloud layer map corresponding to a cloud layer patch model in a virtual scene, wherein mask maps are drawn in multiple map channels of the cloud layer map, and each mask map indicates a cloud layer display effect; based on the texture sampling coordinates corresponding to the vertices in the cloud layer patch model, each mask map is sampled to obtain the pixel values ​​sampled by the vertices in each mask map; the color parameters set for each mask map are obtained; based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, the cloud layer patch model is rendered to obtain a cloud layer image.

[0035] It should be noted that Figure 1 The implementation environment scenario diagram of the image processing method shown is only an example. The implementation environment scenario of the image processing method described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided by the embodiment of the present application. It is known to those skilled in the art that with the evolution of data processing and the emergence of new business scenarios, the technical solution provided by the present application is also applicable to similar technical problems.

[0036] The solutions provided by the embodiments of the present application are specifically described by the following embodiments. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0037] This embodiment will be described from the perspective of an image processing device. The image processing device may be integrated into an electronic device. The electronic device may be a terminal and / or a server, and this application does not limit this.

[0038] See also Figure 2 , Figure 2 : is a flow chart of an image processing method provided in an embodiment of the present application. The image processing method comprises:

[0039] In step 101, a cloud layer map corresponding to a cloud layer model in a virtual scene is obtained.

[0040] Among them, mask images may be drawn in multiple map channels of the cloud map, and each mask image may indicate a cloud display effect.

[0041] The virtual scene may be a simulated environment of the real world, or a semi-simulated and semi-fictitious virtual environment, or a purely fictitious virtual environment, etc. The cloud layer patch model may be a patch model used to display a cloud layer image in a virtual scene, and the patch model may have multiple vertices, and the cloud layer image may be an image with a cloud layer effect. The cloud layer map may be a map used to store the texture of the cloud layer patch model. A mask map may be drawn in multiple map channels of the cloud layer map, and the mask map may be an image of a mask type. The cloud layer display effect may be a display effect of a cloud layer image, for example, it may include effects such as bright parts, dark parts, edge light effects, and reflective effects.

[0042] Optionally, the map channels of the cloud map may include a first channel, a second channel and a third channel, wherein the mask map of the first channel may indicate the bright part and edge light effects of the cloud image to be generated, the mask map of the second channel may indicate the dark part effect of the cloud image to be generated, and the mask map of the third channel may indicate the reflective effect of the cloud image to be generated.

[0043] In one embodiment, assuming that the cloud map includes three map channels of R, G, and B, the R channel can be set as the first channel, and the mask map stored therein can be used to indicate the bright part and edge light effects of the cloud image to be generated. The G channel can be the second channel, and the mask map stored therein can be used to indicate the dark part effect of the cloud image to be generated. The B channel can be the third channel, and the mask map stored therein can be used to indicate the reflective effect of the cloud image to be generated.

[0044] For example, see Figure 3a , Figure 3a is a schematic diagram of cloud display effect of an image processing method provided in an embodiment of the present application, wherein Figure 3a In 1, the red area and the black area represent the cloud display effect corresponding to the mask image stored in the R channel. The red area indicates the bright part of the cloud image to be generated, and the black area indicates the edge light effect of the cloud image to be generated. Figure 3a In 2, the green area represents the cloud display effect corresponding to the mask image stored in the G channel, and the green area indicates the dark effect of the cloud image to be generated. Figure 3a In 3, the blue area represents the cloud display effect corresponding to the mask image stored in the B channel, and the blue area indicates the reflection effect of the cloud image to be generated.

[0045] Optionally, the cloud map may also include a fourth channel, which may be a transparent (A) channel. The fourth channel may draw a mask map indicating ambient occlusion information of the cloud image to be generated, and the ambient occlusion information may be information indicating ambient occlusion values ​​corresponding to each vertex in the cloud layer sheet model, and the ambient occlusion value may be calculated by ambient occlusion technology, and may be used to simulate lighting effects, indicating the degree of occlusion of each vertex in the cloud layer sheet model. Ambient occlusion (AO) can generate shadow effects by calculating the occlusion relationship between object surfaces, making objects or scenes look more real and three-dimensional. The AO effect is fixedly designed according to the characteristics of the cloud layer. The purpose of this layer of AO mask is to limit the brightness of the four coloring channels to avoid averaging, thereby enhancing the layering of the cloud layer in the cloud image to be generated.

[0046] There are many ways to draw the ambient light occlusion information indicating the cloud layer image to be generated. For example, a three-dimensional cloud layer model corresponding to the cloud layer sheet model can be created, and the ambient light occlusion information corresponding to the cloud layer sheet model can be obtained by performing AO baking on the cloud layer model. Optionally, the ambient light occlusion information corresponding to the cloud layer sheet model can be directly drawn according to the required cloud layer layer and three-dimensional effect. The specific settings can be made according to the actual situation, and the embodiments of the present application are not limited here.

[0047] For example, see Figure 3b , Figure 3b This is a schematic diagram of ambient occlusion information of an image processing method provided by an embodiment of the present application. The ambient occlusion information can be a grayscale image, and each pixel value in the grayscale image can indicate a corresponding ambient occlusion value. By rendering the cloud layer model with the ambient occlusion information, the generated cloud layer image can take into account the lighting and shadow effects, thereby making the generated cloud layer image more realistic and three-dimensional, and improving the generation effect of the cloud layer effect image.

[0048] In step 102, each mask image is sampled based on the texture sampling coordinates corresponding to the vertices in the cloud layer model to obtain the pixel values ​​sampled by the vertices in each mask image.

[0049] The texture sampling coordinates may be UV coordinates for texture sampling of a cloud layer sheet model, and may be used to sample the mask maps of each map channel in the cloud layer map of the cloud layer sheet model, thereby obtaining a cloud layer image with a cloud layer display effect. The UV coordinates may be coordinates in a two-dimensional coordinate system, and may be used to map the texture map to the surface of a three-dimensional model, where U and V may represent the horizontal and vertical coordinate axes, respectively. The UV coordinates may define the position information of each point on the texture map, and these points are interconnected with the three-dimensional model to achieve the correspondence of each point on the texture map to the surface of the model, so that sampling may be performed in the texture map according to the UV coordinates, and thus the sampled pixel values ​​may be mapped to the corresponding positions on the model surface, so as to achieve tiling the texture map on the surface of the three-dimensional model. The pixel values ​​may be the results sampled in each mask map based on each texture sampling coordinate.

[0050] Among them, based on the texture sampling coordinates corresponding to the vertices in the cloud layer sheet model, each mask map is sampled, and there are many ways to obtain the pixel values ​​sampled by the vertices in each mask map, for example, obtaining a noise image, and the noise image changes over time; sampling the noise image based on the vertices in the cloud layer sheet model to obtain the sampling offset values ​​corresponding to the vertices; offsetting the texture sampling coordinates corresponding to the vertices based on the sampling offset values ​​to obtain the target sampling coordinates; sampling each mask map based on the target sampling coordinates to obtain the pixel values ​​sampled by the vertices in each mask map.

[0051] The noise image may be an image used to simulate randomness and irregularity, and the noise image may change over time. For example, please refer to Figure 3c , Figure 3c is a schematic diagram of a noise image of an image processing method provided by an embodiment of the present application. The texture on the noise image is random and irregular. As time changes, the texture on the noise image may change. For example, the noise image on the left side of the figure may change to the noise image on the right side of the figure as time changes. The sampling offset value may be a value for offsetting the texture sampling coordinates of the cloud layer sheet model, and the target sampling coordinates may be the texture sampling coordinates offset based on the sampling offset value.

[0052] In this way, by sampling the mask images in the cloud layer map based on the texture sampling coordinates offset by the sampling offset value, the original cloud layer effect pattern can be slightly offset. At the same time, as time passes, the noise image changes dynamically, thereby dynamically changing the sampling offset value, and then correspondingly changing the texture sampling coordinates for sampling, so that the final generated cloud layer image shows the disturbance effect caused by the sampling offset, with a dynamic deformation effect, making the cloud layer effect of the cloud layer image more realistic and diverse, and improving the cloud layer image generation effect.

[0053] In step 103, the color parameters set for each mask image are obtained.

[0054] The color parameter may be a parameter for controlling the color of the cloud layer display effect corresponding to each mask image, and the color of each area in the cloud layer image to be generated may be adjusted through the color parameter.

[0055] Optionally, the specific value of the color parameter can be set according to actual needs, or customized according to the user's preferences. For example, for a mask image indicating the edge light effect of a cloud image to be generated, if its corresponding color parameter is set to a color value corresponding to black, the edge light effect of the cloud image to be generated can be controlled to be black through the color parameter. For a mask image indicating the luminous effect of a cloud image to be generated, if its corresponding color parameter is set to a color value corresponding to yellow, the luminous effect of the cloud image to be generated can be controlled to be yellow through the color parameter, etc. In this way, by setting at least one color parameter for each mask image, a cloud image with a multi-level color-changing effect of clouds can be generated. Users can customize the colors of each area in the cloud image through color parameters, which can improve the freedom and diversity of cloud image generation and improve the cloud image generation effect.

[0056] In step 104, the cloud layer model is rendered based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map to obtain a cloud layer image.

[0057] The cloud layer image may be an image with cloud layer effects, for example, an image with cloud layer display effects indicated by each mask image. Figure 4a , Figure 4a It is a schematic diagram of cloud effects of an image processing method provided in an embodiment of the present application. By processing an image provided in an embodiment of the present application, a cloud image having a multi-level cloud effect and customizable cloud colors can be generated.

[0058] Among them, based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, the cloud layer model is rendered, and there are many ways to obtain the cloud layer image. For example, the product of the pixel value and the color parameter corresponding to the vertex in the same mask map can be calculated to obtain the first color value corresponding to the vertex and each mask map; the first color value corresponding to the vertex and each mask map is fused based on the hierarchical relationship between the mask maps to obtain the second color value corresponding to the vertex; based on the second color value corresponding to the vertex, the cloud layer model is rendered to obtain the cloud layer image.

[0059] Among them, the first color value can be the product of the pixel value corresponding to the same mask map of each vertex in the cloud layer sheet model and the color parameter, and the second color value can be the color value after the vertex and the first color value corresponding to each mask map are merged. The hierarchical relationship between the mask maps can be determined according to the cloud display effect corresponding to the mask map. For example, the mask map simulating the bright part and the edge light can correspond to the bottom layer, the mask map simulating the dark effect can correspond to the middle layer, and the mask map simulating the reflective effect can correspond to the top layer, etc. The specific hierarchical relationship can be set according to actual needs, and the embodiment of the present application is not limited here. In this way, by displaying according to the second color value corresponding to the vertex, a cloud image with a multi-level color effect can be rendered in the cloud layer sheet model.

[0060] There are many ways to calculate the product of the pixel value and color parameter corresponding to the vertex in the same mask map to obtain the first color value corresponding to the vertex and each mask map. For example, assuming that the color parameter corresponding to the first channel is color0, and assuming that the pixel value sampled at vertex a in the cloud layer model in the mask map of the first channel is 0.5, then the product of the pixel value 0.5 corresponding to the mask map of the first channel of vertex a and the color parameter color0 is calculated to obtain the first color value 0.5×color0 corresponding to the vertex a and the mask map of the first channel.

[0061] After calculating the product of the pixel value and color parameter corresponding to the vertex in the same mask map, the first color value corresponding to the vertex and each mask map can be fused based on the hierarchical relationship between the mask maps to obtain the second color value corresponding to the vertex. There are many ways to fuse the first color value corresponding to the vertex and each mask map based on the hierarchical relationship between the mask maps to obtain the second color value corresponding to the vertex. For example, assuming that the mask map stored in the R channel of the cloud map is used to simulate the bright part and edge light effect of the cloud image to be generated, the mask map stored in the G channel is used to simulate the dark part effect of the cloud image to be generated, and the mask map stored in the B channel is used to simulate the reflective effect of the cloud image to be generated, the mask maps of these three map channels are mixed with the corresponding four color parameters (color0, color1, color2, color3) respectively to change the color value corresponding to the pixel value collected by the vertex in each mask map, so as to freely adjust the color of the cloud effect, thereby realizing the multi-level color change effect of the cloud. For details, please continue to refer to Figure 3a , assuming that the pixel values ​​sampled by the vertices in the mask map of the three RGB mapping channels in the cloud layer model are r, g, and b respectively. At the same time, the color parameter corresponding to the mask map for simulating the edge light effect corresponding to the R channel is the color value corresponding to black (color0), the color parameter corresponding to the mask map for simulating the bright effect corresponding to the R channel is the color value corresponding to red (color1), the color parameter corresponding to the mask map for simulating the dark effect corresponding to the G channel is the color value corresponding to green (color2), the color parameter corresponding to the mask map for simulating the reflection effect corresponding to the B channel is the color value corresponding to blue (color3), and assuming that finalcolor is the final output color, that is, the second color value. In this way, in order to facilitate the description of each cloud layer display effect corresponding to the mask map, the effect of 1 in Figure 1 can be obtained by the following formula:

[0062] finalcolor=color1*r+color0*(1-r)

[0063] The red part corresponds to the bright part effect indicated by the mask image of the R channel, and the black part corresponds to the edge light effect indicated by the mask image of the R channel. Based on the effect of 1 in the figure, the effect of 2 in the figure can be obtained by the following formula:

[0064] finalcolor=color2*g+finalcolor*(1-g)

[0065] Among them, finalcolor on the right side of the equal sign can be expressed as the color value corresponding to the effect of 1 in the figure, and the green part corresponds to the dark effect indicated by the mask map of the G channel. Based on the effect of 2 in the figure, the following formula is used to obtain the effect of 3 in the figure, that is, the final multi-level color change effect of the cloud layer:

[0066] finalcolor=color3*b+finalcolor*(1-b)

[0067] The finalcolor on the right side of the equal sign can be expressed as the color value corresponding to the effect of 2 in the figure, and the blue part corresponds to the luminous effect indicated by the mask map of channel B. In this way, for the first color value corresponding to the vertex and each mask map, the second color value corresponding to the vertex can be finally calculated using the following formula based on the hierarchical relationship between the mask maps:

[0068] finalcolor=color3*b+(color2*g+(color1*r+color0*(1-r))*(1-g))*(1-b)

[0069] Among them, finalcolor can be expressed as the second color value corresponding to the vertex, color3*b can be expressed as the first color value corresponding to the mask image of the B channel, color2*g can be expressed as the first color value corresponding to the mask image of the G channel, color1*r and color0*(1-r) can be expressed as the first color values ​​corresponding to the two mask images of the R channel.

[0070] Optionally, to further enrich the performance of cloud effects, the mask map of each map channel can be used as a self-luminous mask for the clouds, and the brightness of the area corresponding to each mask map in the cloud image can be dynamically adjusted through the self-luminous parameters corresponding to each mask map, thereby enhancing the expressiveness of the cloud effect.

[0071] Specifically, at least one mask map may be configured with corresponding self-luminous parameters, so that the step of fusing the first color values ​​corresponding to the vertex and each mask map based on the hierarchical relationship between the mask maps to obtain the second color value corresponding to the vertex may include: calculating the product of the first color value corresponding to the vertex and each mask map and the self-luminous parameter corresponding to the mask map to obtain the luminous color value; fusing the luminous color values ​​corresponding to the vertex in each mask map based on the hierarchical relationship between the mask maps to obtain the second color value corresponding to the vertex.

[0072] The self-luminous parameter, namely the self-luminous intensity value, can be used to control the brightness of the corresponding area of ​​the mask image on the cloud layer model, and the luminous color value can be the first color value adjusted based on the self-luminous parameter.

[0073] For example, please refer to Figure 3a , assuming that the self-luminous parameter corresponding to the mask map of the simulated bright effect of the R channel is x, the self-luminous parameter corresponding to the mask map of the simulated edge light effect of the R channel is y, the self-luminous parameter corresponding to the mask map of the G channel is z, and the self-luminous parameter corresponding to the mask map of the B channel is w, then the formula for calculating the second color value corresponding to the vertex on the cloud layer model can be updated as:

[0074] finalcolor=color3*b*w+(color2*g*z+(color1*r*x+color0*(1-r)*y)*(1-g))*(1-b)

[0075] For another example, please refer to Figure 4b , Figure 4b : is a schematic diagram of the self-luminous effect of an image processing method provided by an embodiment of the present application. Assume that the self-luminous parameter corresponding to the mask image of the simulated bright effect of the R channel is x, the self-luminous parameter corresponding to the mask image of the simulated edge light effect of the R channel is y, the self-luminous parameter corresponding to the mask image of the simulated dark effect of the G channel is z, and the self-luminous parameter corresponding to the mask image of the simulated reflective effect of the B channel is w. When the value of y is 1, the effect Figure 3a The brightness of the black area is Figure 4b The effect of 1 in the middle makes the area corresponding to the edge light effect brighter, showing the effect of self-luminescence; similarly, when the value of x is 1, it affects Figure 3a The brightness of the red area is Figure 4b The effect of 2 makes the area corresponding to the bright effect brighter, showing the effect of self-luminescence; when the value of z is 1, it affects Figure 3a The brightness of the middle green area is Figure 4b The effect of 3 in the middle makes the area corresponding to the dark effect brighter, showing the effect of self-luminescence; when the value of w is 1, it affects Figure 3a The brightness of the blue area is Figure 4b The effect of 4 makes the area corresponding to the reflection effect brighter, showing the effect of self-luminescence.

[0076] In one embodiment, the self-illumination parameters and color parameters corresponding to each mask image can be set through the setting window. For example, please refer to Figure 4c , Figure 4cThis is a schematic diagram of the self-luminous parameter setting of an image processing method provided in an embodiment of the present application, wherein dyed area 1, dyed area 2, dyed area 3, and dyed area 4 can be used to set the color parameters corresponding to the mask image simulating the bright effect, the color parameters corresponding to the mask image simulating the edge light effect, the color parameters corresponding to the mask image simulating the dark effect, and the color parameters corresponding to the mask image simulating the reflective effect, respectively. The self-luminous intensity value of dyed area 1, the self-luminous intensity value of dyed area 2, the self-luminous intensity value of dyed area 3, and the self-luminous intensity value of dyed area 4 can be used to set the self-luminous parameters corresponding to the mask image simulating the bright effect, the self-luminous parameters corresponding to the mask image simulating the edge light effect, the self-luminous parameters corresponding to the mask image simulating the dark effect, and the self-luminous parameters corresponding to the mask image simulating the reflective effect, respectively. The specific settings can be set according to actual needs.

[0077] Optionally, the map channel of the cloud map may also include a fourth channel, the mask map of the fourth channel indicates the ambient occlusion information of the cloud image to be generated, and correspondingly, based on the texture sampling coordinates corresponding to the vertex, the pixel value sampled from the ambient occlusion information is the lighting occlusion value corresponding to the vertex.

[0078] Correspondingly, the step of fusing the first color values ​​corresponding to the vertex and each mask graph based on the hierarchical relationship between the mask graphs to obtain the second color value corresponding to the vertex may include: fusing the first color values ​​corresponding to the vertex and the mask graphs of the first channel, the second channel and the third channel based on the hierarchical relationship between the mask graphs to obtain the second color value corresponding to the vertex.

[0079] Correspondingly, the step of rendering the cloud layer sheet model based on the second color value corresponding to the vertex to obtain a cloud layer image may include: calculating the product of the second color value corresponding to the vertex and the light shielding value to obtain a third color value; based on the third color value, rendering the cloud layer sheet model to obtain a cloud layer image.

[0080] The third color value can be the product of the second color value corresponding to the vertex and the light occlusion value. In this way, the brightness of the four dyeing areas corresponding to the first channel, the second channel and the third channel can be adjusted through the ambient light occlusion information corresponding to the cloud layer model, so as to increase the contrast of each dyeing area and simulate the global light transmission effect of the cloud layer. When the brightness value of each dyeing area is larger, the overall contrast of the cloud layer effect is also enhanced, so that the light transmission effect in the cloud layer image is more outstanding.

[0081] Among them, there are many ways to calculate the product of the second color value corresponding to the vertex and the illumination shading value to obtain the third color value. For example, the illumination parameters of the target light source in the virtual scene can be obtained; the dot product of the illumination shading value and the illumination parameters can be calculated to obtain the target shading value corresponding to the vertex; the product of the target shading value corresponding to the vertex and the second color value can be calculated to obtain the third color value.

[0082] The target light source may be a light source in a virtual scene, for example, sunlight, lamplight, etc. in the virtual scene, and the illumination parameter may be a parameter describing the illumination condition of the target light source, and the illumination condition may include information such as the illumination direction and illumination intensity of the target light source, for example, the illumination parameter may be an illumination direction vector. The target shading value may be information indicating the shading degree corresponding to the vertex.

[0083] For example, the target light source may be sunlight in a virtual scene, and the illumination parameter may be an illumination direction vector of sunlight. Thus, based on the ambient light occlusion information in the mask image of the fourth channel and the illumination direction of sunlight in the virtual scene, the second color value corresponding to the vertex may be adjusted, thereby displaying the cloud effect based on the adjusted third color value. This may result in a cloud image having a three-dimensional shadow effect and a light-transmitting effect, thereby improving the richness and authenticity of the cloud effect of the cloud image and effectively improving the cloud image generation effect.

[0084] In one embodiment, the cloud light transmission effect can also be obtained according to the ambient light shielding information in the mask map of the fourth channel and the self-luminous parameters corresponding to each mask map, through the self-luminous effect of the area corresponding to each mask map. For example, the product of the first color value corresponding to the vertex and each mask map and the self-luminous parameter corresponding to the mask map is calculated to obtain the luminous color value; the luminous color value corresponding to the vertex in each mask map is merged based on the hierarchical relationship between the mask maps to obtain the second color value corresponding to the vertex, and the product of the second color value corresponding to the vertex and the light shielding value is calculated to obtain the third color value; based on the third color value, the cloud layer model is rendered to obtain a cloud layer image.

[0085] For example, see Figure 4d , Figure 4d is a schematic diagram of a light transmission effect of an image processing method provided in an embodiment of the present application, and please continue to refer to Figure 4c , you can set the self-luminous parameters corresponding to the mask image that simulates the reflection effect by the self-luminous intensity of the dyed area 4. For example, please refer to Figure 4d In 1, assuming that the brightness value of the self-luminous intensity of the dyed area 4 is 0, the corresponding cloud effect has no light-transmitting effect; please refer to Figure 4d In 2, assuming that the brightness value of the self-luminous intensity of the dyed area 4 is 1, the corresponding cloud effect has a certain light-transmitting effect; please refer to Figure 4d In 3, assuming that the brightness value of the self-luminous intensity of the dyed area 4 is 2, the corresponding cloud effect is a strong light-transmitting effect, and detailed light is revealed between the gaps in the clouds. The cloud light-transmitting effect can be achieved without relying on the influence of strong light, which greatly improves the generation effect of the cloud image.

[0086] In a specific embodiment, the image processing method provided in the embodiment of the present application can be applied to a game map editing scenario based on user generated content (UGC). For example, in a game map editing scenario, a game application can provide a cloud editing control. The user can trigger the cloud editing control to display a cloud window in the corresponding editing interface. The cloud window can display cloud components with a variety of cloud styles. Different cloud components have different display styles of cloud images. For example, cloud effects in styles such as cirrus, cumulus, small clouds, and square clouds can be included. The user can drag any cloud component to display the cloud image corresponding to the cloud component in the virtual scene. The display position of the cloud image can be the position of the cloud layer model in the virtual scene. The cloud image can be rendered based on the cloud layer map corresponding to the cloud layer model.

[0087] In this way, users can customize the colors corresponding to cloud images according to their creative needs. For example, users can set corresponding color parameters for each mask map in the cloud map corresponding to the cloud image. Based on the color parameters, cloud images with corresponding color effects can be displayed in the virtual scene, thereby achieving multi-level customized color changing of the cloud effects of the cloud image, effectively improving the generation effect of the cloud image.

[0088] In addition, after the user selects the corresponding cloud component, the self-luminous parameters of each mask image corresponding to the cloud component can be set, so that the brightness of the area corresponding to each mask image in the cloud image can be dynamically adjusted through the self-luminous parameters corresponding to each mask image, thereby achieving the effect of cloud self-luminescence and enhancing the expressiveness of the cloud effect.

[0089] Optionally, the user can set whether to display shadow effects in the cloud image. When displaying shadow effects, the cloud layer sheet model corresponding to the cloud image to be generated can be rendered based on the ambient light occlusion information corresponding to the cloud image to be generated. This can make the generated cloud image take into account the lighting and shadow effects, thereby making the generated cloud image more realistic and three-dimensional, and improving the generation effect of the cloud effect image.

[0090] Optionally, users can also set the cloud disturbance density and cloud disturbance speed of the cloud image, so as to adjust the density of texture distribution in the noise image and the speed at which the noise image changes over time. This allows the user to control the amplitude and speed of cloud changes in the displayed cloud image and improve the cloud image creation effect.

[0091] Optionally, users can also save the created cloud image so that they can share and reuse it in subsequent map editing processes.

[0092] In this way, the embodiment of the present application combines the player's creation needs for user-generated content UGC and the corresponding editor usage experience, and realizes the cloud UGC effect through the four-channel coloring production process of the cloud layer map corresponding to the cloud layer sheet model, which has the characteristics of ease of use and what you see is what you get. In the specific implementation, the coloring of the four areas of black, red, green and blue of the cloud layer map is used to simulate the edge light, bright part, dark part and reflective effect respectively. Each area is respectively configured with self-luminous parameters and color parameters that can control its brightness value, so as to realize free editing of the color and self-luminous settings of the cloud layer and realize rich cloud layer effects. In order to more realistically simulate the hierarchical changes and light transmission effects of the cloud layer, the embodiment of the present application adds a grayscale image that simulates the ambient light occlusion of the cloud layer to the cloud layer map, and adds a disturbance effect through a noise image to enhance the dynamic performance of the cloud layer, improve the flexibility and diversity of the generated cloud layer image, and at the same time, effectively enhance the expressiveness and ease of use of UGC, and improve the user experience.

[0093] From the above, it can be seen that the embodiment of the present application obtains a cloud layer map corresponding to a cloud layer patch model in a virtual scene, and mask maps are drawn in multiple map channels of the cloud layer map, and each mask map indicates a cloud layer display effect; based on the texture sampling coordinates corresponding to the vertices in the cloud layer patch model, each mask map is sampled to obtain the pixel values ​​sampled by the vertices in each mask map; the color parameters set for each mask map are obtained; based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, the cloud layer patch model is rendered to obtain a cloud layer image. In this way, by drawing a mask map indicating a cloud display effect in multiple map channels of the cloud map, and setting corresponding color parameters for each mask map, the cloud layer model can be rendered according to the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, and a cloud image with the cloud display effects indicated by each mask map in the cloud map can be obtained, thereby improving the flexibility and diversity of the generated cloud image, and based on the color parameters corresponding to each mask map, multi-level color changing of the cloud effect can be achieved, effectively improving the generation effect of the cloud image.

[0094] In order to better implement the above method, an embodiment of the present invention further provides an image processing device, which can be integrated in an electronic device, and the electronic device can be a terminal or a server.

[0095] For example, Figure 5 As shown, it is a schematic diagram of the structure of the image processing device provided in an embodiment of the present application. The image processing device may include a first acquisition unit 201, a sampling unit 202, a second acquisition unit 203 and a rendering unit 204, as follows:

[0096] The first acquisition unit 201 is used to acquire a cloud layer map corresponding to a cloud layer model in a virtual scene, wherein a mask map is drawn in a plurality of map channels of the cloud layer map, and each mask map indicates a cloud layer display effect;

[0097] The sampling unit 202 is used to sample each mask image based on the texture sampling coordinates corresponding to the vertices in the cloud layer model to obtain the pixel values ​​sampled by the vertices in each mask image;

[0098] The second acquisition unit 203 is used to acquire color parameters set for each mask image;

[0099] The rendering unit 204 is used to render the cloud layer model based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map to obtain a cloud layer image.

[0100] In some embodiments, the rendering unit 204 includes:

[0101] A calculation subunit, used for calculating the product of the pixel value corresponding to the vertex in the same mask image and the color parameter, to obtain the first color value corresponding to the vertex and each mask image;

[0102] A fusion subunit, used for fusing the first color values ​​corresponding to the vertex and each mask graph based on the hierarchical relationship between the mask graphs to obtain a second color value corresponding to the vertex;

[0103] The rendering subunit is used to render the cloud layer model based on the second color value corresponding to the vertex to obtain a cloud layer image.

[0104] In some embodiments, the map channel includes a first channel, a second channel, and a third channel, the mask map of the first channel indicates the bright part and edge light effects of the cloud image to be generated, the mask map of the second channel indicates the dark part effect of the cloud image to be generated, and the mask map of the third channel indicates the reflective effect of the cloud image to be generated.

[0105] In some embodiments, the mapping channel further includes a fourth channel, the mask map of the fourth channel indicates ambient occlusion information of the cloud image to be generated, and based on the texture sampling coordinates corresponding to the vertices, the pixel values ​​sampled from the ambient occlusion information are the illumination occlusion values;

[0106] The fusion subunit is used for:

[0107] The first color value corresponding to the vertex and the mask images of the first channel, the second channel and the third channel is merged based on the hierarchical relationship between the mask images to obtain the second color value corresponding to the vertex;

[0108] Rendering subunit, including:

[0109] A color value calculation module, used to calculate the product of the second color value corresponding to the vertex and the light shielding value to obtain a third color value;

[0110] The image rendering module is used to render the cloud layer model based on the third color value to obtain a cloud layer image.

[0111] In some embodiments, the color value calculation module is used to:

[0112] Get the lighting parameters of the target light source in the virtual scene;

[0113] Calculate the dot product of the illumination occlusion value and the illumination parameter to get the target occlusion value corresponding to the vertex;

[0114] The product of the target shading value corresponding to the vertex and the second color value is calculated to obtain the third color value.

[0115] In some embodiments, at least one mask image is configured with corresponding self-luminous parameters, and the fusion subunit is used to:

[0116] Calculate the product of the first color value corresponding to the vertex and each mask image and the self-luminous parameter corresponding to the mask image to obtain the luminous color value;

[0117] The luminous color values ​​corresponding to the vertex in each mask graph are merged based on the hierarchical relationship between the mask graphs to obtain a second color value corresponding to the vertex.

[0118] In some embodiments, the sampling unit 202 is used to:

[0119] Obtain a noise image, the noise image changes over time;

[0120] The noise image is sampled based on the vertices in the cloud layer model to obtain the sampling offset values ​​corresponding to the vertices;

[0121] The texture sampling coordinates corresponding to the vertex are offset based on the sampling offset value to obtain the target sampling coordinates;

[0122] Each mask map is sampled based on the target sampling coordinates to obtain the pixel value sampled by the vertex in each mask map.

[0123] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.

[0124] From the above, it can be seen that the embodiment of the present application obtains the cloud layer map corresponding to the cloud layer patch model in the virtual scene through the first acquisition unit 201, and mask maps are drawn in multiple map channels of the cloud layer map, and each mask map indicates a cloud layer display effect; the sampling unit 202 samples each mask map based on the texture sampling coordinates corresponding to the vertices in the cloud layer patch model, and obtains the pixel values ​​sampled by the vertices in each mask map; the second acquisition unit 203 obtains the color parameters set for each mask map; the rendering unit 204 renders the cloud layer patch model based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, to obtain a cloud layer image. In this way, by drawing a mask map indicating a cloud display effect in multiple map channels of the cloud map, and setting corresponding color parameters for each mask map, the cloud layer model can be rendered according to the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, and a cloud image with the cloud display effects indicated by each mask map in the cloud map can be obtained, thereby improving the flexibility and diversity of the generated cloud image, and based on the color parameters corresponding to each mask map, multi-level color changing of the cloud effect can be achieved, effectively improving the generation effect of the cloud image.

[0125] The present application also provides an electronic device, such as Figure 6 As shown, it shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present application, and the electronic device may be a terminal or a server. Specifically:

[0126] The electronic device 300 includes a processor 301 having one or more processing cores, a memory 302 having one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 is electrically connected to the memory 302. Those skilled in the art will appreciate that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0127] The processor 301 is the control center of the electronic device 300. It uses various interfaces and lines to connect various parts of the entire electronic device 300, executes various functions of the electronic device 300 and processes data by running or loading software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, thereby monitoring the electronic device 300 as a whole.

[0128] In the embodiment of the present application, the processor 301 in the electronic device 300 will load instructions corresponding to the processes of one or more application programs into the memory 302 according to the following steps, and the processor 301 will run the application programs stored in the memory 302 to implement various functions:

[0129] Obtaining a cloud layer map corresponding to a cloud layer model in a virtual scene, wherein a plurality of map channels of the cloud layer map are drawn with mask maps, and each mask map indicates a cloud layer display effect;

[0130] Based on the texture sampling coordinates corresponding to the vertices in the cloud layer model, each mask map is sampled to obtain the pixel value sampled by the vertex in each mask map;

[0131] Get the color parameters set for each mask image;

[0132] Based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, the cloud layer model is rendered to obtain a cloud layer image.

[0133] This solution can obtain a cloud layer map corresponding to a cloud layer patch model in a virtual scene, wherein mask maps are drawn in multiple map channels of the cloud layer map, and each mask map indicates a cloud layer display effect; based on the texture sampling coordinates corresponding to the vertices in the cloud layer patch model, each mask map is sampled to obtain the pixel values ​​sampled by the vertices in each mask map; the color parameters set for each mask map are obtained; based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, the cloud layer patch model is rendered to obtain a cloud layer image. In this way, by drawing a mask map indicating a cloud display effect in multiple map channels of the cloud map, and setting corresponding color parameters for each mask map, the cloud layer model can be rendered according to the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, and a cloud image with the cloud display effects indicated by each mask map in the cloud map can be obtained, thereby improving the flexibility and diversity of the generated cloud image, and based on the color parameters corresponding to each mask map, multi-level color changing of the cloud effect can be achieved, effectively improving the generation effect of the cloud image.

[0134] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0135] Optional, such as Figure 6 As shown, the electronic device 300 further includes: a touch screen 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. The processor 301 is electrically connected to the touch screen 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307, respectively. Those skilled in the art can understand that Figure 6 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0136] The touch display screen 303 can be used to display a graphical user interface and receive an operation instruction generated by the user acting on the graphical user interface. The touch display screen 303 may include a display panel and a touch panel. Wherein, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 301, and can receive the command sent by the processor 301 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 301 to determine the type of touch event, and then the processor 301 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 303 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 303 can also be used as a part of the input unit 306 to realize the input function.

[0137] The radio frequency circuit 304 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals with the network device or other electronic devices.

[0138] The audio circuit 305 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 305 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 305 and converted into audio data, and then the audio data is output to the processor 301 for processing, and then sent to another electronic device through the radio frequency circuit 304, or the audio data is output to the memory 302 for further processing. The audio circuit 305 may also include an earplug jack to provide communication between an external headset and the electronic device.

[0139] The input unit 306 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0140] The power supply 307 is used to supply power to various components of the electronic device 300. Optionally, the power supply 307 can be logically connected to the processor 301 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 307 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0141] although Figure 6 Not shown, the electronic device 300 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0142] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. It should be noted that the electronic device provided in the embodiment of the present application and the image processing method in the above embodiment belong to the same concept. The specific implementation process is detailed in the above method embodiment and will not be repeated here.

[0143] From the above, it can be seen that the electronic device provided in the embodiment of the present application can obtain a cloud layer map corresponding to a cloud layer model in a virtual scene, wherein mask maps are drawn in multiple map channels of the cloud layer map, and each mask map indicates a cloud layer display effect; based on the texture sampling coordinates corresponding to the vertices in the cloud layer model, each mask map is sampled to obtain the pixel values ​​sampled by the vertices in each mask map; the color parameters set for each mask map are obtained; based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, the cloud layer model is rendered to obtain a cloud layer image. In this way, by drawing a mask map indicating a cloud display effect in multiple map channels of the cloud map, and setting corresponding color parameters for each mask map, the cloud layer model can be rendered according to the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, and a cloud image with the cloud display effects indicated by each mask map in the cloud map can be obtained, thereby improving the flexibility and diversity of the generated cloud image, and based on the color parameters corresponding to each mask map, multi-level color changing of the cloud effect can be achieved, effectively improving the generation effect of the cloud image.

[0144] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0145] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program can be loaded by a processor to execute the steps in any image processing method provided in the embodiment of the present application. For example, the computer program can execute the following steps:

[0146] Obtaining a cloud layer map corresponding to a cloud layer model in a virtual scene, wherein a plurality of map channels of the cloud layer map are drawn with mask maps, and each mask map indicates a cloud layer display effect;

[0147] Based on the texture sampling coordinates corresponding to the vertices in the cloud layer model, each mask map is sampled to obtain the pixel value sampled by the vertex in each mask map;

[0148] Get the color parameters set for each mask image;

[0149] Based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, the cloud layer model is rendered to obtain a cloud layer image.

[0150] This solution can obtain a cloud layer map corresponding to a cloud layer patch model in a virtual scene, wherein mask maps are drawn in multiple map channels of the cloud layer map, and each mask map indicates a cloud layer display effect; based on the texture sampling coordinates corresponding to the vertices in the cloud layer patch model, each mask map is sampled to obtain the pixel values ​​sampled by the vertices in each mask map; the color parameters set for each mask map are obtained; based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, the cloud layer patch model is rendered to obtain a cloud layer image. In this way, by drawing a mask map indicating a cloud display effect in multiple map channels of the cloud map, and setting corresponding color parameters for each mask map, the cloud layer model can be rendered according to the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map, and a cloud image with the cloud display effects indicated by each mask map in the cloud map can be obtained, thereby improving the flexibility and diversity of the generated cloud image, and based on the color parameters corresponding to each mask map, multi-level color changing of the cloud effect can be achieved, effectively improving the generation effect of the cloud image.

[0151] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0152] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0153] Since the computer program stored in the computer-readable storage medium can execute the steps in any one of the image processing methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the image processing methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0154] Among them, according to one aspect of the present application, a computer program product is provided, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device executes the methods provided in the various optional implementations provided in the above embodiments.

[0155] The above is a detailed introduction to an image processing method, device, storage medium and electronic device provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An image processing method, characterized in that: include: Obtaining a cloud layer map corresponding to a cloud layer model in a virtual scene, wherein a plurality of map channels of the cloud layer map are drawn with mask maps, and each mask map indicates a cloud layer display effect; Based on the texture sampling coordinates corresponding to the vertices in the cloud layer model, sampling each of the mask images to obtain the pixel values ​​sampled by the vertices in each of the mask images; Obtaining color parameters set for each of the mask images; Based on the pixel values ​​sampled by the vertices in the mask images and the color parameters corresponding to the mask images, the cloud layer model is rendered to obtain a cloud layer image.

2. The image processing method according to claim 1, characterized in that: The step of rendering the cloud layer model based on the pixel values ​​sampled by the vertices in the mask images and the color parameters corresponding to the mask images to obtain a cloud layer image comprises: Calculate the product of the pixel value corresponding to the vertex in the same mask image and the color parameter to obtain the first color value corresponding to the vertex and each mask image; The first color values ​​corresponding to the vertex and each of the mask images are merged based on the hierarchical relationship between the mask images to obtain a second color value corresponding to the vertex; The cloud layer model is rendered based on the second color value corresponding to the vertex to obtain a cloud layer image.

3. The image processing method according to claim 2, characterized in that: The map channel includes a first channel, a second channel and a third channel. The mask map of the first channel indicates the bright part and edge light effects of the cloud image to be generated, the mask map of the second channel indicates the dark part effect of the cloud image to be generated, and the mask map of the third channel indicates the reflective effect of the cloud image to be generated.

4. The image processing method according to claim 3, characterized in that: The mapping channel further includes a fourth channel, a mask map of the fourth channel indicates ambient occlusion information of a cloud image to be generated, and based on the texture sampling coordinates corresponding to the vertices, pixel values ​​sampled from the ambient occlusion information are illumination occlusion values; The fusing the first color values ​​corresponding to the vertex and each of the mask images based on the hierarchical relationship between the mask images to obtain the second color value corresponding to the vertex includes: Performing fusion processing on the first color value corresponding to the vertex and the mask images of the first channel, the second channel, and the third channel based on the hierarchical relationship between the mask images to obtain a second color value corresponding to the vertex; The step of rendering the cloud layer model based on the second color value corresponding to the vertex to obtain a cloud layer image includes: Calculate the product of the second color value corresponding to the vertex and the light shielding value to obtain a third color value; The cloud layer model is rendered based on the third color value to obtain a cloud layer image.

5. The image processing method according to claim 4, characterized in that: The calculating the product of the second color value corresponding to the vertex and the light shielding value to obtain the third color value includes: Obtaining illumination parameters of a target light source in the virtual scene; Calculate the dot product of the illumination shading value and the illumination parameter to obtain a target shading value corresponding to the vertex; The product of the target shading value corresponding to the vertex and the second color value is calculated to obtain a third color value.

6. The image processing method according to claim 2, characterized in that: At least one mask image is configured with a corresponding self-luminous parameter, and the first color value corresponding to the vertex and each mask image is fused based on the hierarchical relationship between the mask images to obtain the second color value corresponding to the vertex, including: Calculate the product of the first color value corresponding to the vertex and each of the mask images and the self-luminous parameter corresponding to the mask image to obtain a luminous color value; The luminous color values ​​corresponding to the vertex in each of the mask graphs are merged based on the hierarchical relationship between the mask graphs to obtain a second color value corresponding to the vertex.

7. The image processing method according to any one of claims 1 to 6, characterized in that: The sampling of each mask map based on the texture sampling coordinates corresponding to the vertices in the cloud layer model to obtain the pixel values ​​sampled by the vertices in each mask map includes: Acquire a noise image, where the noise image changes over time; Sampling the noise image based on vertices in the cloud layer sheet model to obtain sampling offset values ​​corresponding to the vertices; The texture sampling coordinates corresponding to the vertex are offset based on the sampling offset value to obtain the target sampling coordinates; Each of the mask images is sampled based on the target sampling coordinates to obtain a pixel value sampled by the vertex in each of the mask images.

8. An image processing device, characterized in that: include: A first acquisition unit is used to acquire a cloud layer map corresponding to a cloud layer model in a virtual scene, wherein a plurality of map channels of the cloud layer map are drawn with mask maps, and each mask map indicates a cloud layer display effect; A sampling unit, configured to sample each of the mask images based on texture sampling coordinates corresponding to vertices in the cloud layer sheet model, to obtain pixel values ​​sampled by the vertices in each of the mask images; A second acquisition unit, used for acquiring color parameters set for each of the mask images; A rendering unit is used to render the cloud layer model based on the pixel values ​​sampled by the vertices in each mask map and the color parameters corresponding to the mask map to obtain a cloud layer image.

9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the methods of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: It includes a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any method described in claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for processing cloud mask map

    CN108230430A

  • Cloud layer rendering method and device, equipment and storage medium

    CN112150598A

  • Cloud picture making method and device, storage medium and computer equipment

    CN113313798A

  • Cloud layer rendering method and device, storage medium and electronic device

    CN115131489A

  • Virtual cloud body rendering method and device, electronic equipment and readable storage medium

    CN116645459A