CN117392305A - Mapping processing method and device, storage medium and electronic device - Google Patents

Mapping processing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN117392305A
CN117392305A CN202311336070.XA CN202311336070A CN117392305A CN 117392305 A CN117392305 A CN 117392305A CN 202311336070 A CN202311336070 A CN 202311336070A CN 117392305 A CN117392305 A CN 117392305A
Authority
CN
China
Prior art keywords
result
mapping
texture
area data
density
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311336070.XA
Other languages
Chinese (zh)
Inventor
张孜博
赵进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202311336070.XA priority Critical patent/CN117392305A/en
Publication of CN117392305A publication Critical patent/CN117392305A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The application discloses a mapping processing method, a mapping processing device, a storage medium and an electronic device. The method comprises the following steps: calculating to obtain first area data corresponding to a plurality of fragments of the virtual model by utilizing world space coordinates of the virtual model, wherein the first area data comprises areas of the plurality of fragments in world space; determining texture space coordinates of a plurality of fragments by using texture maps corresponding to the virtual models; calculating to obtain second area data corresponding to the plurality of fragments by using texture space coordinates, wherein the second area data comprises areas of the plurality of fragments in a texture space; and performing mapping density inspection on the texture mapping based on the first area data and the second area data to obtain a density inspection result, wherein the density inspection result is used for assisting in resolution adjustment processing on the texture mapping. The method and the device solve the technical problems of poor flexibility, poor accuracy and low checking efficiency of the mapping density checking in the related technology.

Description

