Image processing method and device, storage medium and electronic device
By drawing mask maps in multiple texture channels of cloud textures and setting color parameters, the problem of monotonous cloud effects in existing technologies is solved, and multi-layered color-changing cloud image generation is realized, thus improving the generation effect.
Patent Information
- Application Number
- CN202411997134.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2044-12-31
AI Technical Summary
Existing image processing methods produce relatively simple cloud effects, resulting in poor cloud image quality.
By acquiring cloud textures corresponding to cloud layer models in a virtual scene, masking maps in multiple texture channels are used to indicate different cloud layer display effects, and rendering is performed based on vertex texture sampling coordinates and color parameters to generate multi-layered color-changing cloud layer images.
It enhances the flexibility and diversity of cloud image generation, enables multi-layered color changing of cloud effects, and improves the generation effect of cloud images.
Smart Images

Figure CN119963714B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, specifically to an image processing method, apparatus, storage medium, and electronic device. Background Technology
[0002] With the rapid development of life and technology, people often use games for entertainment. In some games, it's frequently necessary to generate scenes with cloud effects. Existing image processing methods for achieving cloud effects often involve directly drawing cloud texture maps to create customized cloud effects.
[0003] Research and practice on existing technologies have revealed that existing image processing methods produce relatively simple cloud effects, resulting in poor cloud image generation quality. Summary of the Invention
[0004] This application provides an image processing method, apparatus, storage medium, and electronic device that can generate cloud images with various cloud display effects, improving the flexibility and diversity of cloud image generation. Based on the color parameters corresponding to each mask image, multi-level color changing of cloud effects can be achieved, effectively improving the generation effect of cloud images.
[0005] This application provides an image processing method, including:
[0006] Obtain cloud textures corresponding to cloud layer image models in a virtual scene. Multiple texture channels of the cloud textures contain mask images, and each mask image indicates a cloud display effect.
[0007] Based on the texture sampling coordinates corresponding to the vertices in the cloud layer image model, each of the mask images is sampled to obtain the pixel values of the vertices sampled in each of the mask images;
[0008] Obtain the color parameters set for each of the aforementioned mask images;
[0009] Based on the pixel values sampled by the vertex in each of the mask images and the color parameters corresponding to the mask images, the cloud layer image model is rendered to obtain a cloud layer image.
[0010] Accordingly, embodiments of this application provide an image processing apparatus, including:
[0011] The first acquisition unit is used to acquire cloud textures corresponding to cloud layer image models in a virtual scene. Multiple texture channels of the cloud textures are filled with mask images, and each mask image indicates a cloud display effect.
[0012] The sampling unit is used to sample each of the mask images based on the texture sampling coordinates corresponding to the vertices in the cloud layer image model, so as to obtain the pixel values of the vertices sampled in each of the mask images.
[0013] The second acquisition unit is used to acquire the color parameters set for each of the mask images;
[0014] The rendering unit is used to render the cloud layer image model based on the pixel values sampled by the vertex in each of the mask images and the color parameters corresponding to the mask images, so as to obtain a cloud layer image.
[0015] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a computer program adapted for loading by a processor to execute steps in any of the image processing methods provided in embodiments of this application.
[0016] Furthermore, this 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 this application.
[0017] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. When the processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the electronic device to perform the steps in the image processing method provided in this application.
[0018] This application embodiment obtains cloud textures corresponding to cloud layer models in a virtual scene. Multiple texture channels of the cloud textures contain mask images, each mask image indicating a cloud display effect. Based on the texture sampling coordinates corresponding to the vertices in the cloud layer model, each mask image is sampled to obtain the pixel values of the vertices sampled in each mask image. Color parameters set for each mask image are obtained. Based on the pixel values of the vertices sampled in each mask image and the color parameters corresponding to the mask images, the cloud layer model is rendered to obtain a cloud image. Therefore, by drawing mask maps indicating a cloud display effect in multiple texture channels of the cloud texture, and setting corresponding color parameters for each mask map, the cloud patch model can be rendered based on the pixel values sampled by the vertices in each mask map and the corresponding color parameters of the mask map. This results in cloud images with cloud display effects indicated by each mask map in the cloud texture, improving the flexibility and diversity of the generated cloud images. Based on the color parameters corresponding to each mask map, multi-layer color changing of the cloud effect can be achieved, effectively improving the generation effect of the cloud image. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram illustrating an implementation scenario of an image processing method provided in this application.
[0021] Figure 2 This is a schematic flowchart of an image processing method provided in an embodiment of this application;
[0022] Figure 3a This is a schematic diagram of the cloud display effect of an image processing method provided in an embodiment of this application;
[0023] Figure 3b This is a schematic diagram of ambient light occlusion information for an image processing method provided in an embodiment of this application;
[0024] Figure 3c This is a schematic diagram of a noisy image of an image processing method provided in an embodiment of this application;
[0025] Figure 4a This is a schematic diagram of cloud effects provided by an embodiment of the image processing method in this application;
[0026] Figure 4b This is a schematic diagram illustrating the self-illumination effect of an image processing method provided in an embodiment of this application;
[0027] Figure 4c This is a schematic diagram of the self-illumination parameter settings of an image processing method provided in an embodiment of this application;
[0028] Figure 4d This is a schematic diagram illustrating the light transmission effect of an image processing method provided in an embodiment of this application;
[0029] Figure 5 This is a schematic diagram of the structure of the image processing apparatus provided in the embodiments of this application;
[0030] Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0031] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0032] This application provides an image processing method, apparatus, storage medium, and electronic device. The image processing apparatus can be integrated into an electronic device, which may be a server or a terminal, etc.
[0033] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The terminal can include, but is not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, and aircraft. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0034] Please see Figure 1 Taking the integration of image processing devices into electronic devices as an example, Figure 1 This is a schematic diagram of an implementation scenario of the image processing method provided in this application. The electronic device can be a terminal or a server. The electronic device can acquire cloud textures corresponding to cloud layer models in a virtual scene. Multiple texture channels of the cloud textures are filled with mask images, and each mask image indicates a cloud display effect. Based on the texture sampling coordinates corresponding to the vertices in the cloud layer model, each mask image is sampled to obtain the pixel values sampled by the vertices in each mask image. Color parameters set for each mask image are acquired. Based on the pixel values sampled by the vertices in each mask image and the color parameters corresponding to the mask images, the cloud layer model is rendered to obtain a cloud image.
[0035] It should be noted that, Figure 1 The illustrated scenario of the image processing method is merely an example. The implementation environment of the image processing method described in this application is for the purpose of more clearly illustrating the technical solutions of this application and does not constitute a limitation on the technical solutions provided in this application. Those skilled in the art will understand that with the evolution of data processing and the emergence of new business scenarios, the technical solutions provided in this application are also applicable to similar technical problems.
[0036] The solutions provided in this application are specifically illustrated through the following embodiments. It should be noted that the order of description 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, which can be integrated into an electronic device, which can be a terminal and / or a server, and this application does not limit it.
[0038] Please see Figure 2 , Figure 2 This is a schematic flowchart of an image processing method provided in an embodiment of this application. The image processing method includes:
[0039] In step 101, the cloud texture map corresponding to the cloud layer model in the virtual scene is obtained.
[0040] Among them, multiple texture channels of the cloud texture can be used to draw mask images, and each mask image can indicate a cloud display effect.
[0041] The virtual scene can be a simulation of the real world, a semi-simulated / semi-fictional virtual environment, or a purely fictional virtual environment. The cloud layer patch model can be a patch model used to display cloud images in the virtual scene. This patch model can have multiple vertices, and the cloud image can be an image with cloud effects. The cloud texture map can be a texture map used to store the texture of the cloud layer patch model. Multiple texture channels of the cloud texture map can contain mask images, which can be mask-type images. The cloud display effect can be the display effect of the cloud image, such as including highlights, shadows, rim lighting effects, and reflection effects.
[0042] Optionally, the cloud texture 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 and edge lighting effects of the cloud image to be generated, the mask map of the second channel may indicate the dark effects of the cloud image to be generated, and the mask map of the third channel may indicate the reflective effects of the cloud image to be generated.
[0043] In one embodiment, assuming the cloud texture includes three texture channels: R, G, and B, the R channel can be set as the first channel, and its stored mask image can be used to indicate the bright and edge lighting effects of the cloud image to be generated. The G channel can be the second channel, and its stored mask image can be used to indicate the dark effects of the cloud image to be generated. The B channel can be the third channel, and its stored mask image can be used to indicate the reflection effects of the cloud image to be generated.
[0044] For example, please refer to Figure 3a , Figure 3a This is a schematic diagram illustrating the cloud display effect of an image processing method provided in an embodiment of this application, wherein... Figure 3a In Figure 1, the red and black areas represent the cloud display effect corresponding to the mask image stored in the R channel. The red area indicates the bright parts of the cloud image to be generated, and the black area indicates the edge lighting effect of the cloud image to be generated. Figure 3a In Figure 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 area effect of the cloud image to be generated. Figure 3a In Figure 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 texture may also include a fourth channel, which can be an alpha (A) channel. This fourth channel can plot a mask map indicating ambient occlusion information of the cloud image to be generated. This ambient occlusion information can be information indicating the ambient occlusion value corresponding to each vertex in the cloud image model. This ambient occlusion value can be calculated using ambient occlusion technology and can be used to simulate lighting effects, indicating the degree of occlusion of each vertex in the cloud image model. Ambient occlusion (AO) generates shadow effects by calculating the occlusion relationships between object surfaces, making objects or scenes appear more realistic and three-dimensional. The AO effect is designed based on cloud characteristics. The purpose of this AO mask is to limit the brightness of the four color channels, preventing them from averaging, thereby enhancing the sense of depth in the cloud image to be generated.
[0046] There are several ways to draw the ambient occlusion information of the cloud image to be generated. For example, a three-dimensional cloud model corresponding to the cloud layer image model can be created, and the ambient occlusion information corresponding to the cloud layer image model can be obtained by performing AO baking on the cloud layer model. Optionally, the ambient occlusion information corresponding to the cloud layer image model can also 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 this application embodiment does not limit it.
[0047] For example, please refer to Figure 3b , Figure 3b This is a schematic diagram of ambient light occlusion information provided in an embodiment of this application for an image processing method. The ambient light occlusion information can be a grayscale image, where each pixel value indicates the corresponding ambient light occlusion value. By rendering a cloud layer image model using this ambient light occlusion information, the generated cloud image can take into account 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.
[0048] In step 102, based on the texture sampling coordinates corresponding to the vertices in the cloud layer image model, each mask image is sampled to obtain the pixel values of the vertices sampled in each mask image.
[0049] The texture sampling coordinates can be UV coordinates used for texture sampling of the cloud layer model. They can be used to sample the mask images of each texture channel in the cloud layer map of the cloud layer model, thereby obtaining a cloud image with cloud display effects. The UV coordinates can be coordinates in a two-dimensional coordinate system used to map the texture map onto the surface of the three-dimensional model. U and V can represent the horizontal and vertical coordinate axes, respectively. The UV coordinates define the position information of each point on the texture map. These points are interconnected with the three-dimensional model, allowing each point on the texture map to be mapped to the surface of the model. Therefore, sampling can be performed on the texture map based on the UV coordinates, and the sampled pixel values can be mapped to the corresponding positions on the model surface, thus achieving the tiling of the texture map onto the surface of the three-dimensional model. The pixel value can be the result sampled from each mask image based on each texture sampling coordinate.
[0050] There are several ways to obtain the pixel values sampled by each vertex in each mask image based on the texture sampling coordinates corresponding to the vertices in the cloud layer patch model. For example, one could acquire a noise image that changes over time; sample the noise image based on the vertices in the cloud layer patch model to obtain the sampling offset value corresponding to the vertex; offset the texture sampling coordinates corresponding to the vertex based on the sampling offset value to obtain the target sampling coordinates; and then sample each mask image based on the target sampling coordinates to obtain the pixel values sampled by the vertex in each mask image.
[0051] The noise image can be used to simulate randomness and irregularity, and it can change over time. For example, please refer to... Figure 3c , Figure 3c This is a schematic diagram of a noisy image according to an embodiment of the image processing method provided in this application. The texture on the noisy image is random and irregular, and it can change over time. For example, the noisy image on the left side of the image can change to the noisy image on the right side of the image over time. The sampling offset value can be a numerical value used to offset the texture sampling coordinates of the cloud layer patch model, and the target sampling coordinates can be the texture sampling coordinates after offset based on the sampling offset value.
[0052] Therefore, by sampling the texture coordinates after offsetting based on the sampling offset value, each mask image in the cloud texture is sampled, which can slightly shift the original cloud effect pattern. Simultaneously, as the noise image changes dynamically over time, the sampling offset value is dynamically changed, which in turn changes the texture sampling coordinates. This results in the final cloud image displaying a disturbance effect caused by the sampling offset, exhibiting a dynamic deformation effect, making the cloud effect more realistic and diverse, and improving the overall cloud image generation quality.
[0053] In step 103, the color parameters set for each mask image are obtained.
[0054] The color parameter can be used to control the color of the cloud display effect corresponding to each mask image. The color of each area in the cloud image to be generated can be adjusted through this color parameter.
[0055] Optionally, the specific value of this color parameter can be set according to actual needs or customized according to user preferences. For example, for a mask image indicating the edge lighting effect of the cloud image to be generated, if its corresponding color parameter is set to the color value corresponding to black, the edge lighting effect of the cloud image to be generated can be controlled to be black. For a mask image indicating the glow effect of the cloud image to be generated, if its corresponding color parameter is set to the color value corresponding to yellow, the glow effect of the cloud image to be generated can be controlled to be yellow, and so on. In this way, by setting at least one color parameter for each mask image, cloud images with multi-layered color-changing effects can be generated. Users can customize and edit the colors of different areas in the cloud image through the color parameter, which can improve the freedom and diversity of cloud image generation and enhance the cloud image generation effect.
[0056] In step 104, the cloud layer image model is rendered based on the pixel values sampled by the vertices in each mask image and the color parameters corresponding to the mask images to obtain the cloud layer image.
[0057] The cloud image can be an image with cloud effects, for example, an image showing cloud displays with various masking indicators. For example, please refer to... Figure 4a , Figure 4a This is a schematic diagram of cloud effect provided by an embodiment of the present application. The image processing method provided by the embodiment of the present application can generate a cloud image with multi-layered cloud effect and customizable cloud color.
[0058] There are several ways to render a cloud layer image based on the pixel values sampled by the vertex in each masking image and the color parameters corresponding to the masking images. For example, the product of the pixel value and color parameters of the vertex in the same masking image can be calculated to obtain the first color value of the vertex and each masking image. The first color value of the vertex and each masking image is then fused based on the hierarchical relationship between the masking images to obtain the second color value of the vertex. The cloud layer image is then rendered based on the second color value of the vertex to obtain the cloud image.
[0059] The first color value can be the product of the pixel value and color parameter of each vertex in the cloud layer image model corresponding to the same mask image, and the second color value can be the color value obtained by fusing the first color values of the vertices with those of each mask image. The hierarchical relationship between the mask images can be determined according to the cloud display effect corresponding to the mask images. For example, the mask image simulating bright areas and edge light can correspond to the bottom layer, the mask image simulating dark areas can correspond to the middle layer, and the mask image simulating reflections can correspond to the top layer, etc. The specific hierarchical relationship can be set according to actual needs, and this embodiment of the application does not limit it. In this way, by displaying according to the second color value corresponding to the vertex, a cloud image with multi-layered color effects can be rendered in the cloud layer image model.
[0060] There are several ways to calculate the product of the pixel value and color parameter corresponding to the vertex in the same mask image to obtain the first color value of the vertex and each mask image. For example, assuming the color parameter corresponding to the first channel is color0, and assuming that vertex a in the cloud layer patch model has a sampled pixel value of 0.5 in the mask image of the first channel, then the product of the pixel value 0.5 and the color parameter color0 corresponding to vertex a in the mask image of the first channel is calculated to obtain the first color value 0.5×color0 corresponding to vertex a in the mask image of the first channel.
[0061] After calculating the product of the pixel value and color parameter corresponding to the vertex in the same mask image, the first color value corresponding to the vertex and each mask image can be fused based on the hierarchical relationship between the mask images to obtain the second color value corresponding to the vertex. There are several ways to fuse the first color value corresponding to the vertex and each mask image based on the hierarchical relationship between the mask images to obtain the second color value. For example, suppose the mask image stored in the R channel of the cloud texture is used to simulate the bright and edge lighting effects of the cloud image to be generated, the mask image stored in the G channel is used to simulate the dark effects of the cloud image to be generated, and the mask image stored in the B channel is used to simulate the reflection effects of the cloud image to be generated. The mask images of these three texture channels are mixed with the corresponding four color parameters (color0, color1, color2, color3) to change the color value corresponding to the pixel value of the vertex in each mask image, thus enabling free adjustment of the cloud effect's color and achieving multi-layered color-changing effects for the clouds. For details, please refer to [link / reference]. Figure 3a Assuming that the pixel values sampled by the vertices in the RGB three-channel masking maps of the cloud layer model are r, g, and b respectively, and that the color parameter of the masking map corresponding to the R channel for simulating edge lighting effects is the color value corresponding to black (color0), the color parameter of the masking map corresponding to the R channel for simulating bright areas is the color value corresponding to red (color1), the color parameter of the masking map corresponding to the G channel for simulating dark areas is the color value corresponding to green (color2), and the color parameter of the masking map corresponding to the B channel for simulating reflection effects is the color value corresponding to blue (color3), and assuming that finalcolor is the final output color, i.e., the second color value, then, to facilitate the explanation of each cloud layer display effect corresponding to the masking map, the effect of Figure 1 can be obtained through the following formula:
[0062] finalcolor=color1*r+color0*(1-r)
[0063] In this diagram, the red portion corresponds to the highlight effect indicated by the mask map of the R channel, and the black portion corresponds to the edge light effect indicated by the mask map of the R channel. Therefore, based on the effect in Figure 1, the effect in Figure 2 can be obtained using the following formula:
[0064] finalcolor=color2*g+finalcolor*(1-g)
[0065] In this equation, `finalcolor` on the right-hand side represents the color value corresponding to the effect in Figure 1. The green part corresponds to the dark area effect indicated by the mask map of the G channel. Based on the effect in Figure 2, we can obtain the effect in Figure 3, which is the final multi-layered color-changing effect of the clouds, using the following formula:
[0066] finalcolor=color3*b+finalcolor*(1-b)
[0067] Here, `finalcolor` on the right side of the equals sign represents the color value corresponding to effect 2 in the diagram, with the blue portion corresponding to the glowing effect indicated by the B channel mask map. Therefore, for the first color value corresponding to each vertex and each mask map, the process of merging based on the hierarchical relationship between the mask maps can be performed using the following formula to finally calculate the second color value corresponding to the vertex:
[0068] finalcolor=color3*b+(color2*g+(color1*r+color0*(1-r))*(1-g))*(1-b)
[0069] Here, finalcolor can be represented as the second color value corresponding to the vertex, color3*b can be represented as the first color value corresponding to the mask map of the B channel, color2*g can be represented as the first color value corresponding to the mask map of the G channel, and color1*r and color0*(1-r) can be represented as the first color values corresponding to the two mask maps of the R channel.
[0070] Optionally, to further enrich the cloud effect, the mask map of each texture channel can be used as a self-illuminating mask for the cloud, and the brightness of the corresponding area of each mask map in the cloud image can be dynamically adjusted by the self-illuminating parameters of each mask map, thereby improving the expressiveness of the cloud effect.
[0071] Specifically, at least one masking image can be configured with corresponding self-emission parameters. Therefore, the step of fusing the first color values of a vertex with each masking image based on the hierarchical relationship between the masking images to obtain the second color value of the vertex can include: calculating the product of the first color value of the vertex with each masking image and the self-emission parameter of the masking image to obtain the emission color value; and fusing the emission color values of the vertex with each masking image based on the hierarchical relationship between the masking images to obtain the second color value of the vertex.
[0072] Among them, the self-emission parameter, namely the self-emission intensity value, can be used to control the brightness of the corresponding area of the mask image on the cloud layer model, and the emission color value can be the first color value adjusted based on the self-emission parameter.
[0073] For example, please continue to refer to Figure 3a Assuming the self-emission parameter corresponding to the mask map of the simulated highlight effect in the R channel is x, the self-emission parameter corresponding to the mask map of the simulated rim light effect in the R channel is y, the self-emission parameter corresponding to the mask map of the G channel is z, and the self-emission 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 follows:
[0074] finalcolor=color3*b*w+(color2*g*z+(color1*r*x+color0*(1-r)*y)*(1-g))*(1-b)
[0075] For example, please refer to Figure 4b , Figure 4b This is a schematic diagram illustrating the self-illumination effect of an image processing method provided in this application embodiment. Assuming the self-illumination parameter corresponding to the mask image simulating bright areas in the R channel is x, the self-illumination parameter corresponding to the mask image simulating rim light effects in the R channel is y, the self-illumination parameter corresponding to the mask image simulating dark areas in the G channel is z, and the self-illumination parameter corresponding to the mask image simulating reflection effects in the B channel is w, when the value of y is 1, it affects… Figure 3a The brightness of the black area is obtained Figure 4b The effect of x = 1 brightens the area corresponding to the rim lighting effect, making it appear self-illuminating; similarly, when x = 1, it affects... Figure 3a The brightness of the red area was obtained. Figure 4b The effect of z2 makes the areas corresponding to the highlights brighter, showing a self-illuminating effect; when the value of z is 1, it affects... Figure 3a The brightness of the green area was obtained Figure 4b The effect of setting 3 makes the corresponding area of the shadow brighter, showing a self-illuminating effect; when the value of w is 1, it affects... Figure 3a The brightness of the blue area is obtained Figure 4b The effect of setting 4 makes the area corresponding to the reflective effect brighter, showing a self-illuminating effect.
[0076] In one embodiment, the self-illumination parameters and color parameters corresponding to each mask image can be set via a settings window. For example, please refer to... Figure 4c , Figure 4cThis is a schematic diagram illustrating the self-emission parameter settings of an image processing method provided in this application embodiment. Colored regions 1, 2, 3, and 4 can be used to set the color parameters corresponding to the mask images simulating bright areas, rim lighting, shadows, and reflections, respectively. The self-emission intensity values of colored regions 1, 2, 3, and 4 can be used to set the self-emission parameters corresponding to the mask images simulating bright areas, rim lighting, shadows, and reflections, respectively. Specific settings can be configured according to actual needs.
[0077] Optionally, the cloud texture map may also include a fourth channel, the mask map of the fourth channel indicating the ambient light occlusion information of the cloud image to be generated. Correspondingly, based on the texture sampling coordinates corresponding to the vertex, the pixel value sampled from the ambient light occlusion information is the illumination occlusion value corresponding to the vertex.
[0078] Correspondingly, the step of fusing the first color values of the vertex and each mask map based on the hierarchical relationship between the mask maps to obtain the second color value of the vertex may include: fusing the first color values of the vertex and the mask maps of the first, second and third channels based on the hierarchical relationship between the mask maps to obtain the second color value of the vertex.
[0079] Correspondingly, the step of rendering the cloud layer image model based on the second color value corresponding to the vertex to obtain the cloud image may include: calculating the product of the second color value corresponding to the vertex and the illumination occlusion value to obtain the third color value; and rendering the cloud layer image model based on the third color value to obtain the cloud image.
[0080] The third color value can be the product of the second color value corresponding to the vertex and the illumination occlusion value. Therefore, by using the ambient occlusion information corresponding to the cloud layer image model, the brightness of the four tinted regions corresponding to the first, second, and third channels can be adjusted, thereby increasing the contrast of each tinted region and simulating the global light transmission effect of the cloud layer. The greater the brightness value of each tinted region, the stronger the overall contrast of the cloud effect, thus making the light transmission effect in the cloud image more outstanding.
[0081] There are several ways to calculate the product of the second color value and the lighting occlusion value corresponding to the vertex to obtain the third color value. For example, you can obtain the lighting parameters of the target light source in the virtual scene; calculate the dot product of the lighting occlusion value and the lighting parameters to obtain the target occlusion value corresponding to the vertex; and calculate the product of the target occlusion value and the second color value corresponding to the vertex to obtain the third color value.
[0082] The target light source can be a light source in a virtual scene, such as sunlight or lamplight. The lighting parameter can be a parameter describing the lighting conditions of the target light source, which can include information such as the lighting direction and intensity of the target light source. For example, the lighting parameter can be a lighting direction vector. The target occlusion value can be information indicating the degree of occlusion corresponding to a vertex.
[0083] For example, the target light source can be sunlight in a virtual scene, and the lighting parameter can be the sunlight direction vector. Based on the ambient light occlusion information in the masking map of the fourth channel and the sunlight direction in the virtual scene, the second color value corresponding to the vertex can be adjusted. Then, based on the adjusted third color value, the cloud effect can be displayed, resulting in a cloud image with a three-dimensional shadow effect and a light transmission effect. This improves the richness and realism of the cloud effect in the cloud image and effectively enhances the cloud image generation effect.
[0084] In one embodiment, the cloud light transmission effect can also be obtained based on the ambient light occlusion information in the masking map of the fourth channel and the self-emission parameters corresponding to each masking map, through the self-emission effect of the corresponding region of each masking map. For example, the emission color value is obtained by multiplying the first color value of the vertex corresponding to each masking map and the self-emission parameter corresponding to the masking map; the emission color value of the vertex corresponding to each masking map is fused based on the hierarchical relationship between the masking maps to obtain the second color value of the vertex; the product of the second color value of the vertex and the illumination occlusion value is calculated to obtain the third color value; the cloud layer model is rendered based on the third color value to obtain the cloud image.
[0085] For example, please refer to Figure 4d , Figure 4d This is a schematic diagram illustrating the light transmission effect of an image processing method provided in an embodiment of this application. Please refer to the following for further details. Figure 4c The self-illumination parameters corresponding to the mask image simulating the reflective effect can be set by adjusting the self-illumination intensity of the stained region 4. For example, please refer to... Figure 4d In section 1, assuming the brightness value of the self-illumination intensity of the dyed region 4 is 0, the corresponding cloud effect has no light transmission; please refer to... Figure 4d In section 2, assuming the brightness value of the self-luminous intensity of its dyed region 4 is 1, the corresponding cloud effect exhibits a certain degree of light transmission; please refer to... Figure 4d In case 3, assuming the brightness value of the self-emission intensity of its stained area 4 is 2, the corresponding cloud effect is a strong light transmission effect, and detailed light shines through the gaps between the clouds. It can achieve the cloud light transmission effect without relying on strong light, which greatly improves the generation effect of cloud images.
[0086] In one specific embodiment, the image processing method provided in this application can be applied to a game map editing scenario based on user-generated content (UGC). For example, in a game map editing scenario, the game application can provide a cloud editing control. Users can trigger the cloud editing control to display a cloud window in the corresponding editing interface. The cloud window can display cloud components with various cloud styles. Different cloud components correspond to different display styles of cloud images. For example, it can include cloud effects such as cirrus clouds, cumulus clouds, small clouds, and square clouds. Users can drag any cloud component to display the cloud image corresponding to that cloud component in the virtual scene. The display position of the cloud image can be the position of the cloud patch model in the virtual scene. The cloud image can be rendered based on the cloud texture corresponding to the cloud patch model.
[0087] In this way, users can customize the colors of cloud images according to their creative needs. For example, users can set corresponding color parameters for each mask image in the cloud texture corresponding to the cloud image. Based on the color parameters, cloud images with corresponding color effects can be displayed in the virtual scene, realizing multi-level custom color changing of cloud effects and effectively improving the generation effect of cloud images.
[0088] In addition, after the user selects the corresponding cloud component, the self-illumination parameters of each mask image corresponding to that cloud component can be set. This allows the brightness of the area corresponding to each mask image in the cloud image to be dynamically adjusted through the self-illumination parameters of each mask image, thereby achieving the effect of cloud self-illumination and improving the expressiveness of the cloud effect.
[0089] Optionally, users can set whether to display shadow effects in the cloud image. When displaying shadow effects, the cloud layer image 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 allows the generated cloud image to take into account lighting and shadow effects, 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, thereby adjusting the density of texture distribution in the noise image and the speed at which the noise image changes over time. This allows them to control the amplitude and speed of cloud changes in the displayed cloud image, improving the creative effect of cloud images.
[0091] Optionally, users can also save the completed cloud images so that they can be shared and reused in subsequent map editing processes.
[0092] Therefore, this application embodiment combines players' needs for creating user-generated content (UGC) with their corresponding editor usage experience. Through a four-channel coloring process for cloud textures corresponding to cloud layer models, it achieves cloud UGC effects, offering ease of use and a WYSIWYG (What You See Is What You Get) approach. In the specific implementation, the coloring of the four regions of the cloud texture—black, red, green, and blue—simulates edge lighting, highlights, shadows, and reflections, respectively. Each region is configured with self-illumination parameters and color parameters that control its brightness value, allowing for free editing of cloud colors and self-illumination settings to achieve rich cloud effects. To more realistically simulate the layering changes and light transmission effects of clouds, this application embodiment adds a grayscale image simulating ambient light occlusion in the cloud texture and adds a disturbance effect through a noise image to enhance the dynamic performance of the clouds, improving the flexibility and diversity of the generated cloud images. Simultaneously, it effectively enhances the expressiveness and usability of UGC, improving the user experience.
[0093] As can be seen from the above, the embodiments of this application obtain cloud textures corresponding to cloud layer models in a virtual scene. Multiple texture channels of the cloud textures contain mask images, each mask image indicating a cloud display effect. Based on the texture sampling coordinates corresponding to the vertices in the cloud layer model, each mask image is sampled to obtain the pixel values of the vertices sampled in each mask image. Color parameters set for each mask image are obtained. Based on the pixel values of the vertices sampled in each mask image and the color parameters corresponding to the mask images, the cloud layer model is rendered to obtain a cloud image. Therefore, by drawing mask maps indicating a cloud display effect in multiple texture channels of the cloud texture, and setting corresponding color parameters for each mask map, the cloud patch model can be rendered based on the pixel values sampled by the vertices in each mask map and the corresponding color parameters of the mask map. This results in cloud images with cloud display effects indicated by each mask map in the cloud texture, improving the flexibility and diversity of the generated cloud images. Based on the color parameters corresponding to each mask map, multi-layer color changing of the cloud effect can be achieved, effectively improving the generation effect of the cloud image.
[0094] To better implement the above methods, embodiments of the present invention also provide an image processing device that can be integrated into an electronic device, which can be a terminal or a server.
[0095] For example, such as Figure 5 The diagram shown is a schematic representation of the structure of an image processing apparatus provided in an embodiment of this application. The image processing apparatus 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 cloud textures corresponding to cloud layer models in a virtual scene. Multiple texture channels of the cloud textures are filled with mask images, and each mask image indicates a cloud 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 image model, and obtain the pixel values sampled by the vertices in each mask image.
[0098] The second acquisition unit 203 is used to acquire the color parameters set for each mask image;
[0099] The rendering unit 204 is used to render the cloud layer image model based on the pixel values sampled by the vertices in each mask image and the color parameters corresponding to the mask image, so as to obtain the cloud layer image.
[0100] In some embodiments, the rendering unit 204 includes:
[0101] The calculation subunit is used to calculate the product of the pixel value and color parameter of the vertex corresponding to the same mask map, so as to obtain the first color value of the vertex and each mask map.
[0102] The fusion subunit is used to fuse the first color values of the vertex and each mask map based on the hierarchical relationship between the mask maps to obtain the second color value of the vertex.
[0103] The rendering subunit is used to render the cloud layer patch model based on the second color value corresponding to the vertex to obtain the cloud layer image.
[0104] In some embodiments, the texture channel includes a first channel, a second channel, and a third channel, wherein the mask map of the first channel indicates the bright and edge lighting effects of the cloud image to be generated, the mask map of the second channel indicates the dark effects of the cloud image to be generated, and the mask map of the third channel indicates the reflective effects of the cloud image to be generated.
[0105] In some embodiments, the texture channel further includes a fourth channel, the mask map of the fourth channel indicating the ambient light occlusion information of the cloud image to be generated, and the pixel value sampled from the ambient light occlusion information based on the texture sampling coordinates corresponding to the vertex is the illumination occlusion value.
[0106] This fusion subunit is used for:
[0107] The first color value corresponding to the vertex and the mask map of the first, second and third channels is fused based on the hierarchical relationship between the mask maps to obtain the second color value corresponding to the vertex.
[0108] The rendering subunit includes:
[0109] The color value calculation module is used to calculate the product of the second color value and the lighting occlusion value of the vertex to obtain the third color value;
[0110] The image rendering module is used to render cloud layer image models based on a third color value to obtain cloud layer images.
[0111] In some embodiments, the color value calculation module is used for:
[0112] Obtain the illumination 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 obtain the target occlusion value corresponding to the vertex;
[0114] The third color value is obtained by multiplying the target occlusion value corresponding to the vertex and the second color value.
[0115] In some embodiments, at least one mask image is configured with corresponding self-illumination parameters, and the fusion subunit is used for:
[0116] The emission color value is obtained by multiplying the first color value of the vertex corresponding to each mask map and the self-emission parameter corresponding to the mask map.
[0117] The emission color values of vertices in each mask map are fused based on the hierarchical relationship between the mask maps to obtain the second color value of the vertex.
[0118] In some embodiments, the sampling unit 202 is used for:
[0119] Acquire a noise image that changes over time;
[0120] Based on sampling the noisy image at the vertices in the cloud layer image model, the sampling offset value corresponding to the vertex is obtained;
[0121] The target sampling coordinates are obtained by offsetting the texture sampling coordinates corresponding to the vertex based on the sampling offset value;
[0122] Based on the target sampling coordinates, each mask image is sampled to obtain the pixel values of the vertex sampled in each mask image.
[0123] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.
[0124] As can be seen from the above, in this embodiment of the application, the first acquisition unit 201 acquires the cloud texture corresponding to the cloud layer model in the virtual scene. The cloud texture has multiple texture channels with mask images drawn in them, and each mask image indicates a cloud display effect. The sampling unit 202 samples 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. The second acquisition unit 203 acquires the color parameters set for each mask image. The rendering unit 204 renders the cloud layer model based on the pixel values sampled by the vertices in each mask image and the color parameters corresponding to the mask image to obtain the cloud image. Therefore, by drawing mask maps indicating a cloud display effect in multiple texture channels of the cloud texture, and setting corresponding color parameters for each mask map, the cloud patch model can be rendered based on the pixel values sampled by the vertices in each mask map and the corresponding color parameters of the mask map. This results in cloud images with cloud display effects indicated by each mask map in the cloud texture, improving the flexibility and diversity of the generated cloud images. Based on the color parameters corresponding to each mask map, multi-layer color changing of the cloud effect can be achieved, effectively improving the generation effect of the cloud image.
[0125] This application also provides an electronic device, such as... Figure 6 The diagram shows a structural schematic of an electronic device involved in an embodiment of this application. This electronic device can be a terminal or a server. Specifically:
[0126] The electronic device 300 includes a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 and the memory 302 are electrically connected. Those skilled in the art will understand that the electronic device structure shown in the figures does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0127] The processor 301 is the control center of the electronic device 300. It connects various parts of the electronic device 300 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, it performs various functions of the electronic device 300 and processes data, thereby monitoring the electronic device 300 as a whole.
[0128] In this embodiment, the processor 301 in the electronic device 300 loads the instructions corresponding to the processes of one or more applications into the memory 302 according to the following steps, and the processor 301 runs the applications stored in the memory 302 to realize various functions:
[0129] Obtain the cloud texture corresponding to the cloud layer model in the virtual scene. The cloud texture has multiple texture channels with mask maps drawn in them. Each mask map indicates a cloud display effect.
[0130] Based on the texture sampling coordinates corresponding to the vertices in the cloud layer image model, each mask image is sampled to obtain the pixel values of the vertices sampled in each mask image.
[0131] Get the color parameters set for each mask image;
[0132] Based on the pixel values sampled by the vertices in each mask image and the color parameters corresponding to the mask images, the cloud layer patch model is rendered to obtain the cloud layer image.
[0133] This solution obtains cloud textures corresponding to cloud layer models in a virtual scene. Multiple texture channels of the cloud textures contain mask images, each indicating a different cloud display effect. Based on the texture sampling coordinates of the vertices in the cloud layer model, each mask image is sampled to obtain the pixel values of the vertices sampled in each mask image. Color parameters set for each mask image are then obtained. Finally, based on the pixel values of the vertices sampled in each mask image and the corresponding color parameters, the cloud layer model is rendered to obtain a cloud image. Therefore, by drawing mask maps indicating a cloud display effect in multiple texture channels of the cloud texture, and setting corresponding color parameters for each mask map, the cloud patch model can be rendered based on the pixel values sampled by the vertices in each mask map and the corresponding color parameters of the mask map. This results in cloud images with cloud display effects indicated by each mask map in the cloud texture, improving the flexibility and diversity of the generated cloud images. Based on the color parameters corresponding to each mask map, multi-layer color changing of the cloud effect can be achieved, effectively improving the generation effect of the cloud image.
[0134] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0135] Optional, such as Figure 6 As shown, the electronic device 300 also includes: a touch display 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 display screen 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307. Those skilled in the art will understand that... Figure 6 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0136] The touch display screen 303 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 303 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 301. It can also receive and execute commands from the processor 301. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 301 to determine the type of touch event. Subsequently, the processor 301 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 303 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 303 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 303 can also be used as part of the input unit 306 to achieve input functions.
[0137] The radio frequency circuit 304 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other electronic devices, and to transmit and receive signals with network devices or other electronic devices.
[0138] Audio circuitry 305 can be used to provide an audio interface between a user and an electronic device via a speaker and a microphone. Audio circuitry 305 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 305, converted back into audio data, and then processed by processor 301 before being transmitted via radio frequency circuitry 304 to, for example, another electronic device, or output to memory 302 for further processing. Audio circuitry 305 may also include an earphone jack to facilitate communication between peripheral headphones and electronic devices.
[0139] The input unit 306 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
[0140] Power supply 307 is used to supply power to various components of electronic device 300. Optionally, power supply 307 can be logically connected to processor 301 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 307 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0141] although Figure 6 As not shown in the diagram, the electronic device 300 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.
[0142] In the above embodiments, the descriptions of each embodiment have different focuses. Parts not described in detail in a particular embodiment can be found in the relevant descriptions of other embodiments. It should be noted that the electronic device provided in this application's embodiments belongs to the same concept as the image processing method described in the above embodiments, and its specific implementation process is detailed in the above method embodiments, and will not be repeated here.
[0143] As can be seen from the above, the electronic device provided in this application embodiment can obtain cloud textures corresponding to cloud layer models in a virtual scene. Multiple texture channels of the cloud textures are filled with mask images, and each mask image indicates a cloud display effect. Based on the texture sampling coordinates corresponding to the vertices in the cloud layer model, each mask image is sampled to obtain the pixel values of the vertices sampled in each mask image. Color parameters set for each mask image are obtained. Based on the pixel values of the vertices sampled in each mask image and the color parameters corresponding to the mask images, the cloud layer model is rendered to obtain a cloud image. Therefore, by drawing mask maps indicating a cloud display effect in multiple texture channels of the cloud texture, and setting corresponding color parameters for each mask map, the cloud patch model can be rendered based on the pixel values sampled by the vertices in each mask map and the corresponding color parameters of the mask map. This results in cloud images with cloud display effects indicated by each mask map in the cloud texture, improving the flexibility and diversity of the generated cloud images. Based on the color parameters corresponding to each mask map, multi-layer 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 understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0145] Therefore, embodiments of this application provide a computer-readable storage medium storing a computer program that can be loaded by a processor to execute the steps of any of the image processing methods provided in embodiments of this application. For example, the computer program can execute the following steps:
[0146] Obtain the cloud texture corresponding to the cloud layer model in the virtual scene. The cloud texture has multiple texture channels with mask maps drawn in them. Each mask map indicates a cloud display effect.
[0147] Based on the texture sampling coordinates corresponding to the vertices in the cloud layer image model, each mask image is sampled to obtain the pixel values of the vertices sampled in each mask image.
[0148] Get the color parameters set for each mask image;
[0149] Based on the pixel values sampled by the vertices in each mask image and the color parameters corresponding to the mask images, the cloud layer patch model is rendered to obtain the cloud layer image.
[0150] This solution obtains cloud textures corresponding to cloud layer models in a virtual scene. Multiple texture channels of the cloud textures contain mask images, each indicating a different cloud display effect. Based on the texture sampling coordinates of the vertices in the cloud layer model, each mask image is sampled to obtain the pixel values of the vertices sampled in each mask image. Color parameters set for each mask image are then obtained. Finally, based on the pixel values of the vertices sampled in each mask image and the corresponding color parameters, the cloud layer model is rendered to obtain a cloud image. Therefore, by drawing mask maps indicating a cloud display effect in multiple texture channels of the cloud texture, and setting corresponding color parameters for each mask map, the cloud patch model can be rendered based on the pixel values sampled by the vertices in each mask map and the corresponding color parameters of the mask map. This results in cloud images with cloud display effects indicated by each mask map in the cloud texture, improving the flexibility and diversity of the generated cloud images. Based on the color parameters corresponding to each mask map, multi-layer color changing of the cloud effect can be achieved, effectively improving the generation effect of the cloud image.
[0151] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0152] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0153] Since the computer program stored in the computer-readable storage medium can execute the steps of any of the image processing methods provided in the embodiments of this application, the beneficial effects that any of the image processing methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0154] According to one aspect of this application, a computer program product is provided, comprising a computer program 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, causing the electronic device to perform the methods provided in the various optional implementations of the above embodiments.
[0155] The foregoing has provided a detailed description of an image processing method, apparatus, storage medium, and electronic device provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An image processing method, characterized by, The method comprises the following steps: obtain a cloud layer map corresponding to a cloud layer patch model in a virtual scene, a plurality of map channels of the cloud layer map are drawn with a mask picture, and each mask picture indicates a cloud layer display effect; based on the texture sampling coordinates corresponding to the vertices in the cloud layer patch model, sample each mask picture to obtain the pixel values of the vertices sampled in each mask picture; obtain color parameters set for each mask picture; calculate the product of the pixel values of the vertices corresponding to the same mask picture and the color parameters to obtain the first color values of the vertices corresponding to each mask picture; fuse the first color values of the vertices corresponding to each mask picture based on the hierarchical relationship between the mask pictures to obtain the second color values corresponding to the vertices; based on the second color values corresponding to the vertices, render the cloud layer patch model to obtain a cloud layer image.
2. The image processing method of claim 1, wherein, The map channels include a first channel, a second channel and a third channel, the mask picture of the first channel indicates the bright part and edge light effect of the cloud layer image to be generated, the mask picture of the second channel indicates the dark part effect of the cloud layer image to be generated, and the mask picture of the third channel indicates the reflection effect of the cloud layer image to be generated.
3. The image processing method of claim 2, wherein, The map channels further include a fourth channel, the mask picture of the fourth channel indicates the ambient light shading information of the cloud layer image to be generated, and the pixel value sampled from the ambient light shading information based on the texture sampling coordinates corresponding to the vertices is a light shading value; The fusion processing of the first color values of the vertices corresponding to each mask picture based on the hierarchical relationship between the mask pictures to obtain the second color values corresponding to the vertices comprises: fuse the first color values of the vertices corresponding to the mask pictures of the first channel, the second channel and the third channel based on the hierarchical relationship between the mask pictures to obtain the second color values corresponding to the vertices; The rendering of the cloud layer patch model based on the second color values corresponding to the vertices to obtain a cloud layer image comprises: calculate the product of the second color values corresponding to the vertices and the light shading value to obtain a third color value; render the cloud layer patch model based on the third color value to obtain a cloud layer image.
4. The image processing method of claim 3, wherein, The calculation of the product of the second color values corresponding to the vertices and the light shading value to obtain a third color value comprises: obtain the light parameter of a target light source in the virtual scene; calculate the dot product of the light shading value and the light parameter to obtain a target shading value corresponding to the vertices; calculate the product of the target shading value corresponding to the vertices and the second color value to obtain a third color value.
5. The image processing method of claim 1, wherein, At least one mask picture is configured with a corresponding self-luminous parameter, and the fusion processing of the first color values of the vertices corresponding to each mask picture based on the hierarchical relationship between the mask pictures to obtain the second color values corresponding to the vertices comprises: calculate the product of the first color values of the vertices corresponding to each mask picture and the self-luminous parameter corresponding to the mask picture to obtain a luminous color value; The vertex corresponds to second color values are obtained by fusing the vertex corresponding to first color values of each of the mask maps based on a hierarchical relationship between the mask maps.
6. The image processing method of any one of claims 1 to 5, wherein, The sampling unit is configured to sample each of the mask maps based on the texture sampling coordinates corresponding to the vertex in the cloud layer patch model to obtain pixel values sampled by the vertex in each of the mask maps. An image of noise waves is obtained, and the image of noise waves changes over time. A sampling offset value corresponding to the vertex is obtained by sampling the image of noise waves based on the vertex in the cloud layer patch model. A target sampling coordinate is obtained by offsetting the texture sampling coordinates corresponding to the vertex based on the sampling offset value. The sampling unit is configured to sample each of the mask maps based on the texture sampling coordinates corresponding to the vertex in the cloud layer patch model to obtain pixel values sampled by the vertex in each of the mask maps.
7. An image processing apparatus characterized by comprising: The sampling unit is configured to sample each of the mask maps based on the texture sampling coordinates corresponding to the vertex in the cloud layer patch model to obtain pixel values sampled by the vertex in each of the mask maps. The sampling unit is configured to sample each of the mask maps based on the texture sampling coordinates corresponding to the vertex in the cloud layer patch model to obtain pixel values sampled by the vertex in each of the mask maps. The rendering unit is configured to calculate a product of the pixel values corresponding to the vertex in the same mask map and the color parameters to obtain first color values corresponding to the vertex and each of the mask maps, fuse the first color values corresponding to the vertex and each of the mask maps based on the hierarchical relationship between the mask maps to obtain second color values corresponding to the vertex, and render the cloud layer patch model based on the second color values corresponding to the vertex to obtain a cloud layer image. The computer program is stored in the memory and, when executed by the processor, causes the processor to perform the steps of the method in any one of claims 1-6. The computer program is stored in the memory and, when executed by the processor, causes the processor to perform the steps of the method in any one of claims 1-6.
8. An electronic device, comprising: 9. A computer-readable storage medium, characterized in that,
Citation Information
Patent Citations
Method and device for processing cloud mask map
CN108230430A
Cloud layer rendering method and device, equipment and storage medium
CN112150598A