Model joint repairing method, device, equipment and medium
By constructing the ray emission area and screening candidate texel, the joint problem caused by discontinuity of light map positions in the three-dimensional grid model is solved, the seam search and repair efficiency is improved, and the rendering quality is improved.
Patent Information
- Application Number
- CN202310626315.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-30
- Publication Date
- 2024-12-06
AI Technical Summary
The existing technology has low search and repair efficiency due to discontinuous light map positions in the three-dimensional grid model, especially in open world scenarios.
By constructing a ray emission area perpendicular to the normal direction of the sampling texel, the candidate texel is determined, and the seam texel is screened according to the light difference and spatial relationship for repair, improving the efficiency of seam search and repair.
It realizes rapid search and repair of seam texture, improves the rendering efficiency of the model, reduces seam defects in lighting maps, and improves the rendering quality of three-dimensional virtual scenes.
Smart Images

Figure CN119091077A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to lighting rendering technology, and in particular to a model seam repair method, device, equipment and medium. Background Art
[0002] The baking system can pre-calculate the lighting received by virtual objects in a three-dimensional virtual scene, and the lighting data generated by the calculation is stored in a two-dimensional light map. In a scene with a fixed light source, using a light map instead of real-time lighting calculation can reduce resource consumption, thereby improving the efficiency of scene operation. For example, in the field of games, when rendering virtual object models in game scenes, light maps can be used instead of real-time lighting calculations, thereby improving model rendering efficiency. However, continuous texels in a three-dimensional mesh model may not necessarily correspond to continuous positions in the light map, and the lighting data corresponding to discontinuous texels in the light map vary greatly, resulting in a seam effect in the model obtained by lighting rendering based on the light map.
[0003] In traditional technology, the model vertices are traversed one by one to find texels that may cause seams in the model. The search efficiency of seam texels is low, especially for open large-world scenes. The problem of low efficiency in seam texel search is particularly prominent, resulting in low efficiency in seam repair for the model. Summary of the invention
[0004] Based on this, it is necessary to provide a model seam repair method, device, equipment and medium that can improve the efficiency of model seam repair in response to the above technical problems.
[0005] In a first aspect, the present application provides a model seam repair method, the method comprising:
[0006] For each sampled texel of the initial three-dimensional mesh model in the three-dimensional virtual scene, construct a ray emission area perpendicular to the normal direction of the sampled texel;
[0007] Taking a point in the ray emission area as a ray starting point, constructing at least one ray with the opposite direction of the normal direction of the sampled texel as the ray direction, and determining texels in the initial three-dimensional mesh model that intersect with each of the rays to obtain at least one candidate texel;
[0008] If there is a spatially adjacent texel of the sampled texel in the at least one candidate texel, the sampled texel is determined to be a first seam texel; the number of the spatially adjacent texel is at least one;
[0009] Determine, from at least one of the spatially adjacent texels, a second seam texel that is in a seam-adjacent relationship with the first seam texel;
[0010] The first seam texel and the second seam texel in the initial three-dimensional mesh model are repaired to obtain a target three-dimensional mesh model after seam repair.
[0011] In a second aspect, the present application provides a model seam repair device, the device comprising:
[0012] A construction module, for constructing, for each sampled texel of the initial three-dimensional mesh model in the three-dimensional virtual scene, a ray emission area perpendicular to the normal direction of the sampled texel;
[0013] A determination module, configured to construct at least one ray with a point in the ray emission area as a ray starting point and a direction opposite to the normal direction of the sampled texel as a ray direction, and determine texels in the initial three-dimensional mesh model intersecting with each ray to obtain at least one candidate texel;
[0014] A determination module, configured to determine that the sampled texel is a first seam texel if there is a spatially adjacent texel of the sampled texel in the at least one candidate texel; the number of the spatially adjacent texel is at least one;
[0015] The determining module is further configured to determine, from at least one of the spatially adjacent texels, a second seam texel that is in a seam-adjacent relationship with the first seam texel;
[0016] A repair module is used to repair the first seam texel and the second seam texel in the initial three-dimensional mesh model to obtain a target three-dimensional mesh model after seam repair.
[0017] In one embodiment, the construction module is also used to, for each texel in the initial three-dimensional mesh model, ignore the texel in the three-dimensional virtual scene if there is an occluding mesh patch within a preset range along the normal direction of the texel; the occluding mesh patch is a mesh patch in the initial three-dimensional mesh model other than the mesh patch where the texel is located; and use each texel in the initial three-dimensional mesh model that is not ignored as the sampling texel.
[0018] In one embodiment, the determination module is also used to determine the texels in the initial three-dimensional mesh model that intersect with each of the rays to obtain intersecting texels; for each of the intersecting texels, if the coordinates of the intersecting texel in the plane mesh model are discontinuous with the coordinates of the sampling texel in the plane mesh model, or the intersecting texel and the sampling texel are located in different initial three-dimensional mesh models, the intersecting texel is used as a candidate texel; wherein the plane mesh model is a mesh model that is two-dimensionally flattened with respect to the initial three-dimensional mesh model.
[0019] In one embodiment, the determination module is also used to determine, for each candidate texel, that the candidate texel is a spatially adjacent texel of the sampling texel if the first mesh patch corresponding to the candidate texel and the second mesh patch corresponding to the sampling texel are continuous in the three-dimensional virtual scene; wherein the first mesh patch is the mesh patch where the candidate texel is located in the initial three-dimensional mesh model; and the second mesh patch is the mesh patch where the sampling texel is located in the initial three-dimensional mesh model.
[0020] In one embodiment, the determination module is also used to filter out the spatially adjacent texels that meet the target conditions from at least one of the spatially adjacent texels based on at least one of the lighting differences between the lighting conditions of the spatially adjacent texels and the lighting conditions of the first seam texel, the plane difference between the mesh surface where the spatially adjacent texels are located and the mesh surface where the first seam texel is located, the spatial distance between the spatially adjacent texels and the first seam texel in the three-dimensional virtual scene, and the intersection area between the coverage area of the spatially adjacent texels in the initial three-dimensional mesh model and the coverage area of the first seam texel in the initial three-dimensional mesh model; and determine the second seam texel from the filtered spatially adjacent texels.
[0021] In one embodiment, the determination module is also used to determine, for each of the spatially adjacent texels, the normal angle between the mesh surfaces corresponding to the spatially adjacent texel and the first seam texel, after screening at least one of the spatially adjacent texels based on the lighting difference between the lighting conditions of the spatially adjacent texels and the lighting conditions of the first seam texel, to obtain a first angle corresponding to the spatially adjacent texel; the first angle is positively correlated with the lighting difference; and from at least one of the spatially adjacent texels, screen the spatially adjacent texels whose first angle is less than or equal to a preset angle.
[0022] In one embodiment, the determination module is also used to screen at least one of the spatially adjacent texels based on the plane difference between the mesh patch where the spatially adjacent texel is located and the mesh patch where the first seam texel is located, and to screen, from at least one of the spatially adjacent texels, a spatially adjacent texel that has a patch coplanar relationship with the first seam texel; wherein the mesh patch corresponding to the screened spatially adjacent texel and the mesh patch corresponding to the first seam texel are located in the same plane.
[0023] In one embodiment, the determination module is also used to select, from at least one of the spatially adjacent texels, the spatially adjacent texels whose spatial distance is less than or equal to a preset distance, when at least one of the spatially adjacent texels is selected based on the spatial distance between the spatially adjacent texel and the first seam texel in the three-dimensional virtual scene; wherein the preset distance is less than or equal to the texel radius of the first seam texel.
[0024] In one embodiment, the determination module is also used to determine, for each of the spatially adjacent texels, the angle between the texel vector and the reverse edge normal vector corresponding to the first seam texel, to obtain a second angle corresponding to the spatially adjacent texel, after screening at least one of the spatially adjacent texels based on the intersection area between the coverage area of the spatially adjacent texels in the initial three-dimensional mesh model and the coverage area of the first seam texel in the initial three-dimensional mesh model; the texel vector is a vector pointing from the first seam texel to the spatially adjacent texel; the reverse edge normal vector is in the opposite direction to the edge normal of the first seam texel; and the spatially adjacent texel with the smallest second angle is screened from at least one of the spatially adjacent texels; wherein the size of the second angle is negatively correlated with the size of the intersection area.
[0025] In one embodiment, the initial three-dimensional mesh model has a corresponding initial light map; the repair module is further used to determine, from the initial light map, texels mapped to each of the first seam texels and the second seam texels as seam texels to be repaired; for each seam texel to be repaired, according to the seam texel to be repaired and the seam texels in the initial light map that have the seam adjacent relationship with the seam texel to be repaired, determine the denoising reference area corresponding to the seam texel to be repaired in the initial light map; according to the denoising reference area The angle between the edge normal of each reference texel in the domain and the edge normal of the seam texel to be repaired is used to determine the lighting contribution parameter corresponding to the reference texel; according to the lighting contribution parameter corresponding to each of the reference texels and the lighting data recorded for each of the reference texels in the initial light map, the lighting data recorded for the seam texel to be repaired in the initial light map is subjected to denoising and repair processing to obtain a target light map; the initial three-dimensional mesh model is subjected to lighting rendering according to the target light map to obtain a target three-dimensional mesh model after the seam repair is performed on the initial three-dimensional mesh model.
[0026] In one embodiment, the repair module is also used to determine a first sampling range of a filter kernel used for denoising repair processing along the direction of the edge normal of the seam texel to be repaired; determine a second sampling range of the filter kernel along the direction of the edge normal of an adjacent seam texel; the adjacent seam texel is a seam texel that has a seam adjacent relationship with the seam texel to be repaired; and determine the denoising reference area corresponding to the seam texel to be repaired in the initial light map based on the first sampling range and the second sampling range.
[0027] In one embodiment, the repair module is further used to perform denoising and repair processing on the illumination data recorded for the seam texels to be repaired in the initial light map according to the illumination contribution parameters corresponding to each of the reference texels and the illumination data recorded for each of the reference texels in the initial light map to obtain the denoised illumination data corresponding to the seam texels to be repaired; mix the denoised illumination data corresponding to the seam texels to be repaired with the illumination data before denoising to obtain the mixed illumination data corresponding to the seam texels to be repaired; and write the mixed illumination data corresponding to each of the seam texels to be repaired back to the initial light map to obtain the target light map.
[0028] In one embodiment, the repair module is also used to write the mixed lighting data corresponding to each of the seam texels to be repaired back to the initial light map to obtain a mixed light map; determine the secondary texels adjacent to the seam texels to be repaired from the mixed light map along the direction of the edge normal of the seam texels to be repaired; mix the lighting data recorded by the secondary texels in the mixed light map with the lighting data recorded by the adjacent seam texels in the mixed light map to obtain a target light map; the adjacent seam texels are seam texels that have the seam adjacent relationship with the seam texels to be repaired.
[0029] In one embodiment, the repair module is further used to perform denoising and repair processing on the lighting data recorded for the seam texels to be repaired in the initial light map according to the lighting contribution parameters corresponding to each of the reference texels and the lighting data recorded for each of the reference texels in the initial light map to obtain a denoised light map; for each of the seam texels to be repaired, determine from the denoised light map the unmapped texels that are adjacent to the seam texels to be repaired and have no lighting data recorded therein; fill the lighting data recorded in the denoised light map for the adjacent seam texels into the unmapped texels to obtain a target light map; the adjacent seam texels are seam texels that have the seam adjacent relationship with the seam texels to be repaired.
[0030] In one embodiment, the repair module is also used to determine, for each reference texel in the denoising reference area, a first normal influence parameter according to the angle between the edge normal of the reference texel and the edge normal of the seam texel to be repaired; and determine the lighting contribution parameter corresponding to the reference texel according to at least one of the first normal influence parameter, the second normal influence parameter, the distance influence parameter and the brightness influence parameter; wherein the second normal influence parameter is used to characterize the degree of influence of the normal of the seam texel to be repaired in the three-dimensional virtual scene and the normal of the reference texel in the three-dimensional virtual scene on the lighting contribution; the distance influence parameter is used to characterize the degree of influence of the distance between the seam texel to be repaired and the reference texel in the three-dimensional virtual scene on the lighting contribution; and the brightness influence parameter is used to characterize the degree of influence of the brightness of the seam texel to be repaired and the brightness of the reference texel on the lighting contribution.
[0031] In a third aspect, the present application provides a computer device including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in the method embodiments of the present application are implemented.
[0032] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the method embodiments of the present application.
[0033] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps in the method embodiments of the present application when the computer program is executed by a processor.
[0034] The above-mentioned model seam repair method, device, equipment, medium and computer program product, for each sampled texel of the initial three-dimensional mesh model in the three-dimensional virtual scene, constructs a ray emission area perpendicular to the normal direction of the sampled texel, takes a point in the ray emission area as the ray starting point, and constructs at least one ray with the opposite direction of the normal direction of the sampled texel as the ray direction, and determines the texels intersecting with each ray in the initial three-dimensional mesh model to obtain at least one candidate texel. If there is a spatially adjacent texel of the sampled texel in at least one candidate texel, the sampled texel can be quickly determined to be the first seam texel, and the number of spatially adjacent texels is at least one. From the at least one spatially adjacent texel, the second seam texel that has a seam adjacent relationship with the first seam texel can be quickly determined. Then, by quickly repairing the first seam texel and the second seam texel in the initial three-dimensional mesh model, the target three-dimensional mesh model after seam repair is obtained. Compared with the traditional method of searching for seam texels by traversing the model vertices one by one, the seam search method of the present application does not need to traverse the model vertices to search for seam texels, but rather constructs a ray emission area, and generates rays through the ray emission area to intersect with the initial three-dimensional mesh model to realize the search for seam texels, thereby improving the efficiency of searching for seam texels of the model. Furthermore, by repairing the first seam texel and the second seam texel that are quickly found, the efficiency of seam repair of the model can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A diagram showing an application environment of a model joint repairing method in an embodiment;
[0036] Figure 2 A schematic diagram of a flow chart of a model seam repair method in one embodiment;
[0037] Figure 3 A schematic diagram of constructing a ray emission area in one embodiment;
[0038] Figure 4 Schematic diagram of a search process for a first seam texel and a second seam texel in one embodiment;
[0039] Figure 5 A schematic diagram of a process for determining a denoising reference area corresponding to a seam texel to be repaired in one embodiment;
[0040] Figure 6 A schematic diagram of a process for determining a denoising reference area corresponding to a seam texel to be repaired in another embodiment;
[0041] Figure 7 A schematic diagram of a parameter configuration interface for model seam repair in one embodiment;
[0042] Figure 8A schematic diagram showing a comparison before and after seam repair of a single model in one embodiment;
[0043] Fig. 9 A schematic diagram showing the comparison before and after seam repair of multiple models in one embodiment;
[0044] Fig.10 A schematic diagram of a flow chart of a model seam repairing method in another embodiment;
[0045] Fig.11 is a structural block diagram of a model joint repairing device in one embodiment;
[0046] Fig.12 is an internal structure diagram of a computer device in one embodiment;
[0047] Fig.13 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0049] The model joint repair method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can be set up separately and can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. Among them, the terminal 102 can be, but is not limited to, various desktop computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, cloud security, host security and other network security services, CDN, and basic cloud computing services such as big data and artificial intelligence platforms. The terminal 102 and the server 104 can be directly or indirectly connected by wired or wireless communication, and this application is not limited here.
[0050] For each sampled texel of the initial three-dimensional mesh model in the three-dimensional virtual scene, the server 104 may construct a ray emission area perpendicular to the normal direction of the sampled texel, take a point in the ray emission area as the ray starting point, and construct at least one ray with the opposite direction of the normal direction of the sampled texel as the ray direction, and determine the texels in the initial three-dimensional mesh model that intersect with each ray to obtain at least one candidate texel. If there is a spatially adjacent texel of the sampled texel in at least one candidate texel, the server 104 may determine that the sampled texel is a first seam texel; there is at least one spatially adjacent texel, and from the at least one spatially adjacent texel, determine a second seam texel that has a seam adjacent relationship with the first seam texel. The server 104 may repair the first seam texel and the second seam texel in the initial three-dimensional mesh model to obtain a target three-dimensional mesh model after seam repair.
[0051] It is understood that the server 104 can send the target three-dimensional mesh model after the seam repair to the terminal 102 for display. This embodiment does not limit this. It is understood that Figure 1 The application scenarios are only for illustration and are not limited to this.
[0052] In one embodiment, Figure 2 As shown, a model seam repair method is provided, which can be applied to a computer device, which can be a terminal or a server, and can be executed by the terminal or the server itself alone, or can be implemented through interaction between the terminal and the server. This embodiment takes the method applied to a computer device as an example for explanation, and includes the following steps:
[0053] Step 202: for each sampled texel of the initial three-dimensional mesh model in the three-dimensional virtual scene, construct a ray emission area perpendicular to the normal direction of the sampled texel.
[0054] Among them, the three-dimensional virtual scene is a virtual scene located in a three-dimensional space. For example, the three-dimensional virtual scene may include at least one of a game scene, a film and television special effects scene, a visual design scene, a VR (Virtual Reality) scene, an industrial simulation scene, or a digital cultural and creative scene. The three-dimensional mesh model is a mesh model located in a three-dimensional virtual scene. It can be understood that the mesh model is a virtual model composed of at least one mesh facet. The mesh facet is a facet with a mesh shape. It can be understood that the mesh facet can be a facet with a polygonal shape. For example, the mesh facet can be a triangular mesh facet or a quadrilateral mesh facet, which is not limited in this embodiment. The initial three-dimensional mesh model is a three-dimensional mesh model before seam repair is performed. It can be understood that the initial three-dimensional mesh model is a three-dimensional mesh model to be repaired. There may be seams on the initial three-dimensional mesh model, and the rendering quality of the model is low. The sampled texel is a texel sampled from the initial three-dimensional mesh model. The normal direction of the sampled texel refers to the direction of the normal vector of the sampled texel. The ray emission area is an area in a three-dimensional virtual scene used to emit rays. It can be understood that the ray emission area is an area constructed by moving a preset distance along the direction of the normal vector of the sampled texel, and the plane where the ray emission area is located is perpendicular to the direction of the normal vector of the sampled texel.
[0055] Specifically, the three-dimensional virtual scene includes at least one initial three-dimensional mesh model, the initial three-dimensional mesh model includes at least one mesh face, and each mesh face includes a plurality of texels. The computer device may sample the texels in the initial three-dimensional mesh model to obtain sampled texels. For each sampled texel, the computer device may move a preset distance along the direction of the normal vector of the sampled texel, and construct a ray emission area perpendicular to the normal direction of the sampled texel at a position at a preset distance from the sampled texel.
[0056] In one embodiment, the initial three-dimensional mesh model includes at least one mesh patch consisting of multiple edges, and each mesh patch includes multiple texels. The computer device can sample the texels on each edge of the mesh patch of the initial three-dimensional mesh model to obtain the sampled texels. Since the process of obtaining the plane mesh model by two-dimensional flattening the initial three-dimensional mesh model is based on the mesh vertices in the mesh patch, the texels that are continuous in the three-dimensional virtual scene but discontinuous in the light map corresponding to the initial three-dimensional mesh model are all located on the edge of the mesh patch. It can be understood that each texel in the plane mesh model can obtain a light map by recording the illumination data generated by the illumination calculation. By sampling the texels on each edge of the mesh patch of the initial three-dimensional mesh model to obtain the sampled texels, and performing subsequent seam texel search based on the sampled texels, the search accuracy of the seam texels can be further improved.
[0057] In one embodiment, the computer device may randomly sample each texel in the initial three-dimensional mesh model to obtain sampled texels.
[0058] In one embodiment, for each sampled texel, the computer device may use the texel radius of the sampled texel as the preset distance, use the texel radius of the sampled texel as the moving distance, and move along the direction of the normal vector of the sampled texel. When the moving distance reaches the distance corresponding to the texel radius of the sampled texel, the computer device stops moving, and the computer device may use the sampled texel as the center point at the position where the movement stops, and diffuse to the surroundings in the section space corresponding to the sampled texel to construct a ray emission area perpendicular to the normal direction of the sampled texel.
[0059] In one embodiment, for each sampled texel, the computer device may, at the position where the movement is stopped, diffuse around in the cross-section space corresponding to the sampled texel with the sampled texel as the center point and the texel radius of the sampled texel as the offset to construct a ray emission area perpendicular to the normal direction of the sampled texel.
[0060] In one embodiment, Figure 3 As shown, the three-dimensional virtual scene includes at least one initial three-dimensional mesh model 301, and the initial three-dimensional mesh model 301 includes at least one mesh patch 302. In this embodiment, the mesh patch 302 is a triangular mesh patch. For each sampled texel A in the initial three-dimensional mesh model 301, the computer device can move a preset distance along the direction of the normal vector of the sampled texel A, and construct a ray emission area 303 perpendicular to the normal direction of the sampled texel A at a position at a preset distance from the sampled texel A.
[0061] Step 204, taking a point in the ray emission area as the ray starting point, constructing at least one ray with the opposite direction of the normal direction of the sampled texel as the ray direction, and determining the texels in the initial three-dimensional mesh model that intersect with each ray to obtain at least one candidate texel.
[0062] Specifically, the ray emission area includes multiple points, and the computer device can use a point in the ray emission area that meets the target condition as the ray starting point, and construct at least one ray with the opposite direction of the normal direction of the sampled texel as the ray direction. Furthermore, the computer device can determine at least one texel in the initial three-dimensional mesh model that intersects with each ray, and obtain at least one candidate texel.
[0063] In one embodiment, the computer device may determine the texels intersecting with each ray in the initial three-dimensional mesh model, obtain intersecting texels, and directly use the obtained intersecting texels as candidate texels. The intersecting texels are texels intersecting with each ray in the initial three-dimensional mesh model.
[0064] In one embodiment, the computer device may select at least one candidate texel from each intersecting texel. For example, the computer device may randomly select at least one candidate texel from each intersecting texel.
[0065] In one embodiment, continue to refer to Figure 3 , the computer device can use a point in the ray emission area 303 that meets the target condition as the ray starting point, and construct at least one ray with the opposite direction of the normal direction of the sampled texel A as the ray direction. Furthermore, the computer device can determine at least one texel in the initial three-dimensional mesh model 301 that intersects with each ray, and obtain at least one candidate texel.
[0066] Step 206: If there is a spatially adjacent texel of the sampled texel in at least one candidate texel, the sampled texel is determined to be a first seam texel; the number of the spatially adjacent texel is at least one.
[0067] Among them, the spatially adjacent texels of the sampled texel refer to the texels that are adjacent to the sampled texel in the three-dimensional virtual scene. It can be understood that the three-dimensional virtual scene is located in the three-dimensional world space. Therefore, the texels that are adjacent to the sampled texel in the three-dimensional virtual scene are also the texels that are adjacent to the sampled texel in the world space. The seam texel is the texel that causes the initial three-dimensional mesh model to have a seam effect. In the case where there is at least one spatially adjacent texel to the sampled texel, the sampled texel can be determined as a seam texel to obtain a first seam texel. It can be understood that in the case where there is at least one spatially adjacent texel to the sampled texel, the sampled texel can be directly determined as the first seam texel.
[0068] Specifically, for each candidate texel, the computer device may determine whether the candidate texel is adjacent to the sampled texel in the three-dimensional virtual scene, thereby determining whether the candidate texel is a spatially adjacent texel of the sampled texel. If there is at least one spatially adjacent texel of the sampled texel in each candidate texel, the computer device may determine that the sampled texel is a first seam texel.
[0069] In one embodiment, for each candidate texel, the computer device may determine the distance between the candidate texel and the sampling texel in the three-dimensional virtual scene to obtain the spatial distance corresponding to the candidate texel. If there is a candidate texel whose spatial distance is less than the preset spatial distance, it means that there is a spatially adjacent texel of the sampling texel in each candidate texel, and the computer device may determine that the sampling texel is the first seam texel. It can be understood that the computer device may use the candidate texels whose spatial distance is less than the preset spatial distance as the spatially adjacent texels of the sampling texel.
[0070] Step 208: Determine, from at least one spatially adjacent texel, a second seam texel that is in a seam-adjacent relationship with the first seam texel.
[0071] The second seam texel is a spatially adjacent texel that has a seam adjacent relationship with the first seam texel. The first seam texel and the second seam texel have a seam adjacent relationship. It can be understood that the first seam texel and the second seam texel can form a texel pair, and the texel pair will cause a seam effect to appear in the initial three-dimensional mesh model. It can be understood that the first seam texel and the second seam texel in the texel pair are respectively located on both sides of the seam of the initial three-dimensional mesh model.
[0072] In one embodiment, the computer device may randomly select a spatially adjacent texel from at least one spatially adjacent texel as a second seam texel that has a seam-adjacent relationship with the first seam texel.
[0073] Step 210 , repairing the first seam texel and the second seam texel in the initial three-dimensional mesh model to obtain a target three-dimensional mesh model after seam repair.
[0074] The target 3D mesh model is a 3D mesh model obtained after performing seam repair on the initial 3D mesh model. It can be understood that there is a seam effect on the initial 3D mesh model, and the rendering quality of the model is low. After performing seam repair on the initial 3D mesh model, a target 3D mesh model without seam effect can be obtained, thereby improving the rendering quality of the model.
[0075] Specifically, the computer device may obtain illumination data recorded for the first seam texel in the initial three-dimensional mesh model, and obtain illumination data recorded for the second seam texel in the initial three-dimensional mesh model. It can be understood that the difference between the illumination data recorded for the first seam texel and the illumination data recorded for the second seam texel is large, resulting in a seam effect in the initial three-dimensional mesh model. Therefore, the computer device may perform noise reduction on the illumination data recorded for the first seam texel and the illumination data recorded for the second seam texel to reduce the difference between the illumination data recorded for the first seam texel and the illumination data recorded for the second seam texel, thereby repairing the first seam texel and the second seam texel, and obtaining the target three-dimensional mesh model after seam repair.
[0076] In one embodiment, the computer device may determine the texels adjacent to the first seam texel in the initial three-dimensional mesh model, and determine the texels adjacent to the second seam texel in the initial three-dimensional mesh model. The computer device may obtain the illumination data recorded for the texels adjacent to the first seam texel, and obtain the illumination data recorded for the texels adjacent to the second seam texel. Furthermore, the computer device may refer to the illumination data recorded for the texels adjacent to the first seam texel to reduce the noise of the illumination data recorded for the first seam texel, and refer to the illumination data recorded for the texels adjacent to the second seam texel to reduce the noise of the illumination data recorded for the second seam texel, thereby repairing the first seam texel and the second seam texel, and obtaining the target three-dimensional mesh model after the seam repair.
[0077] In the above-mentioned model seam repair method, for each sampled texel of the initial three-dimensional mesh model in the three-dimensional virtual scene, a ray emission area perpendicular to the normal direction of the sampled texel is constructed, a point in the ray emission area is used as the ray starting point, and at least one ray is constructed with the opposite direction of the normal direction of the sampled texel as the ray direction, and the texels intersecting with each ray in the initial three-dimensional mesh model are determined to obtain at least one candidate texel. If there is a spatially adjacent texel of the sampled texel in at least one candidate texel, the sampled texel can be quickly determined to be the first seam texel, and there is at least one spatially adjacent texel. From the at least one spatially adjacent texel, the second seam texel that has a seam adjacent relationship with the first seam texel can be quickly determined. Then, by quickly repairing the first seam texel and the second seam texel in the initial three-dimensional mesh model, the target three-dimensional mesh model after seam repair is obtained. Compared with the traditional method of searching for seam texels by traversing the model vertices one by one, the seam search method of the present application does not need to traverse the model vertices to search for seam texels, but rather constructs a ray emission area, and generates rays through the ray emission area to intersect with the initial three-dimensional mesh model to realize the search for seam texels, thereby improving the efficiency of searching for seam texels of the model. Furthermore, by repairing the first seam texel and the second seam texel that are quickly found, the efficiency of seam repair of the model can be improved.
[0078] In one embodiment, the method also includes: for each texel in the initial three-dimensional mesh model, in the three-dimensional virtual scene, if there is an occluding mesh patch within a preset range along the normal direction of the texel, the texel is ignored; the occluding mesh patch is a mesh patch in the initial three-dimensional mesh model other than the mesh patch where the texel is located; and each texel that is not ignored in the initial three-dimensional mesh model is used as a sampling texel.
[0079] Texel is the abbreviation of texture element, which is the basic unit in the texture space of computer graphics. It can be understood that texture is represented by the arrangement of texels. For each texel in the initial three-dimensional mesh model, the occlusion mesh patch corresponding to the texel refers to the mesh patch in the initial three-dimensional mesh model that blocks the illumination of the texel except the mesh patch where the texel is located.
[0080] Specifically, for each texel in the initial three-dimensional mesh model, in the three-dimensional virtual scene, if there is an occluded mesh surface within a preset range along the normal direction of the texel, it means that the illumination of the texel may be blocked by the occluded mesh surface, and the illumination data corresponding to the occluded texel is also quite different from the illumination data corresponding to its adjacent texels. At this time, the computer device can ignore the occluded texel. And use each texel that is not ignored in the initial three-dimensional mesh model as a sampling texel. It can be understood that the computer device ignores the occluded texels, which means that the computer device will automatically skip these occluded texels when sampling the texels in the initial three-dimensional mesh model, that is, the computer device will not sample the occluded texels.
[0081] In one embodiment, the above-mentioned preset range is determined by the texel radius of the texel. For example, the preset range is the range corresponding to the texel radius of the texel. For each texel in the initial three-dimensional mesh model, in the three-dimensional virtual scene, if there is an occluding mesh surface within a texel radius of the texel along the normal direction of the texel, the texel is ignored. In this way, since the length of the texel radius of the texel can represent the size of the area covered by the texel in the initial three-dimensional mesh model, the accuracy of searching for seam texels can be further improved by ignoring texels that have occluding mesh surfaces within a texel radius.
[0082] In the above embodiment, for each texel in the initial three-dimensional mesh model, it is determined whether there are any occluding mesh patches around the mesh patch where the texel is located. If there are any occluding mesh patches, it means that the texel is occluded by the surrounding occluding mesh patches. Since the illumination data corresponding to the occluded texel is also quite different from the illumination data corresponding to its adjacent texels, the accuracy of searching for the seam texels can be improved by using the unoccluded texels in the initial three-dimensional mesh model as sampling texels for subsequent seam texel searching.
[0083] In one embodiment, texels intersecting with each ray in the initial three-dimensional mesh model are determined to obtain at least one candidate texel, including: determining texels intersecting with each ray in the initial three-dimensional mesh model to obtain intersecting texels; for each intersecting texel, if the coordinates of the intersecting texel in the plane mesh model are discontinuous with the coordinates of the sampling texel in the plane mesh model, or the intersecting texel and the sampling texel are located in different initial three-dimensional mesh models, then the intersecting texel is used as a candidate texel; wherein the plane mesh model is a mesh model that is two-dimensionally flattened with respect to the initial three-dimensional mesh model.
[0084] The intersecting texels are texels that intersect with each ray in the initial three-dimensional mesh model. The plane mesh model is a mesh model that is two-dimensionally flattened for the initial three-dimensional mesh model. It can be understood that the plane mesh model is a mesh model located in a two-dimensional space.
[0085] Specifically, the computer device may use the texels intersecting with each ray in the initial three-dimensional mesh model as intersecting texels. It can be understood that the number of intersecting texels is at least one. The computer device may unfold the initial three-dimensional mesh model in a two-dimensional space to obtain a plane mesh model after two-dimensional flattening of the initial three-dimensional mesh model. It can be understood that each texel in the initial three-dimensional mesh model has a mapping relationship with each texel in the plane mesh model. For each intersecting texel, the computer device may obtain the coordinates of the intersecting texel in the plane mesh model, and obtain the coordinates of the sampling texel in the plane mesh model. The number of initial three-dimensional mesh models in the initial three-dimensional mesh model is at least one. If the coordinates of the intersecting texel in the plane mesh model are discontinuous with the coordinates of the sampling texel in the plane mesh model, or the intersecting texel and the sampling texel are in different initial three-dimensional mesh models, it can be explained that the intersecting texel is a potential seam texel, that is, the intersecting texel may be the texel that causes the seam in the model, and the computer device may use the intersecting texel as a candidate texel.
[0086] In the above embodiment, for each intersecting texel, if the coordinates of the intersecting texel in the plane grid model are discontinuous with the coordinates of the sampling texel in the plane grid model, or the intersecting texel and the sampling texel are in different initial three-dimensional grid models, it can be explained that the intersecting texel is a potential seam texel, that is, the intersecting texel may be the texel that causes the seam in the model. By taking the potential seam texels preliminarily screened out as candidate texels, and then further screening out the real seam texels from the candidate texels preliminarily screened out, the search efficiency of the seam texels can be further improved.
[0087] In one embodiment, the method also includes: for each candidate texel, if the first mesh patch corresponding to the candidate texel and the second mesh patch corresponding to the sampling texel are continuous in the three-dimensional virtual scene, then the candidate texel is determined to be a spatially adjacent texel of the sampling texel; wherein the first mesh patch is the mesh patch where the candidate texel is located in the initial three-dimensional mesh model; the second mesh patch is the mesh patch where the sampling texel is located in the initial three-dimensional mesh model.
[0088] Specifically, for each candidate texel, the computer device may determine whether a first grid surface where the candidate texel is located is continuous with a second grid surface where the sampling texel is located in the three-dimensional virtual scene. If the first grid surface corresponding to the candidate texel is continuous with the second grid surface corresponding to the sampling texel in the three-dimensional virtual scene, the computer device may determine that the candidate texel is a spatially adjacent texel of the sampling texel.
[0089] In one embodiment, the computer device may determine new candidate texels by iteratively reducing the ray emission area, and then determine spatially adjacent texels of the sampled texel from the new candidate texels.
[0090] In one embodiment, the computer device may decrease the offset used when constructing the ray emission area at a rate of half the texel radius of the sampled texel to determine the spatially adjacent texels of the sampled texel. Specifically, for each sampled texel, the computer device may use the sampled texel as the center point, half of the offset corresponding to the previous round as the offset of this round, and diffuse the offset corresponding to this round to the surrounding in the section space corresponding to the sampled texel to construct a ray emission area perpendicular to the normal direction of the sampled texel and corresponding to this round. It can be understood that the area of the ray emission area corresponding to this round is smaller than the area of the ray emission area corresponding to the previous round. When there are texels that intersect with the sampled texel itself among the candidate texels obtained based on the ray emission area newly constructed in this round, the candidate texels obtained based on the ray emission area newly constructed in the previous round are used as the spatially adjacent texels of the sampled texel.
[0091] In one embodiment, the mesh patch includes multiple mesh vertices. If there is at least one identical mesh vertex in the first mesh patch where the candidate texel is located and the second mesh patch where the sampling texel is located, the computer device can determine whether the first mesh patch and the second mesh patch are continuous in the three-dimensional virtual scene.
[0092] In the above embodiment, for each candidate texel, since two consecutive texels in the three-dimensional virtual scene must have their respective grid surfaces continuous in the three-dimensional virtual scene, it is determined whether the first grid surface corresponding to the candidate texel and the second grid surface corresponding to the sampling texel are continuous in the three-dimensional virtual scene, and thus whether the candidate texel is a spatially adjacent texel of the sampling texel based on the judgment result, thereby improving the judgment accuracy of spatially adjacent texels.
[0093] In one embodiment, determining a second seam texel that has a seam-adjacent relationship with a first seam texel from at least one spatially adjacent texel includes: screening out spatially adjacent texels that meet target conditions from at least one spatially adjacent texel based on at least one of the following: an illumination difference between the illumination condition of the spatially adjacent texel and the illumination condition of the first seam texel, a planar difference between a mesh patch where the spatially adjacent texel is located and a mesh patch where the first seam texel is located, a spatial distance between the spatially adjacent texel and the first seam texel in a three-dimensional virtual scene, and an intersection area between a coverage area of the spatially adjacent texel in an initial three-dimensional mesh model and a coverage area of the first seam texel in the initial three-dimensional mesh model; and determining a second seam texel from the screened spatially adjacent texels.
[0094] Specifically, the computer device may screen out spatially adjacent texels that meet the target condition from at least one of the following: the size of the illumination difference between the illumination conditions of each spatially adjacent texel and the illumination conditions of the first seam texel; the plane difference between the mesh patch where the spatially adjacent texel is located and the mesh patch where the first seam texel is located, that is, whether the mesh patch where the spatially adjacent texel is located and the mesh patch where the first seam texel is located are located in the same plane; the spatial distance between the position of the spatially adjacent texel in the three-dimensional virtual scene and the position of the first seam texel in the three-dimensional virtual scene; and the intersection area between the coverage area of the spatially adjacent texel in the initial three-dimensional grid model and the coverage area of the first seam texel in the initial three-dimensional grid model. Then, the computer device may determine the second seam texel from the screened spatially adjacent texels.
[0095] In one embodiment, first, the computer device may select spatially adjacent texels that meet the target condition from at least one spatially adjacent texel according to the illumination difference between the illumination conditions of each spatially adjacent texel and the illumination condition of the first seam texel. Furthermore, the computer device may select spatially adjacent texels that meet the target condition from the spatially adjacent texels selected based on the illumination difference according to the plane difference between the mesh surface patch where the spatially adjacent texel is located and the mesh surface patch where the first seam texel is located. Further, the computer device may select spatially adjacent texels that meet the target condition from the spatially adjacent texels selected based on the plane difference according to the spatial distance between the spatially adjacent texel and the first seam texel in the three-dimensional virtual scene. Finally, the computer device may select a spatially adjacent texel from the spatially adjacent texels selected based on the spatial distance as the second seam texel according to the intersection area of the coverage area of the spatially adjacent texel in the initial three-dimensional mesh model and the coverage area of the first seam texel in the initial three-dimensional mesh model.
[0096] In the above embodiment, by screening out spatially adjacent texels that meet the target condition from at least one spatially adjacent texel through at least one screening method selected from illumination difference, plane difference, spatial distance, and intersection area, the screening accuracy of some spatially adjacent texels can be improved. Furthermore, by determining the second seam texel from the screened relatively accurate spatially adjacent texels, the screening accuracy of the second seam texel can be improved.
[0097] In one embodiment, spatially adjacent texels that meet target conditions are screened out from at least one spatially adjacent texel, including: while screening at least one spatially adjacent texel based on the illumination difference between the illumination conditions of the spatially adjacent texel and the illumination conditions of the first seam texel, for each spatially adjacent texel, determining the normal angle between the mesh surfaces corresponding to the spatially adjacent texel and the first seam texel to obtain a first angle corresponding to the spatially adjacent texel; the first angle is positively correlated with the illumination difference; and screening, from at least one spatially adjacent texel, spatially adjacent texels whose first angle is less than or equal to a preset angle.
[0098] Among them, the normal angle refers to the angle between the normal of the mesh patch corresponding to the spatially adjacent texel and the normal of the mesh patch corresponding to the first seam texel. The first angle is the normal angle between the mesh patches corresponding to the spatially adjacent texel and the first seam texel. The first angle is positively correlated with the illumination difference. It can be understood that the larger the first angle, the greater the illumination difference between the illumination conditions of the spatially adjacent texels and the illumination conditions of the first seam texel. The smaller the first angle, the smaller the illumination difference between the illumination conditions of the spatially adjacent texels and the illumination conditions of the first seam texel.
[0099] In one embodiment, when at least one spatially adjacent texel is screened according to the illumination difference between the illumination conditions of the spatially adjacent texels and the illumination conditions of the first seam texel, for each spatially adjacent texel, the computer device may determine the normal angle between the normal of the mesh surface corresponding to the spatially adjacent texel and the normal of the mesh surface corresponding to the first seam texel, and use the normal angle as the first angle corresponding to the spatially adjacent texel. It can be understood that the first angle is positively correlated with the illumination difference. Then, the computer device may screen the spatially adjacent texels whose first angle is less than or equal to the preset angle from at least one spatially adjacent texel. It can be understood that the computer device may screen the spatially adjacent texels whose illumination difference is smaller from at least one spatially adjacent texel.
[0100] In the above embodiment, when spatially adjacent texels that meet the target conditions are screened out based on the illumination difference, since the first angle is positively correlated with the illumination difference, the spatially adjacent texels whose first angle is less than or equal to the preset angle are screened out through the first angle between the corresponding normals of the mesh facets. This can screen out spatially adjacent texels whose illumination differences are smaller, thereby improving the search accuracy of the second seam texels.
[0101] In one embodiment, spatially adjacent texels that meet target conditions are screened out from at least one spatially adjacent texel, including: while screening at least one spatially adjacent texel based on the plane difference between a mesh patch where the spatially adjacent texel is located and a mesh patch where a first seam texel is located, screening out, from at least one spatially adjacent texel, a spatially adjacent texel that has a patch coplanar relationship with the first seam texel; wherein the mesh patch corresponding to the screened spatially adjacent texel and the mesh patch corresponding to the first seam texel are located in the same plane.
[0102] Among them, the facet coplanar relationship means that the mesh facets where the two seam texels are located are located in the same plane. It can be understood that by selecting the spatially adjacent texels that have a facet coplanar relationship with the first seam texel from at least one spatially adjacent texel, the spatially adjacent texels that do not have a superposition relationship can be selected. For example, it can avoid the situation where decorative items such as belts are suspended above the surface of clothes and are mistaken for seams.
[0103] Specifically, when at least one spatially adjacent texel is screened based on the plane difference between the mesh patch where the spatially adjacent texel is located and the mesh patch where the first seam texel is located, the computer device can determine whether each spatially adjacent texel has a patch coplanar relationship with the first seam texel, that is, determine whether the mesh patch where the spatially adjacent texel is located and the mesh patch where the first seam texel is located are located in the same plane. Then, the computer device can screen the spatially adjacent texel that has a patch coplanar relationship with the first seam texel from at least one spatially adjacent texel. It can be understood that the mesh patch corresponding to the spatially adjacent texel screened based on the plane difference and the mesh patch corresponding to the first seam texel are located in the same plane.
[0104] In one embodiment, for each spatially adjacent texel, the computer device may project the vector between the spatially adjacent texel and the first seam texel onto the normal of the mesh patch corresponding to the first seam texel to obtain the projected line segment corresponding to the spatially adjacent texel. Furthermore, the computer device may determine the spatially adjacent texel corresponding to the projected line segment whose length is less than or equal to the preset length as the spatially adjacent texel that has a patch coplanar relationship with the first seam texel.
[0105] In the above embodiment, when the spatially adjacent texels meeting the target condition are screened out according to the plane difference, the spatially adjacent texels that are in a patch coplanar relationship with the first seam texel must not have an overlapping relationship with the first seam texel. Therefore, by screening the spatially adjacent texels that are in a patch coplanar relationship with the first seam texel from at least one spatially adjacent texel, the spatially adjacent texels that are not in an overlapping relationship can be screened out, thereby improving the search accuracy of the second seam texel.
[0106] In one embodiment, spatially adjacent texels that meet target conditions are screened out from at least one spatially adjacent texel, including: while screening at least one spatially adjacent texel based on the spatial distance between the spatially adjacent texel and the first seam texel in the three-dimensional virtual scene, spatially adjacent texels whose spatial distance is less than or equal to a preset distance are screened out from at least one spatially adjacent texel; wherein the preset distance is less than or equal to the texel radius of the first seam texel.
[0107] Specifically, when at least one spatially adjacent texel is screened according to the spatial distance between the spatially adjacent texel and the first seam texel in the three-dimensional virtual scene, the computer device may determine the spatial distance between the position of each spatially adjacent texel in the three-dimensional virtual scene and the position of the first seam texel in the three-dimensional virtual scene. Then, the computer device may screen the spatially adjacent texels whose spatial distance is less than or equal to the preset distance from the at least one spatially adjacent texel.
[0108] In the above embodiment, when spatially adjacent texels that meet the target condition are screened out according to the spatial distance, since the spatial distance between the two texels is too large, it means that the area covered by the two texels is not continuous in the three-dimensional virtual space. Therefore, by screening spatially adjacent texels whose spatial distance is less than or equal to the preset distance from at least one spatially adjacent texel, the spatially adjacent texels whose coverage area in the three-dimensional virtual space is continuous with the coverage area of the first seam texel can be screened out, thereby improving the search accuracy of the second seam texel.
[0109] In one embodiment, spatially adjacent texels that meet target conditions are screened out from at least one spatially adjacent texel, including: while screening at least one spatially adjacent texel based on the intersection area of the coverage area of the spatially adjacent texel in the initial three-dimensional grid model and the coverage area of the first seam texel in the initial three-dimensional grid model, for each spatially adjacent texel, determining the angle between the texel vector and the reverse edge normal vector corresponding to the first seam texel to obtain a second angle corresponding to the spatially adjacent texel; the texel vector is a vector pointing from the first seam texel to the spatially adjacent texel; the reverse edge normal vector is in the opposite direction to the edge normal of the first seam texel; and from at least one spatially adjacent texel, screening the spatially adjacent texel with the smallest second angle; wherein the size of the second angle is negatively correlated with the size of the intersection area.
[0110] The edge normal of the texel is the direction vector of the perpendicular line between the edge where the texel is located and the opposite mesh vertex in the mesh patch, and the direction of the edge normal of the texel is from the edge where the texel is located to the opposite mesh vertex. It can be understood that the edge normal of the first seam texel is the direction vector of the perpendicular line between the edge where the first seam texel is located and the opposite mesh vertex in the mesh patch.
[0111] In one embodiment, when at least one spatially adjacent texel is screened according to the intersection area of the coverage area of the spatially adjacent texel in the initial three-dimensional mesh model and the coverage area of the first seam texel in the initial three-dimensional mesh model, for each spatially adjacent texel, the computer device may use the vector pointing from the first seam texel to the spatially adjacent texel as the texel vector, and the vector in the opposite direction to the edge normal of the first seam texel as the reverse edge normal vector. The computer device may determine the angle between the texel vector and the reverse edge normal vector corresponding to the first seam texel to obtain the second angle corresponding to the spatially adjacent texel. The size of the second angle is negatively correlated with the size of the intersection area, that is, the smaller the second angle, the larger the intersection area of the coverage area of the spatially adjacent texel in the initial three-dimensional mesh model and the coverage area of the first seam texel in the initial three-dimensional mesh model, and the larger the second angle, the smaller the intersection area of the coverage area of the spatially adjacent texel in the initial three-dimensional mesh model and the coverage area of the first seam texel in the initial three-dimensional mesh model. Then, the computer device may screen the spatially adjacent texel with the smallest second angle from at least one spatially adjacent texel. It can be understood that the computer device can filter out spatially adjacent texels with the largest intersection area.
[0112] In the above embodiment, when the spatially adjacent texels meeting the target condition are screened out according to the intersection area, because the size of the second angle is negatively correlated with the size of the intersection area, the spatially adjacent texels with the smallest second angle can be screened out from at least one spatially adjacent texel, thereby improving the search accuracy of the second seam texel.
[0113] In one embodiment, Figure 4As shown, the computer device can perform self-occlusion judgment on each texel in the initial three-dimensional mesh model. Specifically, for each texel in the initial three-dimensional mesh model, in the three-dimensional virtual scene, if there is an occluding mesh patch within a preset range along the normal direction of the texel, the texel is ignored, and each texel that is not ignored in the initial three-dimensional mesh model is used as a sampling texel. For each sampling texel of the initial three-dimensional mesh model in the three-dimensional virtual scene, the computer device can construct a ray emission area perpendicular to the normal direction of the sampling texel, take the point in the ray emission area as the ray starting point, and construct at least one ray (i.e., ray beam) with the opposite direction of the normal direction of the sampling texel as the ray direction, and determine the texels in the initial three-dimensional mesh model that intersect with each ray to obtain at least one candidate texel. It is determined whether there are spatially adjacent texels to the sampling texel through a world space adjacent discriminator. If there are spatially adjacent texels of the sampling texel in at least one candidate texel, the sampling texel is determined to be a first seam texel. Furthermore, the computer device can determine the second seam texel that has a seam adjacent relationship with the first seam texel from the spatially adjacent texels through the normal angle discriminator, the same plane discriminator, the spatial distance discriminator and the edge normal discriminator respectively. Specifically, first, the computer device can filter out the spatially adjacent texels that meet the target condition from at least one spatially adjacent texel through the normal angle discriminator according to the illumination difference between the illumination conditions of each spatially adjacent texel and the illumination condition of the first seam texel. Furthermore, the computer device can filter out the spatially adjacent texels that meet the target condition from the spatially adjacent texels filtered out based on the illumination difference through the same plane discriminator according to the plane difference between the mesh surface where the spatially adjacent texel is located and the mesh surface where the first seam texel is located. Further, the computer device can filter out the spatially adjacent texels that meet the target condition from the spatially adjacent texels filtered out based on the plane difference according to the spatial distance between the spatially adjacent texel and the first seam texel in the three-dimensional virtual scene through the spatial distance discriminator. Finally, the computer device can select a spatially adjacent texel from the spatially adjacent texels selected based on the spatial distance as the second seam texel through the edge normal discriminator according to the intersection area of the spatially adjacent texels in the initial three-dimensional mesh model and the coverage area of the first seam texel in the initial three-dimensional mesh model. It can be understood that the first seam texel and the second seam texel can be output as a set of seam texel pairs, so as to facilitate the subsequent model seam repair based on the output seam texel pair.
[0114] In one embodiment, an initial three-dimensional mesh model has a corresponding initial light map; repairing a first seam texel and a second seam texel in the initial three-dimensional mesh model to obtain a target three-dimensional mesh model after seam repair, including: determining, from the initial light map, texels mapped to each seam texel in the first seam texel and the second seam texel as seam texels to be repaired; for each seam texel to be repaired, determining the seam texel to be repaired in the initial light map according to the seam texel to be repaired and the seam texels that have a seam adjacent relationship with the seam texel to be repaired in the initial light map; a denoising reference area corresponding to the denoising reference area; determining the lighting contribution parameter corresponding to the reference texel according to the angle between the edge normal of each reference texel in the denoising reference area and the edge normal of the seam texel to be repaired; performing denoising and repair processing on the lighting data recorded in the initial light map for the seam texel to be repaired, according to the lighting contribution parameter corresponding to each reference texel and the lighting data recorded for each reference texel in the initial light map, to obtain a target light map; performing lighting rendering on the initial three-dimensional mesh model according to the target light map, to obtain a target three-dimensional mesh model after the seam repair is performed on the initial three-dimensional mesh model.
[0115] Among them, the initial light map is the light map corresponding to the initial three-dimensional mesh model. It can be understood that the initial light map is the light map before the noise reduction and repair process is performed. Each seam texel in the first seam texel and the second seam texel refers to any texel in the first seam texel and the second seam texel. The seam texel to be repaired is the seam texel to be repaired in the initial light map. The denoising reference area is an area used for reference in the denoising and repair process for the seam texel to be repaired. It can be understood that the denoising reference area includes at least one reference texel, and the reference texel is a texel used for reference in the denoising and repair process for the seam texel to be repaired. The edge normal of the reference texel is the direction vector of the perpendicular line between the edge where the reference texel is located in the mesh patch and the opposite mesh vertex. The direction of the edge normal of the reference texel is from the edge where the reference texel is located to the opposite mesh vertex. The edge normal of the seam texel to be repaired is the direction vector of the perpendicular line between the edge of the seam texel to be repaired and the opposite mesh vertex in the mesh patch. The direction of the edge normal of the seam texel to be repaired is from the edge of the seam texel to be repaired to the opposite mesh vertex. The lighting contribution parameter is a parameter used to characterize the lighting contribution of the reference texel to the seam texel to be repaired. The target light map is the light map after the denoising repair process.
[0116] Specifically, the computer device may determine, from the initial light map, a texel mapped to each of the first seam texel and the second seam texel as the seam texel to be repaired. It can be understood that each of the first seam texel and the second seam texel is a seam texel in the initial three-dimensional mesh model located in the three-dimensional space, and the seam texel to be repaired is a seam texel in the initial light map in the two-dimensional space. Each of the first seam texel and the second seam texel in the three-dimensional space has a mapping relationship with the seam texel to be repaired in the two-dimensional space. For each seam texel to be repaired, the computer device may determine the denoising reference area corresponding to the seam texel to be repaired in the initial light map according to the seam texel to be repaired and the seam texel that has a seam adjacent relationship with the seam texel to be repaired in the initial light map. It can be understood that the first seam texel and the second seam texel are a set of seam texel pairs in the initial three-dimensional mesh model, and the seam texel to be repaired and the corresponding seam texel in a seam adjacent relationship are also a set of seam texel pairs in the initial light map. The computer device can determine the illumination contribution parameter of the reference texel for the seam texel to be repaired based on the angle between the edge normal of each reference texel in the denoising reference area and the edge normal of the seam texel to be repaired, and perform denoising and repair processing on the illumination data recorded for the seam texel to be repaired in the initial light map based on the illumination contribution parameters of the seam texel to be repaired for each reference texel and the illumination data recorded for each reference texel in the initial light map to obtain a target light map. Furthermore, the computer device can perform illumination rendering on the initial three-dimensional mesh model according to the target light map to obtain a target three-dimensional mesh model after seam repair on the initial three-dimensional mesh model.
[0117] In one embodiment, for each seam texel to be repaired, according to the seam texel to be repaired and the seam texel that has a seam adjacent relationship with the seam texel to be repaired in the initial light map, determine the denoising reference area corresponding to the seam texel to be repaired in the initial light map, including: for each seam texel to be repaired, according to the seam texel to be repaired and the seam texel that has a seam adjacent relationship with the seam texel to be repaired in the initial light map, determine the seam texel to be repaired in this round of denoising repair processing in the initial light map. The method further includes: using the light map after the current round of denoising and repair processing as the initial light map for the next round of denoising and repair processing, and using the next round as a new round, returning to each seam texel to be repaired, and determining the denoising reference area corresponding to the seam texel to be repaired in the current round of denoising and repair processing in the initial light map according to the seam texel to be repaired and the seam texel that has a seam adjacent relationship with the seam texel to be repaired in the initial light map, so as to iteratively perform denoising and repair until the iteration stop condition is met, and obtain the target light map. It can be understood that in this embodiment, by performing multiple rounds of denoising and repair processing on the initial light map, the model seam repair effect is further improved, thereby further improving the model rendering quality.
[0118] In one embodiment, in each round of denoising and repair processing, the distance between any two adjacent sampling points in the filter kernel used in this round is greater than the distance between any two adjacent sampling points in the previous round. In this way, through multiple rounds of iterative denoising and repair, the sampling range of the filter kernel can gradually cover the entire light map, achieving a large range of filter sampling, and making more full use of the lighting information of each reference texel in the light map, thereby further improving the model seam repair effect.
[0119] In one embodiment, for each seam texel to be repaired, the computer device may determine the denoising reference area corresponding to the seam texel to be repaired in the initial light map according to the texels adjacent to the seam texel to be repaired in the initial light map and the texels adjacent to the seam texel to be repaired in the initial light map. It can be understood that the denoising reference area includes the seam texel to be repaired, the texels adjacent to the seam texel to be repaired in the initial light map, the seam texels in the seam adjacent relationship with the seam texel to be repaired, and the texels adjacent to the seam texel in the initial light map in the seam adjacent relationship with the seam texel to be repaired.
[0120] In one embodiment, the computer device may perform denoising and repair processing on the illumination data recorded for the seam texels to be repaired in the initial light map according to the illumination contribution parameters corresponding to each reference texel and the illumination data recorded for each reference texel in the initial light map, obtain the denoised illumination data corresponding to the seam texels to be repaired, and directly write the denoised illumination data back to the initial light map to obtain the target light map. It is understandable that the denoised illumination data corresponding to the seam texels to be repaired may overwrite the illumination data recorded for the seam texels to be repaired in the initial light map.
[0121] In one embodiment, a computer device may perform denoising and repair processing on the lighting data recorded for the seam texels to be repaired in the initial light map based on the lighting contribution parameters corresponding to each reference texel and the lighting data recorded for each reference texel in the initial light map, to obtain a denoised light map after denoising and repair, and directly use the denoised light map as the target light map.
[0122] In the above embodiment, the denoising reference area corresponding to the seam texel to be repaired in the initial light map is determined by the seam texel to be repaired and the seam texel that has a seam adjacent relationship with the seam texel to be repaired in the initial light map, so that the accuracy of the denoising reference area can be improved. Since the angle between the edge normal of the reference texel and the edge normal of the seam texel to be repaired is inversely proportional to the illumination contribution of the reference texel to the seam texel to be repaired. Therefore, the illumination contribution parameter corresponding to the reference texel is determined by the angle between the edge normal of each reference texel in the denoising reference area and the edge normal of the seam texel to be repaired, so that the accuracy of the illumination contribution parameter can be improved. Then, based on the more accurate illumination contribution parameter, the seam texel to be repaired in the initial light map is subjected to denoising and repair processing, so that the initial three-dimensional mesh model is illuminated and rendered based on the denoised target light map, so that the rendering quality of the target three-dimensional mesh model after seam repair can be improved.
[0123] In one embodiment, based on the seam texels to be repaired and the seam texels that are in a seam-adjacent relationship with the seam texels to be repaired in the initial light map, the denoising reference area corresponding to the seam texels to be repaired in the initial light map is determined, including: determining a first sampling range of a filter kernel used for denoising repair processing along the direction of the edge normal of the seam texels to be repaired; determining a second sampling range of the filter kernel along the direction of the edge normal of adjacent seam texels; adjacent seam texels are seam texels that are in a seam-adjacent relationship with the seam texels to be repaired; and determining the denoising reference area corresponding to the seam texels to be repaired in the initial light map based on the first sampling range and the second sampling range.
[0124] The first sampling range and the second sampling range of the filter kernel are respectively the sampling ranges of the filter kernel that meet the target conditions. It can be understood that the first sampling range and the second sampling range of the filter kernel together constitute the sampling range of the filter kernel.
[0125] Specifically, the computer device may determine the first sampling range of the filter kernel used for the noise reduction repair process along the direction of the edge normal of the seam texel to be repaired, and determine the second sampling range of the filter kernel along the direction of the edge normal of the adjacent seam texel. Among them, the adjacent seam texel is a seam texel that has a seam adjacent relationship with the seam texel to be repaired. Furthermore, the computer device may use the first sampling range and the second sampling range together as the sampling range of the filter kernel, and determine the noise reduction reference area corresponding to the seam texel to be repaired in the initial light map according to the sampling range of the filter kernel. It can be understood that the reference texels included in the noise reduction reference area are the texels covered by the sampling range of the filter kernel in the initial light map.
[0126] In one embodiment, the computer device may perform multiple rounds (e.g., two rounds) of denoising and repairing processing on the seam texels to be repaired in the initial light map. In each round of denoising and repairing processing, the distance between any two adjacent sampling points in the filter kernel used in the current round is greater than the distance between any two adjacent sampling points in the previous round. Figure 5 As shown, the filter kernel used for denoising and repair processing is a 3×3 filter kernel. In the first round of denoising and repair processing (first filtering), the computer device can determine the first sampling range of the filter kernel used for denoising and repair processing (i.e., the sampling points of the five circles in the triangular mesh patch A1A2A3) along the direction of the edge normal line n1 of the seam texel to be repaired (i.e., the point M located on the A side (A1A2) of the triangular mesh patch A1A2A3). The computer device can determine the second sampling range of the filter kernel (i.e., the sampling points of the five crosses in the triangular mesh patch B1B2B3) along the direction of the edge normal line n2 of the adjacent seam texel (i.e., the point N located on the B side (B1B2) of the triangular mesh patch B1B2B3). Furthermore, the computer device can determine the denoising reference area corresponding to the seam texels to be repaired in the initial light map (i.e., the 5 circles in the triangular mesh patch A1A2A3 and the 5 crosses in the triangular mesh patch B1B2B3) based on the first sampling range and the second sampling range.
[0127] In one embodiment, Figure 6 As shown, in the second round of noise reduction and restoration processing (second filtering), the spacing between any two adjacent sampling points in the filter kernel used in the second round of noise reduction and restoration is greater than the spacing between any two adjacent sampling points in the first round. It can be understood that compared with Figure 5 The distance between any two adjacent sampling points in is Figure 6The distance between any two adjacent sampling points is large. Compared with the first round of denoising and repair processing, the filtering range of the second denoising and repair filter kernel is wider, which further improves the model seam repair effect, thereby improving the model rendering quality.
[0128] In one embodiment, Figure 7 The figure shows the interface corresponding to the computer device and used to configure the parameters involved in the noise reduction and repair process (i.e., model seam repair). The repair of model seams can be enabled by checking "Enable model repair function" in the parameter configuration interface. Among them, the parameter "Seam repair level" can be used to configure the sampling range of the filter kernel and the number of iterations of multiple rounds of noise reduction and repair processing.
[0129] In the above embodiment, since the direction of the edge normal of the texel is consistent with the direction of the inner side of the mesh patch where the illumination data is recorded, by determining the first sampling range along the direction of the edge normal of the seam texel to be repaired, and by determining the second sampling range along the direction of the edge normal of the adjacent seam texel, it is possible to avoid sampling invalid texels, that is, texels in the illumination map where no illumination data is recorded. Then, based on the first sampling range and the second sampling range, the denoising reference area corresponding to the seam texel to be repaired in the initial illumination map is determined, which can improve the accuracy of the denoising reference area.
[0130] In one embodiment, according to the illumination contribution parameters corresponding to each reference texel and the illumination data recorded for each reference texel in the initial light map, the illumination data recorded for the seam texel to be repaired in the initial light map is subjected to denoising and repair processing to obtain a target light map, including: according to the illumination contribution parameters corresponding to each reference texel and the illumination data recorded for each reference texel in the initial light map, the illumination data recorded for the seam texel to be repaired in the initial light map is subjected to denoising and repair processing to obtain denoised illumination data corresponding to the seam texel to be repaired; the denoised illumination data corresponding to the seam texel to be repaired is mixed with the illumination data before denoising to obtain mixed illumination data corresponding to the seam texel to be repaired; and the mixed illumination data corresponding to each seam texel to be repaired is written back to the initial light map to obtain a target light map.
[0131] The mixed illumination data is illumination data obtained by mixing the illumination data after denoising corresponding to the seam texel to be repaired with the illumination data before denoising. It can be understood that the mixed illumination data takes into account both the illumination data after denoising corresponding to the seam texel to be repaired and the illumination data before denoising corresponding to the seam texel to be repaired.
[0132] In one embodiment, the computer device may perform denoising and repair processing on the illumination data recorded for the seam texels to be repaired in the initial light map according to the illumination contribution parameters corresponding to each reference texel and the illumination data recorded for each reference texel in the initial light map, to obtain the denoised illumination data corresponding to the seam texels to be repaired. The computer device may obtain the mixing coefficient of the denoised illumination data corresponding to the seam texels to be repaired, and based on the mixing coefficient of the denoised illumination data corresponding to the seam texels to be repaired, mix the denoised illumination data corresponding to the seam texels to be repaired with the illumination data before denoising, to obtain the mixed illumination data corresponding to the seam texels to be repaired. Furthermore, the computer device may write back the mixed illumination data corresponding to each seam texel to be repaired to the initial light map, to obtain the target light map. Continue to refer to Figure 7 The "Seam Blending Level" parameter can be used to configure the blending coefficient for blending the lighting data corresponding to the texels.
[0133] In one embodiment, the mixing coefficient of the denoised illumination data corresponding to the seam texel to be repaired can be used as the mixing weight of the denoised illumination data corresponding to the seam texel to be repaired, and based on the mixing coefficient, the denoised illumination data corresponding to the seam texel to be repaired is mixed with the illumination data before denoising to obtain the mixed illumination data corresponding to the seam texel to be repaired. For example, if the mixing coefficient (mixing weight) of the denoised illumination data corresponding to the seam texel to be repaired is a, then the mixing weight of the illumination data before denoising corresponding to the seam texel to be repaired is (1-a).
[0134] In one embodiment, the computer device may write the mixed illumination data corresponding to each seam texel to be repaired back to the initial light map to obtain a mixed illumination map, and directly use the mixed illumination map as the target light map. The mixed illumination map is a light map obtained by writing the mixed illumination data corresponding to each seam texel to be repaired back to the initial light map. It can be understood that the mixed illumination data corresponding to each seam texel to be repaired can overwrite the illumination data of each seam texel to be repaired in the initial light map to obtain a mixed illumination map.
[0135] In the above embodiment, since the difference between the denoised illumination data corresponding to the seam texel to be repaired and the illumination data corresponding to the secondary texel is too large, the denoised illumination data corresponding to the seam texel to be repaired is mixed with the illumination data before denoising to obtain the mixed illumination data corresponding to the seam texel to be repaired, thereby reducing the difference between the denoised illumination data corresponding to the seam texel to be repaired and the illumination data corresponding to the secondary texel. Furthermore, by writing the mixed illumination data corresponding to each seam texel to be repaired back to the initial illumination map to obtain the target illumination map, the rendering quality of the target three-dimensional mesh model after seam repair based on the target illumination map can be further improved.
[0136] In one embodiment, the mixed illumination data corresponding to each seam texel to be repaired is written back to the initial light map to obtain a target light map, including: writing the mixed illumination data corresponding to each seam texel to be repaired back to the initial light map to obtain a mixed light map; determining the secondary texels adjacent to the seam texels to be repaired from the mixed light map along the direction of the edge normal of the seam texels to be repaired; mixing the illumination data recorded by the secondary texels in the mixed light map with the illumination data recorded by the adjacent seam texels in the mixed light map to obtain the target light map; the adjacent seam texels are seam texels that have a seam adjacent relationship with the seam texels to be repaired.
[0137] In one embodiment, the secondary texel is a texel adjacent to the seam texel to be repaired in the light map. The computer device may write the mixed illumination data corresponding to each seam texel to be repaired back to the initial light map to obtain a mixed light map. Furthermore, the computer device may determine the secondary texels adjacent to the seam texel to be repaired from the mixed light map along the direction of the edge normal of the seam texel to be repaired, and obtain the mixing coefficient for the secondary texel. Based on the mixing coefficient of the secondary texel, the illumination data recorded by the secondary texel in the mixed light map is mixed with the illumination data recorded by the adjacent seam texel in the mixed light map to obtain the target light map. Among them, the adjacent seam texel is a seam texel that has a seam adjacent relationship with the seam texel to be repaired.
[0138] In the above embodiment, since the mixed illumination data corresponding to the seam texels to be repaired and the illumination data corresponding to the secondary texels are too different, the seam will change from a dark-colored thin seam to a light-colored seam strip. Therefore, by mixing the illumination data recorded by the secondary texels in the mixed illumination map with the illumination data recorded by the adjacent seam texels in the mixed illumination map to obtain the target illumination map, the difference between the mixed illumination data corresponding to the seam texels to be repaired and the illumination data corresponding to the secondary texels can be reduced, thereby further improving the rendering quality of the target three-dimensional mesh model after seam repair based on the target illumination map.
[0139] In one embodiment, according to the illumination contribution parameters corresponding to each reference texel and the illumination data recorded for each reference texel in the initial light map, the illumination data recorded for the seam texel to be repaired in the initial light map is subjected to denoising and repair processing to obtain a target light map, including: according to the illumination contribution parameters corresponding to each reference texel and the illumination data recorded for each reference texel in the initial light map, the illumination data recorded for the seam texel to be repaired in the initial light map is subjected to denoising and repair processing to obtain a denoised light map; for each seam texel to be repaired, determining from the denoised light map an unmapped texel that is adjacent to the seam texel to be repaired and has no illumination data recorded therein; filling the illumination data recorded for the adjacent seam texels in the denoised light map into the unmapped texels to obtain a target light map; the adjacent seam texels are seam texels that have a seam-adjacent relationship with the seam texels to be repaired.
[0140] The denoised light map is a light map obtained by performing denoising and repairing the light data recorded in the seam texels to be repaired in the initial light map. The unmapped texels are texels in the light map that have no mapping relationship with the texels in the three-dimensional mesh model. It can be understood that no relevant light data is recorded in the unmapped texels.
[0141] Specifically, the computer device may perform denoising and repair processing on the illumination data recorded for the seam texels to be repaired in the initial light map according to the illumination contribution parameters corresponding to each reference texel and the illumination data recorded for each reference texel in the initial light map to obtain a denoised light map. For each seam texel to be repaired, the computer device may determine from the denoised light map the unmapped texels that are adjacent to the seam texels to be repaired and that do not record illumination data. Furthermore, the computer device may fill the illumination data recorded by the adjacent seam texels in the denoised light map into the unmapped texels to obtain a target light map, wherein the adjacent seam texels are seam texels that have a seam-adjacent relationship with the seam texels to be repaired. It can be understood that after filling, the unmapped texels in the target light map also record illumination data.
[0142] In one embodiment, for each unmapped texel, when the unmapped texel is adjacent to a plurality of seam texels to be repaired, the computer device may determine the edge normals of each seam texel to be repaired respectively. For each unmapped texel, the illumination data is filled in the unmapped texel preferentially through the adjacent seam texels of the seam texel to be repaired that are opposite to the unmapped texel. If the unmapped texel does not have a seam texel to be repaired that is opposite to the unmapped texel, the illumination data is filled in the unmapped texel through the adjacent seam texels of the seam texel to be repaired that are 45 degrees to the unmapped texel.
[0143] In the above embodiment, when the initial three-dimensional mesh model is illuminated and rendered according to the target light map, the illumination data in the target light map is sampled by interpolation sampling (i.e., each sampling of illumination data will refer to the illumination data recorded by multiple adjacent texels). Therefore, the illumination data recorded by the adjacent seam texels in the denoised light map is filled into the unmapped texels to obtain the target light map, which can avoid sampling texels that do not record illumination data during interpolation sampling, thereby further improving the rendering quality of the model.
[0144] In one embodiment, according to the angle between the edge normal of each reference texel in the denoising reference area and the edge normal of the seam texel to be repaired, the illumination contribution parameter corresponding to the reference texel is determined, including: for each reference texel in the denoising reference area, according to the angle between the edge normal of the reference texel and the edge normal of the seam texel to be repaired, determining the first normal influence parameter; according to at least one of the first normal influence parameter, the second normal influence parameter, the distance influence parameter and the brightness influence parameter, determining the illumination contribution parameter corresponding to the reference texel; wherein the second normal influence parameter is used to characterize the degree of influence of the normal of the seam texel to be repaired in the three-dimensional virtual scene and the normal of the reference texel in the three-dimensional virtual scene on the illumination contribution; the distance influence parameter is used to characterize the degree of influence of the distance between the seam texel to be repaired and the reference texel in the three-dimensional virtual scene on the illumination contribution; the brightness influence parameter is used to characterize the degree of influence of the brightness of the seam texel to be repaired and the brightness of the reference texel on the illumination contribution.
[0145] Among them, the first normal influence parameter is used to characterize the degree of influence of the angle between the edge normal of the reference texel and the edge normal of the seam texel to be repaired on the lighting contribution. The second normal influence parameter is determined based on the normal of the seam texel to be repaired in the three-dimensional virtual scene and the normal of the reference texel in the three-dimensional virtual scene. The distance influence parameter is determined based on the distance between the seam texel to be repaired and the reference texel in the three-dimensional virtual scene. The brightness influence parameter is determined based on the brightness of the seam texel to be repaired and the brightness of the reference texel.
[0146] In one embodiment, for each reference texel in the denoising reference area, the computer device may select a maximum value from zero and the first dot product result as the first normal influence parameter. The first dot product result is a vector dot product result between the edge normal vector of the reference texel and the edge normal vector of the seam texel to be repaired. It can be understood that the first dot product result is negatively correlated with the angle between the edge normal of the reference texel and the edge normal of the seam texel to be repaired.
[0147] In one embodiment, for each reference texel in the denoising reference area, the computer device may select a maximum value from zero and a second dot product result as a second normal influence parameter, wherein the second dot product result is a vector dot product result between a normal vector of the reference texel in the three-dimensional virtual scene and a normal vector of a seam texel to be repaired in the three-dimensional virtual scene.
[0148] In one embodiment, the computer device may perform noise reduction and restoration processing on the illumination data recorded by the seam texels to be restored using the following formula.
[0149]
[0150] w i (p,q)=w p ·w n ·w l ·w n ′;
[0151]
[0152]
[0153]
[0154]
[0155] Among them, p represents the seam texel to be repaired, q represents the reference texel, Ω represents the denoising reference area, i represents the previous round of denoising repair processing, i+1 represents the current round of denoising repair processing, σp, σ n , σ l , σ n ′ and ε are preset constants, p(p) represents the position of the seam texel to be repaired in three-dimensional space, |P(p)-P(q)| is the world space distance between the position of the reference texel in three-dimensional space and the position of the seam texel to be repaired in three-dimensional space, n(p) is the normal vector of the seam texel to be repaired in the three-dimensional virtual scene, n(q) is the normal vector of the reference texel in the three-dimensional virtual scene, l i (p) is the brightness value of the seam texel to be repaired after the previous round of denoising and repair processing, l i (q) is the brightness value of the reference texel after the previous round of noise reduction and restoration, Var represents the variance function, and g 3×3 represents a 3*3 Gaussian function. n′(p) is the edge normal vector of the seam texel to be repaired, and n′(q) is the edge normal vector of the reference texel. w p Represents the distance influence parameter, w n ′ represents the first normal influence parameter, w n Represents the second normal influence parameter, w lrepresents the brightness influence parameter, w i (p, q) represents the illumination contribution parameter of the reference texel to the seam texel to be repaired after the previous round of denoising and repair processing. Represents the lighting data recorded for the reference texel in the light map after the previous round of noise reduction and repair processing (for example, the lighting data can be a color value or other lighting data except color values). Represents the lighting data recorded for the seam texels to be repaired in the light map after this round of denoising and repair processing.
[0156] In the above embodiment, the lighting contribution parameter corresponding to the reference texel is determined by at least one of the first normal influence parameter, the second normal influence parameter, the distance influence parameter and the brightness influence parameter, which can further improve the accuracy of the lighting contribution parameter and further improve the model rendering quality.
[0157] In one embodiment, Figure 8 As shown, (a) is a schematic diagram of the initial three-dimensional mesh model before seam repair. It can be seen that there are obvious seam defects 801 in the initial three-dimensional mesh model in (a), resulting in low model rendering quality. The initial three-dimensional mesh model is seam repaired by the model seam repair method of the present application, and the target three-dimensional mesh model after seam repair in (b) can be obtained. It can be seen that there are no seam defects in the target three-dimensional mesh model in (b), which improves the rendering quality of the model.
[0158] In one embodiment, Fig. 9 As shown in Figure 2, (a) shows multiple initial 3D mesh models in a 3D virtual scene before seam repair (e.g. Fig. 9 As shown in the schematic diagram of (a) and (b), there are obvious seam defects 901 in the area where the multiple initial three-dimensional mesh models are connected, resulting in low rendering quality of the multiple models in a three-dimensional virtual scene. The model seam repair method of the present application is used to repair the seams of the multiple initial three-dimensional mesh models in a three-dimensional virtual scene, and multiple target three-dimensional mesh models in a three-dimensional virtual scene after the seams are repaired can be obtained. It can be seen that there are no seam defects in the multiple target three-dimensional mesh models in a three-dimensional virtual scene in (b), which improves the rendering quality of the multiple models in a three-dimensional virtual scene.
[0159] like Fig.10 As shown, in one embodiment, a model seam repair method is provided. The method can be applied to a computer device, which can be a terminal or a server. The method can be executed by the terminal or the server itself, or can be implemented through interaction between the terminal and the server. This embodiment is described by taking the method applied to a computer device as an example. The method specifically includes the following steps:
[0160] Step 1002: for each texel of the initial three-dimensional mesh model in the three-dimensional virtual scene, if there is an occluding mesh face within a preset range along the normal direction of the texel in the three-dimensional virtual scene, the texel is ignored.
[0161] Step 1004: Use each texel that is not ignored in the initial three-dimensional mesh model as a sampling texel, and construct a ray emission area perpendicular to the normal direction of the sampling texel for each sampling texel of the initial three-dimensional mesh model.
[0162] Step 1006, taking a point in the ray emission area as the ray starting point, constructing at least one ray with the opposite direction of the normal direction of the sampled texel as the ray direction, and determining the texels intersecting with each ray in the initial three-dimensional mesh model to obtain intersecting texels.
[0163] Step 1008 , for each intersecting texel, if the coordinates of the intersecting texel in the plane grid model are discontinuous with the coordinates of the sampling texel in the plane grid model, or the intersecting texel and the sampling texel are located in different initial three-dimensional grid models, the intersecting texel is used as a candidate texel.
[0164] Step 1010 , for each candidate texel, if the first mesh patch corresponding to the candidate texel and the second mesh patch corresponding to the sampling texel are continuous in the three-dimensional virtual scene, then the candidate texel is determined to be a spatially adjacent texel of the sampling texel.
[0165] Step 1012: If there is a spatially adjacent texel of the sampled texel in at least one candidate texel, the sampled texel is determined to be a first seam texel.
[0166] Step 1014, based on at least one of the following: the lighting difference between the lighting conditions of the spatially adjacent texels and the lighting conditions of the first seam texel, the planar difference between the mesh patch where the spatially adjacent texels are located and the mesh patch where the first seam texel is located, the spatial distance between the spatially adjacent texels and the first seam texel in the three-dimensional virtual scene, and the intersection area between the coverage area of the spatially adjacent texels in the initial three-dimensional mesh model and the coverage area of the first seam texel in the initial three-dimensional mesh model, select the spatially adjacent texels that meet the target conditions from at least one spatially adjacent texel.
[0167] Step 1016: determine a second seam texel from the screened spatially adjacent texels.
[0168] Step 1018: Determine, from the initial light map corresponding to the initial three-dimensional mesh model, texels mapped to each of the first seam texels and the second seam texels as seam texels to be repaired.
[0169] Step 1020, for each seam texel to be repaired, determine the denoising reference area corresponding to the seam texel to be repaired in the initial light map according to the seam texel to be repaired and the seam texels that have a seam adjacent relationship with the seam texel to be repaired in the initial light map.
[0170] Step 1022: for each reference texel in the denoising reference area, determine a first normal influence parameter according to the angle between the edge normal of the reference texel and the edge normal of the seam texel to be repaired.
[0171] Step 1024: Determine the illumination contribution parameter corresponding to the reference texel according to at least one of the first normal influence parameter, the second normal influence parameter, the distance influence parameter and the brightness influence parameter.
[0172] Step 1026, based on the lighting contribution parameters corresponding to each reference texel and the lighting data recorded for each reference texel in the initial light map, the lighting data recorded for the seam texel to be repaired in the initial light map is subjected to denoising and repair processing to obtain the denoised lighting data corresponding to the seam texel to be repaired.
[0173] Step 1028 , mixing the illumination data after denoising corresponding to the seam texel to be repaired with the illumination data before denoising to obtain mixed illumination data corresponding to the seam texel to be repaired.
[0174] Step 1030, writing the mixed lighting data corresponding to each seam texel to be repaired back to the initial light map to obtain a mixed light map.
[0175] Step 1032: determine the secondary texels adjacent to the seam texel to be repaired from the mixed light map along the direction of the edge normal of the seam texel to be repaired.
[0176] Step 1034, mixing the lighting data recorded by the secondary texels in the mixed light map with the lighting data recorded by the adjacent seam texels in the mixed light map to obtain a target light map; the adjacent seam texels are seam texels that have a seam adjacent relationship with the seam texels to be repaired.
[0177] Step 1036, performing lighting rendering on the initial three-dimensional mesh model according to the target light map, to obtain a target three-dimensional mesh model after seam repairing is performed on the initial three-dimensional mesh model.
[0178] The present application also provides an application scenario, and the model seam repair method mentioned above is applied to the application scenario. Specifically, the model seam repair method can be applied to the seam repair scenario of game models in the game field.
[0179] It can be understood that the three-dimensional virtual scene includes a game scene, the initial three-dimensional mesh model includes an initial game model, and the target three-dimensional mesh model includes a target game model. It can be understood that the game model in the game scene may have a seam effect, and the model seam repair method of the present application can be used to repair the seams of the game model in the game scene. For example, the game model may include at least one of a virtual table, a virtual chair, or a virtual desk lamp in the game scene. The model seam repair method of the present application can be used to repair the seams of virtual tables, virtual chairs, virtual desk lamps, etc., thereby improving the rendering quality of the game model in the game scene.
[0180] Specifically, for each texel of the initial game model in the game scene, if there is an occluding mesh patch within a preset range along the normal direction of the texel in the game scene, the computer device may ignore the texel. Each texel that is not ignored in the initial game model is used as a sampling texel, and for each sampling texel of the initial game model, a ray emission area perpendicular to the normal direction of the sampling texel is constructed. A point in the ray emission area is used as the ray starting point, and at least one ray is constructed with the opposite direction of the normal direction of the sampling texel as the ray direction, and the texels intersecting with each ray in the initial game model are determined to obtain the intersecting texels. For each intersecting texel, if the coordinates of the intersecting texel in the plane mesh model are not continuous with the coordinates of the sampling texel in the plane mesh model, or the intersecting texel and the sampling texel are located in different initial game models, the intersecting texel is used as a candidate texel. For each candidate texel, if the first mesh patch corresponding to the candidate texel and the second mesh patch corresponding to the sampling texel are continuous in the game scene, the candidate texel is determined to be a spatially adjacent texel of the sampling texel. If there is a spatially adjacent texel of the sampled texel in at least one candidate texel, the sampled texel is determined to be a first seam texel.
[0181] The computer device may screen out spatially adjacent texels that meet the target condition from at least one spatially adjacent texel based on at least one of the following: the illumination difference between the illumination condition of the spatially adjacent texel and the illumination condition of the first seam texel, the plane difference between the mesh surface patch where the spatially adjacent texel is located and the mesh surface patch where the first seam texel is located, the spatial distance between the spatially adjacent texel and the first seam texel in the game scene, and the intersection area between the coverage area of the spatially adjacent texel in the initial game model and the coverage area of the first seam texel in the initial game model. The second seam texel is determined from the screened spatially adjacent texels.
[0182] The computer device can determine, from the initial light map corresponding to the initial game model, the texels mapped to each of the first seam texel and the second seam texel as the seam texels to be repaired. For each seam texel to be repaired, according to the seam texel to be repaired and the seam texels that have a seam adjacent relationship with the seam texel to be repaired in the initial light map, determine the denoising reference area corresponding to the seam texel to be repaired in the initial light map. For each reference texel in the denoising reference area, according to the angle between the edge normal of the reference texel and the edge normal of the seam texel to be repaired, determine the first normal influence parameter. According to at least one of the first normal influence parameter, the second normal influence parameter, the distance influence parameter and the brightness influence parameter, determine the illumination contribution parameter corresponding to the reference texel. According to the lighting contribution parameters corresponding to each reference texel and the lighting data recorded for each reference texel in the initial light map, the lighting data recorded for the seam texel to be repaired in the initial light map is denoised and repaired to obtain the denoised lighting data corresponding to the seam texel to be repaired.
[0183] The computer device can mix the denoised illumination data corresponding to the seam texel to be repaired with the illumination data before denoising to obtain the mixed illumination data corresponding to the seam texel to be repaired. The mixed illumination data corresponding to each seam texel to be repaired is written back to the initial illumination map to obtain a mixed illumination map. The secondary texels adjacent to the seam texel to be repaired are determined from the mixed illumination map along the direction of the edge normal of the seam texel to be repaired. The illumination data recorded by the secondary texel in the mixed illumination map is mixed with the illumination data recorded by the adjacent seam texel in the mixed illumination map to obtain a target illumination map; the adjacent seam texel is a seam texel that has a seam adjacent relationship with the seam texel to be repaired. The initial game model is illuminated and rendered according to the target illumination map to obtain a target game model after the seam repair is performed on the initial game model. The model seam repair method of the present application can improve the efficiency of game model repair in the game scene and improve the rendering quality of the game model.
[0184] The present application also provides some application scenarios, which apply the above-mentioned model seam repair method. Specifically, the present application can also be applied to scenes such as film and television special effects, visual design, VR (Virtual Reality), industrial simulation, and digital cultural creation. It can be understood that scenes such as film and television special effects, visual design, VR (Virtual Reality), industrial simulation, and digital cultural creation may include virtual object models, the initial three-dimensional mesh model includes the initial virtual model, and the target three-dimensional mesh model includes the target virtual model. The model seam repair method of the present application can be used to repair the seams of the virtual object model, thereby improving the rendering quality of the virtual object model.
[0185] For example, the present application can be applied to an industrial simulation scene. The three-dimensional virtual scene includes an industrial simulation scene, the initial three-dimensional mesh model includes an initial industrial model, and the target three-dimensional mesh model includes a target industrial model. It can be understood that the industrial model in the industrial simulation scene may have a seam effect. The model seam repair method of the present application can be used to repair the seams of the industrial model in the industrial simulation scene, thereby improving the rendering quality of the industrial model in the industrial simulation scene.
[0186] It should be understood that, although each step in the flow chart of the above-mentioned embodiments is shown in order, these steps are not necessarily performed in order. Unless there is a clear explanation in this article, the execution of these steps does not have strict order restrictions, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above-mentioned embodiments may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in order, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0187] In one embodiment, Fig.11 As shown, a model joint repair device 1100 is provided, and the device specifically comprises:
[0188] A construction module 1102 is used to construct a ray emission area perpendicular to the normal direction of each sampled texel of the initial three-dimensional mesh model in the three-dimensional virtual scene;
[0189] A determination module 1104 is used to construct at least one ray with a point in the ray emission area as the ray starting point and a direction opposite to the normal direction of the sampled texel as the ray direction, and determine the texels intersecting with each ray in the initial three-dimensional mesh model to obtain at least one candidate texel;
[0190] A determination module 1106 is configured to determine that the sampled texel is a first seam texel if there is a spatially adjacent texel of the sampled texel in at least one candidate texel; the number of the spatially adjacent texel is at least one;
[0191] The determination module 1104 is further configured to determine, from the at least one spatially adjacent texel, a second seam texel that is in a seam adjacent relationship with the first seam texel;
[0192] The repair module 1108 is used to repair the first seam texel and the second seam texel in the initial three-dimensional mesh model to obtain a target three-dimensional mesh model after seam repair.
[0193] In one embodiment, the construction module 1102 is also used to, for each texel in the initial three-dimensional mesh model, ignore the texel in the three-dimensional virtual scene if there is an occluded mesh patch within a preset range along the normal direction of the texel; the occluded mesh patch is a mesh patch other than the mesh patch where the texel is located in the initial three-dimensional mesh model; and each texel that is not ignored in the initial three-dimensional mesh model is used as a sampling texel.
[0194] In one embodiment, the determination module 1104 is also used to determine the texels in the initial three-dimensional mesh model that intersect with each ray to obtain intersecting texels; for each intersecting texel, if the coordinates of the intersecting texel in the plane mesh model are discontinuous with the coordinates of the sampling texel in the plane mesh model, or the intersecting texel and the sampling texel are located in different initial three-dimensional mesh models, the intersecting texel is used as a candidate texel; wherein the plane mesh model is a mesh model that is two-dimensionally flattened with respect to the initial three-dimensional mesh model.
[0195] In one embodiment, the determination module 1106 is also used to determine, for each candidate texel, that the candidate texel is a spatially adjacent texel of the sampling texel if the first grid patch corresponding to the candidate texel and the second grid patch corresponding to the sampling texel are continuous in the three-dimensional virtual scene; wherein the first grid patch is the grid patch where the candidate texel is located in the initial three-dimensional grid model; and the second grid patch is the grid patch where the sampling texel is located in the initial three-dimensional grid model.
[0196] In one embodiment, the determination module 1104 is further used to filter out spatially adjacent texels that meet target conditions from at least one spatially adjacent texel based on at least one of the following: the lighting difference between the lighting conditions of the spatially adjacent texels and the lighting conditions of the first seam texel, the planar difference between the mesh surface where the spatially adjacent texels are located and the mesh surface where the first seam texel is located, the spatial distance between the spatially adjacent texels and the first seam texel in the three-dimensional virtual scene, and the intersection area between the coverage area of the spatially adjacent texels in the initial three-dimensional mesh model and the coverage area of the first seam texel in the initial three-dimensional mesh model; and determine the second seam texel from the filtered spatially adjacent texels.
[0197] In one embodiment, the determination module 1104 is also used to determine, for each spatially adjacent texel, the normal angle between the mesh faces corresponding to the spatially adjacent texel and the first seam texel, after screening at least one spatially adjacent texel based on the lighting difference between the lighting condition of the spatially adjacent texel and the lighting condition of the first seam texel, to obtain a first angle corresponding to the spatially adjacent texel; the first angle is positively correlated with the lighting difference; and from at least one spatially adjacent texel, screen the spatially adjacent texel whose first angle is less than or equal to the preset angle.
[0198] In one embodiment, the determination module 1104 is also used to screen at least one spatially adjacent texel based on the plane difference between the mesh patch where the spatially adjacent texel is located and the mesh patch where the first seam texel is located, and to screen, from at least one spatially adjacent texel, a spatially adjacent texel that has a patch coplanar relationship with the first seam texel; wherein the mesh patch corresponding to the screened spatially adjacent texel and the mesh patch corresponding to the first seam texel are located in the same plane.
[0199] In one embodiment, the determination module 1104 is also used to screen at least one spatially adjacent texel according to the spatial distance between the spatially adjacent texel and the first seam texel in the three-dimensional virtual scene, and to screen spatially adjacent texels whose spatial distance is less than or equal to a preset distance from at least one spatially adjacent texel; wherein the preset distance is less than or equal to the texel radius of the first seam texel.
[0200] In one embodiment, the determination module 1104 is also used to determine, for each spatially adjacent texel, the angle between the texel vector and the reverse edge normal vector corresponding to the first seam texel, to obtain a second angle corresponding to the spatially adjacent texel, after screening at least one spatially adjacent texel based on the intersection area of the texel's coverage area in the initial three-dimensional mesh model and the coverage area of the first seam texel in the initial three-dimensional mesh model; the texel vector is a vector pointing from the first seam texel to the spatially adjacent texel; the reverse edge normal vector is in the opposite direction to the edge normal of the first seam texel; and the spatially adjacent texel with the smallest second angle is screened from at least one spatially adjacent texel; wherein the size of the second angle is negatively correlated with the size of the intersection area.
[0201] In one embodiment, the initial three-dimensional mesh model has a corresponding initial light map; the repair module 1108 is further used to determine, from the initial light map, texels mapped to each of the first seam texel and the second seam texel as seam texels to be repaired; for each seam texel to be repaired, according to the seam texel to be repaired and the seam texels that have a seam adjacent relationship with the seam texel to be repaired in the initial light map, determine the denoising reference area corresponding to the seam texel to be repaired in the initial light map; according to the denoising reference area The angle between the edge normal of each reference texel and the edge normal of the seam texel to be repaired is used to determine the lighting contribution parameter corresponding to the reference texel; according to the lighting contribution parameter corresponding to each reference texel and the lighting data recorded for each reference texel in the initial light map, the lighting data recorded for the seam texel to be repaired in the initial light map is subjected to denoising and repair processing to obtain a target light map; the initial three-dimensional mesh model is illuminated and rendered according to the target light map to obtain a target three-dimensional mesh model after the seam repair is performed on the initial three-dimensional mesh model.
[0202] In one embodiment, the repair module 1108 is also used to determine a first sampling range of the filter kernel used for noise reduction repair processing along the direction of the edge normal of the seam texel to be repaired; determine a second sampling range of the filter kernel along the direction of the edge normal of the adjacent seam texel; the adjacent seam texel is a seam texel that has a seam adjacent relationship with the seam texel to be repaired; based on the first sampling range and the second sampling range, determine the noise reduction reference area corresponding to the seam texel to be repaired in the initial light map.
[0203] In one embodiment, the repair module 1108 is further used to perform denoising and repair processing on the lighting data recorded for the seam texels to be repaired in the initial light map according to the lighting contribution parameters corresponding to each reference texel and the lighting data recorded for each reference texel in the initial light map, so as to obtain the denoised lighting data corresponding to the seam texels to be repaired; mix the denoised lighting data corresponding to the seam texels to be repaired with the lighting data before denoising, so as to obtain the mixed lighting data corresponding to the seam texels to be repaired; and write the mixed lighting data corresponding to each seam texel to be repaired back to the initial light map, so as to obtain the target light map.
[0204] In one embodiment, the repair module 1108 is also used to write the mixed lighting data corresponding to each seam texel to be repaired back to the initial light map to obtain a mixed light map; determine the secondary texels adjacent to the seam texels to be repaired from the mixed light map along the direction of the edge normal of the seam texels to be repaired; mix the lighting data recorded by the secondary texels in the mixed light map with the lighting data recorded by the adjacent seam texels in the mixed light map to obtain a target light map; the adjacent seam texels are seam texels that have a seam adjacent relationship with the seam texels to be repaired.
[0205] In one embodiment, the repair module 1108 is further used to perform denoising and repair processing on the lighting data recorded for the seam texels to be repaired in the initial light map according to the lighting contribution parameters corresponding to each reference texel and the lighting data recorded for each reference texel in the initial light map to obtain a denoised light map; for each seam texel to be repaired, determine from the denoised light map the unmapped texels adjacent to the seam texel to be repaired and having no lighting data recorded therein; fill the lighting data recorded in the denoised light map for the adjacent seam texels into the unmapped texels to obtain a target light map; the adjacent seam texels are seam texels that have a seam-adjacent relationship with the seam texels to be repaired.
[0206] In one embodiment, the repair module 1108 is also used to determine, for each reference texel in the denoising reference area, a first normal influence parameter according to the angle between the edge normal of the reference texel and the edge normal of the seam texel to be repaired; and determine the lighting contribution parameter corresponding to the reference texel according to at least one of the first normal influence parameter, the second normal influence parameter, the distance influence parameter and the brightness influence parameter; wherein the second normal influence parameter is used to characterize the degree of influence of the normal of the seam texel to be repaired in the three-dimensional virtual scene and the normal of the reference texel in the three-dimensional virtual scene on the lighting contribution; the distance influence parameter is used to characterize the degree of influence of the distance between the seam texel to be repaired and the reference texel in the three-dimensional virtual scene on the lighting contribution; and the brightness influence parameter is used to characterize the degree of influence of the brightness of the seam texel to be repaired and the brightness of the reference texel on the lighting contribution.
[0207] The above-mentioned model seam repair device, for each sampled texel of the initial three-dimensional mesh model in the three-dimensional virtual scene, constructs a ray emission area perpendicular to the normal direction of the sampled texel, takes a point in the ray emission area as the ray starting point, and constructs at least one ray with the opposite direction of the normal direction of the sampled texel as the ray direction, and determines the texels in the initial three-dimensional mesh model that intersect with each ray to obtain at least one candidate texel. If there is a spatially adjacent texel of the sampled texel in at least one candidate texel, the sampled texel can be quickly determined to be the first seam texel, and there is at least one spatially adjacent texel. From the at least one spatially adjacent texel, the second seam texel that has a seam adjacent relationship with the first seam texel can be quickly determined. Then, by quickly repairing the first seam texel and the second seam texel in the initial three-dimensional mesh model, the target three-dimensional mesh model after seam repair is obtained. Compared with the traditional method of searching for seam texels by traversing the model vertices one by one, the seam search method of the present application does not need to traverse the model vertices to search for seam texels, but rather constructs a ray emission area, and generates rays through the ray emission area to intersect with the initial three-dimensional mesh model to realize the search for seam texels, thereby improving the efficiency of searching for seam texels of the model. Furthermore, by repairing the first seam texel and the second seam texel that are quickly found, the efficiency of seam repair of the model can be improved.
[0208] Each module in the above-mentioned model seam repairing device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0209] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.12As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a model seam repair method is implemented.
[0210] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.13 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a model seam repair method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0211] Those skilled in the art will understand that Fig.12 and Fig.13The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0212] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0213] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0214] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0215] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0216] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0217] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0218] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A model seam repair method, It is characterized in that The method comprises: For each sampled texel of the initial three-dimensional mesh model in the three-dimensional virtual scene, construct a ray emission area perpendicular to the normal direction of the sampled texel; Taking a point in the ray emission area as a ray starting point, constructing at least one ray with the opposite direction of the normal direction of the sampled texel as the ray direction, and determining texels in the initial three-dimensional mesh model that intersect with each of the rays to obtain at least one candidate texel; If there is a spatially adjacent texel of the sampled texel in the at least one candidate texel, the sampled texel is determined to be a first seam texel; the number of the spatially adjacent texel is at least one; Determine, from at least one of the spatially adjacent texels, a second seam texel that is in a seam-adjacent relationship with the first seam texel; The first seam texel and the second seam texel in the initial three-dimensional mesh model are repaired to obtain a target three-dimensional mesh model after seam repair.
2. The method according to claim 1, It is characterized in that The method further comprises: For each texel in the initial three-dimensional mesh model, in the three-dimensional virtual scene, if there is an occluding mesh surface within a preset range along the normal direction of the texel, the texel is ignored; the occluding mesh surface is a mesh surface in the initial three-dimensional mesh model other than the mesh surface where the texel is located; Each of the texels that are not ignored in the initial three-dimensional mesh model is used as the sampling texel.
3. The method according to claim 1, It is characterized in that The step of determining the texels in the initial three-dimensional mesh model that intersect with each of the rays to obtain at least one candidate texel comprises: Determine the texels in the initial three-dimensional mesh model that intersect with each of the rays to obtain intersecting texels; For each of the intersecting texels, if the coordinates of the intersecting texel located in the plane grid model are discontinuous with the coordinates of the sampling texel located in the plane grid model, or the intersecting texel and the sampling texel are located in different initial three-dimensional grid models, then the intersecting texel is used as a candidate texel; The plane mesh model is a mesh model obtained by two-dimensionally flattening the initial three-dimensional mesh model.
4. The method according to claim 1, It is characterized in that The method further comprises: For each of the candidate texels, if a first mesh surface corresponding to the candidate texel and a second mesh surface corresponding to the sampling texel are continuous in the three-dimensional virtual scene, then determining that the candidate texel is a spatially adjacent texel of the sampling texel; The first mesh patch is the mesh patch where the candidate texel is located in the initial three-dimensional mesh model; the second mesh patch is the mesh patch where the sampling texel is located in the initial three-dimensional mesh model.
5. The method according to claim 1, It is characterized in that The determining, from at least one of the spatially adjacent texels, a second seam texel that is in a seam-adjacent relationship with the first seam texel comprises: Filtering the spatially adjacent texel that meets the target condition from at least one of the spatially adjacent texels according to at least one of the following: a lighting difference between the lighting conditions of the spatially adjacent texels and the lighting conditions of the first seam texel, a plane difference between a mesh surface patch where the spatially adjacent texels are located and a mesh surface patch where the first seam texel is located, a spatial distance between the spatially adjacent texels and the first seam texel in the three-dimensional virtual scene, and an intersection area between a coverage area of the spatially adjacent texels in the initial three-dimensional mesh model and a coverage area of the first seam texel in the initial three-dimensional mesh model; A second seam texel is determined from the screened spatially adjacent texels.
6. The method according to claim 5, It is characterized in that The step of selecting the spatially adjacent texel that meets the target condition from at least one of the spatially adjacent texels includes: When at least one of the spatially adjacent texels is screened according to the illumination difference between the illumination conditions of the spatially adjacent texels and the illumination conditions of the first seam texel, for each of the spatially adjacent texels, a normal angle between mesh patches corresponding to the spatially adjacent texel and the first seam texel is determined to obtain a first angle corresponding to the spatially adjacent texel; the first angle is positively correlated with the illumination difference; From at least one of the spatially adjacent texels, the spatially adjacent texels whose first angle is less than or equal to a preset angle are screened.
7. The method according to claim 5, It is characterized in that The step of selecting the spatially adjacent texel that meets the target condition from at least one of the spatially adjacent texels includes: When at least one of the spatially adjacent texels is screened according to a plane difference between a mesh patch where the spatially adjacent texel is located and a mesh patch where the first seam texel is located, a spatially adjacent texel that is in a patch coplanar relationship with the first seam texel is screened from the at least one spatially adjacent texel; The mesh patches corresponding to the screened spatially adjacent texels and the mesh patches corresponding to the first seam texels are located in the same plane.
8. The method according to claim 5, It is characterized in that The step of selecting the spatially adjacent texel that meets the target condition from at least one of the spatially adjacent texels includes: In the case where at least one of the spatially adjacent texels is screened according to the spatial distance between the spatially adjacent texels and the first seam texel in the three-dimensional virtual scene, the spatially adjacent texels whose spatial distance is less than or equal to a preset distance are screened from the at least one spatially adjacent texel; Wherein, the preset distance is less than or equal to the texel radius of the first seam texel.
9. The method according to claim 5, It is characterized in that The step of selecting the spatially adjacent texel that meets the target condition from at least one of the spatially adjacent texels includes: In the case where at least one of the spatially adjacent texels is screened according to the intersection area of the coverage area of the spatially adjacent texels in the initial three-dimensional mesh model and the coverage area of the first seam texel in the initial three-dimensional mesh model, for each of the spatially adjacent texels, an angle between a texel vector and a reverse edge normal vector corresponding to the first seam texel is determined to obtain a second angle corresponding to the spatially adjacent texel; the texel vector is a vector pointing from the first seam texel to the spatially adjacent texel; and the reverse edge normal vector is in the opposite direction to the edge normal of the first seam texel; Selecting the spatially adjacent texel having the smallest second angle from at least one of the spatially adjacent texels; The size of the second angle is negatively correlated with the size of the intersection area.
10. The method according to claim 1, It is characterized in that The initial three-dimensional mesh model has a corresponding initial light map; the repairing of the first seam texel and the second seam texel in the initial three-dimensional mesh model to obtain a target three-dimensional mesh model after seam repair includes: Determine, from the initial light map, a texel mapped to each of the first seam texel and the second seam texel as a seam texel to be repaired; for each seam texel to be repaired, determine a denoising reference area corresponding to the seam texel to be repaired in the initial light map according to the seam texel to be repaired and the seam texels in the initial light map that have the seam adjacent relationship with the seam texel to be repaired; Determining, according to the angle between the edge normal of each reference texel in the denoising reference area and the edge normal of the seam texel to be repaired, a lighting contribution parameter corresponding to the reference texel; According to the illumination contribution parameters corresponding to the reference texels and the illumination data recorded for the reference texels in the initial light map, the illumination data recorded for the seam texels to be repaired in the initial light map are subjected to denoising and repair processing to obtain a target light map; The initial three-dimensional mesh model is subjected to illumination rendering according to the target illumination map to obtain a target three-dimensional mesh model after seam repair is performed on the initial three-dimensional mesh model.
11. The method according to claim 10, It is characterized in that The determining, according to the seam texel to be repaired and the seam texel in the initial light map that has the seam adjacent relationship with the seam texel to be repaired, a denoising reference area corresponding to the seam texel to be repaired in the initial light map, comprises: Determine a first sampling range of a filter kernel for denoising and repairing processing along the direction of the edge normal of the seam texel to be repaired; Determining a second sampling range of the filter kernel along the direction of the edge normal of the adjacent seam texels; the adjacent seam texels are seam texels that have the seam adjacent relationship with the seam texels to be repaired; A denoising reference area corresponding to the seam texel to be repaired in the initial light map is determined according to the first sampling range and the second sampling range.
12. The method according to claim 10, It is characterized in that The step of performing noise reduction and repair processing on the illumination data recorded for the seam texels to be repaired in the initial light map according to the illumination contribution parameters corresponding to the reference texels and the illumination data recorded for the reference texels in the initial light map to obtain a target light map includes: According to the illumination contribution parameter corresponding to each of the reference texels and the illumination data recorded for each of the reference texels in the initial light map, the illumination data recorded for the seam texels to be repaired in the initial light map is subjected to denoising and repair processing to obtain denoised illumination data corresponding to the seam texels to be repaired; Mixing the illumination data after denoising corresponding to the seam texel to be repaired with the illumination data before denoising to obtain mixed illumination data corresponding to the seam texel to be repaired; The mixed illumination data corresponding to each of the seam texels to be repaired are written back to the initial illumination map to obtain a target illumination map.
13. The method according to claim 12, It is characterized in that The step of writing the mixed illumination data corresponding to each of the seam texels to be repaired back to the initial illumination map to obtain a target illumination map comprises: Writing the mixed illumination data corresponding to each of the seam texels to be repaired back into the initial illumination map to obtain a mixed illumination map; Determine, from the mixed light map, a secondary texel adjacent to the seam texel to be repaired along the direction of the edge normal of the seam texel to be repaired; The lighting data recorded by the secondary texel in the mixed light map is mixed with the lighting data recorded by the adjacent seam texel in the mixed light map to obtain a target light map; the adjacent seam texel is a seam texel that has the seam adjacent relationship with the seam texel to be repaired.
14. The method according to claim 10, It is characterized in that The step of performing noise reduction and repair processing on the illumination data recorded for the seam texels to be repaired in the initial light map according to the illumination contribution parameters corresponding to the reference texels and the illumination data recorded for the reference texels in the initial light map to obtain a target light map includes: According to the illumination contribution parameters corresponding to the reference texels and the illumination data recorded for the reference texels in the initial light map, the illumination data recorded for the seam texels to be repaired in the initial light map are subjected to denoising and repair processing to obtain a denoised light map; For each of the seam texels to be repaired, determining from the denoised light map an unmapped texel adjacent to the seam texel to be repaired and having no lighting data recorded therein; The lighting data recorded in the adjacent seam texels in the denoised light map are filled into the unmapped texels to obtain a target light map; the adjacent seam texels are seam texels that have the seam adjacent relationship with the seam texels to be repaired.
15. The method according to claim 10, It is characterized in that The step of determining the illumination contribution parameter corresponding to the reference texel according to the angle between the edge normal of each reference texel in the denoising reference area and the edge normal of the seam texel to be repaired comprises: For each reference texel in the denoising reference area, determining a first normal influence parameter according to an angle between an edge normal of the reference texel and an edge normal of the seam texel to be repaired; Determining a lighting contribution parameter corresponding to the reference texel according to at least one of the first normal influencing parameter, the second normal influencing parameter, the distance influencing parameter, and the brightness influencing parameter; The second normal influence parameter is used to characterize the influence of the normal of the seam texel to be repaired in the three-dimensional virtual scene and the normal of the reference texel in the three-dimensional virtual scene on the illumination contribution; The distance influence parameter is used to characterize the influence degree of the distance between the seam texel to be repaired and the reference texel in the three-dimensional virtual scene on the illumination contribution; The brightness impact parameter is used to characterize the degree of influence of the brightness of the seam texel to be repaired and the brightness of the reference texel on the illumination contribution.
16. A model seam repair device, It is characterized in that The device comprises: A construction module, for constructing, for each sampled texel of the initial three-dimensional mesh model in the three-dimensional virtual scene, a ray emission area perpendicular to the normal direction of the sampled texel; A determination module, configured to construct at least one ray with a point in the ray emission area as a ray starting point and a direction opposite to the normal direction of the sampled texel as a ray direction, and determine texels in the initial three-dimensional mesh model intersecting with each ray to obtain at least one candidate texel; A determination module, configured to determine that the sampled texel is a first seam texel if there is a spatially adjacent texel of the sampled texel in the at least one candidate texel; the number of the spatially adjacent texel is at least one; The determining module is further configured to determine, from at least one of the spatially adjacent texels, a second seam texel that is in a seam-adjacent relationship with the first seam texel; A repair module is used to repair the first seam texel and the second seam texel in the initial three-dimensional mesh model to obtain a target three-dimensional mesh model after seam repair.
17. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 15 are implemented.
18. A computer-readable storage medium storing a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 15 are implemented.
19. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 15 are implemented.
Citation Information
Cited By
Model SEAM repairing method and apparatus, and device and medium
EP4641509A1
