Texture mapping processing method and device and electronic equipment

By calculating the pixel density of texture maps on the virtual model and adjusting the size of the texture map, the problem of increasing the size of the game package and resource consumption of high-resolution texture maps is solved, and the effect of reducing storage space while ensuring picture quality is achieved.

CN119810292APending Publication Date: 2025-04-11NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411707068.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

Although high-resolution texture maps can improve the quality of the game screen, they will also significantly increase the size of the game package and resource consumption, especially on mobile and resource-constrained platforms, which will affect the loading time, running performance and user experience of the game.

Method used

By obtaining the model parameters of the texture map and its corresponding virtual model, determining the surface area and texture area of ​​the virtual model, calculating the pixel density, and in response to the pixel density meeting the preset conditions, the texture map is sized to reduce storage space occupation.

Benefits of technology

While not sacrificing the display effect, it reduces the storage space occupied by texture maps, improves the loading speed and running performance of the game, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810292A_ABST
    Figure CN119810292A_ABST
Patent Text Reader

Abstract

The invention provides a texture map processing method and apparatus, and an electronic device. The method comprises the steps of obtaining a texture map and a model parameter of a virtual model corresponding to the texture map; the virtual model comprises a plurality of vertexes; the surface of the virtual model is formed by connecting polygons formed by vertexes; determining the surface area of the virtual model and the texture area corresponding to the virtual model based on the model parameters, and determining the pixel density based on the surface area, the texture area and the size of the texture map; the pixel density is used for indicating the number of pixels in the texture map occupied in the surface of the unit area of the virtual model; and in response to the pixel density meeting a preset condition, performing size adjustment processing on the texture map. According to the method, when the number of the pixels in the texture map occupied in the surface of the unit area of the virtual model exceeds the required number, the size of the texture map is reduced, and the storage space occupied by the texture map is reduced while the display effect is not sacrificed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of rendering technology, and in particular to a texture mapping processing method, device and electronic device. Background Art

[0002] With the rapid development of the game industry, the visual effects and complexity of games are constantly improving, and the models and texture resources in the game are becoming more and more sophisticated. However, although high-resolution textures can improve the picture quality, they will also significantly increase the size of the game package and resource consumption. This is particularly evident on mobile terminals and resource-constrained platforms, which directly affects the loading time, running performance and user experience of the game. In related technologies, developers can manually check the textures of each model and downgrade unnecessary high-resolution textures. Although this method can accurately control the quality of each resource, it is time-consuming and labor-intensive, cannot adapt to large-scale resource management, and is easily affected by human factors, resulting in incorrect optimization. Some automated tools can also be used to detect and optimize textures. These tools usually reduce the texture resolution according to preset rules. However, this method cannot flexibly adapt to the needs of different games, which may cause unnecessary downgrades and affect the image quality. Summary of the invention

[0003] In view of this, an object of the present disclosure is to provide a texture map processing method, device and electronic device, so as to reduce the storage space occupied by the texture map without sacrificing the display effect.

[0004] In a first aspect, an embodiment of the present disclosure provides a method for processing a texture map, the method comprising: obtaining a texture map and model parameters of a virtual model corresponding to the texture map; the virtual model comprises a plurality of vertices; the surface of the virtual model is connected by polygons composed of the vertices; the model parameters are used to indicate: the positions of the plurality of vertices of the virtual model in a virtual three-dimensional space, and the corresponding positions in the texture map; based on the model parameters, determining the surface area of ​​the virtual model and the texture area corresponding to the virtual model, and determining the pixel density based on the surface area, the texture area and the size of the texture map; the pixel density is used to indicate: the number of pixels in the texture map occupied by a unit area of ​​the surface of the virtual model; in response to the pixel density satisfying a preset condition, resizing the texture map.

[0005] In a second aspect, an embodiment of the present disclosure provides a texture map processing device, the device comprising: a texture map acquisition module, used to acquire a texture map, and model parameters of a virtual model corresponding to the texture map; the virtual model comprises a plurality of vertices; the surface of the virtual model is connected by polygons composed of vertices; the model parameters are used to indicate: the positions of the plurality of vertices of the virtual model in a virtual three-dimensional space, and the corresponding positions in the texture map; a pixel density determination module, used to determine the surface area of ​​the virtual model and the texture area corresponding to the virtual model based on the model parameters, and to determine the pixel density based on the surface area, the texture area and the size of the texture map; the pixel density is used to indicate: the number of pixels in the texture map occupied by a unit area of ​​the surface of the virtual model; a size adjustment processing module, used to perform size adjustment processing on the texture map in response to the pixel density satisfying a preset condition.