Mapping processing method and device, storage medium and electronic device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a mapping processing method and apparatus, a storage medium, and an electronic device.
Background
In the process of manufacturing the virtual scene image, as the virtual scene generally comprises virtual models with different sizes and different distances, the consistency of the mapping densities of the texture mapping of a plurality of virtual models in the scene needs to be considered, so that the situation that the virtual model with a smaller size uses a higher-precision texture mapping and the virtual model with a larger size uses a lower-precision texture mapping to further reduce the sense of reality of the virtual scene image is avoided, and the performance waste in rendering is reduced.
In this regard, the map density inspection method provided in the related art is mainly: the texel density of the texture map is checked using a rendering engine or a third party plug-in, and then a determination is made as to whether the current resolution of the texture map is reasonable in combination with the size of the virtual model. However, this approach has poor flexibility, poor accuracy of the map density inspection results, and low inspection efficiency.
In view of the above problems, no effective solution has been proposed at present.
It should be noted that the information disclosed in the foregoing background section is only for enhancing understanding of the background of the present application and thus may include information that does not form the prior art that is already known to those of ordinary skill in the art.
Disclosure of Invention
At least some embodiments of the present application provide a mapping processing method, apparatus, storage medium, and electronic device, so as to at least solve the technical problems of poor flexibility, poor accuracy of a mapping density inspection result, and low inspection efficiency of a related art method that relies on an existing plug-in to inspect texel density of a texture mapping to process the mapping.
According to one embodiment of the present application, there is provided a mapping method, including: calculating to obtain first area data corresponding to a plurality of fragments of the virtual model by utilizing world space coordinates of the virtual model, wherein the first area data comprises areas of the plurality of fragments in world space; determining texture space coordinates of a plurality of fragments by using texture maps corresponding to the virtual models; calculating to obtain second area data corresponding to the plurality of fragments by using texture space coordinates, wherein the second area data comprises areas of the plurality of fragments in a texture space; and performing mapping density inspection on the texture mapping based on the first area data and the second area data to obtain a density inspection result, wherein the density inspection result is used for assisting in resolution adjustment processing on the texture mapping.
According to one embodiment of the present application, there is also provided a mapping processing apparatus, including: the first calculation module is used for calculating first area data corresponding to a plurality of fragments of the virtual model by utilizing world space coordinates of the virtual model, wherein the first area data comprises areas of the fragments in world space; the determining module is used for determining texture space coordinates of a plurality of fragments by utilizing texture maps corresponding to the virtual model; the second calculation module is used for calculating second area data corresponding to the plurality of fragments by using texture space coordinates, wherein the second area data comprises areas of the plurality of fragments in a texture space; and the checking module is used for carrying out mapping density checking on the texture mapping based on the first area data and the second area data to obtain a density checking result, wherein the density checking result is used for assisting in carrying out resolution adjustment processing on the texture mapping.
According to one embodiment of the present application, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the mapping method of any one of the above-mentioned claims when run.
According to one embodiment of the present application, there is also provided an electronic device including: comprising a memory in which a computer program is stored and a processor arranged to run the computer program to perform the mapping method of any of the above.
In at least some embodiments of the present application, on the one hand, first area data corresponding to a plurality of primitives of a virtual model is obtained by calculation by using world space coordinates of the virtual model, where the first area data includes areas of the plurality of primitives in world space; on the other hand, determining texture space coordinates of a plurality of fragments by using texture maps corresponding to the virtual model, and calculating second area data corresponding to the plurality of fragments by using the texture space coordinates, wherein the second area data comprises areas of the plurality of fragments in a texture space; and performing mapping density inspection on the texture mapping based on the first area data and the second area data to obtain a density inspection result, wherein the density inspection result is used for assisting in resolution adjustment processing on the texture mapping. Therefore, the method provided by the application utilizes the area occupied by the patch element of the texture map in world space and texture space to determine the map density, and further performs map density inspection on the texture map, so that resolution adjustment processing is performed on the texture map based on a density inspection result, the purposes of calculating the actual map density of the texture map and performing map density inspection are achieved, the technical effects of improving the flexibility, accuracy and efficiency of map density inspection in the map processing process are achieved, and the technical problems that the related technology relies on the existing plug-in unit to inspect the density of the texture map to process the map are poor in flexibility, poor in map density inspection result accuracy and low in inspection efficiency are solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a block diagram of the hardware architecture of a computer terminal of a mapping method according to one embodiment of the present application;
FIG. 2 is a flow chart of a mapping method according to one embodiment of the present application;
FIG. 3 is a schematic diagram of an alternative method of chip area calculation according to one embodiment of the present application;
FIG. 4 is a schematic diagram of an alternative first area data calculation mode according to one embodiment of the present application;
FIG. 5 is a schematic diagram of an alternative second area data calculation mode according to one embodiment of the present application;
FIG. 6 is a schematic diagram of an alternative density inspection result calculation mode according to one embodiment of the present application;
FIG. 7 is a schematic diagram of an alternative inspection result view generation approach in accordance with one embodiment of the present application;
FIG. 8 is a partial schematic view of an alternative inspection result view according to one embodiment of the present application;
FIG. 9 is a schematic diagram of an alternative graphical user interface according to one embodiment of the present application;
FIG. 10 is a block diagram of a mapping apparatus according to one embodiment of the present application;
FIG. 11 is a block diagram of an alternative mapping apparatus according to one embodiment of the present application;
FIG. 12 is a block diagram of an alternative mapping apparatus according to one embodiment of the present application;
FIG. 13 is a block diagram of an alternative mapping apparatus according to one embodiment of the present application;
FIG. 14 is a block diagram of an alternative mapping apparatus according to one embodiment of the present application;
fig. 15 is a schematic diagram of an electronic device according to one embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the description of the present application, the term "for example" is used to mean "serving as an example, illustration, or description". Any embodiment described herein as "for example" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for purposes of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known structures and processes have not been shown in detail to avoid obscuring the description of the present application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
In describing embodiments of the present application, partial terms or terms that appear are used in the following explanation:
application mapping: refers to a process of attaching a picture to a model skeleton made of mesh (mesh). In the process of applying the mapping, when an oversized (refer to resolution) picture is attached to a smaller mesh, the problem of performance waste is generated; when too small pictures are attached to a larger mesh, the problem of insufficient picture accuracy can occur.
In one possible implementation manner of the present application, the inventor has practiced and studied carefully a method for checking the texel density of a texture map and then performing the mapping process, which is generally adopted in the background related to virtual scene picture making in the field of computer technology, and still has the technical problems of poor flexibility, poor accuracy of the mapping density checking result and low checking efficiency.
The embodiment of the application provides a mapping processing method, which adopts the technical conception that the mapping density is determined by utilizing the area occupied by the patch elements of the texture mapping in world space and texture space, and then the texture mapping is subjected to mapping density inspection so as to carry out resolution adjustment processing on the texture mapping based on a density inspection result, thereby achieving the purposes of calculating the actual mapping density of the texture mapping and carrying out mapping density inspection, realizing the technical effects of improving the flexibility, accuracy and efficiency of mapping density inspection in the mapping processing process, and further solving the technical problems of poor flexibility, poor mapping density inspection result accuracy and lower inspection efficiency of the method for inspecting the texture density of the texture mapping by the related technology by relying on the existing plug-in.
The above-described method embodiments referred to in the present application may be performed in a terminal device (e.g., a mobile terminal, a computer terminal, or similar computing device). Taking the mobile terminal as an example, the mobile terminal can be a terminal device such as a smart phone, a tablet computer, a palm computer, a mobile internet device, a game machine and the like.
Fig. 1 is a block diagram of a hardware structure of a computer terminal according to a mapping processing method according to one embodiment of the present application. As shown in fig. 1, a computer terminal may include one or more (only one shown in fig. 1) processors 102, memory 104, transmission devices 106, input output devices 108, and display devices 110. Taking the example of the mapping method applied to the computer graphics (Computer Graphics, CG) by the computer terminal to make a scene, the processor 102 invokes and runs the computer program stored in the memory 104 to execute the mapping method, the density check result of the generated texture map or the resolution adjustment result of the texture map is transmitted to the input output device 108 and/or the display device 110 by the transmission device 106, and the density check result or the resolution adjustment result is provided to the producer.
As also shown in fig. 1, the processor 102 may include, but is not limited to: a central processor (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU), a digital signal processing (Digital Signal Processing, DSP) chip, a microprocessor (Microcontroller Unit, MCU), a programmable logic device (Field Programmable Gate Array, FPGA), a Neural network processor (Neural-Network Processing Unit, NPU), a tensor processor (Tensor Processing Unit, TPU), an artificial intelligence (Artificial Intelligence, AI) type processor, and the like.
It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the computer terminal described above. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
In some alternative embodiments, the terminal device may further provide a human-machine interaction interface with a touch-sensitive surface, the human-machine interaction interface may sense finger contacts and/or gestures to interact with a graphical user interface (Graphical User Interface, GUI), the human-machine interaction functionality may include the following interactions: executable instructions for performing the above-described human-machine interaction functions, such as creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving electronic mail, talking interfaces, playing digital video, playing digital music, and/or web browsing, are configured/stored in a computer program product or readable storage medium executable by one or more processors.
The above method embodiments related to the present application may also be executed in a server. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, a content distribution network (Content Delivery Network, CDN), basic cloud computing services such as big data and an artificial intelligent platform. Taking the example that the mapping processing method is applied to the CG making scene through the server, the CG making server may generate a density check result of the texture map or a resolution adjustment result of the texture map in the CG making scene based on the mapping processing method, and provide the density check result or the resolution adjustment result to the producer (for example, may be rendered and displayed on a display screen of the player terminal, or provided to the producer through holographic projection, etc.).
According to one embodiment of the present application, there is provided an embodiment of a mapping processing method, it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that, although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order other than that illustrated herein.
In this embodiment, a mapping processing method running on the computer terminal is provided, and fig. 2 is a flowchart of a mapping processing method according to one embodiment of the present application, as shown in fig. 2, and the method includes the following steps:
step S21, calculating to obtain first area data corresponding to a plurality of fragments of the virtual model by utilizing world space coordinates of the virtual model, wherein the first area data comprises areas of the plurality of fragments in world space;
step S22, determining texture space coordinates of a plurality of fragments by using texture maps corresponding to the virtual model;
step S23, calculating second area data corresponding to the plurality of fragments by using texture space coordinates, wherein the second area data comprises areas of the plurality of fragments in a texture space;
and step S24, performing mapping density inspection on the texture mapping based on the first area data and the second area data to obtain a density inspection result, wherein the density inspection result is used for assisting in resolution adjustment processing on the texture mapping.
The virtual model may be a two-dimensional model, a three-dimensional model, or the like in a virtual scene. The virtual scene may be: game scenes, entertainment scenes, educational training scenes, travel sightseeing scenes, advertising scenes, marketing scenes, artistic cultural exhibition scenes, social interaction scenes, building design scenes, military scenes, security scenes, social public welfare scenes and the like.
The world space coordinates are position coordinates of the virtual model in a world space coordinate system (which may be a two-dimensional coordinate system or a three-dimensional coordinate system) corresponding to the virtual scene. The world space coordinates include position coordinates of a plurality of primitives of the virtual model in the world space coordinate system. The world space coordinates may further include position coordinates of a plurality of mesh points of a model mesh (mesh) of the virtual model in the world space coordinate system.
The texture map corresponding to the virtual model is a virtual scene or a picture attached to the virtual model in the process of manufacturing the virtual model, and the picture is used for determining the display texture of the virtual model in the virtual scene. The texture space coordinates are the position coordinates of the virtual model in the texture space coordinate system, and the position coordinates of the plurality of fragments of the texture space coordinate virtual model in the texture space coordinate system. The texture map is a target map of the density of the map to be checked.
In the application scene, the world space coordinates and the texture space coordinates can be acquired by a coordinate acquisition function. For example, in the illusion engine, absolute World Positon nodes are used to obtain world space coordinates of the virtual model, and Texcoord nodes are used to obtain texture space coordinates of the virtual model.
And calculating the first area data and the second area data according to the geometric rules corresponding to the world space coordinates and the texture space coordinates. In an application scenario, if the tile of a texture map occupies an area in world space that is close to the area it occupies in texture space, then the map density of the texture map may be considered to fit into the corresponding virtual model. On the basis of the first area data and the second area data, the texture mapping can be subjected to mapping density inspection to obtain a density inspection result. The density check result may be used to determine a partial map region in the texture map where the degree of matching of the map resolution to the corresponding virtual model size does not reach the expected. Further, the resolution of the texture map may be fully or partially adjusted using the density check results to optimize the virtual scene picture.
In the embodiment of the application, on one hand, first area data corresponding to a plurality of fragments of a virtual model are obtained through calculation by utilizing world space coordinates of the virtual model, wherein the first area data comprises areas of the plurality of fragments in world space; on the other hand, determining texture space coordinates of a plurality of fragments by using texture maps corresponding to the virtual model, and calculating second area data corresponding to the plurality of fragments by using the texture space coordinates, wherein the second area data comprises areas of the plurality of fragments in a texture space; and performing mapping density inspection on the texture mapping based on the first area data and the second area data to obtain a density inspection result, wherein the density inspection result is used for assisting in resolution adjustment processing on the texture mapping. Therefore, the method provided by the application utilizes the area occupied by the patch element of the texture map in world space and texture space to determine the map density, and further performs map density inspection on the texture map, so that resolution adjustment processing is performed on the texture map based on a density inspection result, the purposes of calculating the actual map density of the texture map and performing map density inspection are achieved, the technical effects of improving the flexibility, accuracy and efficiency of map density inspection in the map processing process are achieved, and the technical problems that the related technology relies on the existing plug-in unit to inspect the density of the texture map to process the map are poor in flexibility, poor in map density inspection result accuracy and low in inspection efficiency are solved.
The above-described methods of embodiments of the present application are further described below.
In a specific application scenario, it is assumed that the shapes of the primitives in the model mesh of the virtual model are rectangular, and there may be deformation, rotation, and the like of the primitives in the model mesh. Taking a single element facing the virtual camera in the virtual scene as an example, a schematic diagram of calculating the area of the element based on the coordinate information of the element is shown in fig. 3, wherein the horizontal direction corresponds to the X direction (or the U direction) in fig. 3, the vertical direction corresponds to the Y direction (or the V direction), a rectangle with an edge parallel to the coordinate direction in fig. 3 represents the element before rotation, and another rectangle represents the element after rotation α. Based on this, a in FIG. 3 represents du, b represents dv, and c represents dv, according to the partial differential conceptd represents->e represents->f represents->Further, the above->Can be expressed as ddx.x, above +.>Can be expressed as ddx.y, above +.>Can be expressed as ddy.x, above +.>May be denoted ddy.
The area of the patch is denoted as Δs, and the following equation (1) can be obtained from the trigonometric function relationship.
Δs=du×dv=ddx×ddy.y-ddy.x×ddx.y formula (1)
In addition, according to the geometric law and trigonometric function, the above formula (1) can also prove that under the condition that any rotation angle or any angle beveling occurs to the wafer. Based on the above formula (1), the occupied area of each patch can be calculated using the coordinate information of the patch in world space and texture space.
Optionally, in step S21, calculating, using world space coordinates of the virtual model, first area data corresponding to a plurality of primitives of the virtual model may include the following steps:
step S211, differential processing is carried out on world space coordinates to obtain a first differential result and a second differential result corresponding to a plurality of fragments, wherein the differential directions of the first differential result and the second differential result are mutually orthogonal;
step S212, vector multiplication is carried out on the first differential result and the second differential result to obtain first area data.
In an application scenario, the process of calculating the first area data by using a rendering engine or a self-development code may be as shown in fig. 4, where the first differential result is ddx in world space and the second differential result is ddy in world space based on world space coordinate differentiation of multiple primitives of the virtual model. The first differential result is also denoted as vector (ddx.x, ddx.y) and the second differential result is also denoted as vector (ddy.x, ddy.y). The first multiplication node (such as a Cross node) is used for performing vector multiplication calculation on the first differential result and the second differential result, and the vector product obtained by calculation through the first multiplication node. And taking the modular Length of the Vector product by using a Vector modular node (such as Vector Length) to obtain the occupied area of a plurality of fragments under the world space. Further, in the application scene, there may be a case that the area of a part of the primitives calculated by the method is a negative value, in order to avoid the influence of the case on the subsequent mapping density checking process, a large function node (e.g. Max (0)) is adopted to process the output of the vector modulus node, and the negative values are replaced by 0, so as to obtain a first output, where the first output represents the first area data.
It should be noted that before performing differential processing on the world space coordinate to obtain a first differential result and a second differential result corresponding to the plurality of primitives, the world space coordinate may also be subjected to unit conversion by using the first division node. For example, the length units in world space are centimeters, and world space coordinates are scaled by dividing 100, where the scaled coordinates correspond to the length units meters in texture space.
Optionally, in step S23, calculating the second area data corresponding to the plurality of primitives by using the texture space coordinates may include the following steps:
step S231, performing differential processing on the texture space coordinates to obtain a third differential result and a fourth differential result corresponding to the plurality of fragments, wherein the differential directions of the third differential result and the fourth differential result are mutually orthogonal;
step S232, performing mixed multiplication on the numerical components of the third differential result and the fourth differential result to obtain second area data.
In the application scenario, the process of calculating the second area data by using the rendering engine or the self-development code may be as shown in fig. 5, where the third differential result is ddx in the texture space and the fourth differential result is ddy in the texture space based on the texture space coordinate differentiation of the plurality of primitives of the virtual model. And (3) carrying out mixed multiplication on the numerical components of the differential result according to a formula (1) to obtain the occupied area of the plurality of fragments in a texture space.
Optionally, in step S232, performing a mixed multiplication calculation on the numerical components of the third differential result and the fourth differential result to obtain second area data, the method may include the following steps:
step S2321, carrying out coordinate splitting on the third differential result to obtain a first component in the first direction and a second component in the second direction;
step S2322, carrying out coordinate splitting on the fourth differential result to obtain a third component in the first direction and a fourth component in the second direction;
step S2323, multiplying the first component and the fourth component to obtain a first calculation result, and multiplying the second component and the third component to obtain a second calculation result;
step S2324, subtraction is performed on the first calculation result and the second calculation result, so as to obtain second area data.
In the application scenario, it is assumed that the first direction takes the X direction and the second direction takes the Y direction. Splitting the third differentiation result ddx into a first component ddx.x and a second component ddx.y; the fourth differentiation result ddy is split into a third component ddy.x and a fourth component ddy.y.
Further, according to the above formula (1), the first component ddx.x is multiplied by the fourth component ddy.y to obtain ddx.x×ddy.y; the second component ddx.y is multiplied by the third component ddy.x to obtain ddy.x x ddx.y. Further, the area occupied by the plurality of fragments in the texture space is calculated according to the formula (1).
As shown in fig. 5, the implementation of the above procedure in a rendering engine or self-developed code includes: the third differential result is stored as a doublet (ddx.x, ddx.y) and the fourth differential result is stored as a doublet (ddy.x, ddy.y); processing the binary group of the fourth differential result into (ddy.y, ddy.x) by adopting a first numerical processing node; and correspondingly multiplying and subtracting the binary group of the third differential result and the binary group of the fourth differential result by using the second multiplication node to obtain an initial calculation result. In the application scenario, a negative number area may exist in the initial calculation result, in order to avoid the influence of this situation on the subsequent mapping density inspection process, a second numerical processing node (such as an ABS function) is adopted to perform absolute value processing on the initial calculation result, so as to obtain a second output, where the second output represents second area data.
Optionally, in step S24, performing a mapping density check on the texture mapping based on the first area data and the second area data to obtain a density check result, the method may include the following steps:
step S241, determining density information of the texture map by using the first area data, the second area data and the map resolution of the texture map;
In step S242, the texture map is subjected to a map density inspection based on the density information, so as to obtain a density inspection result.
In the application scene, the mapping resolution of the texture mapping is calculated by texture space coordinates. Based on the first area data and the second area data, the difference degree of the occupied area of the patch in the world space and the texture space can be obtained, and the density information of the texture map can be determined by combining the difference degree and the map resolution. Further, a mapping density check is performed on the texture mapping to determine which partial mapping resolution data in the texture mapping does not conform to expectations, and a density check result is obtained.
Optionally, in step S241, determining the density information of the texture map using the first area data, the second area data, and the map resolution may include performing the steps of:
step S2411, performing division calculation on the first area data and the second area data to obtain a third calculation result;
in step S2412, the third calculation result and the mapping resolution are multiplied to obtain density information.
In the application scenario, the process of implementing the map density check by using the rendering engine or the self-development code may be as shown in fig. 6, and a second division node is used to perform division calculation on the first area data and the second area data, specifically, the areas occupied by the plurality of primitives in the world space and the areas occupied by the plurality of primitives in the texture space are subjected to one-to-one division calculation, so as to obtain a third calculation result, where the third calculation result can represent the difference of the area sizes of each primitive in the world space and the texture space, and the third calculation result includes a plurality of area ratios corresponding to the plurality of primitives.
Further, the third multiplication node is utilized to multiply the resolution of the texture map obtained by calculating the texture space coordinates with the third calculation result, specifically, the area ratio corresponding to each fragment is multiplied with the resolution value corresponding to the fragment in the resolution data of the texture map, so as to obtain the calculation result corresponding to a plurality of fragments, namely the density information of the texture map.
It will be readily appreciated that the area ratio corresponding to each tile multiplied by the map resolution can characterize the display area of the corresponding pixel in the map through the tile on the model surface in world space and the display area in the texture map in texture space. For example, the area of a tile in world space is denoted as s1, the area of a tile in texture space is denoted as s2, the area ratio corresponding to the tile is denoted as p=s1/s 2 (e.g., p is 1.5), the mapping resolution corresponding to the tile is m1 (e.g., 960×540= 518400), and the data corresponding to the tile in the density information is p×m1, that is (777600).
Optionally, in step S242, the texture map is subjected to a map density check based on the density information, to obtain a density check result, which may include the following steps:
in step S2421, the density information is compared with a density inspection standard to obtain a density inspection result, where the density inspection standard is used to determine the expected display resolution corresponding to the virtual model.
In the application scenario, still as shown in fig. 6, the third division result is used to divide the acquired density inspection standard with the density information to obtain a density inspection result, and specifically, the density inspection standard is used to determine the expected resolution (for example 1440×810= 777600) in the virtual scene picture. Taking a patch whose density information is (777600) as an example, the density check result obtained by the division calculation is 1, which indicates that the resolution m1 (960×540) of the texture map on the model where the patch is located is appropriate. Assuming that the expected resolution corresponding to the density check criterion is set to (4096×4096=16777216), i.e. 4K resolution, the density check result corresponding to the tile with the density information (777600) is about 0.046, which indicates that the resolution m1 (960×540) of the texture map on the model where the tile is located is too low.
Optionally, the mapping processing method may further include the following execution steps:
step S25, based on the density check result, determining a partial map to be adjusted from the texture map, and generating a resolution adjustment suggestion corresponding to the partial map.
The density check result can be used to determine which partial maps in the texture map have too high a resolution, causing unnecessary performance consumption, and which partial maps have too low a resolution, affecting the display accuracy of the rendered picture. In an application scenario, a partial map to be adjusted is determined from the texture map, which may be characterized by a region identification or a pixel identification of the texture map. Meanwhile, according to the density checking result, generating a resolution adjustment suggestion corresponding to the part of the map to be adjusted, for example, if the value of the density checking result corresponding to a part of the map is in the range of 1.5 to 2, generating an adjustment suggestion to suggest to reduce the resolution corresponding to the part of the map. Alternatively, adjustment suggestions containing target resolution information may be generated based on density inspection criteria.
Optionally, the mapping processing method may further include the following execution steps:
step S261, determining a resolution adjustment strategy of partial mapping based on the density check result;
in step S262, the resolution adjustment process is performed on the texture map according to the resolution adjustment policy.
The resolution adjustment strategy described above may be expressed as adjustment levels, e.g., levels-1 through-3 represent 2/3, 1/2, and 1/3, respectively, of the resolution to be adjusted down to the original resolution; the levels 1 to 3 represent the need to raise the resolution to 1, 2 and 3 times the original resolution, respectively.
In the application scenario, based on the resolution adjustment strategy, the resolution of the partial maps can be automatically adjusted by combining a resolution adjustment tool, or a candidate database can be combined, and a target picture is selected from the candidate database according to the resolution adjustment strategy so as to replace the partial maps in the texture maps.
Optionally, the mapping processing method may further include the following execution steps:
step S271, mapping the density inspection result to a preset numerical interval to obtain a mapping result, wherein at least one threshold value in the preset numerical interval corresponds to at least one preset color parameter;
in step S272, an inspection result view corresponding to the texture map is generated based on the mapping result and at least one preset color parameter.
In an application scenario, the process of implementing the map density check using a rendering engine or self-developed code may use a third numerical processing node to pre-process the density check result, e.g., remove noise, outliers, etc., as shown in fig. 7. Mapping the density inspection result to a preset numerical interval by using a color mapping node, for example, the preset numerical interval is 0 to 2, wherein 0 corresponds to blue, and the RGB value is (0,0,255); 1 corresponds to green, RGB values (0,255,0); 2 corresponds to red, and the RGB value is (255, 0). Based on the mapping result, an inspection result view is generated by the view generation node.
For example, based on a partial virtual scene in which three virtual building models of different sizes are displayed, density inspection is performed on a texture map corresponding to the partial virtual scene, and the resultant inspection view is shown in fig. 8, and the first virtual building is displayed in red (shown as horizontal hatching in fig. 8) to indicate that the resolution of the partial texture map corresponding to the first virtual building is too high; the second virtual building is displayed green (shown as a square hatching in fig. 8) indicating that the resolution of the corresponding portion of the texture map of the second virtual building is appropriate; the third virtual building is shown in blue (shown as a vertical line shadow in fig. 8) indicating that the resolution of the corresponding portion of the texture map of the third virtual building is too low. Thus, by generating the inspection result view, the density inspection result of the texture map can be more intuitively expressed.
Optionally, providing, by the terminal device, a graphical user interface, where the content displayed by the graphical user interface at least partially includes a map density check scene, and the method for processing a map may further include the following steps:
step S281, responding to a first control operation executed on the graphical user interface, and determining a texture map to be checked and a virtual model corresponding to the texture map;
step S282, responding to a second control operation executed on the graphical user interface, and acquiring a density inspection standard;
in step S283, in response to the third control operation performed on the graphical user interface, the inspection result view corresponding to the texture map is displayed in the graphical user interface.
In the application scene, a window corresponding to the map density checking scene is displayed in the graphical user interface, where the window is shown in fig. 9, and the first control operation may be an operation of selecting a virtual model in the preview sub-window, and determining a texture map corresponding to the selected virtual model as the texture map to be checked.
As shown in fig. 9, the above-described second control operation may include: the slider control is adjusted or the target map density is entered within the input box. Further, the expected resolution in the density check criterion is determined based on the current state of the slider or the target map density entered in the input box.
As shown in fig. 9, the third control operation may be to click the inspection button, automatically execute the method provided in the embodiment of the present application after detecting that the inspection button is clicked, generate an inspection result view, and display the inspection result view in the preview sub-window.
As shown in FIG. 9, the operations sub-window may also include a mapping slot selection control. The first control operation may further specify a texture map to be checked and a virtual model through a map slot selection control.
As shown in fig. 9, the window corresponding to the map density inspection scene further includes a log sub-window, and in the map density inspection scene, a user may set different texture maps to be inspected, different virtual models, and different density inspection standards for performing map density inspection, where inspection logs of each map density inspection are displayed in the log sub-window in real time.
According to the method provided by the application, the application service or the plug-in tool can be packaged, and the mapping density checking service or the mapping processing service can be provided for a user in a visual mode. Because the area of the patch is obtained through geometric and numerical calculation, the actual mapping density of the texture mapping can be accurately obtained, and a plurality of controllable variables are involved in the mapping density checking process and the mapping processing process, so that the flexible urheen is high. The method is applied to a larger virtual scene, one-key density inspection and resolution processing can be carried out on one or more texture maps corresponding to the virtual model, and the efficiency is high.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. a magnetic disc, an optical disc), including several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present application.
In this embodiment, a mapping processing apparatus is further provided, and this apparatus is used to implement the foregoing embodiments and preferred embodiments, and will not be described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 10 is a block diagram of a mapping apparatus according to one embodiment of the present application, as shown in fig. 10, the apparatus includes:
a first calculation module 1001, configured to calculate, using world space coordinates of a virtual model, first area data corresponding to a plurality of primitives of the virtual model, where the first area data includes areas of the plurality of primitives in world space;
a determining module 1002, configured to determine texture space coordinates of a plurality of primitives using texture maps corresponding to the virtual model;
a second calculation module 1003, configured to calculate, using texture space coordinates, second area data corresponding to the plurality of primitives, where the second area data includes areas of the plurality of primitives in texture space;
the checking module 1004 is configured to perform a map density check on the texture map based on the first area data and the second area data to obtain a density check result, where the density check result is used to assist in performing resolution adjustment processing on the texture map.
Optionally, the first computing module 1001 is further configured to: performing differential processing on world space coordinates to obtain a first differential result and a second differential result corresponding to the plurality of fragments, wherein the differential directions of the first differential result and the second differential result are mutually orthogonal; vector multiplication is carried out on the first differential result and the second differential result, and first area data are obtained.
Optionally, the second calculating module 1003 is further configured to: performing differential processing on the texture space coordinates to obtain a third differential result and a fourth differential result corresponding to the plurality of fragments, wherein the differential directions of the third differential result and the fourth differential result are mutually orthogonal; and carrying out mixed multiplication on the numerical components of the third differential result and the fourth differential result to obtain second area data.
Optionally, the second calculating module 1003 is further configured to: carrying out coordinate splitting on the third differential result to obtain a first component in the first direction and a second component in the second direction; carrying out coordinate resolution on the fourth differential result to obtain a third component in the first direction and a fourth component in the second direction; multiplying the first component by the fourth component to obtain a first calculation result, and multiplying the second component by the third component to obtain a second calculation result; and subtracting the first calculation result and the second calculation result to obtain second area data.
Optionally, the above-mentioned checking module 1004 is further configured to: determining density information of the texture map by using the first area data, the second area data and the map resolution of the texture map; and performing mapping density inspection on the texture mapping based on the density information to obtain a density inspection result.
Optionally, the above-mentioned checking module 1004 is further configured to: dividing the first area data and the second area data to obtain a third calculation result; and multiplying the third calculation result and the mapping resolution to obtain density information.
Optionally, the above-mentioned checking module 1004 is further configured to: and comparing the density information with a density inspection standard to obtain a density inspection result, wherein the density inspection standard is used for determining the expected display resolution corresponding to the virtual model.
Alternatively, fig. 11 is a block diagram of an alternative mapping processing apparatus according to an embodiment of the present application, and as shown in fig. 11, the apparatus includes, in addition to all the modules shown in fig. 10: a suggestion module 1005 is configured to determine a partial map to be adjusted from the texture map based on the density check result, and generate a resolution adjustment suggestion corresponding to the partial map.
Alternatively, fig. 12 is a block diagram of an alternative mapping processing apparatus according to one embodiment of the present application, as shown in fig. 12, which includes, in addition to all the modules shown in fig. 11: a processing module 1006, configured to determine a resolution adjustment policy of the partial map based on the density check result; and carrying out resolution adjustment processing on the texture map according to a resolution adjustment strategy.
Alternatively, fig. 13 is a block diagram of an alternative mapping processing apparatus according to one embodiment of the present application, as shown in fig. 13, which includes, in addition to all the modules shown in fig. 12: a generating module 1007, configured to map the density inspection result to a preset numerical interval to obtain a mapping result, where at least one threshold value in the preset numerical interval corresponds to at least one preset color parameter; and generating a checking result view corresponding to the texture map based on the mapping result and at least one preset color parameter.
Optionally, a graphical user interface is provided through the terminal device, where the content displayed by the graphical user interface at least partially includes a map density check scene, and fig. 14 is a block diagram of an alternative map processing device according to an embodiment of the present application, where the device includes, in addition to all the modules shown in fig. 13, as shown in fig. 14: a visualization module 1008, configured to determine a texture map to be inspected and a virtual model corresponding to the texture map in response to a first control operation performed by the graphical user interface; acquiring a density inspection standard in response to a second control operation performed on the graphical user interface; and responding to a third control operation executed on the graphical user interface, and displaying the inspection result view corresponding to the texture map in the graphical user interface.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described computer-readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media in which a computer program can be stored.
Alternatively, in this embodiment, the above-mentioned computer-readable storage medium may be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.
Alternatively, in the present embodiment, the above-described computer-readable storage medium may be configured to store a computer program for performing the steps of:
S1, calculating to obtain first area data corresponding to a plurality of fragments of a virtual model by utilizing world space coordinates of the virtual model, wherein the first area data comprises areas of the plurality of fragments in world space;
s2, determining texture space coordinates of a plurality of fragments by using texture maps corresponding to the virtual model;
s3, calculating second area data corresponding to the plurality of fragments by using texture space coordinates, wherein the second area data comprises areas of the plurality of fragments in a texture space;
and S4, performing mapping density inspection on the texture mapping based on the first area data and the second area data to obtain a density inspection result, wherein the density inspection result is used for assisting in resolution adjustment processing on the texture mapping.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: performing differential processing on world space coordinates to obtain a first differential result and a second differential result corresponding to the plurality of fragments, wherein the differential directions of the first differential result and the second differential result are mutually orthogonal; vector multiplication is carried out on the first differential result and the second differential result, and first area data are obtained.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: performing differential processing on the texture space coordinates to obtain a third differential result and a fourth differential result corresponding to the plurality of fragments, wherein the differential directions of the third differential result and the fourth differential result are mutually orthogonal; and carrying out mixed multiplication on the numerical components of the third differential result and the fourth differential result to obtain second area data.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: carrying out coordinate splitting on the third differential result to obtain a first component in the first direction and a second component in the second direction; carrying out coordinate resolution on the fourth differential result to obtain a third component in the first direction and a fourth component in the second direction; multiplying the first component by the fourth component to obtain a first calculation result, and multiplying the second component by the third component to obtain a second calculation result; and subtracting the first calculation result and the second calculation result to obtain second area data.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: determining density information of the texture map by using the first area data, the second area data and the map resolution of the texture map; and performing mapping density inspection on the texture mapping based on the density information to obtain a density inspection result.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: dividing the first area data and the second area data to obtain a third calculation result; and multiplying the third calculation result and the mapping resolution to obtain density information.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: and comparing the density information with a density inspection standard to obtain a density inspection result, wherein the density inspection standard is used for determining the expected display resolution corresponding to the virtual model.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: based on the density check result, a partial map to be adjusted is determined from the texture map, and a resolution adjustment suggestion corresponding to the partial map is generated.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: determining a resolution adjustment strategy of the partial map based on the density check result; and carrying out resolution adjustment processing on the texture map according to a resolution adjustment strategy.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: mapping the density inspection result to a preset numerical value interval to obtain a mapping result, wherein at least one threshold value in the preset numerical value interval corresponds to at least one preset color parameter; and generating a checking result view corresponding to the texture map based on the mapping result and at least one preset color parameter.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: responding to a first control operation executed on the graphical user interface, and determining a texture map to be checked and a virtual model corresponding to the texture map; acquiring a density inspection standard in response to a second control operation performed on the graphical user interface; and responding to a third control operation executed on the graphical user interface, and displaying the inspection result view corresponding to the texture map in the graphical user interface.
In the computer readable storage medium of the above embodiment, a technical solution for implementing the mapping processing method is provided. On the one hand, the world space coordinates of the virtual model are utilized to calculate first area data corresponding to a plurality of fragments of the virtual model, wherein the first area data comprises areas of the fragments in world space; on the other hand, determining texture space coordinates of a plurality of fragments by using texture maps corresponding to the virtual model, and calculating second area data corresponding to the plurality of fragments by using the texture space coordinates, wherein the second area data comprises areas of the plurality of fragments in a texture space; and performing mapping density inspection on the texture mapping based on the first area data and the second area data to obtain a density inspection result, wherein the density inspection result is used for assisting in resolution adjustment processing on the texture mapping. Therefore, the method provided by the application utilizes the area occupied by the patch element of the texture map in world space and texture space to determine the map density, and further performs map density inspection on the texture map, so that resolution adjustment processing is performed on the texture map based on a density inspection result, the purposes of calculating the actual map density of the texture map and performing map density inspection are achieved, the technical effects of improving the flexibility, accuracy and efficiency of map density inspection in the map processing process are achieved, and the technical problems that the related technology relies on the existing plug-in unit to inspect the density of the texture map to process the map are poor in flexibility, poor in map density inspection result accuracy and low in inspection efficiency are solved.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a computer readable storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present application.
In an exemplary embodiment of the present application, a computer-readable storage medium stores thereon a program product capable of implementing the method described above in the present embodiment. In some possible implementations, the various aspects of the embodiments of the present application may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the present application as described in the "exemplary methods" section of the embodiments, when the program product is run on the terminal device.
A program product for implementing the above method according to an embodiment of the present application may employ a portable compact disc read-only memory (CD-ROM) and comprise program code and may be run on a terminal device, such as a personal computer. However, the program product of the embodiments of the present application is not limited thereto, and in the embodiments of the present application, the computer-readable storage medium may be any tangible medium that can contain, or store the program for use by or in connection with the instruction execution system, apparatus, or device.
Any combination of one or more computer readable media may be employed by the program product described above. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It should be noted that the program code embodied on the computer readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Embodiments of the present application also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, calculating to obtain first area data corresponding to a plurality of fragments of a virtual model by utilizing world space coordinates of the virtual model, wherein the first area data comprises areas of the plurality of fragments in world space;
s2, determining texture space coordinates of a plurality of fragments by using texture maps corresponding to the virtual model;
s3, calculating second area data corresponding to the plurality of fragments by using texture space coordinates, wherein the second area data comprises areas of the plurality of fragments in a texture space;
And S4, performing mapping density inspection on the texture mapping based on the first area data and the second area data to obtain a density inspection result, wherein the density inspection result is used for assisting in resolution adjustment processing on the texture mapping.
Optionally, the above processor may be further configured to perform the following steps by a computer program: performing differential processing on world space coordinates to obtain a first differential result and a second differential result corresponding to the plurality of fragments, wherein the differential directions of the first differential result and the second differential result are mutually orthogonal; vector multiplication is carried out on the first differential result and the second differential result, and first area data are obtained.
Optionally, the above processor may be further configured to perform the following steps by a computer program: performing differential processing on the texture space coordinates to obtain a third differential result and a fourth differential result corresponding to the plurality of fragments, wherein the differential directions of the third differential result and the fourth differential result are mutually orthogonal; and carrying out mixed multiplication on the numerical components of the third differential result and the fourth differential result to obtain second area data.
Optionally, the above processor may be further configured to perform the following steps by a computer program: carrying out coordinate splitting on the third differential result to obtain a first component in the first direction and a second component in the second direction; carrying out coordinate resolution on the fourth differential result to obtain a third component in the first direction and a fourth component in the second direction; multiplying the first component by the fourth component to obtain a first calculation result, and multiplying the second component by the third component to obtain a second calculation result; and subtracting the first calculation result and the second calculation result to obtain second area data.
Optionally, the above processor may be further configured to perform the following steps by a computer program: determining density information of the texture map by using the first area data, the second area data and the map resolution of the texture map; and performing mapping density inspection on the texture mapping based on the density information to obtain a density inspection result.
Optionally, the above processor may be further configured to perform the following steps by a computer program: dividing the first area data and the second area data to obtain a third calculation result; and multiplying the third calculation result and the mapping resolution to obtain density information.
Optionally, the above processor may be further configured to perform the following steps by a computer program: and comparing the density information with a density inspection standard to obtain a density inspection result, wherein the density inspection standard is used for determining the expected display resolution corresponding to the virtual model.
Optionally, the above processor may be further configured to perform the following steps by a computer program: based on the density check result, a partial map to be adjusted is determined from the texture map, and a resolution adjustment suggestion corresponding to the partial map is generated.
Optionally, the above processor may be further configured to perform the following steps by a computer program: determining a resolution adjustment strategy of the partial map based on the density check result; and carrying out resolution adjustment processing on the texture map according to a resolution adjustment strategy.
Optionally, the above processor may be further configured to perform the following steps by a computer program: mapping the density inspection result to a preset numerical value interval to obtain a mapping result, wherein at least one threshold value in the preset numerical value interval corresponds to at least one preset color parameter; and generating a checking result view corresponding to the texture map based on the mapping result and at least one preset color parameter.
Optionally, the above processor may be further configured to perform the following steps by a computer program: responding to a first control operation executed on the graphical user interface, and determining a texture map to be checked and a virtual model corresponding to the texture map; acquiring a density inspection standard in response to a second control operation performed on the graphical user interface; and responding to a third control operation executed on the graphical user interface, and displaying the inspection result view corresponding to the texture map in the graphical user interface.
In the electronic device of the above embodiment, a technical solution for implementing a mapping processing method is provided. On the one hand, the world space coordinates of the virtual model are utilized to calculate first area data corresponding to a plurality of fragments of the virtual model, wherein the first area data comprises areas of the fragments in world space; on the other hand, determining texture space coordinates of a plurality of fragments by using texture maps corresponding to the virtual model, and calculating second area data corresponding to the plurality of fragments by using the texture space coordinates, wherein the second area data comprises areas of the plurality of fragments in a texture space; and performing mapping density inspection on the texture mapping based on the first area data and the second area data to obtain a density inspection result, wherein the density inspection result is used for assisting in resolution adjustment processing on the texture mapping. Therefore, the method provided by the application utilizes the area occupied by the patch element of the texture map in world space and texture space to determine the map density, and further performs map density inspection on the texture map, so that resolution adjustment processing is performed on the texture map based on a density inspection result, the purposes of calculating the actual map density of the texture map and performing map density inspection are achieved, the technical effects of improving the flexibility, accuracy and efficiency of map density inspection in the map processing process are achieved, and the technical problems that the related technology relies on the existing plug-in unit to inspect the density of the texture map to process the map are poor in flexibility, poor in map density inspection result accuracy and low in inspection efficiency are solved.
Fig. 15 is a schematic diagram of an electronic device according to one embodiment of the present application. As shown in fig. 15, the electronic device 1500 is merely an example, and should not impose any limitation on the functionality and scope of use of the embodiments of the present application.
As shown in fig. 15, the electronic apparatus 1500 is embodied in the form of a general purpose computing device. The components of the electronic device 1500 may include, but are not limited to: the at least one processor 1510, the at least one memory 1520, a bus 1530 connecting the various system components (including the memory 1520 and the processor 1510), and a display 1540.
Therein, the above-described memory 1520 stores program codes that can be executed by the processor 1510, so that the processor 1510 performs steps according to various exemplary implementations of the present application described in the above-described method section of the present application embodiment.
The memory 1520 may include readable media in the form of volatile memory units such as Random Access Memory (RAM) 15201 and/or cache memory 15202, and may further include Read Only Memory (ROM) 15203, as well as nonvolatile memory such as one or more magnetic storage devices, flash memory, or other nonvolatile solid state memory.
In some examples, memory 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 or some combination of which may include an implementation of a network environment. Memory 1520 may further include memory located remotely from processor 1510, which may be connected to electronic device 1500 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Bus 1530 may be a bus representing 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 processor 1510, or a local bus using any of a variety of bus architectures.
The display 1540 may be, for example, a touch screen type liquid crystal display (Liquid Crystal Display, LCD) that may enable a user to interact with a user interface of the electronic device 1500.
Optionally, the electronic apparatus 1500 may also communicate with one or more external devices 1600 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic apparatus 1500, and/or with any device (e.g., router, modem, etc.) that enables the electronic apparatus 1500 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 1550. Also, the electronic device 1500 may communicate with one or more networks such as a local area network (Local Area Network, LAN), a wide area network (Wide Area Network, WAN) and/or a public network such as the internet via the network adapter 1560. As shown in fig. 15, the network adapter 1560 communicates with other modules of the electronic device 1500 over the bus 1530. It should be appreciated that although not shown in fig. 15, other hardware and/or software modules may be used in connection with electronic device 1500, which may include, but are not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk array (Redundant Arrays of Independent Disks, RAID) systems, tape drives, data backup storage systems, and the like.
The electronic device 1500 may further include: a keyboard, a cursor control device (e.g., a mouse), an input/output interface (I/O interface), a network interface, a power supply, and/or a camera.
It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 15 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, the electronic device 1500 may also include more or fewer components than shown in fig. 15, or have a different configuration than shown in fig. 15. The memory 1520 may be used for storing a computer program and corresponding data, such as a computer program and corresponding data corresponding to the mapping method in the embodiment of the present application. The processor 1510 executes a computer program stored in the memory 1520 to perform various functional applications and data processing, i.e., to implement the above-described mapping processing method.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a read-only memory (ROM), a random-access memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, etc., which can store program codes.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (14)

