Texture mapping processing method and device, storage medium and electronic equipment
By using the target mask map composed of polygons to rotate the texture map, the problem of high texture repetition in the texture map is solved, and the authenticity and artistic effect of the game screen are improved.
Patent Information
- Application Number
- CN202411707879.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-02-18
AI Technical Summary
When creating large-size game scenes, the texture repetition in the texture map is high, resulting in the game screen being easily misleading and losing its authenticity. The texture richness after processing is poor, affecting the art effect.
By obtaining a target mask map composed of multiple continuous polygons, mapping it to the texture map to be processed, and rotating the texture in the target direction based on the target mask map to obtain the processed texture map.
It effectively reduces the repeatability of textures in texture maps, improves the authenticity of game pictures, richness and randomness of textures, and improves the effect quality of art scenes.
Smart Images

Figure CN119478106A_ABST
Abstract
Description
Background Art
[0002] In large-scale games, there are usually many large-scale game scenes. When making large-scale game scenes, in order to ensure that the screen ratio is not deformed, four-square continuous mapping (TillingMap) is usually used to make texture details and then generate large-area random texture maps. However, the texture map generated by the above method has a high degree of texture repetition, which makes the game screen easy to be exposed and lose authenticity.
[0003] In order to reduce the texture repetition of the above texture maps, the existing technical solutions usually use a rectangular mask to perform blending and connection processing on the seams of the texture maps. However, in the above technical solutions, due to the limitation of the rectangular shape of the blending mask, the high repetition of the texture maps cannot be effectively removed, and the processed texture is less rich, which in turn affects the artistic effect of the game scene production. Summary of the invention
[0004] The present invention discloses a texture map processing method, a texture map processing device, a computer storage medium and an electronic device, thereby reducing the texture repetition in the random texture map, improving the realism of the game screen, and enhancing the texture richness displayed by the processed random texture map, thereby improving the overall artistic effect and quality.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for processing a texture map, the method comprising: obtaining a target mask map, the target mask map being composed of multiple continuous polygons; mapping the target mask map to a texture map to be processed, so as to rotate each texture in the texture map to be processed in a target direction based on the target mask map, so as to obtain a processed first target texture map; wherein the texture map to be processed is formed by splicing at least one basic texture map multiple times.
[0006] In a second aspect, an embodiment of the present disclosure provides a texture map processing device, the device comprising: a mask map acquisition module, used to acquire a target mask map, the target mask map being composed of multiple continuous polygons; a texture rotation module, used to map the target mask map to the texture map to be processed, so as to rotate each texture in the texture map to be processed in a target direction based on the target mask map, so as to obtain a processed first target texture map; wherein the texture map to be processed is formed by splicing at least one basic texture map multiple times.
[0007] In a third aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which implements the above texture mapping processing method when executed by a processor.
[0008] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the above texture mapping processing method by executing the executable instructions.
[0009] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which is executed by a processor to implement the above texture mapping processing method.
[0010] The technical solution disclosed in this disclosure has the following beneficial effects:
[0011] The above-mentioned texture map processing method obtains a target mask map, which is composed of multiple continuous polygons; maps the target mask map to the texture map to be processed, and rotates each texture in the texture map to be processed in the target direction based on the target mask map to obtain the processed first target texture map; wherein the texture map to be processed is formed by multiple splicing of at least one basic texture map. This method uses a target mask map with richer polygonal shapes to realize the rotation of the texture map to be processed in the target direction, and then distorts and divides the seamless map so that it does not contain repeated textures, thereby solving the technical problem of high texture repetition in the prior art and greatly improving the effect quality of the art scene. In addition, this method uses a target mask map with richer shapes, so that different texture effects can be achieved using rich polygons, thereby improving the richness and randomness of the texture map, avoiding the technical problem of poor authenticity caused by the scene screen being exposed, thereby improving the user experience.
[0012] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0014] Figure 1A A schematic diagram of a four-sided continuous mapping in this exemplary embodiment is shown;
[0015] Figure 1B A schematic diagram of a scene in which a random texture map in a larger area is generated based on a four-square continuous map in this exemplary embodiment is shown;
[0016] Figure 2AA schematic diagram showing a texture map to be processed in a related art in this exemplary embodiment;
[0017] Figure 2B A schematic diagram of a rectangular mask used in a related technology in this exemplary embodiment is shown;
[0018] Figure 3 An architectural diagram showing a texture map processing system in this exemplary embodiment;
[0019] Figure 4 A flowchart showing a method for processing a texture map in this exemplary embodiment;
[0020] Figure 5A A schematic diagram showing a method of randomly generating a plurality of discrete points on a two-dimensional plane in this exemplary embodiment is shown;
[0021] Figure 5B A schematic diagram showing a method of generating a plurality of perpendicular bisectors in this exemplary embodiment is shown;
[0022] Figure 5C A schematic diagram showing a generated first target mask map in this exemplary embodiment;
[0023] Figure 6 Another schematic diagram of a process for generating a first target mask map in this exemplary embodiment is shown;
[0024] Figure 7 A schematic diagram showing a second target mask map in this exemplary embodiment;
[0025] Figure 8 A schematic diagram showing a processed first target texture map in this exemplary embodiment;
[0026] Fig. 9A , Fig. 9B A schematic diagram showing different effects displayed after adjusting the pixel value of the second target mask map in this exemplary embodiment is shown;
[0027] Fig.10 A schematic diagram showing a layered effect on a first target texture map in this exemplary embodiment;
[0028] Fig.11A A schematic diagram showing a third target mask map in this exemplary embodiment;
[0029] Fig. 11B A schematic diagram showing a fourth target mask map in this exemplary embodiment;
[0030] Fig.12A schematic diagram showing a method of mapping a fourth target mask map to a first target texture map in this exemplary embodiment is shown;
[0031] Fig.13 A schematic diagram showing a processed second target texture map in this exemplary embodiment;
[0032] Fig.14 A schematic diagram of the structure of a texture mapping processing device in this exemplary embodiment is shown;
[0033] Fig.15 The structure diagram of an electronic device in this exemplary embodiment is schematically shown. DETAILED DESCRIPTION
[0034] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, exemplary embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the exemplary embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0035] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0036] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation.
[0037] In large-scale games, there are usually many large-scale game scene images, such as grass textures and sand textures on large-area virtual surfaces. When making large-area game scenes, in order to ensure that the screen ratio is normal and not deformed, four-square continuous mapping (Tilling Map, also known as seamless mapping) is usually used to create texture details and then generate random texture maps in a large area.
[0038] It should be explained that four-dimensional continuous mapping is a method of evenly placing one or more main textures in a unit space, and repeatedly arranging at least one main texture to cover the entire scene screen to ensure seamless splicing, thereby showing the overall effect of the game scene screen. Figure 1A , Figure 1B An exemplary description is given.
[0039] Figure 1A A schematic diagram of a four-sided continuous mapping in this exemplary embodiment is shown, Figure 1A As shown, the four-way continuous mapping can ensure the connection of the texture in the up and down directions and the left and right directions, but it cannot achieve the texture connection in directions such as the left and top, the right and bottom.
[0040] Figure 1B A schematic diagram of a scene in which a random texture map in a large area is generated based on a four-square continuous map in this exemplary embodiment is schematically shown, referring to Figure 1B As shown, it is for Figure 1A The random texture map is obtained by repeatedly arranging the four continuous maps shown in the figure. Figure 1B From the random texture map shown, it can be seen that in a larger area, especially when the viewing angle (such as the virtual observation camera) is far away from the virtual model, there will be a problem of high repetition of texture details in some areas, which can easily lead to the picture being blemish-free and losing authenticity, making it difficult to meet the artistic requirements in the application scenario.
[0041] In the related technical solutions, a rectangular mask is usually used to perform blending and connection processing on the texture edge (i.e. the joint of four continuous textures). Figure 2A , Figure 2B As shown, Figure 2A A schematic diagram showing a texture map to be processed in a related art in this exemplary embodiment; Figure 2B A schematic diagram of a rectangular mask used in a related technology in this exemplary embodiment is shown schematically. Figure 2A A random texture map is obtained by copying and arranging a four-square continuous map based on a grid multiple times. Figure 2A The random texture map formed by mixing and connecting the joints of multiple square continuous maps can be used Figure 2B The white portion of the mask shown is Figure 2A The texture edge is rotated in the Z-axis direction to reduce the repetitiveness by tilting the texture on the Z-axis.
[0042] However, in the above technical solution, since the shape of the hybrid mask is relatively rigid and only exists in a rectangular shape, the texture repetition is still high even if the texture edge is rotated on the Z axis, especially when the virtual camera is far away from the virtual model in the game scene, the texture repetition cannot be effectively removed. In addition, since the mask shape used is the same, the processed texture map is less rich, which affects the artistic effect of the game scene production, and thus it is difficult to meet the actual needs of large-area scene production.
[0043] In view of the above problems, the exemplary embodiment of the present disclosure proposes a method for processing texture maps, which adopts the method of obtaining a target mask map, which is composed of multiple continuous polygons; mapping the target mask map to the texture map to be processed, so as to rotate each texture in the texture map to be processed in the target direction based on the target mask map, and obtain a processed first target texture map; wherein the texture map to be processed is formed by multiple splicing of at least one basic texture map. The method uses a target mask map with richer polygonal shapes to realize the rotation of the texture map to be processed in the target direction, and then distorts and divides the seamless map so that it does not contain repeated textures, thereby solving the technical problem of high texture repetition in the prior art and greatly improving the effect quality of the art scene. In addition, the method uses a target mask map with richer shapes, so that different texture effects can be achieved by using rich polygons, thereby improving the richness and randomness of the texture map, avoiding the technical problem of poor authenticity caused by the scene screen being exposed, and thus improving the user experience.
[0044] The following will be combined Figure 3 The texture mapping processing method and device proposed in the present disclosure are applied to Figure 3 The embodiments are described in the system architecture of the exemplary application environment shown.
[0045] Figure 3 A schematic diagram of an application scenario provided for an embodiment of the present application, in which a terminal device 301 and a server 302 may be included.
[0046] The terminal device 301 can be, for example, a mobile phone, a tablet computer (PAD), a laptop computer, a desktop computer, or any other device involved in making texture maps. The terminal device 301 can be installed with a target application, and the target application can have functions such as texture map display. The application involved in the embodiment of the present application can be a software client, or a client such as a web page or a small program. The server 302 is a server corresponding to the software or a web page, a small program, etc., and does not limit the specific type of the client.
[0047] The server 302 may be a background server of the target application, used to provide corresponding background services for it, such as texture mapping processing services, etc. It may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, i.e., content delivery networks (CDNs), and big data and artificial intelligence platforms, but is not limited thereto.
[0048] It should be noted that the processing method of the texture map in the embodiment of the present application can be executed separately by the terminal device 301 or the server 302, or it can be executed jointly by the server 302 and the terminal device 301. In actual application, specific configuration can be performed according to the situation, and the present application does not make specific limitations here. The server 302 and the terminal device 301 can both include one or more processors, memories, and interactive I / O interfaces, etc. In addition, the server 302 can also be configured with a database, which can be used to store data and configuration files in the processing process of the texture map. Among them, the memory of the server 302 and the terminal device 301 can also store the program instructions required to be executed in the processing method of the texture map provided in the embodiment of the present application, and these program instructions can be used to implement the processing process of the texture map provided in the embodiment of the present application when executed by the processor.
[0049] It should be noted that when the texture map processing method provided in the embodiment of the present application is executed by the server 302 or the terminal device 301 alone, the above-mentioned application scenario may also only include a single device of the server 302 or the terminal device 301, or the server 302 and the terminal device 301 may be considered to be the same device. Of course, in actual application, when the recommendation reason generation method provided in the embodiment of the present application is jointly executed by the server 302 and the terminal device 301, the server 302 and the terminal device 301 may also be the same device, that is, the server 302 and the terminal device 301 may be different functional modules of the same device, or virtual devices virtualized from the same physical device.
[0050] In the embodiment of the present application, the terminal device 301 and the server 302 can be directly or indirectly connected to each other through one or more networks 303. The network 103 can be a wired network or a wireless network. For example, the wireless network can be a mobile cellular network or a wireless fidelity (Wireless-Fidelity, WIFI) network. Of course, it can also be other possible networks, which are not limited in the embodiment of the present application. It should be noted that Figure 3 The figure is only an example. In fact, the number of terminal devices and servers is not limited and is not specifically limited in the embodiments of the present application.
[0051] For example, in an exemplary embodiment, a terminal device obtains a target mask map, which is composed of multiple continuous polygons; the target mask map is mapped to a texture map to be processed, so as to rotate each texture in the texture map to be processed in a target direction based on the target mask map, so as to obtain a processed first target texture map; wherein the texture map to be processed is formed by multiple splicing of at least one basic texture map.
[0052] Below, in combination with the application scenarios described above, the method provided by the exemplary implementation of the present application is described with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principle of the present application, and the implementation of the present application is not limited in this respect. It should be noted that the following method can be executed by the above terminal device or server, or by the terminal device and the server together. Here, the execution of the terminal device is specifically shown as an example.
[0053] Figure 4 A flowchart schematically shows a method for processing a texture map in this exemplary embodiment, see Figure 4 As shown, the method can be executed by a terminal device, and the specific implementation process of the method is as follows: Step 401-Step 402:
[0054] Step 401: Obtain a target mask map, where the target mask map is composed of multiple continuous polygons.
[0055] Step 402, mapping the target mask map to the texture map to be processed, so as to rotate each texture in the texture map to be processed in the target direction based on the target mask map, and obtain a processed first target texture map; the texture map to be processed is formed by splicing one or more basic texture maps multiple times.
[0056] exist Figure 4In the provided technical solution, a target mask map is obtained, which is composed of multiple continuous polygons; the target mask map is mapped to the texture map to be processed, so as to rotate each texture in the texture map to be processed in the target direction based on the target mask map, and obtain the processed first target texture map; wherein, the texture map to be processed is formed by multiple splicing of at least one basic texture map. This method uses a target mask map with richer polygonal shapes to realize the rotation of the texture map to be processed in the target direction, and then distorts and divides the seamless map so that it does not contain repeated textures, thereby solving the technical problem of high texture repetition in the prior art and greatly improving the effect quality of the art scene. In addition, this method uses a target mask map with richer shapes, so that different texture effects can be achieved by using rich polygons, thereby improving the richness and randomness of the texture map, avoiding the technical problem of poor authenticity caused by the scene screen being exposed, and thus improving the user experience.
[0057] The following will be combined with specific embodiments to Figure 4 The specific implementation methods of each step in the embodiment shown are described in detail:
[0058] In step 401, a target mask map is obtained, where the target mask map is composed of a plurality of continuous polygons.
[0059] The target mask map is composed of a plurality of identical or different and continuous polygons, and the polygons may be any polygons such as triangles, quadrilaterals, pentagons, etc.
[0060] Before executing step 401, it is necessary to generate a target mask map in advance, which will be described below in conjunction with a specific embodiment.
[0061] Embodiment 1:
[0062] In an optional embodiment of the present disclosure, the target mask map can be formed based on a set of continuous polygons formed by the intersection of perpendicular bisectors connecting two discrete points, that is, based on connecting every two discrete points and drawing a perpendicular bisector of the connecting line, the intersection of each perpendicular bisector can obtain a continuous polygon.
[0063] In order to illustrate the process of generating the target mask map, the following will combine Figure 5A , Figure 5B , Figure 5C An exemplary description is given.
[0064] Step 1: Randomly generate multiple discrete points on a two-dimensional plane.
[0065] Reference Figure 5A As shown, a number of discrete points are randomly generated on a two-dimensional plane.
[0066] Then, step 2 is executed to generate a vertical extension line perpendicular to the connecting line through the midpoint position of the connecting line between each two discrete points.
[0067] Reference Figure 5B As shown, for every two discrete points, the midpoint position of the line connecting the two discrete points is taken, and a vertical extension line perpendicular to the line (i.e., the perpendicular bisector between the two discrete points) is generated through the midpoint position, and then multiple vertical extension lines can be generated for multiple discrete points.
[0068] Step 3: intersect each vertical extension line generated according to the plurality of discrete points to form a plurality of continuous polygons, and obtain a first target mask map.
[0069] For example, in step 2, corresponding perpendicular bisectors are generated for every two discrete points, and the process of step 2 is performed for all discrete points, so that multiple perpendicular extension lines can be obtained, and the intersection of the perpendicular extension lines will form multiple continuous polygons, so that the following can be obtained: Figure 5C The first target mask map is shown.
[0070] Embodiment 2:
[0071] In addition to the above embodiments, in another optional embodiment of the present disclosure, a plurality of discrete points are randomly generated on a two-dimensional plane, and a triangular network is constructed based on the plurality of discrete points; the center of the circumscribed circle of each triangle in the triangular network is determined; for each target triangle in the triangular network, if an adjacent triangle to the target triangle is found, the center of the circumscribed circle of the adjacent triangle is connected with the center of the circumscribed circle of the target triangle to obtain a first line, and the first line is stored in a line list; if an adjacent triangle corresponding to the target edge in the target triangle is not found, a second line perpendicular to the target edge is generated, and the second line is stored in a line list; a plurality of continuous polygons are constructed based on the lines in the line list to obtain a first target mask map.
[0072] The triangle network is a network structure composed of multiple triangles, the target triangle is any triangle in the triangle network, and the target edge is any edge in the target triangle. The adjacent triangle represents the triangle that has a common edge with the target triangle, that is, the triangle that shares the same triangle edge with the target triangle.
[0073] Each connection included in the connection linked list corresponds to the first connection and / or the second connection mentioned above. Through the connection linked list, each connection can be stored in the memory in a dispersed manner, and different connections point to the memory address where the next connection is located through pointers. This process does not require each connection to be stored in a continuous memory space, and then scattered storage resources can be fully utilized to improve the utilization rate of storage resources.
[0074] For the sake of convenience, the following will be combined Figure 6 The implementation steps of the above embodiment are exemplarily described as follows:
[0075] The specific steps are as follows: Step a), construct a triangular network based on a plurality of randomly generated discrete points. Figure 6 As shown in the first figure, multiple discrete points can be randomly generated on a two-dimensional plane, and then a structure such as Figure 6 The triangle network of the second figure is shown. Exemplarily, the triangle network is composed of multiple triangles, and the discrete points and the triangles formed by the discrete points can be numbered to record the three discrete points corresponding to each triangle.
[0076] It should be explained that the circumscribed circle of any triangle in the triangular network does not contain other discrete points. The advantages of the triangular network constructed by the above step a) are simple data structure, low data redundancy, high storage efficiency, easy update, and adaptability to data of various distribution densities.
[0077] Step b), calculate the center of the circumscribed circle of each triangle in the triangular network.
[0078] Step c), traverse the triangle linked list, and for each target triangle, search for adjacent triangles TriA, TriB and TriC that share three sides with the target triangle pTri.
[0079] Step d), if found, connect the center of the circumscribed circle of the found triangle with the center of the circumscribed circle of the target triangle pTri, and store the obtained first link in the link linked list.
[0080] On the contrary, if no adjacent triangle connected to the target edge of the target triangle pTri is found, step e) is executed to obtain a second connection line for the vertical extension line of the target edge, and the second connection line is stored in the connection list. The second connection line can be a vertical bisector of the target edge, that is, a vertical extension line is made for the midpoint position of the target edge.
[0081] Step f), traverse all triangles and execute the above steps b) to e), and complete the traversal for all triangles, so that all the links in the link list are found, and then the first target mask map can be constructed according to all the links in the link list. At this time, the first target mask map is composed of multiple continuous polygons.
[0082] Through the above-mentioned embodiments, a polygonal effect with richer mask shapes can be generated. Compared with the rectangular mixed mask used in the related technical scheme, the target mask map formed by multiple continuous polygons is used to facilitate different rotation effects of the processed texture map in mask areas of different shapes, thereby improving the texture richness and randomness.
[0083] In step 402, the target mask map is mapped to the texture map to be processed, so as to rotate each texture in the texture map to be processed in a target direction based on the target mask map, thereby obtaining a processed first target texture map.
[0084] Among them, the texture map to be processed can be a texture map on the surface of the target virtual model, and the target virtual model can be a model to be rendered in the virtual scene (for example, a surface model in the virtual scene, and the corresponding texture map to be processed is a grass texture map on the surface model). The virtual scene can be a game screen design scene involving the generation of random textures in a large area in the field of computer technology and image processing. The game type corresponding to the game screen design scene can be of any type, for example, action (for example: first-person or third-person shooting games, two-dimensional or three-dimensional fighting games, war action games and sports action games, etc.), adventure (for example: exploration games, collection games, puzzle games, etc.), simulation (for example: simulation sandbox games, simulation development games, strategy simulation games, city construction simulation games, business simulation games, etc.), role-playing and leisure (for example: chess and card table games, casual competitive games, music rhythm games, dress-up development games, etc.), etc., and the embodiments provided in the present disclosure do not impose any special restrictions on this.
[0085] The texture map to be processed is formed by splicing at least one basic texture map multiple times. Therefore, the texture map to be processed must have a high degree of texture repetition. The above-mentioned basic texture map can be a pre-configured texture map, and the texture map to be processed of the above-mentioned virtual model can be generated by at least one basic texture map. For example, the basic texture map can be Figure 1A The four-sided continuous map shown in Figure 1A The basic texture map shown is repeatedly arranged to obtain Figure 1B The texture map shown is to be processed.
[0086] It should be noted that, in order to enhance the randomness of the texture map to be processed, multiple basic texture maps can be pre-selected, and the texture map to be processed can be obtained by repeatedly arranging the multiple basic texture maps. In this embodiment, the multiple basic texture maps can be different texture maps of the same type, such as multiple different grass texture maps, or multiple different sand texture maps.
[0087] Exemplarily, the terminal device may segment and map the target mask map into the texture map to be processed, that is, map the target mask map to the location information (location) and rotation information (rotation) of the texture map to be processed, thereby rotating a specific texture on the texture map to be processed based on the location information.
[0088] It should be explained that texture mapping contains three attributes: location, rotation, and scale. By adjusting the parameter values of the above three attributes, the texture mapping can be matched with the layer of the virtual model. Among them, location represents the center point of the entire map; rotation represents rotating the map. Generally, it is not necessary to change the x and y angles, but only the rotation angle on the z axis; and scale represents stretching the map. Generally, it is not necessary to adjust the value in the z axis direction, but to adjust the values in the x and y axes.
[0089] In an optional embodiment of the present disclosure, when the target virtual model is a two-dimensional virtual model, the target direction is the Z-axis direction; when the target virtual model is a three-dimensional virtual model, the target direction is the X-axis direction, and / or the Y-axis direction, and / or the Z-axis direction.
[0090] Exemplarily, for the texture map on the surface of the two-dimensional virtual model, when executing the step of rotating each texture in the texture map to be processed based on the target mask map, only the twisting rotation in the Z-axis direction (i.e., the normal direction perpendicular to the two-dimensional plane) can be realized. For the texture map on the surface of the three-dimensional virtual model, when executing the step of rotating each texture in the texture map to be processed based on the target mask map, the twisting rotation can be performed in a single direction of the three-dimensional X-axis (left-right direction), Y-axis (front-back direction), and Z-axis (up-down direction) or in a combination of the above multiple directions (for example, only rotating in the X-axis and Y-axis directions) to obtain the processed first target texture map.
[0091] It should be explained that before executing the above embodiment to map the target mask map to the rotation information (rotation) of the texture map to be processed, the mapping information in the target direction can be pre-added, so that each texture in the texture map to be processed can be rotated in the target direction based on the target mask map, and then the processed first target texture map is obtained. For example, if it is necessary to perform a rotation in the Z-axis direction, the mapping in the Z-axis direction is pre-added before mapping the target mask map to the rotation information (rotation) of the texture map to be processed. If it is necessary to perform a rotation in the X, Y, and Z-axis directions for the texture map on the three-dimensional virtual model, the mapping in the X, Y, and Z-axis directions is pre-added.
[0092] Furthermore, based on the above-mentioned embodiment of obtaining the first target mask map, the first target mask map is usually a color image with RGB color information, and in the process of rotating each texture in the texture map to be processed in the target direction based on the first target mask map, there is no need to use the RGB color information. In order to reduce the amount of data processing and save computing resources, the first target mask map can be decolorized (i.e., grayscale processed) and only the brightness value of each pixel in the first target mask map is retained.
[0093] In an optional embodiment, the first target mask map is grayscaled to obtain a second target mask map; the second target mask map is mapped to the texture map to be processed in step 402, and each texture in the texture map to be processed is rotated in a target direction based on the second target mask map to obtain a processed first target texture map.
[0094] Through the grayscale processing, the color information in the first target mask map can be removed, and only the brightness value of each pixel in the map is retained, thereby obtaining the second target mask map.
[0095] Exemplarily, when grayscale processing is performed, a multiplication transformation (Multiply) may be performed on each pixel value of the first target mask map. The principle is to directly multiply images of different spatial resolutions with corresponding pixel grayscale values to obtain grayscale values of each pixel corresponding to the image.
[0096] In addition to the above embodiments, any other method may be used for grayscale processing, and the embodiments of the present disclosure do not impose any special restrictions on this. For example, decolorization processing may also be performed by training a neural network model. For example, multiple color image samples and grayscale images corresponding to each color image sample are obtained; and the multiple color image samples are input into the image processing model to obtain a predicted grayscale image corresponding to each color image sample.
[0097] In the above Figure 5C Based on the first target mask map shown in FIG. 1 , a second target mask map is obtained by graying the first target mask map. Figure 7 As shown in FIG. 1 , the color information of the first target mask map is removed from the second target mask map, and only the brightness value of the image is retained. Figure 7 The second target mask map is mapped to Figure 2A The location and rotation attributes of the texture map to be processed are shown in Figure 2A Each texture of the location parameter instruction in the texture map to be processed is rotated in the target direction, and the rotation angle is determined by the rotation parameter value, thereby obtaining Figure 8Shown is the first target texture map after processing.
[0098] Depend on Figure 8 It can be seen that the processed first target texture map effectively removes repeated textures in the texture map compared to the texture map before processing, thereby reducing the texture repetition in the texture map, so as to further meet the needs and quality of scene production.
[0099] In the process of generating the first target mask map in any of the above embodiments, the user may also adjust the pixel values of the second target mask map to adjust the shapes of the polygons in the second target mask map, thereby adjusting the overall display effect of the second target mask map.
[0100] In an optional embodiment of the present disclosure, in response to adjusting the pixel values of the second target mask map, the rotation parameters of each texture in the texture map to be processed are adjusted in the target direction based on the adjusted second target mask map.
[0101] Exemplarily, the user may also adjust the pixel values of the second target mask map to control the adjustment of the rotation parameters, thereby achieving different rotation effects.
[0102] Fig. 9A , Fig. 9B FIG. 1 shows a schematic diagram of different effects displayed after adjusting the pixel value of the second target mask map in this exemplary embodiment; FIG. Fig. 9A , Fig. 9B As shown, by adjusting the pixel values of the second target mask map, the shapes of multiple polygons in the second target mask map can be changed, thereby achieving different rotation effects and improving texture richness.
[0103] Furthermore, in the first target texture map obtained based on any of the above embodiments, when the distance between the virtual camera and the texture map on the target virtual model is shortened, it is found that there are still obvious layers or seams on the segmented edges. Figure 8 The first target texture map shown is reduced in distance from the virtual camera and can be seen as Fig.10 Layering shown.
[0104] In an optional embodiment of the present disclosure, for each continuous polygon of the target mask map, the brightness value is changed from dark to light toward the inside of the polygon based on the edge position of the continuous polygon to obtain a third target mask map; the color scale of the third target mask map is adjusted to the target color scale value to obtain a fourth target mask map, the target color scale value is the same as the color scale value of the texture map to be processed or the difference between the target color scale value and the color scale value of the texture map to be processed is less than a preset quantity threshold; the fourth target mask map is implicitly mapped to the texture map to be processed to obtain a processed second target texture map.
[0105] For example, when the layering at the splicing is processed, Figure 7 Based on the second target mask map shown in FIG. 1 , the brightness value of the continuous polygon edge position can be changed from dark to bright inside the polygon to obtain a reference Fig.11A The third target mask map is shown.
[0106] Then, adjust the color level of the third target mask map to the target color level value, and get Fig. 11B Finally, based on Fig.12 Will Fig. 11B The fourth target mask map shown is mapped to the texture map to be processed, and the processed second target texture map can be obtained, thereby obtaining Fig.13 The second target texture map is shown.
[0107] Depend on Fig.13 It can be seen that the masked part texture of the processed second target texture map segmented by polygons is always seamlessly connected and has low repetition, which greatly improves the effect quality of the art scene.
[0108] In order to implement the above-mentioned texture mapping processing method, an embodiment of the present disclosure provides a texture mapping processing device. Fig.14 A schematic architecture diagram of a texture map processing device is schematically shown.
[0109] The texture map processing device 1400 includes a mask map acquisition module 1401 and a texture rotation module 1402 .
[0110] The mask map acquisition module 1401 is used to obtain a target mask map, which is composed of multiple continuous polygons; the texture rotation module 1402 is used to map the target mask map to the texture map to be processed, so as to rotate each texture in the texture map to be processed in a target direction based on the target mask map to obtain a processed first target texture map; wherein the texture map to be processed is formed by splicing at least one basic texture map multiple times.
[0111] In an optional embodiment of the present disclosure, a plurality of discrete points are randomly generated on a two-dimensional plane; for every two discrete points, a perpendicular bisector perpendicular to the line connecting the two discrete points is generated through the midpoint position of the line connecting the two discrete points; the perpendicular bisectors generated from the plurality of discrete points intersect to form a plurality of continuous polygons, thereby obtaining a first target mask map.
[0112] In an optional embodiment of the present disclosure, a plurality of discrete points are randomly generated on a two-dimensional plane, and a Delaunay triangulation is constructed based on the plurality of discrete points; the center of the circumscribed circle of each triangle in the Delaunay triangulation is determined; for each target triangle in the Delaunay triangulation, if an adjacent triangle to the target triangle is found, the center of the circumscribed circle of the adjacent triangle is connected with the center of the circumscribed circle of the target triangle to obtain a first line, and the first line is stored in a Voronoi edge list; if an adjacent triangle corresponding to the target edge in the target triangle is not found, a second line perpendicular to the target edge is generated, and the second line is stored in a Voronoi edge list; the adjacent triangles represent triangles having common edges with the target triangle; the plurality of continuous polygons are constructed based on the lines in the Voronoi edge list to obtain a first target mask map.
[0113] In an optional embodiment of the present disclosure, the first target mask map is grayscaled to obtain a second target mask map; the second target mask map is mapped to a texture map to be processed, and each texture in the texture map to be processed is rotated in a target direction based on the second target mask map to obtain a processed first target texture map.
[0114] In an optional embodiment of the present disclosure, the texture rotation module 1402 is specifically configured to adjust the rotation parameters of each texture in the texture map to be processed in the target direction based on the adjusted second target mask map in response to adjusting the pixel values of the second target mask map.
[0115] In an optional embodiment of the present disclosure, the texture map to be processed is a texture map for the surface of the target virtual model. When the target virtual model is a two-dimensional virtual model, the target direction is the Z-axis direction; when the target virtual model is a three-dimensional virtual model, the target direction is the X-axis direction, and / or the Y-axis direction, and / or the Z-axis direction.
[0116] In an optional embodiment of the present disclosure, the device also includes a processing module and a color scale adjustment module. The processing module is used to change the brightness value from dark to light inside the polygon for each continuous polygon of the target mask map based on the edge position of the continuous polygon, so as to obtain a third target mask map; the color scale adjustment module is used to adjust the color scale of the third target mask map to a target color scale value, so as to obtain a fourth target mask map, wherein the target color scale value is the same as the color scale value of the texture map to be processed or the difference between the target color scale value and the color scale value of the texture map to be processed is less than a preset quantity threshold; the texture rotation module 1402 is specifically used to map the fourth target mask map to the texture map to be processed, so as to obtain a processed second target texture map.
[0117] The texture map processing device 1400 provided in the embodiment of the present disclosure can execute the technical solution of the texture map processing method in any of the above-mentioned embodiments. Its implementation principle and beneficial effects are similar to the implementation principle and beneficial effects of the texture map processing method. Please refer to the implementation principle and beneficial effects of the texture map processing method, which will not be repeated here.
[0118] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0119] The program product for implementing the above method according to an embodiment of the present invention may adopt a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device.
[0120] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0121] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0122] The program code contained in the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, radio frequency (RF), etc., or any suitable combination of the above.
[0123] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0124] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0125] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0126] Refer to the following Fig.15 15 to 16. An electronic device 1500 according to this embodiment of the present invention is described. Fig.15 The electronic device 1500 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0127] like Fig.15 As shown, the electronic device 1500 is in the form of a general computing device. The components of the electronic device 1500 may include, but are not limited to: the at least one processing unit 1510, the at least one storage unit 1520, a bus 1530 connecting different system components (including the storage unit 1520 and the processing unit 1510), and a display unit 1540.
[0128] The storage unit stores program codes, which can be executed by the processing unit 1510, so that the processing unit 1510 performs the steps of various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 1510 can perform the following steps: Figure 4 From step 401 to step 402 shown in FIG.
[0129] The storage unit 1520 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 15201 and / or a cache storage unit 15202 , and may further include a read-only storage unit (ROM) 15203 .
[0130] The storage unit 1520 may also include a program / utility 15204 having a set (at least one) of program modules 15205, such program modules 15205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0131] Bus 1530 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0132] The electronic device 1500 may also communicate with one or more external devices 2000 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1500, and / or communicate with any device that enables the electronic device 1500 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1550. Furthermore, the electronic device 1500 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1560. As shown, the network adapter 1560 communicates with other modules of the electronic device 1500 via a bus 1530. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems.
[0133] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0134] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0135] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0136] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0137] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A texture mapping processing method, characterized in that: include: Obtain a target mask map, wherein the target mask map is composed of a plurality of continuous polygons; The target mask map is mapped to the texture map to be processed, so as to rotate each texture in the texture map to be processed in a target direction based on the target mask map to obtain a processed first target texture map; wherein the texture map to be processed is formed by splicing at least one basic texture map multiple times.
2. The method according to claim 1, characterized in that The method further comprises: Randomly generate multiple discrete points on a two-dimensional plane; Generate a vertical extension line perpendicular to the connecting line through the midpoint position of the connecting line between every two discrete points; The vertical extension lines generated from the plurality of discrete points are intersected to form the plurality of continuous polygons, thereby obtaining a first target mask map.
3. The method according to claim 1, characterized in that The method further comprises: Randomly generate a plurality of discrete points on a two-dimensional plane, and construct a triangular network based on the plurality of discrete points; Determine the center of the circumscribed circle of each triangle in the triangular network; For each target triangle in the triangle network, if an adjacent triangle to the target triangle is found, the center of the circumscribed circle of the adjacent triangle is connected with the center of the circumscribed circle of the target triangle to obtain a first link, and the first link is stored in a link linked list; If no adjacent triangle corresponding to the target edge of the target triangle is found, a second line perpendicular to the target edge is generated, and the second line is stored in a line linked list; the adjacent triangle is used to represent a triangle having a common edge with the target triangle; The plurality of continuous polygons are constructed based on the links in the link chain list to obtain a first target mask map.
4. The method according to claim 2 or 3, characterized in that: The step of mapping the target mask map to the texture map to be processed, so as to rotate each texture in the texture map to be processed in a target direction based on the target mask map, and obtaining a processed first target texture map, comprises: grayscale the first target mask map to obtain a second target mask map; The second target mask map is mapped to the texture map to be processed, so as to rotate each texture in the texture map to be processed in a target direction based on the second target mask map, so as to obtain the processed first target texture map.
5. The method according to claim 4, characterized in that Mapping the second target mask map to the texture map to be processed, so as to rotate each texture in the texture map to be processed in a target direction based on the second target mask map, comprises: In response to adjusting the pixel values of the second target mask map, a rotation parameter of each texture in the texture map to be processed in a target direction is adjusted based on the adjusted second target mask map.
6. The method according to claim 1, characterized in that The texture map to be processed is a texture map for the surface of the target virtual model. When the target virtual model is a two-dimensional virtual model, the target direction is the Z-axis direction; when the target virtual model is a three-dimensional virtual model, the target direction is the X-axis direction, and / or the Y-axis direction, and / or the Z-axis direction.
7. The method according to claim 1, characterized in that The method further comprises: For each continuous polygon of the target mask map, based on the edge position of the continuous polygon, the brightness value is changed from dark to light inside the polygon to obtain a third target mask map; The color scale of the third target mask map is adjusted to a target color scale value to obtain a fourth target mask map; the target color scale value is the same as the color scale value of the texture map to be processed or the difference between the target color scale value and the color scale value of the texture map to be processed is less than a preset quantity threshold; The fourth target mask map is mapped to the texture map mapped to be processed to obtain a processed second target texture map.
8. A texture map processing device, characterized in that: The device comprises: A mask map acquisition module is used to acquire a target mask map, wherein the target mask map is composed of a plurality of continuous polygons; A texture rotation module is used to map the target mask map to the texture map to be processed, so as to rotate each texture in the texture map to be processed in a target direction based on the target mask map to obtain a processed first target texture map; wherein the texture map to be processed is formed by splicing at least one basic texture map multiple times.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the texture map processing method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the texture map processing method according to any one of claims 1 to 7 by executing the executable instructions.