[0006] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned texture mapping processing method.

[0007] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned texture mapping processing method.

[0008] The embodiments of the present invention bring the following beneficial effects:

[0009] The above-mentioned texture map processing method, device and electronic device obtain the texture map and the model parameters of the virtual model corresponding to the texture map; the virtual model includes multiple vertices; the surface of the virtual model is connected by polygons composed of vertices; based on the model parameters, the surface area of ​​the virtual model and the texture area corresponding to the virtual model are determined, and the pixel density is determined based on the surface area, the texture area and the size of the texture map; the pixel density is used to indicate: the number of pixels in the texture map occupied by the unit area of ​​the surface of the virtual model; in response to the pixel density meeting the preset conditions, the texture map is resized. This method reduces the size of the texture map when the number of pixels in the texture map occupied by the unit area of ​​the surface of the virtual model exceeds the required number, thereby reducing the storage space occupied by the texture map without sacrificing the display effect.

[0010] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or understood by practicing the present disclosure. The purpose and other advantages of the present disclosure are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0011] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0013] Figure 1 A flowchart of a texture mapping processing method provided by an embodiment of the present disclosure;

[0014] Figure 2 A schematic diagram of the structure of a texture mapping processing device provided by an embodiment of the present disclosure;

[0015] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0017] With the rapid development of the gaming industry, the visual effects and complexity of games are constantly improving, and the models and texture resources in games are becoming more and more sophisticated. However, although high-resolution texture maps can improve the picture quality, they will also significantly increase the game package size and resource consumption. This is especially obvious on mobile terminals and resource-constrained platforms, which directly affects the game's loading time, running performance, and user experience. Therefore, how to effectively reduce the package size while ensuring visual quality has become an important issue in current game development.

[0018] At present, there are two commonly used texture optimization solutions in game development:

[0019] 1. Manual optimization:

[0020] Developers manually check the textures of each model and downgrade unnecessary high-resolution textures. Although this method can accurately control the quality of each resource, it is time-consuming and labor-intensive and cannot adapt to large-scale resource management.

[0021] However, this method has high labor costs and low efficiency, and it is difficult to ensure the optimization consistency of all maps. It is also easily affected by human factors, resulting in incorrect optimization.

[0022] 2. Automation Tools

[0023] Some automated tools can detect and optimize textures, these tools usually reduce the texture resolution according to preset rules.

[0024] However, in this method, the rules are relatively fixed and cannot flexibly adapt to the needs of different games; it is impossible to make smart judgments based on specific model resources, which may lead to unnecessary degradation and affect image quality.

[0025] Based on this, the embodiments of the present disclosure provide a method, device and electronic device for processing texture mapping, and the technology can be applied to the process of processing texture mapping.

[0026] See also Figure 1 First, a texture mapping processing method provided by an embodiment of the present invention is introduced. The method comprises the following steps:

[0027] Step S102, obtaining a texture map and model parameters of a virtual model corresponding to the texture map; the virtual model includes a plurality of vertices; the surface of the virtual model is connected by polygons composed of vertices; the model parameters are used to indicate: the positions of the plurality of vertices of the virtual model in the virtual three-dimensional space, and the corresponding positions in the texture map.

[0028] Texture maps are usually two-dimensional images. The pixels in the texture map have position coordinates in the texture space, namely texture coordinates, which are usually represented by two coordinate axes, U and V. The pixels in the texture map are mapped to the surface of the virtual model and can represent the surface properties of the virtual model, such as color, glossiness, transparency, shadow, and lighting information.

[0029] The virtual model can be a three-dimensional model or a two-dimensional model, which is not limited here. The virtual model usually includes multiple vertices, and adjacent vertices are connected to form polygons, which can be triangles or quadrilaterals, which are not limited here. The surface of the virtual model is formed by connecting these polygons.

[0030] The above model parameters usually include the spatial position parameters of the vertex, which are used to indicate the position of the vertex of the virtual model in the virtual three-dimensional space, and can be specifically represented by the coordinates on the XYZ axes. The above model parameters usually also include the texture map coordinates of the vertex, which are used to indicate the corresponding position of the vertex in the texture map. The pixel value of the pixel at this position indicates the color, glossiness, lighting information, etc. of the vertex.