1. A method of mapping, comprising:
calculating to obtain first area data corresponding to a plurality of fragments of a virtual model by utilizing world space coordinates of the virtual model, wherein the first area data comprises areas of the plurality of fragments in world space;
determining texture space coordinates of the plurality of fragments by using texture maps corresponding to the virtual model;
calculating to obtain second area data corresponding to the plurality of fragments by using the texture space coordinates, wherein the second area data comprises areas of the plurality of fragments in a texture space;
and performing mapping density inspection on the texture mapping based on the first area data and the second area data to obtain a density inspection result, wherein the density inspection result is used for assisting in resolution adjustment processing on the texture mapping.
2. The mapping method according to claim 1, wherein calculating the first area data corresponding to the plurality of primitives of the virtual model using the world space coordinates of the virtual model includes:
performing differential processing on the world space coordinates to obtain a first differential result and a second differential result corresponding to the plurality of fragments, wherein the differential directions of the first differential result and the second differential result are mutually orthogonal;
and carrying out vector multiplication calculation on the first differential result and the second differential result to obtain the first area data.
3. The method of mapping according to claim 1, wherein calculating the second area data corresponding to the plurality of primitives using the texture space coordinates includes:
performing differential processing on the texture space coordinates to obtain a third differential result and a fourth differential result corresponding to the plurality of fragments, wherein the differential directions of the third differential result and the fourth differential result are mutually orthogonal;
and carrying out mixed multiplication calculation on the numerical components of the third differential result and the fourth differential result to obtain the second area data.
4. A mapping method according to claim 3, wherein performing a mixed multiplication on the numerical components of the third differential result and the fourth differential result to obtain the second area data includes:
carrying out coordinate splitting on the third differential result to obtain a first component in a first direction and a second component in a second direction;
carrying out coordinate splitting on the fourth differential result to obtain a third component in the first direction and a fourth component in the second direction;
multiplying the first component by the fourth component to obtain a first calculation result, and multiplying the second component by the third component to obtain a second calculation result;
and subtracting the first calculation result and the second calculation result to obtain the second area data.
5. The method of mapping according to claim 1, wherein performing a mapping density check on the texture map based on the first area data and the second area data, obtaining the density check result includes:
determining density information of the texture map using the first area data, the second area data, and a map resolution of the texture map;
And performing mapping density inspection on the texture mapping based on the density information to obtain the density inspection result.
6. The method of mapping according to claim 5, wherein determining the density information of the texture map using the first area data, the second area data, and the mapping resolution comprises:
dividing the first area data and the second area data to obtain a third calculation result;
and multiplying the third calculation result and the mapping resolution to obtain the density information.
7. The method of claim 5, wherein performing a texture map density check on the texture map based on the density information, the density check result comprising:
and comparing the density information with a density inspection standard to obtain a density inspection result, wherein the density inspection standard is used for determining the expected display resolution corresponding to the virtual model.
8. The mapping method according to claim 1, characterized in that the mapping method further comprises:
and determining a partial map to be adjusted from the texture map based on the density check result, and generating a resolution adjustment suggestion corresponding to the partial map.
9. The mapping method of claim 8, wherein the mapping method further comprises:
determining a resolution adjustment strategy of the partial map based on the density check result;
and carrying out resolution adjustment processing on the texture map according to the resolution adjustment strategy.
10. The mapping method according to claim 1, characterized in that the mapping method further comprises:
mapping the density inspection result to a preset numerical value interval to obtain a mapping result, wherein at least one threshold value in the preset numerical value interval corresponds to at least one preset color parameter;
and generating an inspection result view corresponding to the texture map based on the mapping result and the at least one preset color parameter.
11. The method of claim 7, wherein a graphical user interface is provided by the terminal device, the graphical user interface displaying content at least partially including a map density check scene, the method further comprising:
responding to a first control operation executed on the graphical user interface, and determining a texture map to be checked and a virtual model corresponding to the texture map;
Acquiring the density inspection standard in response to a second control operation performed on the graphical user interface;
and responding to a third control operation executed on the graphical user interface, and displaying a check result view corresponding to the texture map in the graphical user interface.
12. A map processing apparatus, comprising:
the first calculation module is used for calculating and obtaining first area data corresponding to a plurality of fragments of the virtual model by utilizing world space coordinates of the virtual model, wherein the first area data comprises areas of the fragments in world space;
the determining module is used for determining texture space coordinates of the plurality of fragments by utilizing texture maps corresponding to the virtual model;
the second calculation module is used for calculating second area data corresponding to the plurality of fragments by utilizing the texture space coordinates, wherein the second area data comprises areas of the plurality of fragments in a texture space;
and the checking module is used for carrying out mapping density checking on the texture mapping based on the first area data and the second area data to obtain a density checking result, wherein the density checking result is used for assisting in carrying out resolution adjustment processing on the texture mapping.
13. A computer readable storage medium, characterized in that a computer program is stored in the computer readable storage medium, wherein the computer program is arranged to perform the mapping method as claimed in any one of claims 1 to 11 when being run by a processor.
14. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the mapping method as claimed in any of the claims 1 to 11.
CN202311336070.XA 2023-10-13 2023-10-13 Mapping processing method and device, storage medium and electronic device Pending CN117392305A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311336070.XA CN117392305A (en) 2023-10-13 2023-10-13 Mapping processing method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311336070.XA CN117392305A (en) 2023-10-13 2023-10-13 Mapping processing method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN117392305A true CN117392305A (en) 2024-01-12

