Image processing method and device, storage medium and electronic equipment

By randomly distributed the material stickers of the virtual object in the game scenario and converted into a four -party continuous map, the performance overhead caused by the virtual object laying of the virtual objects in the existing technologies has been solved, and efficient image processing and flexible virtual object distribution are achieved.

CN119379885APending Publication Date: 2025-01-28NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411322221.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The existing image processing method of laying multiple virtual object models on the ground of a game scene results in high performance overhead, thereby reducing image processing efficiency.

Method used

By obtaining the first material sticker of the target virtual object, a multiple position points are randomly distributed in the preset texture area, the first material sticker is placed on these points, the distribution map of the object is generated, and it is converted to the four -party continuous target material The texture is finally generated based on the target material texture.

Benefits of technology

The target image with the effect of the distribution of target virtual objects is achieved with lower performance consumption, which improves the efficiency of image processing and improves the flexibility and convenience of the distribution of target virtual objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379885A_ABST
    Figure CN119379885A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image processing method and device, a storage medium and electronic equipment. The method comprises the steps of obtaining a first material map of a target virtual object; first material chartlets are placed on a plurality of position points in the preset chartlet area to obtain an object distribution map, and the position points are randomly distributed points generated in the preset chartlet area; converting the object distribution map into a target material map, wherein the target material map belongs to a tetragonal continuous map; and generating a target image with a target virtual object distribution effect based on the target material map. Therefore, the first material map of the target virtual object is placed on the plurality of position points randomly distributed in the preset map area to obtain the object distribution map, and the target material map with continuous four sides is generated based on the object distribution map, so that the target material map is adopted for rendering. The target image with a target virtual object distribution effect can be generated with relatively low rendering overhead, and the image processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, 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, there are often scenes of virtual objects such as fallen leaves and petals on the ground. In order to create a scene of fallen leaves on the ground, it is necessary to lay multiple leaf models on the ground in the game scene.

[0003] In the process of research and practice of existing technologies, it was found that the existing image processing method of laying out models of multiple virtual objects on the ground of a game scene separately would cause a lot of performance overhead, especially when covering a large area, thereby making the image processing efficiency low. 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 a target image with a target virtual object distribution effect with lower performance consumption, thereby effectively improving image processing efficiency.

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

[0006] Obtain a first material map of the target virtual object;

[0007] Placing the first material map at a plurality of position points in a preset map area respectively to obtain an object distribution map, wherein the position points are randomly distributed points generated in the preset map area;

[0008] Converting the object distribution map into a target material map, wherein the target material map is a four-way continuous map;

[0009] A target image having a target virtual object distribution effect is generated based on the target material map.

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

[0011] An acquisition unit, used for acquiring a first material map of a target virtual object;

[0012] A laying unit, used for placing the first material map at a plurality of position points in a preset map area respectively to obtain an object distribution map, wherein the position points are randomly distributed points generated in the preset map area;

[0013] A conversion unit, used for converting the object distribution map into a target material map, wherein the target material map is a four-way continuous map;

[0014] A generating unit is used to generate a target image with a target virtual object distribution effect based on the target material map.

[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 the first material map of the target virtual object; places the first material map at multiple position points in the preset map area respectively to obtain an object distribution map, where the position points are randomly distributed points generated in the preset map area; converts the object distribution map into a target material map, where the target material map belongs to a four-way continuous map; and generates a target image with a target virtual object distribution effect based on the target material map. In this way, by placing the first material map of the target virtual object at multiple position points randomly distributed in the preset map area, an object distribution map is obtained, and a four-way continuous target material map is generated based on the object distribution map, so that the material maps of multiple target virtual objects are merged into a large target material map in a seamless splicing manner, so that the target material map is used for rendering, which can avoid the large rendering overhead generated by rendering the models of multiple target virtual objects, and realize the generation of a target image with a target virtual object distribution effect with a lower performance consumption. At the same time, the four-way continuous target material map can facilitate the generation of a target image with a target virtual object distribution effect in a large area scene, improve the flexibility and convenience of the target virtual object distribution, and thus effectively improve the image processing efficiency. 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 is a material mapping schematic diagram of an image processing method provided in an embodiment of the present application;

[0023] Figure 3b It is a schematic diagram of a preset mapping area of ​​an image processing method provided in an embodiment of the present application;

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

[0025] Figure 3d It is a schematic diagram of texture rendering of an image processing method provided in an embodiment of the present application;

[0026] Figure 3e It is a schematic diagram of four-way continuous generation of an image processing method provided in an embodiment of the present application;

[0027] Figure 4a is another material mapping schematic diagram of an image processing method provided by an embodiment of the present application;

[0028] Figure 4b is a schematic diagram of a target image of an image processing method provided in an embodiment of the present application;

[0029] Figure 4c It is a shadow production schematic diagram of an image processing method provided in an embodiment of the present application;

[0030] Figure 4d It is a specific flow chart of an image processing method provided in an embodiment of the present application;

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

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

[0033] 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.

[0034] 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.

[0035] 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.

[0036] 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 first material map of a target virtual object; place the first material map at multiple position points in a preset map area respectively to obtain an object distribution map, wherein the position points are randomly distributed points generated in the preset map area; convert the object distribution map into a target material map, wherein the target material map is a four-way continuous map; and generate a target image with a target virtual object distribution effect based on the target material map.

[0037] 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.

[0038] 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.

[0039] 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.

[0040] 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:

[0041] In step 101, a first material map of a target virtual object is obtained.

[0042] The target virtual object may be a virtual object used to be distributed in a virtual scene, and 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. For example, the target virtual object may be a virtual object such as leaves, petals, insects, fruits, luminous points, etc., which are used to be placed in a virtual scene to present a random distribution effect. For example, a plurality of leaves may be laid on the ground of a virtual scene to produce an image effect of fallen leaves randomly laid on the ground. For another example, a plurality of leaves and petals may be laid on the ground of a virtual scene to produce an image effect of fallen leaves and petals randomly laid on the ground, etc. The first material map may be a material map of a target virtual object. The material map may be a map that describes the characteristics of an object surface or several faces. The first material map may include material maps of different map channels. For example, the first material map may include a diffuse channel intrinsic color map, a normal channel normal map, and a glossiness channel glossiness map. It may also include only an intrinsic color map of an intrinsic color channel, or other types of material maps. The specific setting may be based on the actual application scenario, and the embodiments of the present application are not limited here.

[0043] Optionally, the number of target virtual objects obtained can be multiple, for example, multiple leaves, multiple leaves and petals, etc., and different target virtual objects have different display attributes, for example, different target virtual objects can have different colors, different postures, different sizes, different seasons or different types, etc. For example, when the target virtual object is a leaf, it can include leaves of different colors such as red leaves, green leaves, and yellow leaves, and can include leaves of different types such as leaves of ginkgo trees, leaves of maple trees, and leaves of camphor trees. It can also include leaves placed on the front, leaves placed on the back, and leaves placed at an angle. Leaves of different postures can be combined together to create a diverse group of fallen leaves, thereby increasing the realism of the scene. The specific target virtual objects to be obtained can be selected according to the actual application scenario, so as to generate an image with a natural and realistic target virtual object distribution effect based on the obtained target virtual objects with different display attributes.

[0044] In one embodiment, taking the target virtual object as a leaf as an example, please refer to Figure 3a , Figure 3a It is a material mapping schematic diagram of an image processing method provided in an embodiment of the present application, which can obtain an intrinsic color map, a normal map and a glossiness map including multiple target virtual objects, so that the intrinsic color map, the normal map and the glossiness map can be split into a single target virtual object respectively, and the map corresponding to the split single target virtual object is placed in a square patch, so as to obtain the intrinsic color map, the normal map and the glossiness map of each target virtual object as the first material map of each target virtual object.

[0045] In step 102, a first material map is placed at a plurality of position points in a preset map area to obtain an object distribution map.

[0046] The preset map area may be an area for displaying and editing a material map, the location point may be a randomly distributed point generated in the preset map area, and the object distribution map may be an area where a first material map is placed, and may indicate the distribution of a target virtual object.

[0047] Among them, the density of the position points distributed in the preset map area can be a larger density, or can be the maximum density of the target virtual objects distributed in the virtual scene. In this way, the density of the first material map distributed in the object distribution map can be at a larger density. Therefore, in the subsequent image processing process, the density can be adjusted according to the distribution of the target virtual objects required in the actual scene, so that images of target virtual object distribution effects with various densities can be generated more flexibly, naturally and conveniently.

[0048] In one embodiment, the first material map is placed at multiple positions in the preset map area, and there are many ways to obtain the object distribution map. For example, taking the target virtual object as a leaf as an example, please refer to Figure 3b , Figure 3b is a schematic diagram of a preset mapping area of ​​an image processing method provided in an embodiment of the present application. A plurality of randomly distributed position points can be generated in the preset mapping area based on a random distribution algorithm, so that the first material mapping of the target virtual object can be copied, and the copied first material mapping is randomly placed at the position points in the preset mapping area to obtain an object distribution map. For example, please refer to Figure 3c , Figure 3c This is a schematic diagram of an object distribution map of an image processing method provided by an embodiment of the present application. The copied first material map can be randomly placed at position points in a preset map area to obtain an object distribution map with multiple copied first material maps. In this way, the first material maps of different target virtual objects can be copied to achieve random and multiple distribution in the object distribution map, so that based on a small number of non-repetitive three-dimensional models of target virtual objects, the first material map of the target virtual object is rendered, and the first material map is copied and placed at multiple position points in the preset map area to obtain a large number of object distribution maps with multiple target virtual objects randomly distributed, so that subsequent image generation based on the object distribution map can avoid the rendering consumption caused by rendering multiple models, thereby improving image processing efficiency.

[0049] Among them, the random distribution algorithm can be a Monte Carlo algorithm, which can be used to simulate randomness in the real world. For example, in the process of generating fallen leaves, the Monte Carlo distribution can be used to determine the position and number of fallen leaves. Through random sampling, a more realistic and diverse fallen leaf distribution effect can be achieved. At the same time, copy placement refers to copying the same fallen leaf map multiple times and placing it in different positions to increase the density and richness of the fallen leaf paving and enhance the authenticity of the fallen leaf paving effect. In this way, based on the Monte Carlo algorithm, the discrete point coordinates of random variables with various probability distributions can be generated on a plane, thereby obtaining multiple randomly distributed position points, thereby copying the first material map to each position point, and the target virtual object can be placed randomly and evenly according to the randomly distributed position points, thereby forming a natural and random target virtual object distribution effect.

[0050] In a specific embodiment, a scatter node of Houdini (a three-dimensional computer graphics software) may be used to implement a random distribution algorithm of a Monte Carlo distribution, thereby generating a plurality of randomly distributed position points in a preset mapping area.

[0051] In one embodiment, when the first material map of the target virtual object includes an intrinsic color map, a normal map, and a glossiness map, each first material map can be copied respectively, and the copied maps can be placed at a position point in a preset map area, so as to obtain a first object distribution map corresponding to the intrinsic color map, a second object distribution map corresponding to the normal map, and a third object distribution map corresponding to the glossiness map. Optionally, one of the first material maps can also be copied, and the copied map can be placed at a position point in the preset map area to obtain an object distribution map corresponding to the first material map, so that according to the correspondence between the various first material maps of the target virtual object, the first material maps in the object distribution map corresponding to the first material map can be replaced with other types of first material maps respectively, so as to obtain a first object distribution map corresponding to the intrinsic color map, a second object distribution map corresponding to the normal map, and a third object distribution map corresponding to the glossiness map.

[0052] In one embodiment, the coordinates of the center points of the maps in each square patch may be aligned, so that when the first material map placed in the object distribution map is subsequently rotated, the orientation of the normal map corresponding to the first material map may be adjusted based on the coordinates of the aligned center point and the rotation angle, so as to unify the normal directions of the first material maps distributed in the object distribution map, thereby obtaining a normal map with a correct normal orientation. Optionally, the RG value of the adjusted normal map may be calculated by the following formula:

[0053] R=dot(innor.xy,float2(cos(a),(sin(a)*-1)));

[0054] G=dot(innor.xy,float2((sin(a)),cos(a)));

[0055] final = float2(R,G).

[0056] Among them, R and G may be the values ​​of the R channel and G channel of the adjusted normal map, innor.xy may be the RG value of the original normal map of the target virtual object before rotation, and a may be the rotation angle of the first material map of the target virtual object.

[0057] Wherein, in step 103, the object distribution map is converted into a target material map.

[0058] The target texture is a four-way continuous texture. The target texture may be a texture rendered based on an object distribution map, and may indicate the characteristics of a first texture distributed in the object distribution map. The target texture may be a four-way continuous texture, and four-way continuous refers to a pattern generated by a unit pattern being repeatedly and continuously arranged in four directions, upward, downward, left, and right.

[0059] Optionally, when the first material map includes an intrinsic color map, a normal map, and a glossiness map of different map channels, the target material map may include a target intrinsic color map, a target normal map, and a target glossiness map of different map channels. The target intrinsic color map may be a material map rendered from an object distribution map under an intrinsic color channel, the target normal map may be a material map rendered from an object distribution map under a normal channel, and the target glossiness map may be a material map rendered from an object distribution map under a glossiness channel.

[0060] There are many ways to convert the object distribution map into a target material map. For example, when the object distribution map includes a first object distribution map corresponding to an intrinsic color map, a second object distribution map corresponding to a normal map, and a third object distribution map corresponding to a glossiness map, the object distribution map can be processed for four-way continuous map generation to obtain a processed distribution map; a map rendering area is determined in the processed distribution map; the first object distribution map, the second object distribution map, and the third object distribution map of the map rendering area are respectively rendered to obtain a target intrinsic color map, a target normal map, and a target glossiness map; and a target material map is obtained based on the target intrinsic color map, the target normal map, and the target glossiness map.

[0061] Among them, the processed distribution map can be used to obtain a four-way continuous object distribution map, and the processed distribution map is composed of at least an object distribution map located at the center and multiple object distribution maps distributed around the object distribution map in the center. The map rendering area can be an area in the processed distribution map used to render the target material map, and the object distribution map in the map rendering area belongs to a four-way continuous map.

[0062] There are many ways to generate a square continuous map of the object distribution map to obtain the processed distribution map. For example, the object distribution map can be copied to obtain multiple object distribution maps, and the copied object distribution maps can be spliced ​​into a nine-square grid to obtain the processed distribution map.

[0063] After the object distribution map is processed for four-square continuous mapping, the mapping rendering area can be determined in the processed distribution map. There are many ways to determine the mapping rendering area in the processed distribution map. For example, the center area of ​​the processed distribution map spliced ​​in the form of a nine-square grid can be determined as the mapping rendering area.

[0064] In one embodiment, taking the target virtual object as a leaf as an example, please refer to Figure 3d , Figure 3d This is a schematic diagram of texture rendering of an image processing method provided in an embodiment of the present application. The nine copied object distribution maps can be spliced ​​together to obtain a processed distribution map spliced ​​in the form of a nine-square grid. Among them, in order to enhance the expressiveness of the scene, virtual lights and cameras can be automatically created to perform channel-by-channel rendering on the object distribution maps of different texture channels. Among them, by setting appropriate lights, the leaves can have better light and shadow effects and light and dark contrast in the virtual scene, thereby improving the image effect. At the same time, the channel-by-channel rendering can divide the rendering results of the processed distribution maps corresponding to the first material maps into different channels such as intrinsic color, normal, depth, and glossiness, which is convenient for later color processing and adjustment, and increases the flexibility and artistry of rendering. The processed distribution map can thus be divided into nine areas, and the area in the center is determined as the texture rendering area. For example, please refer to Figure 3e , Figure 3e It is a schematic diagram of four-way continuous generation of an image processing method provided in an embodiment of the present application. A central area in the processed distribution map can be determined as a map rendering area. The map rendering area is rendered in different channels through a virtual camera to obtain a target intrinsic color map, a target normal map and a target gloss map corresponding to each object distribution map.

[0065] In one embodiment, a depth map corresponding to the object distribution map can be rendered in a texture rendering area of ​​a processed distribution map corresponding to the first object distribution map, the second object distribution map, or the third object distribution map. Specifically, a target depth map in the target material map can be rendered based on at least one of the first object distribution map, the second object distribution map, and the third object distribution map in the texture rendering area, so that the target material map can be obtained based on the target intrinsic color map, the target normal map, the target glossiness map, and the target depth map.

[0066] For example, see Figure 4a , Figure 4a It is another material map schematic diagram of an image processing method provided in an embodiment of the present application. Channel rendering can be performed based on the first object distribution map, the second object distribution map and the third object distribution map in the map rendering area to obtain the target intrinsic color map, the target normal map, the target gloss map and the target depth map corresponding to the object distribution map as the target material map.

[0067] In this way, based on the four-way continuous target material map, the first material maps of multiple target virtual objects can be merged into a large map in a seamless manner, which can eliminate the edge gaps and overlapping problems between the material maps, making the texture mapping of the target virtual object more natural and continuous, thereby improving the realism and detail performance of the rendering, making the target virtual objects in the scene look more realistic and detailed. In addition, the four-way continuous target material map can reduce resource and rendering costs to a certain extent. Compared with using an independent material map to render each target virtual object, using a four-way continuous target material map can reduce texture switching and rendering overhead. At the same time, the merged target material map can be reused, reducing memory usage and resource loading time. In this way, not only can development costs and hardware resources be saved, but also rendering speed and efficiency can be improved. In addition, the four-way continuous target material map has a high degree of freedom and can meet the requirements of different scenes and needs. By controlling the splicing and merging methods, the density and distribution range of the target virtual objects can be freely adjusted, making the distribution of the target virtual objects in the scene more flexible and diversified. At the same time, since the merged target material map can be reused, it can be dynamically loaded and applied when the game is running, so that the leaf distribution in the scene can be changed and adjusted in real time, which can increase the variability and playability of the scene and enhance the user experience.

[0068] In step 104, a target image having a target virtual object distribution effect is generated based on the target material map.

[0069] The target image may be an image with a target virtual object distribution effect. For example, when the target virtual object is a leaf, the target image may be an image with a leaf laying effect. When the target virtual object is a leaf and a petal, the target image may be an image with a leaf laying effect and a petal laying effect. When the target virtual object is a person, the target image may be an image with a fruit laying effect. For example, please refer to Figure 4b , Figure 4b It is a schematic diagram of a target image of an image processing method provided in an embodiment of the present application. When the target virtual object is a leaf, the target image may be an image of fallen leaves randomly laid on the ground.

[0070] There are many ways to generate a target image with a target virtual object distribution effect based on a target material map. For example, a second material map of a base object model on which a target virtual object is to be placed can be obtained, and the second material map and the target material map can be merged to obtain a target map. The base object model is rendered using the target map to obtain a target image indicating that target virtual objects are randomly distributed on the base object model.

[0071] The basic object model may be a three-dimensional model of a basic object on which a target virtual object is to be placed, for example, the basic object may be an object such as the ground, a roof, or a lawn on which a target virtual object may be placed. The second material map may be a material map corresponding to the basic object model, and the target map may be a map that combines the second material map and the target material map.

[0072] There are many ways to fuse the second material map and the target material map to obtain the target map. For example, the target material map can be superimposed on the second material map to display the laid target virtual object on the base object. Specifically, a step function can be used to set the grayscale values ​​in the target depth map in the target material map to 0 and 1, multiply the grayscale values ​​of the set target depth map and the channel values ​​of other target material maps to obtain the synthesized target material map, and then multiply the grayscale values ​​of the set target depth map and the channel values ​​of the second material map to obtain the processed second material map. In the processed second material map, the channel value corresponding to the position where the target virtual object is laid in the target material map is 0, and the channel values ​​of the processed second material map and the channel values ​​of the synthesized target material map are added to obtain the target map.

[0073] In one embodiment, the target material map may include a target depth map and at least one surface material map. The surface material map may include a target intrinsic color map, and may also include a target glossiness map and a normal map, etc., so that the density of the target virtual object distributed on the base object can be adjusted according to the target depth map. Specifically, before the second material map and the target material map are merged to obtain the target map, a target grayscale value can be determined, and the target grayscale value is used to indicate the required distribution density of the target virtual object on the base object; based on the target grayscale value, the target depth map is partially cropped to obtain a cropped depth map; based on the cropped depth map, the surface material map is cropped to obtain a target material map corresponding to the distribution density.

[0074] Among them, the target grayscale value can be information for adjusting the density of the target virtual object distributed on the base object, and the cropped depth map can be a depth map after partially cropping the target depth map based on the target grayscale value. Since the object distribution map is a map in which multiple first material maps are stacked, and the density of the first material maps distributed in the object distribution map is relatively large, the first material maps placed in the object distribution map will be stacked, so that when the object distribution map is rendered in different channels, the first material maps at different levels will have different grayscale values, that is, the first material maps at different levels in the target depth map will correspond to different grayscale values. Therefore, the first material maps at the corresponding level can be cropped according to the grayscale value, so as to control the first material maps distributed in the object distribution map to become sparse, thereby reducing the distribution density of the target virtual objects distributed on the base object in the target image generated based on the target material map.

[0075] Among them, based on the target grayscale value, the target depth map is partially cropped, and there are many ways to obtain the cropped depth map. For example, the grayscale values ​​in the target depth map that are greater than the target grayscale value can be set to 0, and the grayscale values ​​in the target depth map that are not greater than the target grayscale value can be set to 1, so that the target virtual objects located at the level corresponding to the target grayscale value can be cropped, and then based on the cropped target material map of the cropped depth map, a target image with a relatively sparse distribution of target virtual objects can be generated.

[0076] Among them, there are many ways to crop the surface material map based on the cropped depth map to obtain the target material map corresponding to the distribution density. For example, the grayscale value of each position in the cropped depth map can be multiplied by the channel value of the corresponding position in the surface material map to obtain the target material map corresponding to the distribution density.

[0077] In one embodiment, the shadow effect of the target virtual object distributed on the base object can be generated according to the target depth map, so as to improve the authenticity and naturalness of the target virtual object distributed on the base object in the target image and improve the image processing effect. Specifically, the target grayscale range can be determined; the grayscale values ​​in the target depth map that do not match the target grayscale range are set to 0 to obtain a first target depth map; the grayscale values ​​in the first target depth map are positionally offset according to a preset lighting direction to obtain a second target depth map; the positions in the second target depth map where the grayscale values ​​are not 0 are filled with dark pixels to obtain a shadow map; the first target depth map, the shadow map and the surface material map are mixed to obtain a target material map with a shadow effect added.

[0078] Among them, the target grayscale range can be the grayscale value range of the area in the target depth map used to construct a pseudo shadow, the first target depth map can be a depth map obtained by setting the grayscale values ​​in the target depth map that do not match the target grayscale range to 0, the second target depth map can be a depth map obtained by positionally offsetting the grayscale values ​​in the first target depth map according to the lighting direction, and the shadow map can be a map used as a shadow.

[0079] Among them, the grayscale values ​​in the target depth map that do not match the target grayscale range are set to 0, and there are many ways to obtain the first target depth map. For example, in the stacked target virtual objects, the grayscale range corresponding to the target virtual objects in the top two layers in the target depth map can be determined as the target grayscale range, that is, the range of the two smallest grayscale values ​​in the target depth map is determined as the target grayscale range. In this way, a shadow effect can be made under the top two layers of target virtual objects. Optionally, a pseudo shadow effect can also be made at other levels, which can be set according to actual conditions. Specifically, according to the target grayscale range, the grayscale value corresponding to the position in the target depth map where the grayscale value is not within the target grayscale range can be set to 0 to retain the grayscale value of the position where the grayscale value is within the target grayscale range, that is, retain the grayscale value corresponding to the top two layers of target virtual objects to obtain the first target depth map.

[0080] There are multiple ways to obtain the second target depth map by offsetting the grayscale values ​​in the first target depth map according to the preset illumination direction. For example, the grayscale values ​​in the first target depth map are offset in the same direction as the incident direction of sunlight in the virtual scene to obtain the second target depth map. For example, assuming an offset distance of 0.1, the preset illumination direction is to the right, and assuming that the grayscale value of the pixel at the position (0.2, 0.3) of the first target depth map is 1, then after the grayscale value in the first target depth map is offset according to the preset illumination direction, the position of the grayscale value in the second target depth map is (0.3, 0.3).

[0081] There are many ways to fill the positions where the grayscale value in the second target depth map is not 0 with dark pixels to obtain the shadow map. For example, the grayscale value in the second target depth map can be multiplied with the channel value in the second material map, and then the pixel values ​​of the non-0 pixel values ​​after the multiplication are adjusted to dark pixel values, that is, adjusted to the color that meets the shadow effect, so that the pixel values ​​of the shadow effect can be constructed to obtain the shadow map. Optionally, the grayscale value in the second target depth map can also be multiplied with the map filled with dark pixels to obtain the shadow map.

[0082] Among them, there are many ways to mix the first target depth map, the shadow map and the surface material map to obtain the target material map with added shadow effect. For example, the grayscale value of the first target depth map and the surface material map can be multiplied to obtain a map that retains the target virtual object laid on the upper layer, the grayscale value of the shadow map and the surface material map can be multiplied to obtain a map that retains the shadow effect, the map that retains the target virtual object laid on the upper layer is superimposed on the map that retains the shadow effect to obtain a map that retains the target virtual object laid on the upper layer and covers part of the shadow effect, and the map that retains the target virtual object laid on the upper layer and covers part of the shadow effect is covered on the surface material map to obtain a target material map with added shadow effect.

[0083] For example, take the target virtual object as a leaf and the base object as the ground. Figure 4c , Figure 4c This is a shadow production schematic diagram of an image processing method provided by an embodiment of the present application. The grayscale values ​​in the target depth map that do not match the target grayscale range can be set to 0 to obtain a first target depth map, so that the grayscale values ​​in the first target depth map can be offset according to the preset lighting direction to obtain a second target depth map. Then, the positions where the grayscale values ​​in the second target depth map are not 0 are filled with dark pixels to obtain a shadow map. The first target depth map, the shadow map and the surface material map are mixed to obtain a target material map with a shadow effect. If a target image is generated based on a target material map without a pseudo shadow effect, the target virtual object in the generated target image only presents a plane effect, and if a target image is generated based on a target material map with a shadow effect added, the target virtual objects distributed on the base object will be displayed with a shadow effect in the generated target image, so that the three-dimensional effect of the target virtual object can be constructed based on the pseudo shadow effect, and the large rendering overhead generated by rendering the models of multiple target virtual objects is avoided, so that a more realistic and natural target image with a target virtual object distribution effect can be generated with lower performance consumption.

[0084] In one embodiment, taking the target virtual object as a leaf as an example, please refer to Figure 4d , Figure 4dIt is a specific flow chart of an image processing method provided in an embodiment of the present application. The first material maps such as the glossiness map, the intrinsic color map, and the normal map of the original fallen leaves can be input to check whether the input image meets the generation specifications. When it does not meet the generation specifications of the target image, the first material map of the original fallen leaves is re-input. When it meets the generation specifications, the individual leaves can be cut according to the type of fallen leaves. Then, the leaves can be copied and randomly placed according to the Monte Carlo distribution to obtain an object distribution map, so that the color, density and shadow can be adjusted later to present a realistic and detailed fallen leaf effect, so as to enhance the effect of the generated target image, and thus the final target image can be output.

[0085] In game production, there are often scenes of fallen leaves on the ground. In existing image processing methods, placing leaf models one by one in the scene to achieve the effect of fallen leaves will bring about a large performance overhead, including draw calls, vertex processing, and rendering pipeline switching. Even if these leaf models are merged into a whole mesh to reduce draw calls, it will still bring considerable performance overhead. This is because each leaf model requires independent rendering calls and vertex data, which will cause the rendering pipeline to constantly switch and process a large amount of vertex information. In a large world scene, if there are a large number of leaf models, these draw calls and vertex processing will become a performance bottleneck, causing the game's frame rate to drop.

[0086] To this end, an embodiment of the present application provides an image processing method, which only needs to copy and place the first material map at randomly distributed positions according to the distribution law of fallen leaves based on a small number of non-repetitive target virtual objects' first material maps to obtain an object distribution map, and then perform channel rendering based on the object distribution maps corresponding to various first material maps to obtain target material maps of various channels, so as to realize the merging of the material maps of multiple target virtual objects into a large target material map in a seamless stitching manner. This large map can contain texture information of hundreds or even thousands of leaves. By merging the textures of all leaves into one map, only one drawing call is required to render the leaves on the entire ground, thereby reducing the number of drawing calls. In addition, using a large map can also reduce the number of vertices. When each leaf is a separate model, each leaf requires a set of vertices to define its shape and texture coordinates. When a large map is used, only a shared vertex buffer is needed to render all leaves because they share the same texture coordinates. This can greatly reduce memory usage and rendering overhead, and improve the rendering performance of laying multiple leaf models in the scene. At the same time, the density of the target material map can be adjusted according to the target depth map, and a pseudo shadow effect can be produced to improve the naturalness and authenticity of the target virtual object distribution. Therefore, based on the target material map, a target image with a target virtual object distribution effect and better effect can be generated with lower performance consumption, which greatly improves the image processing efficiency.

[0087] As can be seen from the above, the embodiment of the present application obtains the first material map of the target virtual object; places the first material map at multiple position points in the preset map area respectively to obtain an object distribution map, where the position points are randomly distributed points generated in the preset map area; converts the object distribution map into a target material map, where the target material map belongs to a four-way continuous map; and generates a target image with a target virtual object distribution effect based on the target material map. In this way, by placing the first material map of the target virtual object at multiple position points randomly distributed in the preset map area to obtain an object distribution map, and generating a four-way continuous target material map based on the object distribution map, the target material map is used for rendering, which can avoid the large rendering overhead generated by rendering the models of multiple target virtual objects, and realize the generation of a target image with a target virtual object distribution effect with lower performance consumption. At the same time, the four-way continuous target material map can facilitate the generation of a target image with a target virtual object distribution effect in a large-area scene, improve the flexibility and convenience of the target virtual object distribution, and thus effectively improve the image processing efficiency.

[0088] 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.

[0089] 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 an acquisition unit 201, a laying unit 202, a conversion unit 203 and a generation unit 204, as follows:

[0090] An acquisition unit 201 is used to acquire a first material map of a target virtual object;

[0091] A placing unit 202 is used to place the first material map at a plurality of position points in a preset map area to obtain an object distribution map, where the position points are randomly distributed points generated in the preset map area;

[0092] A conversion unit 203, used for converting the object distribution map into a target material map, where the target material map is a four-way continuous map;

[0093] The generating unit 204 is used to generate a target image with a target virtual object distribution effect based on the target material map.

[0094] In some embodiments, the generating unit 204 includes:

[0095] A texture acquisition subunit, used to acquire a second material texture of a base object model of a target virtual object to be laid;

[0096] A texture fusion subunit, used for fusing the second material texture with the target material texture to obtain a target texture;

[0097] The model rendering subunit is used to render the basic object model through the target map to obtain a target image indicating that target virtual objects are randomly distributed on the basic object model.

[0098] In some embodiments, the target material map includes a target depth map and at least one surface material map, and the image processing device further includes a distribution density adjustment unit for:

[0099] Determine a target grayscale value, where the target grayscale value is used to indicate a required distribution density of the target virtual object on the base object;

[0100] Based on the target grayscale value, partially crop the target depth map to obtain a cropped depth map;

[0101] The surface material map is cropped based on the cropped depth map to obtain a target material map corresponding to the distribution density.

[0102] In some embodiments, the target material map includes a target depth map and at least one surface material map, and the image processing device further includes a shadow generation unit for:

[0103] Determine the target grayscale range;

[0104] The grayscale values ​​in the target depth map that do not match the target grayscale range are set to 0 to obtain a first target depth map;

[0105] Performing a position shift on the grayscale values ​​in the first target depth map according to a preset illumination direction to obtain a second target depth map;

[0106] Fill the positions whose grayscale values ​​in the second target depth map are not 0 with dark pixels to obtain a shadow map;

[0107] The first target depth map, the shadow map and the surface texture map are mixed to obtain a target texture map with a shadow effect added.

[0108] In some embodiments, the first material map includes an intrinsic color map, a normal map, and a glossiness map of different map channels, and the target material map includes a target intrinsic color map, a target normal map, and a target glossiness map of different map channels.

[0109] In some embodiments, the object distribution map includes a first object distribution map corresponding to the intrinsic color map, a second object distribution map corresponding to the normal map, and a third object distribution map corresponding to the glossiness map. The conversion unit 203 includes:

[0110] A four-way continuous generation subunit is used to perform four-way continuous mapping generation processing on the object distribution map to obtain a processed distribution map, wherein the processed distribution map is at least composed of an object distribution map located at the center and a plurality of object distribution maps distributed around the object distribution map at the center;

[0111] A rendering area determination subunit, used to determine a texture rendering area in the processed distribution map;

[0112] A texture rendering subunit, used to render the first object distribution map, the second object distribution map and the third object distribution map of the texture rendering area respectively, to obtain a target intrinsic color map, a target normal map and a target glossiness map;

[0113] The map determination subunit is used to obtain a target material map based on a target intrinsic color map, a target normal map and a target glossiness map.

[0114] In some embodiments, the image processing apparatus further includes a depth rendering unit, configured to:

[0115] Rendering a target depth map in a target material map based on at least one of the first object distribution map, the second object distribution map, and the third object distribution map in the map rendering area;

[0116] The texture determination subunit is used to:

[0117] A target material map is obtained based on the target intrinsic color map, the target normal map, the target glossiness map and the target depth map.

[0118] In some embodiments, there are multiple target virtual objects, and different target virtual objects have different display attributes.

[0119] 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.

[0120] As can be seen from the above, the embodiment of the present application obtains the first material map of the target virtual object through the acquisition unit 201; the placement unit 202 places the first material map at multiple position points in the preset map area respectively to obtain an object distribution map, and the position points are randomly distributed points generated in the preset map area; the conversion unit 203 converts the object distribution map into a target material map, and the target material map belongs to a four-way continuous map; the generation unit 204 generates a target image with a target virtual object distribution effect based on the target material map. In this way, by placing the first material map of the target virtual object at multiple position points randomly distributed in the preset map area, an object distribution map is obtained, and a four-way continuous target material map is generated based on the object distribution map, so that the target material map is used for rendering, which can avoid the large rendering overhead generated by rendering the models of multiple target virtual objects, and realize the generation of a target image with a target virtual object distribution effect with a lower performance consumption. At the same time, the four-way continuous target material map can facilitate the generation of a target image with a target virtual object distribution effect in a large area scene, improve the flexibility and convenience of the target virtual object distribution, and thus effectively improve the image processing efficiency.

[0121] 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:

[0122] 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.

[0123] 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.

[0124] 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:

[0125] Obtain a first material map of the target virtual object;

[0126] Placing the first material map at a plurality of position points in the preset map area respectively to obtain an object distribution map, wherein the position points are randomly distributed points generated in the preset map area;

[0127] Convert the object distribution map to a target material map, which is a four-way continuous map;

[0128] A target image with a target virtual object distribution effect is generated based on the target material map.

[0129] This solution can obtain the first material map of the target virtual object; place the first material map at multiple position points in the preset map area respectively to obtain an object distribution map, where the position points are randomly distributed points generated in the preset map area; convert the object distribution map into a target material map, where the target material map belongs to a four-way continuous map; and generate a target image with a target virtual object distribution effect based on the target material map. In this way, by placing the first material map of the target virtual object at multiple position points randomly distributed in the preset map area to obtain an object distribution map, and generating a four-way continuous target material map based on the object distribution map, the target material map is used for rendering, which can avoid the large rendering overhead generated by rendering the models of multiple target virtual objects, and achieve the generation of a target image with a target virtual object distribution effect with lower performance consumption. At the same time, the four-way continuous target material map can facilitate the generation of a target image with a target virtual object distribution effect in a large-area scene, improve the flexibility and convenience of the target virtual object distribution, and thus effectively improve the image processing efficiency.

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

[0131] Optional, such as Figure 6As 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.

[0132] The touch display screen 303 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 303 may include a display panel and a touch panel. Among them, the display panel can 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 can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can 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 can be used to collect the user's touch operation on or near it (such as the user uses 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.

[0133] 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.

[0134] 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.

[0135] 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.

[0136] 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.

[0137] 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.

[0138] 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.

[0139] As can be seen from the above, the electronic device provided by the embodiment of the present application can obtain the first material map of the target virtual object; place the first material map at multiple position points in the preset map area respectively to obtain an object distribution map, where the position points are randomly distributed points generated in the preset map area; convert the object distribution map into a target material map, where the target material map belongs to a four-way continuous map; and generate a target image with a target virtual object distribution effect based on the target material map. In this way, by placing the first material map of the target virtual object at multiple position points randomly distributed in the preset map area to obtain an object distribution map, and generating a four-way continuous target material map based on the object distribution map, the target material map is used for rendering, which can avoid the large rendering overhead generated by rendering the models of multiple target virtual objects, and realize the generation of a target image with a target virtual object distribution effect with lower performance consumption. At the same time, the four-way continuous target material map can facilitate the generation of a target image with a target virtual object distribution effect in a large area scene, improve the flexibility and convenience of the target virtual object distribution, and thus effectively improve the image processing efficiency.

[0140] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished 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.

[0141] 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:

[0142] Obtain a first material map of the target virtual object;

[0143] Placing the first material map at a plurality of position points in the preset map area respectively to obtain an object distribution map, wherein the position points are randomly distributed points generated in the preset map area;

[0144] Convert the object distribution map to a target material map, which is a four-way continuous map;

[0145] A target image with a target virtual object distribution effect is generated based on the target material map.

[0146] This solution can obtain the first material map of the target virtual object; place the first material map at multiple position points in the preset map area respectively to obtain an object distribution map, where the position points are randomly distributed points generated in the preset map area; convert the object distribution map into a target material map, where the target material map belongs to a four-way continuous map; and generate a target image with a target virtual object distribution effect based on the target material map. In this way, by placing the first material map of the target virtual object at multiple position points randomly distributed in the preset map area to obtain an object distribution map, and generating a four-way continuous target material map based on the object distribution map, the target material map is used for rendering, which can avoid the large rendering overhead generated by rendering the models of multiple target virtual objects, and achieve the generation of a target image with a target virtual object distribution effect with lower performance consumption. At the same time, the four-way continuous target material map can facilitate the generation of a target image with a target virtual object distribution effect in a large-area scene, improve the flexibility and convenience of the target virtual object distribution, and thus effectively improve the image processing efficiency.

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

[0148] 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.

[0149] Since the computer program stored in the computer-readable storage medium can execute the steps in any image processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any image processing method 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.

[0150] 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.

[0151] 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: Obtain a first material map of the target virtual object; Placing the first material map at a plurality of position points in a preset map area respectively to obtain an object distribution map, wherein the position points are randomly distributed points generated in the preset map area; Converting the object distribution map into a target material map, wherein the target material map is a four-way continuous map; A target image having a target virtual object distribution effect is generated based on the target material map.

2. The image processing method according to claim 1, characterized in that: The step of generating a target image having a target virtual object distribution effect based on the target material map comprises: Acquire a second material map of a base object model on which the target virtual object is to be laid; Merging the second material map and the target material map to obtain a target map; The basic object model is rendered using the target map to obtain a target image indicating that the target virtual objects are randomly distributed on the basic object model.

3. The image processing method according to claim 2, characterized in that: The target texture map includes a target depth map and at least one surface texture map. Before fusing the second texture map with the target texture map to obtain the target texture, the method further includes: Determining a target grayscale value, where the target grayscale value is used to indicate a required distribution density of the target virtual object on the base object; Based on the target grayscale value, partially cropping the target depth map to obtain a cropped depth map; The surface material map is cropped based on the cropped depth map to obtain a target material map corresponding to the distribution density.

4. The image processing method according to claim 2, wherein: The target texture map includes a target depth map and at least one surface texture map. Before fusing the second texture map with the target texture map to obtain the target texture, the method further includes: Determine the target grayscale range; The grayscale values ​​in the target depth map that do not match the target grayscale range are set to 0 to obtain a first target depth map; Performing a position shift on the grayscale values ​​in the first target depth map according to a preset illumination direction to obtain a second target depth map; Filling dark pixels at positions where the grayscale value in the second target depth map is not 0 to obtain a shadow map; The first target depth map, the shadow map and the surface material map are mixed to obtain a target material map with a shadow effect added.

5. The image processing method according to any one of claims 1 to 4, characterized in that: The first material map includes an intrinsic color map, a normal map and a glossiness map of different map channels, and the target material map includes a target intrinsic color map, a target normal map and a target glossiness map of different map channels.

6. The image processing method according to claim 5, characterized in that: The object distribution map includes a first object distribution map corresponding to an intrinsic color map, a second object distribution map corresponding to a normal map, and a third object distribution map corresponding to a glossiness map, and converting the object distribution map into a target material map includes: Performing a four-way continuous mapping generation process on the object distribution map to obtain a processed distribution map, wherein the processed distribution map is at least composed of an object distribution map located at a center and a plurality of object distribution maps distributed around the object distribution map at the center; Determining a texture rendering area in the processed distribution map; Rendering the first object distribution map, the second object distribution map, and the third object distribution map of the map rendering area respectively to obtain a target intrinsic color map, a target normal map, and a target glossiness map; A target material map is obtained based on the target intrinsic color map, the target normal map and the target gloss map.

7. The image processing method according to claim 6, characterized in that: The method further comprises: Rendering a target depth map in the target material map based on at least one of the first object distribution map, the second object distribution map, and the third object distribution map in the map rendering area; The step of obtaining a target material map based on the target intrinsic color map, the target normal map, and the target glossiness map comprises: The target material map is obtained based on the target intrinsic color map, the target normal map, the target glossiness map and the target depth map.

8. The image processing method according to claim 1, characterized in that: There are multiple target virtual objects, and different target virtual objects have different display attributes.

9. An image processing device, characterized in that: include: An acquisition unit, used for acquiring a first material map of a target virtual object; A laying unit, used for placing the first material map at a plurality of position points in a preset map area respectively to obtain an object distribution map, wherein the position points are randomly distributed points generated in the preset map area; A conversion unit, used for converting the object distribution map into a target material map, wherein the target material map is a four-way continuous map; A generating unit is used to generate a target image with a target virtual object distribution effect based on the target material map.

10. 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 8.

11. A computer-readable storage medium, characterized in that: It comprises a computer program. When the computer program is run on an electronic device, the computer program is used to make the electronic device execute the steps of any one of the methods of claims 1 to 8.