[0031] Step S104, based on the model parameters, determine the surface area of ​​the virtual model and the texture area corresponding to the virtual model, and determine the pixel density based on the surface area, texture area and the size of the texture map; the pixel density is used to indicate: the number of pixels in the texture map occupied by a unit area of ​​the surface of the virtual model.

[0032] The surface area of ​​the virtual model may refer to the total area of ​​the entire surface of the virtual model, or may refer to the area of ​​a portion of the surface of the virtual model. The surface of the virtual model is formed by connecting polygons, and the surface area of ​​the virtual model is the sum of the areas of the polygons that constitute the entire surface or a portion of the surface of the virtual model. Polygons are plane figures connected by vertices. For each polygon, after determining the position of the vertices of the polygon, the length of the side of the polygon, the angle between the sides, etc. can be calculated, and the area of ​​the polygon can be further calculated. After calculating the area of ​​each polygon, the areas of these polygons are added together to obtain the surface area of ​​the virtual model.

[0033] The above texture area corresponds to the surface area. When the surface area is the area of ​​the entire surface, the texture area also corresponds to the entire surface; when the surface area is the area of ​​a portion of the surface, the texture area also corresponds to the portion of the surface. It is usually also necessary to calculate the texture area corresponding to each polygon in units of polygons, and then add up the calculated texture areas corresponding to each polygon to obtain the texture area corresponding to the surface area. When calculating the texture area corresponding to a polygon, the texture mapping coordinates of the vertices of the polygon are required. After obtaining the texture mapping coordinates of the vertices, the side length corresponding to the polygon in the texture space, the angle between the sides, etc. can be calculated, and then the texture area corresponding to the polygon can be calculated.

[0034] The length and width of the texture map size are usually measured in pixels. For example, if the size of the texture map is 1024×1024, it means that the length and width of the texture map are both 1024 pixels. The area of ​​a texture map in texture space is usually a unit area. Multiply the calculated texture area by the number of pixels contained in the texture map to get the number of pixels in the texture space presented on the surface area corresponding to the texture area. Divide this number by the surface area to get the number of pixels presented per unit area of ​​the model surface, which is the pixel density mentioned above.

[0035] It is worth noting that the pixel density obtained by the above method is the average pixel density on the model surface portion corresponding to the surface area. The surface of the virtual model can also be divided into multiple smaller surface portions, and the average pixel density of each surface portion can be determined to understand the change in the pixel density of the surface of the virtual model. It is even possible to calculate the pixel density corresponding to each polygon, in which case the change in the pixel density of the surface of the virtual model is the most accurate.

[0036] Step S106: in response to the pixel density satisfying a preset condition, resizing the texture map.

[0037] The screen sizes of different types of terminal devices are usually different. For example, the display screen of a computer is larger than that of a mobile phone. In order to ensure the display effect, the virtual model displayed by the computer usually has more details, that is, a higher pixel density is required; while the virtual model displayed by the mobile phone usually has fewer details and may require a lower pixel density. When the texture map is applied to different terminal devices, a corresponding pixel density threshold can be set for it. The above preset condition is usually that the pixel density is higher than the preset pixel density threshold, and the size of the texture map needs to be reduced. A pixel density range can also be preset so that the pixel density of the resized texture map falls within the pixel density range.

[0038] As described above, the pixel density may include multiple pixel density values ​​for different surface parts of the virtual model. The preset condition may be that the smallest pixel density value among the multiple pixel density values ​​is greater than a preset pixel density threshold, or that 80% of the pixel density values ​​are greater than a preset pixel density threshold, etc. The specific setting may be based on demand and is not limited here.

[0039] The above-mentioned texture map processing method obtains a texture map and model parameters of a virtual model corresponding to the texture map; the virtual model includes multiple vertices; the surface of the virtual model is connected by polygons composed of vertices; based on the model parameters, the surface area of ​​the virtual model and the texture area corresponding to the virtual model are determined, and the pixel density is determined based on the surface area, the texture area and the size of the texture map; the pixel density is used to indicate: the number of pixels in the texture map occupied by a unit area of ​​the surface of the virtual model; in response to the pixel density meeting a preset condition, the texture map is resized. This method reduces the size of the texture map when the number of pixels in the texture map occupied by a unit area of ​​the surface of the virtual model exceeds the required number, thereby reducing the storage space occupied by the texture map without sacrificing the display effect.

[0040] The following embodiments provide a specific method for determining the surface area of ​​a virtual model and the texture area corresponding to the virtual model based on model parameters, and determining the pixel density based on the surface area, the texture area and the size of the texture map.

[0041] In practical applications, the above model parameters usually include the spatial position parameters, texture coordinate parameters and polygon index of the vertices of the virtual model. Among them, the spatial position parameters are usually the position coordinates in the three-dimensional virtual space, such as (12, 40, 11); the texture coordinate parameters are usually the two-dimensional coordinates in the texture space (0.1, 0.5). The polygon index is used to indicate: the vertices of each polygon that forms the surface of the virtual model. Generally speaking, the vertices included in the virtual model have unique numbers, and the polygon index can be the number of the vertices that make up the polygon. For example, if the virtual model is composed of triangles, the index can be [(0,1,2), (1,2,3),.....], that is, the vertices numbered 0, 1, 2 form a triangle, the vertices numbered 1, 2, 3 form another triangle, and so on.

[0042] In a specific implementation, the surface area of ​​the virtual model can be determined based on the spatial position parameters and polygon index. Specifically, the vertices of each polygon in the virtual model surface can be determined based on the polygon index; then, for each polygon, the surface area of ​​the polygon is calculated based on the spatial position parameters of the vertices of the polygon. For example, for a triangle composed of vertices numbered 0, 1, and 2, the side length between the two vertices numbered 0 and 1, the side length between the two vertices numbered 1 and 2 can be calculated, and the angle between the two sides can be calculated, and then the area of ​​the triangle can be calculated. Furthermore, the surface areas of the polygons in the virtual model surface can be added, and the addition result can be determined as the surface area of ​​the virtual model.

[0043] In a specific implementation, the texture area corresponding to the virtual model can be determined based on the texture coordinate parameters and the polygon index. Specifically, first, the vertices of each polygon in the virtual model surface are determined based on the polygon index. Then, for each polygon, the texture area of ​​the polygon is calculated based on the texture coordinate parameters of the vertices of the polygon. The calculation process is similar to the calculation of the surface area of ​​the polygon, which will not be repeated here. Then, the texture areas of each polygon in the virtual model surface are added, and the addition result is determined as the texture area corresponding to the virtual model.

[0044] After determining the surface area and texture area of ​​the virtual model, first determine the result of dividing the texture area by the surface area; then multiply the result by the size of the texture map, which can be expressed as the total number of pixels contained in the texture map. Since the texture map is usually square, the size can also be expressed as the number of pixels contained in the length direction or the width direction, which is not limited here. The multiplication result is further determined as the pixel density.

[0045] The following embodiment provides a specific method for resizing a texture map in response to pixel density satisfying a preset condition.

[0046] In a specific implementation, a density threshold is usually preset, and then the pixel density is compared with the density threshold. In response to the pixel density being greater than the preset density threshold, the texture map is downsized. Specifically, the resolution of the texture map can be reduced. Resolution refers to the amount of information stored in an image, which is how many pixels are in each inch of the image. After reducing the resolution of the texture map, the storage space occupied by the texture map is usually reduced.

[0047] The density threshold can be determined based on the terminal display device corresponding to the virtual model. For example, when the texture map needs to be applied to a computer, the density threshold can be a preset first threshold; when the texture map needs to be applied to a mobile phone, the density threshold can be a preset second threshold. The first threshold is usually greater than the second threshold.

[0048] The present disclosure also provides another method for processing texture maps. Figure 1 This method proposes a texture size detection method based on pixel density. By analyzing the grid information of the grid model, the pixel density of the texture on the model, that is, the number of pixels per unit area, is calculated, and the texture resolution is automatically determined and adjusted, thereby minimizing the package size and improving game performance while ensuring visual quality.

[0049] This method is mainly implemented in the following ways:

[0050] 1. Mesh information analysis: Calculate pixel density by analyzing the mesh information of the model. The specific method is: obtain the vertex data, UV coordinates and triangle index of the mesh, calculate the total UV area of ​​the mesh (equivalent to the above "texture area") and the triangle area (equivalent to the above "surface area"), divide the two and then multiply by the area of ​​the texture to get the number of texture pixels per unit area, that is, the pixel density of the texture.

[0051] 2. Set a reasonable threshold range for texture pixel density: The pixel density of a texture reflects the number of pixels per unit area. The lower the density, the lower the details and the blurrier they are. The higher the density, the more details and the clearer they are. When the pixel density reaches a certain threshold, increasing it will not bring much improvement in effect. Therefore, setting a reasonable texture pixel standard can help us judge whether the texture size is reasonable. According to practice, it is more reasonable to set the value between 64 and 256.

[0052] 3. Automatically adjust texture resolution: For high-resolution textures that exceed the set threshold, automatically reduce their resolution. For example, a texture with a size of 1024x1024 is calculated to have a pixel density of 300, which exceeds the threshold of 256. Then, its resolution is halved to 512x512, and the pixel density is reduced to 150, which meets the condition.

[0053] 4. Automated batch processing: Use automated engineering to batch process every texture in the game, and each time a new resource is added, it needs to go through this process.

[0054] This method can achieve a balance between visual effects and package size, intelligently and automatically optimize the size of textures, and maintain visual quality to the maximum extent. No human intervention is required throughout the process, which reduces the cost of manual adjustment and management of textures by developers, and can also reduce the package size and memory usage, achieving dual benefits of cost and performance.

[0055] For the above method embodiments, see Figure 2 A texture map processing device is shown, the device comprising:

[0056] The texture map acquisition module 202 is used to acquire the texture map and the model parameters of the virtual model corresponding to the texture map; the virtual model includes a plurality of vertices; the surface of the virtual model is connected by polygons composed of vertices; the model parameters are used to indicate: the positions of the plurality of vertices of the virtual model in the virtual three-dimensional space, and the corresponding positions in the texture map;

[0057] The pixel density determination module 204 is used to determine the surface area of ​​the virtual model and the texture area corresponding to the virtual model based on the model parameters, and determine the pixel density based on the surface area, the texture area and the size of the texture map; the pixel density is used to indicate: the number of pixels in the texture map occupied by a unit area of ​​the surface of the virtual model;

[0058] The resizing processing module 206 is used to resize the texture map in response to the pixel density satisfying a preset condition.

[0059] The above-mentioned texture map processing device obtains a texture map and model parameters of a virtual model corresponding to the texture map; the virtual model includes a plurality of vertices; the surface of the virtual model is connected by polygons composed of vertices; based on the model parameters, the surface area of ​​the virtual model and the texture area corresponding to the virtual model are determined, and the pixel density is determined based on the surface area, the texture area and the size of the texture map; the pixel density is used to indicate: the number of pixels in the texture map occupied by a unit area of ​​the surface of the virtual model; in response to the pixel density meeting a preset condition, the texture map is resized. In this way, when the number of pixels in the texture map occupied by a unit area of ​​the surface of the virtual model exceeds the required number, the size of the texture map is reduced, and the storage space occupied by the texture map is reduced without sacrificing the display effect.

[0060] The above-mentioned model parameters include the spatial position parameters, texture coordinate parameters and polygon index of the vertices of the virtual model; the polygon index is used to indicate: the vertices of each polygon forming the surface of the virtual model; the pixel density determination module is also used to: determine the surface area of ​​the virtual model based on the spatial position parameters and the polygon index; determine the texture area corresponding to the virtual model based on the texture coordinate parameters and the polygon index.

[0061] The above-mentioned pixel density determination module is also used to: determine the vertices of each polygon in the virtual model surface based on the polygon index; for each polygon, calculate the texture area of ​​the polygon based on the texture coordinate parameters of the vertices of the polygon; add the texture areas of each polygon in the virtual model surface, and determine the addition result as the texture area corresponding to the virtual model.

[0062] The pixel density determination module is further used to: determine a calculation result of dividing the texture area by the surface area; multiply the calculation result by the size of the texture map, and determine the multiplication result as the pixel density.

[0063] The size adjustment processing module is further used to: in response to the pixel density being greater than a preset density threshold, perform size reduction processing on the texture map.

[0064] The step of reducing the size of the texture map includes: reducing the resolution of the texture map.

[0065] The above-mentioned device also includes: a density threshold determination module, which is used to determine the density threshold based on the terminal display device corresponding to the virtual model.

[0066] This embodiment further provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned texture mapping processing method, for example:

[0067] A texture map and model parameters of a virtual model corresponding to the texture map are obtained; the virtual model includes a plurality of vertices; the surface of the virtual model is connected by polygons composed of the vertices; based on the model parameters, the surface area of ​​the virtual model and the texture area corresponding to the virtual model are determined, and the pixel density is determined based on the surface area, the texture area and the size of the texture map; the pixel density is used to indicate: the number of pixels in the texture map occupied by a unit area of ​​the surface of the virtual model; in response to the pixel density satisfying a preset condition, the texture map is resized.

[0068] In the above method, when the number of pixels in the texture map occupied by the surface per unit area of ​​the virtual model exceeds the required number, the size of the texture map is reduced, thereby reducing the storage space occupied by the texture map without sacrificing the display effect.

[0069] Optionally, the above-mentioned model parameters include spatial position parameters, texture coordinate parameters and polygon index of the vertices of the virtual model; the polygon index is used to indicate: the vertices of each polygon forming the surface of the virtual model; based on the model parameters, the step of determining the surface area of ​​the virtual model and the texture area corresponding to the virtual model includes: determining the surface area of ​​the virtual model based on the spatial position parameters and the polygon index; determining the texture area corresponding to the virtual model based on the texture coordinate parameters and the polygon index.

[0070] Optionally, the above-mentioned step of determining the texture area corresponding to the virtual model based on the texture coordinate parameters and the polygon index includes: determining the vertices of each polygon in the surface of the virtual model based on the polygon index; for each polygon, calculating the texture area of ​​the polygon based on the texture coordinate parameters of the vertices of the polygon; adding the texture areas of each polygon in the surface of the virtual model, and determining the addition result as the texture area corresponding to the virtual model.

[0071] Optionally, the step of determining the pixel density based on the surface area, texture area and the size of the texture map includes: determining a calculation result of dividing the texture area by the surface area; multiplying the calculation result by the size of the texture map, and determining the multiplication result as the pixel density.

[0072] Optionally, the step of resizing the texture map in response to the pixel density satisfying a preset condition includes: reducing the size of the texture map in response to the pixel density being greater than a preset density threshold.

[0073] Optionally, the step of reducing the size of the texture map includes: reducing the resolution of the texture map.

[0074] Optionally, the above method also includes: determining a density threshold based on a terminal display device corresponding to the virtual model.

[0075] See also Figure 3 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine executable instructions that can be executed by the processor 100. The processor 100 executes the machine executable instructions to implement the above-mentioned texture mapping processing method.

[0076] Further, Figure 3 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 100 , the communication interface 103 and the memory 101 are connected via the bus 102 .

[0077] The memory 101 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0078] The processor 100 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 100. The above processor 100 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and completes the steps of the method of the above embodiment in combination with its hardware.

[0079] This embodiment further provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned texture mapping processing method.

[0080] A texture map processing method, device and electronic device provided in the embodiments of the present disclosure include a computer-readable storage medium storing program code, and the program code includes instructions that can be used to execute the methods described in the previous method embodiments, for example:

[0081] A texture map and model parameters of a virtual model corresponding to the texture map are obtained; the virtual model includes a plurality of vertices; the surface of the virtual model is connected by polygons composed of the vertices; based on the model parameters, the surface area of ​​the virtual model and the texture area corresponding to the virtual model are determined, and the pixel density is determined based on the surface area, the texture area and the size of the texture map; the pixel density is used to indicate: the number of pixels in the texture map occupied by a unit area of ​​the surface of the virtual model; in response to the pixel density satisfying a preset condition, the texture map is resized.

[0082] In the above method, when the number of pixels in the texture map occupied by the surface per unit area of ​​the virtual model exceeds the required number, the size of the texture map is reduced, thereby reducing the storage space occupied by the texture map without sacrificing the display effect.

[0083] Optionally, the above-mentioned model parameters include spatial position parameters, texture coordinate parameters and polygon index of the vertices of the virtual model; the polygon index is used to indicate: the vertices of each polygon forming the surface of the virtual model; based on the model parameters, the step of determining the surface area of ​​the virtual model and the texture area corresponding to the virtual model includes: determining the surface area of ​​the virtual model based on the spatial position parameters and the polygon index; determining the texture area corresponding to the virtual model based on the texture coordinate parameters and the polygon index.

[0084] Optionally, the above-mentioned step of determining the texture area corresponding to the virtual model based on the texture coordinate parameters and the polygon index includes: determining the vertices of each polygon in the surface of the virtual model based on the polygon index; for each polygon, calculating the texture area of ​​the polygon based on the texture coordinate parameters of the vertices of the polygon; adding the texture areas of each polygon in the surface of the virtual model, and determining the addition result as the texture area corresponding to the virtual model.

[0085] Optionally, the step of determining the pixel density based on the surface area, texture area and the size of the texture map includes: determining a calculation result of dividing the texture area by the surface area; multiplying the calculation result by the size of the texture map, and determining the multiplication result as the pixel density.

[0086] Optionally, the step of resizing the texture map in response to the pixel density satisfying a preset condition includes: reducing the size of the texture map in response to the pixel density being greater than a preset density threshold.

[0087] Optionally, the step of reducing the size of the texture map includes: reducing the resolution of the texture map.

[0088] Optionally, the above method also includes: determining a density threshold based on a terminal display device corresponding to the virtual model.

[0089] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0090] In addition, in the description of the embodiments of the present disclosure, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present disclosure can be understood according to specific circumstances.

[0091] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0092] In the description of the present disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present disclosure. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0093] Finally, it should be noted that the above embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above embodiments, those skilled in the art should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A texture mapping processing method, characterized in that: The method comprises: Acquire a texture map and model parameters of a virtual model corresponding to the texture map; the virtual model includes a plurality of vertices; the surface of the virtual model is formed by connecting polygons composed of the vertices; the model parameters are used to indicate: positions of the plurality of vertices of the virtual model in a virtual three-dimensional space, and corresponding positions in the texture map; Based on the model parameters, determine the surface area of ​​the virtual model and the texture area corresponding to the virtual model, and determine the pixel density based on the surface area, the texture area and the size of the texture map; the pixel density is used to indicate: the number of pixels in the texture map occupied by a unit area of ​​the surface of the virtual model; In response to the pixel density satisfying a preset condition, the texture map is resized.

2. The method according to claim 1, characterized in that The model parameters include spatial position parameters, texture coordinate parameters and polygon indexes of the vertices of the virtual model; the polygon indexes are used to indicate: vertices of each polygon forming the surface of the virtual model; The step of determining the surface area of ​​the virtual model and the texture area corresponding to the virtual model based on the model parameters comprises: Determining a surface area of ​​the virtual model based on the spatial position parameter and the polygon index; Based on the texture coordinate parameters and the polygon index, a texture area corresponding to the virtual model is determined.

3. The method according to claim 2, characterized in that The step of determining the texture area corresponding to the virtual model based on the texture coordinate parameters and the polygon index comprises: Based on the polygon index, determining the vertices of each polygon in the surface of the virtual model; For each polygon, calculating the texture area of ​​the polygon based on texture coordinate parameters of the vertices of the polygon; The texture areas of the polygons on the surface of the virtual model are added together, and the addition result is determined as the texture area corresponding to the virtual model.

4. The method according to claim 1, characterized in that: The step of determining pixel density based on the surface area, the texture area and the size of the texture map comprises: determining a calculation result of dividing the texture area by the surface area; The calculation result is multiplied by the size of the texture map, and the multiplication result is determined as the pixel density.

5. The method according to claim 1, characterized in that In response to the pixel density satisfying a preset condition, the step of resizing the texture map comprises: In response to the pixel density being greater than a preset density threshold, the texture map is downsized.

6. The method according to claim 5, characterized in that The step of reducing the size of the texture map comprises: Reduce the resolution of the texture map.

7. The method according to claim 5, characterized in that The method further comprises: The density threshold is determined based on a terminal display device corresponding to the virtual model.

8. A texture map processing device, characterized in that: The device comprises: A texture map acquisition module, used to acquire a texture map and model parameters of a virtual model corresponding to the texture map; the virtual model includes a plurality of vertices; the surface of the virtual model is formed by connecting polygons composed of the vertices; the model parameters are used to indicate: positions of the plurality of vertices of the virtual model in a virtual three-dimensional space, and corresponding positions in the texture map; a pixel density determination module, configured to determine the surface area of ​​the virtual model and the texture area corresponding to the virtual model based on the model parameters, and to determine the pixel density based on the surface area, the texture area and the size of the texture map; the pixel density is used to indicate: the number of pixels in the texture map occupied by a unit area of ​​the surface of the virtual model; The size adjustment processing module is used to perform size adjustment processing on the texture map in response to the pixel density meeting a preset condition.

9. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the texture mapping processing method according to any one of claims 1 to 7.

10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the texture mapping processing method according to any one of claims 1 to 7.