Family

ID=89471420

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311336070.XA Pending CN117392305A (en) 2023-10-13 2023-10-13 Mapping processing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN117392305A (en)

Similar Documents

Publication Publication Date Title
Tewari et al. State of the art on neural rendering
CN110889890B (en) Image processing method and device, processor, electronic equipment and storage medium
CN109771951B (en) Game map generation method, device, storage medium and electronic equipment
WO2021228031A1 (en) Rendering method, apparatus and system
CN107886562A (en) Water surface rendering intent, device and readable storage medium storing program for executing
US9224233B2 (en) Blending 3D model textures by image projection
US20140267393A1 (en) Virtual scene generation based on imagery
CN107464286B (en) Method, device, equipment and readable medium for repairing holes in three-dimensional city model
JP7443647B2 (en) Keypoint detection and model training method, apparatus, device, storage medium, and computer program
CN111047509A (en) Image special effect processing method and device and terminal
CN116977522A (en) Rendering method and device of three-dimensional model, computer equipment and storage medium
CN111583378B (en) Virtual asset processing method and device, electronic equipment and storage medium
CN114842121A (en) Method, device, equipment and medium for generating mapping model training and mapping
CN114863002A (en) Virtual image generation method and device, terminal equipment and computer readable medium
CN113610958A (en) 3D image construction method and device based on style migration and terminal
Boom et al. Interactive light source position estimation for augmented reality with an RGB‐D camera
CN112489179A (en) Target model processing method and device, storage medium and computer equipment
US20230298243A1 (en) 3d digital avatar generation from a single or few portrait images
CN115965735B (en) Texture map generation method and device
CN109375866B (en) Screen touch click response method and system for realizing same
CN116385619A (en) Object model rendering method, device, computer equipment and storage medium
CN117392305A (en) Mapping processing method and device, storage medium and electronic device
CN115035231A (en) Shadow baking method, shadow baking device, electronic apparatus, and storage medium
KR20230013099A (en) Geometry-aware augmented reality effects using real-time depth maps
CN116012666B (en) Image generation, model training and information reconstruction methods and devices and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination