Model seam repairing method and apparatus, and device and medium
By constructing the ray emission area and determining the seam striatum, the problem of low seam striatum search caused by lighting maps in three-dimensional virtual scenes is solved, efficient seam repair is achieved, and the rendering quality of the model is improved.
Patent Information
- Application Number
- PCT/CN2024/083202
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-30
- Filing Date
- 2024-03-22
- Publication Date
- 2024-12-05
AI Technical Summary
In three-dimensional virtual scenes, when lighting rendering is performed based on light maps, the search efficiency of model seam texture is low, especially in open big world scenes, resulting in inefficient seam repair of model.
By constructing a ray emission area perpendicular to the normal direction of the sampling martin, the martin where the ray intersects with the initial three-dimensional grid model is determined, and the martin where the martin intersects with the initial three-dimensional grid model is determined, and the martin where the seam relationship exists is determined from the adjacent martin. Carry out repairs to improve the search and repair efficiency of seam strands.
It improves the search efficiency and repair efficiency of model seam texture, reduces the rendering time of the three-dimensional mesh model, and improves the rendering quality.
Smart Images

Figure CN2024083202_05122024_PF_FP_ABST
Abstract
Description
Model joint repair method, device, equipment and medium
[0001] Related applications
[0002] This application claims priority to Chinese patent application number 2023106263156, filed on May 30, 2023, entitled “Model Seam Repair Method, Device, Equipment and Medium,” which is hereby incorporated by reference in its entirety. Technical Field
[0003] The present application relates to lighting rendering technology, and in particular to a model seam repair method, device, equipment and medium. Background Art
[0004] 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 light maps instead of real-time lighting calculations can reduce resource consumption, thereby improving the efficiency of scene operation. For example, in the field of gaming, when rendering virtual object models in a game scene, 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.
[0005] In traditional technology, the method of traversing the model vertices one by one is used to search for texels that may cause seams in the model. The efficiency of searching for seam texels is low, especially for open large-scale world scenes. The problem of low efficiency of searching for seam texels is particularly prominent, resulting in low efficiency of seam repair for the model.
[0006] Summary of the Invention
[0007] The present application provides a model seam repair method, device, equipment and medium.
[0008] In a first aspect, the present application provides a model seam repair method, the method comprising:
[0009] Determine sampling texels obtained by sampling texels of an initial three-dimensional mesh model in a three-dimensional virtual scene, and construct, for each of the sampling texels, a ray emission region perpendicular to the normal direction of the sampling texel;
[0010] constructing 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 determining a texel in the initial three-dimensional mesh model that intersects with any ray of the at least one ray to obtain at least one candidate texel;
[0011] If at least one spatially adjacent texel of the sampled texel exists in the at least one candidate texel, determining that the sampled texel is a first seam texel;
[0012] 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;
[0013] 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.
[0014] In a second aspect, the present application provides a model seam repair device, the device comprising:
[0015] A construction module is configured to determine sampled texels obtained by sampling texels of an initial three-dimensional mesh model in a three-dimensional virtual scene, and construct, for each sampled texel, a ray emission region perpendicular to a normal direction of the sampled texel;
[0016] 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 a normal direction of the sampled texel as a ray direction, and determine a texel in the initial three-dimensional mesh model that intersects with any ray of the at least one ray to obtain at least one candidate texel;
[0017] a determination module, configured to determine that the sampled texel is a first seam texel if at least one spatially adjacent texel of the sampled texel exists in the at least one candidate texel;
[0018] 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;
[0019] 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.
[0020] 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.
[0021] 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 various method embodiments of the present application.
[0022] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps in the various method embodiments of the present application when the computer program is executed by a processor.
[0023] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without any creative work.
[0025] FIG1 is a diagram showing an application environment of a model seam repair method according to an embodiment;
[0026] FIG2 is a schematic flow chart of a model seam repair method according to an embodiment;
[0027] FIG3 is a schematic diagram of the construction of a ray emission area in one embodiment;
[0028] FIG4 is a schematic diagram of a search process for a first seam texel and a second seam texel in one embodiment;
[0029] FIG5 is a schematic diagram of a process for determining a denoising reference area corresponding to a seam texel to be repaired in one embodiment;
[0030] FIG6 is a schematic diagram of a process for determining a denoising reference area corresponding to a seam texel to be repaired in another embodiment;
[0031] FIG7 is a schematic diagram of a parameter configuration interface for model seam repair in one embodiment;
[0032] FIG8 is a schematic diagram showing a comparison of seam repair before and after repair of a single model in one embodiment;
[0033] FIG9 is a schematic diagram showing a comparison of seam repair before and after for multiple models in one embodiment;
[0034] FIG10 is a schematic flow chart of a model seam repair method according to another embodiment;
[0035] FIG11 is a structural block diagram of a model seam repair device according to one embodiment;
[0036] FIG12 is a diagram showing the internal structure of a computer device according to one embodiment;
[0037] FIG13 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0039] The model seam repair method provided in this application can be applied in the application environment shown in Figure 1. Terminal 102 communicates with server 104 via a network. A data storage system can be separately provided to store data that server 104 needs to process. The data storage system can be integrated with server 104 or placed in the cloud or on another server. Terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart car devices, etc. Portable wearable devices can include smart watches, smart bracelets, head-mounted devices, etc. Server 104 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides network security services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, cloud security, host security, CDN, and basic cloud computing services such as big data and artificial intelligence platforms. Terminal 102 and server 104 can be connected directly or indirectly via wired or wireless communication, which is not limited in this application.
[0040] For each sampled texel in the initial 3D mesh model of the 3D virtual scene, the server 104 may construct a ray-launching region perpendicular to the normal direction of the sampled texel. Using a point in the ray-launching region as the ray-starting point, the server 104 constructs at least one ray with a direction opposite to the normal direction of the sampled texel. The server 104 then determines which texel in the initial 3D mesh model intersects with any of the at least one ray, obtaining at least one candidate texel. If at least one candidate texel has at least one spatially adjacent texel to the sampled texel, the server 104 may determine that the sampled texel is a first seam texel. The server 104 may then determine, from the at least one spatially adjacent texel, a second seam texel that is seam-adjacent to the first seam texel. The server 104 may then repair the first and second seam texels in the initial 3D mesh model to obtain a target 3D mesh model after seam repair.
[0041] It is understood that the server 104 can send the target 3D mesh model after seam repair to the terminal 102 for display. This embodiment does not limit this. It is understood that the application scenario in FIG1 is only for illustration and is not limited thereto.
[0042] In one embodiment, as shown in FIG2 , 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 independently by the terminal or server itself, or through interaction between the terminal and the server. This embodiment uses the method applied to a computer device as an example to illustrate the method, and includes the following steps:
[0043] Step 202 : determining sampling texels obtained by sampling texels of an initial three-dimensional mesh model in a three-dimensional virtual scene, and constructing a ray emission region perpendicular to the normal direction of the sampling texel for each sampling texel.
[0044] A 3D virtual scene is a virtual scene located in a three-dimensional space. For example, a 3D virtual scene can 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. A 3D mesh model is a mesh model located in a 3D virtual scene. It is understood that a mesh model is a virtual model comprising at least one mesh facet. A mesh facet is a unit facet in a meshed mesh model. It is understood that a mesh facet can be a facet having a polygonal shape. For example, a mesh facet can be a triangular mesh facet or a quadrilateral mesh facet, which is not limited in this embodiment. An initial 3D mesh model is a 3D mesh model before seam repair is performed. It is understood that the initial 3D mesh model is the 3D mesh model to be repaired. Seams may exist on the initial 3D mesh model, and in such cases, the rendering quality of the initial 3D mesh model is low. A sampled texel is a texel sampled from the initial 3D mesh model. The normal direction of a 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 can be an area constructed by moving a preset distance from the sampling texel along the direction of the normal vector of the sampling texel. The plane where the ray emission area is located is perpendicular to the direction of the normal vector of the sampling texel.
[0045] Specifically, the 3D virtual scene includes at least one initial 3D mesh model, the initial 3D mesh model includes at least one mesh patch, and each mesh patch includes multiple texels. A computer device may sample texels in the initial 3D mesh model to obtain sampled texels. For each sampled texel, the computer device may move a preset distance in the direction of the normal vector of the sampled texel and construct a ray emission region perpendicular to the normal direction of the sampled texel at a position at the preset distance from the sampled texel.
[0046] In one embodiment, the initial three-dimensional mesh model includes at least one mesh patch consisting of multiple edges, each mesh patch including multiple texels. The computer device may sample texels on each edge of the mesh patch of the initial three-dimensional mesh model to obtain sampled texels. Since the two-dimensional flattening of the initial three-dimensional mesh model to obtain a planar mesh model is performed based on the mesh vertices in the mesh patch, 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 located on the edges of the mesh patch. It will be understood that the light map can be obtained by recording illumination data generated by illumination calculations for each texel in the planar mesh model. By sampling texels on each edge of the mesh patch of the initial three-dimensional mesh model to obtain sampled texels and performing subsequent seam texel searches based on the sampled texels, the accuracy of seam texel searches can be further improved.
[0047] In one embodiment, the computer device may randomly sample each texel in the initial three-dimensional mesh model to obtain sampled texels.
[0048] In one embodiment, for each sampled texel, the computer device may use the texel radius of the sampled texel as a preset distance, the texel radius of the sampled texel as a movement distance, and move along the direction of the normal vector of the sampled texel. When the movement distance reaches the distance corresponding to the texel radius of the sampled texel, the computer device may stop moving. At the position where the movement stops, the computer device may diffuse the sampled texel in the tangent plane space corresponding to the sampled texel with the sampled texel as the center point, thereby constructing a ray emission area perpendicular to the normal direction of the sampled texel.
[0049] In one embodiment, for each sampling texel, the computer device may, at the position where the movement is stopped, diffuse to the surrounding areas in the cross-section space corresponding to the sampling texel with the sampling texel as the center point and the texel radius of the sampling texel as the offset to construct a ray emission area perpendicular to the normal direction of the sampling texel.
[0050] In one embodiment, as shown in FIG3 , a 3D virtual scene includes at least one initial 3D mesh model 301, which includes at least one mesh patch 302. In this embodiment, mesh patch 302 is a triangular mesh patch. For each sampled texel A in initial 3D mesh model 301, a computer device may move a predetermined distance from sampled texel A in the direction of the normal vector of sampled texel A and construct a ray emission region 303 perpendicular to the normal direction of sampled texel A at a position at the predetermined distance from sampled texel A.
[0051] In step 204, 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 in the initial three-dimensional mesh model that intersect with any ray in the at least one ray are determined to obtain at least one candidate texel.
[0052] Specifically, the ray emission region includes multiple points. The computer device may use a point in the ray emission region that meets the target condition as the ray starting point and construct at least one ray with the direction opposite to the normal direction of the sampled texel as the ray direction. Furthermore, the computer device may determine at least one texel in the initial three-dimensional mesh model that intersects with each ray, thereby obtaining at least one candidate texel.
[0053] In one embodiment, the computer device may determine texels in the initial three-dimensional mesh model that intersect with any of the at least one ray, obtain intersecting texels, and directly use each of the obtained intersecting texels as a candidate texel. The intersecting texel is a texel in the initial three-dimensional mesh model that intersects with any of the at least one ray.
[0054] 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.
[0055] In one embodiment, referring again to FIG. 3 , the computer device may construct at least one ray with a point in the ray emission region 303 that meets the target condition as the ray starting point and a direction opposite to the normal direction of the sampled texel A as the ray direction. Furthermore, the computer device may determine at least one texel in the initial three-dimensional mesh model 301 that intersects with each ray, thereby obtaining at least one candidate texel.
[0056] Step 206 : If at least one candidate texel has at least one spatially adjacent texel to the sampled texel, determine that the sampled texel is a first seam texel.
[0057] The term "spatially adjacent texels" refers to texels adjacent to the sampled texel in the 3D virtual scene. It is understood that the 3D virtual scene is located in a 3D world space. Therefore, texels adjacent to the sampled texel in the 3D virtual scene are also texels adjacent to the sampled texel in world space. A seam texel is a texel that causes a seam effect to appear in the initial 3D mesh model. If a sampled texel has at least one spatially adjacent texel, the sampled texel can be determined to be a seam texel, resulting in a first seam texel. It is understood that if a sampled texel has at least one spatially adjacent texel, the sampled texel can be directly determined to be the first seam texel.
[0058] 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 neighboring texel of the sampled texel. If at least one spatially neighboring texel of the sampled texel exists among each candidate texel, the computer device may determine that the sampled texel is a first seam texel.
[0059] 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 a preset spatial distance, it indicates that there is a spatially adjacent texel of the sampling texel among the candidate texels, and the computer device may determine that the sampling texel is a first seam texel. It is understood that the computer device may regard the candidate texels whose spatial distance is less than the preset spatial distance as spatially adjacent texels of the sampling texel.
[0060] 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.
[0061] The second seam texel is a spatially adjacent texel in a seam-adjacent relationship with the first seam texel. The first seam texel and the second seam texel are in a seam-adjacent relationship. It is understood that the first seam texel and the second seam texel can form a texel pair, which can cause a seam effect to appear in the initial three-dimensional mesh model. It is understood that the first seam texel and the second seam texel in the texel pair are respectively located on either side of the seam of the initial three-dimensional mesh model.
[0062] 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.
[0063] Step 210 : 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.
[0064] The target 3D mesh model is the 3D mesh model obtained by repairing the seams of the initial 3D mesh model. As can be appreciated, the initial 3D mesh model has seam effects, resulting in lower rendering quality. Repairing the seams of the initial 3D mesh model results in a target 3D mesh model without seams, improving rendering quality.
[0065] Specifically, the computer device may obtain illumination data recorded for a first seam texel in the initial 3D mesh model, and illumination data recorded for a second seam texel in the initial 3D mesh model. It will be appreciated that the illumination data recorded for the first seam texel and the illumination data recorded for the second seam texel differ significantly, resulting in a seam effect in the initial 3D 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 a target 3D mesh model after seam repair. Illumination data describes illumination and may describe the color and intensity of illumination. Accordingly, the illumination data may include color values and brightness values. Illumination differences may include color value differences and brightness value differences.
[0066] In one embodiment, a computer device may determine texels adjacent to a first seam texel in an initial three-dimensional mesh model, and determine texels adjacent to a second seam texel in the initial three-dimensional mesh model. The computer device may obtain illumination data recorded for texels adjacent to the first seam texel, and obtain illumination data recorded for texels adjacent to the second seam texel. Furthermore, the computer device may perform noise reduction on the illumination data recorded for the first seam texel with reference to the illumination data recorded for texels adjacent to the first seam texel, and perform noise reduction on the illumination data recorded for the second seam texel with reference to the illumination data recorded for texels adjacent to the second seam texel, thereby repairing the first seam texel and the second seam texel, and obtaining a target three-dimensional mesh model after seam repair.
[0067] In the above-mentioned model seam repair method, for each sampled texel in the initial 3D mesh model of the 3D virtual scene, a ray emission region perpendicular to the normal direction of the sampled texel is constructed. A ray is then constructed with a point in the ray emission region as the ray starting point and the direction opposite to the normal direction of the sampled texel as the ray direction. Texels in the initial 3D mesh model that intersect with any of the at least one ray are then determined to obtain at least one candidate texel. If at least one candidate texel contains at least one spatially adjacent texel to the sampled texel, the sampled texel can be quickly determined to be a first seam texel. From the at least one spatially adjacent texel, a second seam texel that is seam-adjacent to the first seam texel can be quickly determined. Then, by quickly repairing the first and second seam texels in the initial 3D mesh model, a target 3D mesh model with the seams repaired is obtained. Compared to the traditional method of searching for seam texels by traversing model vertices one by one, the seam search method of this application does not require traversing model vertices to search for seam texels. Instead, it constructs a ray emission region and generates rays from the ray emission region to intersect with the initial three-dimensional mesh model to search for seam texels, thereby improving the efficiency of seam texel search in the model. Furthermore, by repairing the first and second seam texels that are quickly found, the efficiency of model seam repair can be improved.
[0068] In one embodiment, determining the sampling texels obtained by sampling texels of an initial three-dimensional mesh model in a three-dimensional virtual scene 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 from 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 in the initial three-dimensional mesh model that is not ignored is used as a sampling texel.
[0069] Texel, short for texture element, is the basic unit in computer graphics texture space. It can be understood that textures are represented by arrangements of texels. For each texel in the initial 3D mesh model, the occlusion mesh patch corresponding to that texel is the mesh patch in the initial 3D mesh model that blocks the illumination of that texel, excluding the mesh patch in which the texel is located.
[0070] Specifically, 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 starting from the texel, it means that the illumination of the texel may be blocked by the occluding mesh surface, and the illumination data corresponding to the blocked texel is also quite different from the illumination data corresponding to its adjacent texels. At this time, the computer device can ignore the blocked 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 blocked texels, which means that the computer device will automatically skip these blocked texels when sampling the texels in the initial three-dimensional mesh model, that is, the computer device will not sample the blocked texels.
[0071] In one embodiment, the 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 one 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 can represent the size of the area covered by the texel in the initial three-dimensional mesh model, by ignoring texels with occluding mesh surfaces within one texel radius, the accuracy of finding seam texels can be further improved.
[0072] In the above embodiment, for each texel in the initial 3D mesh model, the presence of occluding mesh patches surrounding the texel is determined. If an occluding mesh patch exists, it indicates that the texel is obscured by the surrounding occluding mesh patches. Because the illumination data corresponding to an obscured texel differs significantly from the illumination data corresponding to its neighboring texels, the accuracy of finding seam texels can be improved by using unobstructed texels in the initial 3D mesh model as sampling texels for subsequent seam texel searches.
[0073] In one embodiment, determining a texel in an initial three-dimensional mesh model that intersects with any one of at least one ray to obtain at least one candidate texel includes: determining a texel in the initial three-dimensional mesh model that intersects with any one of at least one ray to obtain an intersecting texel; 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.
[0074] The intersecting texels are texels in the initial three-dimensional mesh model that intersect with each ray. The plane mesh model is a mesh model that is two-dimensionally flattened from 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.
[0075] Specifically, the computer device may identify texels in the initial 3D mesh model that intersect with each ray as intersecting texels. It is understood that there is at least one intersecting texel. The computer device may unfold the initial 3D mesh model in two-dimensional space to obtain a planar mesh model that is a two-dimensional flattening of the initial 3D mesh model. It is understood that each texel in the initial 3D mesh model has a mapping relationship with each texel in the planar mesh model. For each intersecting texel, the computer device may obtain the coordinates of the intersecting texel in the planar mesh model and the coordinates of the sampled texel in the planar mesh model. The number of initial 3D mesh models in the initial 3D mesh model is at least one. If the coordinates of the intersecting texel in the planar mesh model are discontinuous with the coordinates of the sampled texel in the planar mesh model, or if the intersecting texel and the sampled texel are located in different initial 3D mesh models, this may indicate that the intersecting texel is a potential seam texel, i.e., the intersecting texel may be a texel that causes a seam in the model, and the computer device may identify the intersecting texel as a candidate texel.
[0076] In the above embodiment, for each intersecting texel, if the coordinates of the intersecting texel located in the plane grid model are discontinuous with the coordinates of the sampled texel located in the plane grid model, or the intersecting texel and the sampled texel are located in different initial three-dimensional grid models, it can be indicated 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 using the potential seam texels obtained through the preliminary screening as candidate texels, and then further screening out the true seam texels from the candidate texels obtained through the preliminary screening, the efficiency of searching for seam texels can be further improved.
[0077] In one embodiment, the method also includes: for each candidate 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, then the candidate texel is determined to be a spatially adjacent texel of the sampling texel; wherein the first grid patch is the grid patch where the candidate texel is located in the initial three-dimensional grid model; the second grid patch is the grid patch where the sampling texel is located in the initial three-dimensional grid model.
[0078] Specifically, for each candidate texel, the computer device may determine whether a first mesh patch in which the candidate texel is located is continuous with a second mesh patch in which the sampled texel is located in the three-dimensional virtual scene. If the first mesh patch corresponding to the candidate texel is continuous with the second mesh patch corresponding to the sampled texel in the three-dimensional virtual scene, the computer device may determine that the candidate texel is a spatially adjacent texel of the sampled texel.
[0079] 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.
[0080] 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 the offset corresponding to the previous round as the offset of this round, and diffuse the offset corresponding to this round to the surrounding area in the cross-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 is a texel that intersects with the sampled texel itself among the candidate texels obtained based on the ray emission area newly constructed in this round, the candidate texel obtained based on the ray emission area newly constructed in the previous round is used as the spatially adjacent texel of the sampled texel.
[0081] In one embodiment, a mesh patch includes multiple mesh vertices. If a first mesh patch where the candidate texel is located and a second mesh patch where the sampling texel is located have at least one identical mesh vertex, the computer device can determine whether the first mesh patch and the second mesh patch are continuous in the three-dimensional virtual scene.
[0082] 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, by judging 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 then judging whether the candidate texel is a spatially adjacent texel of the sampling texel based on the judgment result, the judgment accuracy of spatially adjacent texels can be improved.
[0083] 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 data of the spatially adjacent texel and the illumination data 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, or 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.
[0084] Among them, the specific data according to which spatially adjacent texels that meet the target conditions are screened from at least one spatially adjacent texel can be pre-specified, and can be specifically specified in a configuration file or solidified in an algorithm code, so that according to the logic solidified in the configuration file or the algorithm code, according to at least one of the aforementioned lighting differences, plane differences, spatial distances or intersection areas, spatially adjacent texels that meet the target conditions are screened from at least one spatially adjacent texel; and the second seam texel is determined from the screened spatially adjacent texels.
[0085] Specifically, the computer device may screen spatially adjacent texels that meet the target condition from at least one of the following: a lighting difference between lighting data of each spatially adjacent texel and lighting data of the first seam texel; a planar difference between the mesh patch where the spatially adjacent texel is located and the mesh patch where the first seam texel is located (i.e., whether the mesh patch where the spatially adjacent texel is located and the mesh patch where the first seam texel is located are located on the same plane); a 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; or an intersection area between 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. The computer device may then determine the second seam texel from the screened spatially adjacent texels.
[0086] In one embodiment, the computer device may first select spatially adjacent texels that meet target criteria from at least one spatially adjacent texel based on the illumination difference between the illumination data of each spatially adjacent texel and the illumination data of the first seam texel. Furthermore, the computer device may select spatially adjacent texels that meet target criteria from the spatially adjacent texels selected based on illumination difference based on the planar difference between the mesh patch where the spatially adjacent texel is located and the mesh patch where the first seam texel is located. Furthermore, the computer device may select spatially adjacent texels that meet target criteria from the spatially adjacent texels selected based on planar difference based on 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 spatial distance as the second seam texel based on the intersection area between 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.
[0087] In the above embodiment, spatially adjacent texels that meet target conditions are screened from at least one spatially adjacent texel using at least one screening method selected from among illumination differences, plane differences, spatial distances, and intersection areas. This improves the accuracy of screening for some spatially adjacent texels. Furthermore, by determining a second seam texel from the relatively accurate screened spatially adjacent texels, the accuracy of screening for the second seam texel can be improved.
[0088] 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 data of the spatially adjacent texel and the illumination data 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.
[0089] The "normal angle" refers to the angle between the normals of the mesh patches corresponding to spatially adjacent texels and the normal of the mesh patch corresponding to the first seam texel. The "first angle" is the angle between the normals of the mesh patches corresponding to the spatially adjacent texels and the first seam texel. The first angle is positively correlated with illumination difference. As can be understood, the larger the first angle, the greater the illumination difference between the illumination data of the spatially adjacent texels and the illumination data of the first seam texel. The smaller the first angle, the smaller the illumination difference between the illumination data of the spatially adjacent texels and the illumination data of the first seam texel.
[0090] In one embodiment, when screening at least one spatially adjacent texel based on the illumination difference between the illumination data of the spatially adjacent texel and the illumination data of the first seam texel, the computer device may determine, for each spatially adjacent texel, 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, and use this angle as the first angle corresponding to the spatially adjacent texel. It will be appreciated that the first angle is positively correlated with the illumination difference. The computer device may then screen, from the at least one spatially adjacent texel, those spatially adjacent texels whose first angle is less than or equal to a predetermined angle. It will be appreciated that the computer device may screen, from the at least one spatially adjacent texel, those spatially adjacent texels whose illumination difference is smaller.
[0091] 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 with smaller illumination differences, thereby improving the search accuracy of the second seam texels.
[0092] 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 planar difference between the grid patch where the spatially adjacent texel is located and the grid patch where the first seam texel is located, screening out spatially adjacent texels that have a coplanar relationship with the first seam texel from at least one spatially adjacent texel; wherein the grid patch corresponding to the screened spatially adjacent texel and the grid patch corresponding to the first seam texel are located in the same plane.
[0093] Here, a patch coplanar relationship means that the mesh patches of the two seam texels are located on the same plane. It can be understood that by selecting spatially adjacent texels that are in a patch coplanar relationship with the first seam texel from at least one spatially adjacent texel, spatially adjacent texels that are not in a superimposed relationship can be selected. For example, this can prevent decorative items such as belts from floating above the surface of clothing, thereby being mistaken for seams.
[0094] Specifically, when screening at least one spatially adjacent texel based on the planar 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. The computer device can then screen, from the at least one spatially adjacent texel, for spatially adjacent texels that have a patch coplanar relationship with the first seam texel. It will be understood that the mesh patches corresponding to the spatially adjacent texels screened based on the planar difference and the mesh patches corresponding to the first seam texel are located in the same plane.
[0095] 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 a projected line segment corresponding to the spatially adjacent texel. Furthermore, the computer device may determine that the spatially adjacent texel corresponding to the projected line segment whose length is less than or equal to a preset length is a spatially adjacent texel that is in a patch-coplanar relationship with the first seam texel.
[0096] In the above embodiment, when spatially adjacent texels that meet the target criteria are screened based on planar differences, since spatially adjacent texels that are patch-coplanar with the first seam texel must not have an overlapping relationship with the first seam texel, by screening spatially adjacent texels that are patch-coplanar with the first seam texel from at least one spatially adjacent texel, spatially adjacent texels that are not in an overlapping relationship can be screened out, thereby improving the accuracy of searching for the second seam texel.
[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 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.
[0098] Specifically, when selecting 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, 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. Furthermore, the computer device may select, from the at least one spatially adjacent texel, spatially adjacent texels whose spatial distance is less than or equal to a preset distance.
[0099] In the above embodiment, when spatially adjacent texels meeting the target criteria are screened based on spatial distance, if the spatial distance between two texels is too large, it indicates that the areas covered by the two texels are discontinuous in the three-dimensional virtual space. Therefore, by screening spatially adjacent texels whose spatial distance is less than or equal to a predetermined distance from at least one spatially adjacent texel, spatially adjacent texels whose coverage areas in the three-dimensional virtual space are continuous with the coverage area of the first seam texel can be screened, thereby improving the accuracy of searching for the second seam texel.
[0100] In one embodiment, spatially adjacent texels that meet target conditions are screened out from at least one spatially adjacent texel, including: when 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 the spatially adjacent texel with the smallest second angle is screened out from at least one spatially adjacent texel; wherein the size of the second angle is negatively correlated with the size of the intersection area.
[0101] The edge normal of a texel is the direction vector of the perpendicular line between the edge of the texel and the opposite mesh vertex in the mesh patch. The direction of the texel edge normal points from the texel edge 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 of the first seam texel and the opposite mesh vertex in the mesh patch.
[0102] In one embodiment, when selecting at least one spatially adjacent texel based on the intersection area between the coverage area of the spatially adjacent texel in the initial 3D mesh model and the coverage area of the first seam texel in the initial 3D mesh model, for each spatially adjacent texel, the computer device may use a vector pointing from the first seam texel to the spatially adjacent texel as the texel vector, and a vector pointing in the opposite direction of 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 a second angle corresponding to the spatially adjacent texel. The magnitude of the second angle is negatively correlated with the magnitude of the intersection area; that is, the smaller the second angle, the larger the intersection area between the coverage area of the spatially adjacent texel in the initial 3D mesh model and the coverage area of the first seam texel in the initial 3D mesh model, and the larger the second angle, the smaller the intersection area between the coverage area of the spatially adjacent texel in the initial 3D mesh model and the coverage area of the first seam texel in the initial 3D mesh model. The computer device may then select the spatially adjacent texel with the smallest second angle from the 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.
[0103] In the above embodiment, when spatially adjacent texels that meet the target condition are selected based on the intersection area, since the size of the second angle is negatively correlated with the size of the intersection area, by selecting the spatially adjacent texel with the smallest second angle from at least one spatially adjacent texel, the spatially adjacent texel with the largest intersection area can be selected, thereby improving the accuracy of searching for the second seam texel.
[0104] In one embodiment, as shown in FIG4 , a computer device may perform self-occlusion determination on each texel in the initial 3D mesh model. Specifically, for each texel in the initial 3D mesh model, if an occluding mesh patch exists within a preset range along the texel's normal from the texel in the 3D virtual scene, the texel is ignored, and each texel in the initial 3D mesh model that is not ignored is used as a sampling texel. For each sampling texel in the initial 3D mesh model in the 3D virtual scene, the computer device may construct a ray emission region perpendicular to the normal direction of the sampling texel, construct at least one ray (i.e., a ray bundle) with a point in the ray emission region as the ray starting point and a direction opposite to the normal direction of the sampling texel as the ray direction, and determine the texels in the initial 3D mesh model that intersect with any of the at least one ray to obtain at least one candidate texel. A world space neighboring discriminator is used to determine whether the sampling texel has any spatially adjacent texels. If at least one candidate texel has at least one spatially adjacent texel of the sampling texel, the sampling texel is determined to be a first seam texel. Furthermore, the computer device may use a normal angle discriminator, a same-plane discriminator, a spatial distance discriminator, and an edge normal discriminator to determine, from the spatially adjacent texels, a second seam texel that is in a seam-adjacent relationship with the first seam texel. Specifically, first, the computer device may use the normal angle discriminator to filter out spatially adjacent texels that meet target criteria from at least one spatially adjacent texel based on the illumination difference between the illumination data of each spatially adjacent texel and the illumination data of the first seam texel. Furthermore, the computer device may use the same-plane discriminator to filter out spatially adjacent texels that meet target criteria from the spatially adjacent texels filtered out based on illumination difference 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. Furthermore, the computer device may use the spatial distance discriminator to filter out spatially adjacent texels that meet target criteria from the spatially adjacent texels filtered out based on plane difference based on the spatial distance between the spatially adjacent texel and the first seam texel in the three-dimensional virtual scene. Finally, the computer device can use the edge normal discriminator to select a spatially adjacent texel from the spatially adjacent texels selected based on the spatial distance, based on the intersection area of the spatially adjacent texels' 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, as the second seam texel. It will 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 subsequent model seam repair based on the output seam texel pair.
[0105] 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, a texel mapped to each seam texel in the first seam texel and the second seam texel as a seam texel to be repaired; for each seam texel to be repaired, determining, based on 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 image in the denoising reference area; 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; performing denoising and repair processing on the illumination data recorded for the seam texel to be repaired in the initial light map according to the illumination contribution parameter corresponding to each reference texel and the illumination data recorded for each reference texel in the initial light map to obtain a target light map; performing illumination 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.
[0106] 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. 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 of the reference texel in the mesh patch and the opposite mesh vertex. The direction of the edge normal of the reference texel is from the edge of the reference texel to the opposite mesh vertex. The edge normal of the repaired seam texel is the direction vector of the perpendicular line between the edge of the repaired seam texel and the opposite mesh vertex in the mesh patch. The direction of the edge normal of the repaired seam texel is from the edge of the repaired seam texel to the opposite mesh vertex. The lighting contribution parameter is a parameter used to characterize the lighting contribution of the reference texel to the repaired seam texel. The target lightmap is the lightmap after the denoising repair process.
[0107] Specifically, the computer device may determine, from the initial light map, a texel mapped to each of the first and second seam texels as the seam texel to be repaired. It will be understood that each of the first and second seam texels is a seam texel in the initial three-dimensional mesh model located in three-dimensional space, and the seam texel to be repaired is a seam texel located in the initial light map in two-dimensional space. Each of the first and second seam texels 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 a denoising reference area in the initial light map corresponding to the seam texel to be repaired based on the seam texel to be repaired and the seam texels in the initial light map that are adjacent to the seam texel to be repaired. It can be understood that the first seam texel and the second seam texel are a pair of seam texels in the initial three-dimensional mesh model, and the seam texel to be repaired and the corresponding seam texels in a seam-adjacent relationship are also a pair of seam texels in the initial light map. The computer device can determine the lighting contribution parameters of the reference texels for the seam texels 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. Based on the lighting contribution parameters of each reference texel for the seam texels to be repaired and the lighting data recorded for each reference texel in the initial light map, the computer device performs denoising and repair on the lighting data recorded for the seam texels to be repaired in the initial light map to obtain a target light map. Furthermore, the computer device can perform lighting rendering on the initial three-dimensional mesh model based on the target light map to obtain a target three-dimensional mesh model after the seam repair of the initial three-dimensional mesh model.
[0108] In one embodiment, 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, the denoising reference area corresponding to the seam texel to be repaired in the initial light map is determined, including: 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, determining 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, for each seam texel to be repaired, and determining, based on the seam texel to be repaired and the seam texels in the initial light map that have a seam-adjacent relationship with the seam texel to be repaired, 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, so as to iteratively perform denoising and repair until the iteration stop condition is satisfied, thereby obtaining a 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.
[0109] In one embodiment, in each round of denoising and restoration, the spacing between any two adjacent sampling points in the filter kernel used in this round is larger than the spacing between any two adjacent sampling points in the previous round. This allows the filter kernel's sampling range to gradually cover the entire lightmap through multiple rounds of iterative denoising and restoration, achieving wide-scale filtering sampling and more fully utilizing the lighting information of each reference texel in the lightmap, further improving the model seam restoration effect.
[0110] In one embodiment, for each seam texel to be repaired, the computer device may determine a denoising reference area corresponding to the seam texel to be repaired in the initial light map based on texels adjacent to the seam texel to be repaired in the initial light map and texels adjacent to the seam texel to be repaired in a seam-adjacent relationship in the initial light map. It will 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 a seam-adjacent relationship with the seam texel to be repaired, and the texels adjacent to the seam texel in a seam-adjacent relationship with the seam texel to be repaired in the initial light map.
[0111] In one embodiment, the computer device may perform a denoising and repair process on the illumination data recorded for the seam texels to be repaired in the initial lightmap based on the illumination contribution parameters corresponding to each reference texel and the illumination data recorded for each reference texel in the initial lightmap, thereby obtaining denoised illumination data corresponding to the seam texels to be repaired, and directly write the denoised illumination data back to the initial lightmap to obtain a target lightmap. It will be understood 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 lightmap.
[0112] In one embodiment, the computer device can 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.
[0113] In the above embodiment, the denoising reference region corresponding to the seam texel to be repaired in the initial lightmap is determined by combining the seam texel to be repaired and the seam texels that are adjacent to the seam texel to be repaired in the initial lightmap, thereby improving the accuracy of the denoising reference region. Because the angle between the edge normal of a 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, 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 region and the edge normal of the seam texel to be repaired, thereby improving the accuracy of the illumination contribution parameter. Furthermore, denoising and repairing the seam texel to be repaired in the initial lightmap is performed based on the more accurate illumination contribution parameter, and then the initial 3D mesh model is illuminated and rendered based on the denoised target lightmap, thereby improving the rendering quality of the target 3D mesh model after the seam repair is performed.
[0114] 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 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 the adjacent seam texels; the 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.
[0115] 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.
[0116] Specifically, the computer device can 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. Adjacent seam texels are seam texels that are adjacent to the seam texel to be repaired. Furthermore, the computer device can 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 based on 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.
[0117] In one embodiment, the computer device may perform multiple rounds (e.g., two rounds) of denoising and repair processing on the seam texels to be repaired in the initial light map. In each round of denoising and repair processing, the spacing between any two adjacent sampling points in the filter kernel used in this round is greater than the spacing between any two adjacent sampling points in the previous round. Now, for example, as shown in FIG5 , the filter kernel used for denoising and repair processing is a 3×3 filter kernel. In the first round of denoising and repair processing (the first filtering), the computer device may determine the first sampling range of the filter kernel used for denoising and repair processing (i.e., the sampling points of the 5 circles in the triangular mesh patch A1A2A3) along the direction of the edge normal n1 of the seam texel to be repaired (i.e., the point M on the A side (A1A2) of the triangular mesh patch A1A2A3). The computer device may determine a second sampling range of the filter kernel (i.e., the sampling points of the five crosses in the triangle mesh patch B1B2B3) along the direction of the edge normal n2 of the adjacent seam texel (i.e., point N located on the B edge (B1B2) of the triangle mesh patch B1B2B3). Furthermore, the computer device may determine a denoising reference area corresponding to the seam texel to be repaired in the initial light map (i.e., the five circles in the triangle mesh patch A1A2A3 and the five crosses in the triangle mesh patch B1B2B3) based on the first sampling range and the second sampling range.
[0118] In one embodiment, as shown in FIG6 , 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 to the spacing between any two adjacent sampling points in FIG5 , the spacing between any two adjacent sampling points in FIG6 is larger. Compared to the first round of noise reduction and restoration processing, the filtering range of the second round of noise reduction and restoration filter kernel is wider, further improving the model seam repair effect, thereby improving the model rendering quality.
[0119] In one embodiment, Figure 7 shows a computer interface for configuring parameters involved in the noise reduction and repair process (i.e., model seam repair). By selecting "Enable Model Repair" in the parameter configuration interface, model seam repair can be enabled. The "Seam Repair Level" parameter configures the sampling range of the filter kernel and the number of iterations for the noise reduction and repair process.
[0120] In the above embodiment, since the direction of the texel's edge normal aligns with the direction of the inside of the mesh patch where lighting data is recorded, determining the first sampling range along the direction of the edge normal of the seam texel to be repaired and determining the second sampling range along the direction of the edge normal of the adjacent seam texel can avoid sampling invalid texels (i.e., texels in the lightmap where no lighting data is recorded). Furthermore, based on the first and second sampling ranges, the denoising reference area corresponding to the seam texel to be repaired in the initial lightmap is determined, thereby improving the accuracy of the denoising reference area.
[0121] 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.
[0122] The mixed illumination data is obtained by mixing the denoised illumination data corresponding to the seam texels to be repaired with the illumination data before denoising. It can be understood that the mixed illumination data takes into account both the denoised illumination data corresponding to the seam texels to be repaired and the illumination data before denoising.
[0123] 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 based on the illumination contribution parameters corresponding to each reference texel and the illumination data recorded for each reference texel in the initial light map, thereby obtaining denoised illumination data corresponding to the seam texels to be repaired. The computer device may obtain a blending coefficient for the denoised illumination data corresponding to the seam texels to be repaired, and based on the blending coefficient for the denoised illumination data corresponding to the seam texels to be repaired, blend the denoised illumination data corresponding to the seam texels to be repaired with the illumination data before denoising, thereby obtaining blended illumination data corresponding to the seam texels to be repaired. Furthermore, the computer device may write the blended illumination data corresponding to each seam texel to be repaired back to the initial light map, thereby obtaining a target light map. Continuing with reference to FIG. 7 , the parameter "Seam Blending Level" may be used to configure the blending coefficient for blending illumination data corresponding to texels.
[0124] 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).
[0125] In one embodiment, the computer device may write the mixed lighting data corresponding to each seam texel to be repaired back to the initial lightmap to obtain a mixed lightmap, and directly use the mixed lightmap as the target lightmap. The mixed lightmap is a lightmap obtained by writing the mixed lighting data corresponding to each seam texel to be repaired back to the initial lightmap. It is understood that the mixed lighting data corresponding to each seam texel to be repaired may overwrite the lighting data of each seam texel to be repaired in the initial lightmap to obtain the mixed lightmap.
[0126] In the above embodiment, since the difference between the denoised illumination data corresponding to the seam texels to be repaired and the illumination data corresponding to the secondary texels is too large, by mixing the denoised illumination data corresponding to the seam texels to be repaired with the illumination data before denoising to obtain mixed illumination data corresponding to the seam texels to be repaired, the difference between the denoised illumination data corresponding to the seam texels to be repaired and the illumination data corresponding to the secondary texels can be reduced. Furthermore, by writing the mixed illumination data corresponding to each seam texel to be repaired back to the initial lightmap to obtain the target lightmap, the rendering quality of the target 3D mesh model after seam repair based on the target lightmap can be further improved.
[0127] In one embodiment, the mixed lighting 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 lighting 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 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.
[0128] In one embodiment, the secondary texels are texels adjacent to the seam texels to be repaired in the light map. The computer device may 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. Furthermore, the computer device may 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, and obtain the mixing coefficient for the secondary texels. Based on the mixing coefficient of the secondary texels, the lighting data recorded in the mixed light map for the secondary texels is mixed with the lighting data recorded in the mixed light map for the adjacent seam 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.
[0129] In the above embodiment, due to the large difference between the mixed illumination data corresponding to the seam texels to be repaired and the illumination data corresponding to the secondary texels, the seam will change from a dark, thin seam to a light seam strip. Therefore, by 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 a target light 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 3D mesh model after seam repair based on the target light map.
[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 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.
[0131] The denoised lightmap is the lightmap obtained by performing denoising and repair on the lighting data recorded for the seam texels to be repaired in the original lightmap. Unmapped texels are texels in the lightmap that have no mapping relationship with texels in the 3D mesh model. It can be understood that unmapped texels do not contain any lighting data.
[0132] 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 based on the illumination contribution parameters corresponding to each reference texel and the illumination data recorded for each reference texel in the initial light map, thereby obtaining a denoised light map. For each seam texel to be repaired, the computer device may determine, from the denoised light map, unmapped texels adjacent to the seam texel to be repaired that do not have illumination data recorded. Furthermore, the computer device may fill the unmapped texels with the illumination data recorded in the denoised light map for the adjacent seam texels, thereby obtaining a target light map. Adjacent seam texels are seam texels that are adjacent to the seam texels to be repaired. It will be understood that after filling, the unmapped texels in the target light map also have illumination data recorded.
[0133] In one embodiment, for each unmapped texel, if the unmapped texel is adjacent to multiple seam texels to be repaired, the computer device can determine the edge normals of each seam texel to be repaired. For each unmapped texel, the lighting data is first filled using 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 lighting data is filled using the adjacent seam texels of the seam texel to be repaired that are at a 45-degree angle to the unmapped texel.
[0134] In the above embodiment, when the initial 3D mesh model is illuminated and rendered according to the target lightmap, the illumination data in the target lightmap is sampled through interpolation sampling (i.e., each illumination data sampling references the illumination data recorded by multiple adjacent texels). Therefore, the illumination data recorded in the denoised lightmap for adjacent seam texels is filled into the unmapped texels to obtain the target lightmap. This can avoid sampling texels that do not record illumination data during interpolation sampling, thereby further improving the rendering quality of the model.
[0135] In one embodiment, the illumination contribution parameter corresponding to the reference texel is determined 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, including: for each reference texel in the denoising reference area, determining 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; determining 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; 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; 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 illumination contribution.
[0136] The first normal influence parameter characterizes 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 illumination contribution. The second normal influence parameter is determined based on the normal of the seam texel to be repaired in the 3D virtual scene and the normal of the reference texel in the 3D 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 3D 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.
[0137] In one embodiment, for each reference texel in the denoising reference area, the computer device may select a maximum value from zero and a first dot product result as a first normal influence parameter. The first dot product result is the 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 will be appreciated 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.
[0138] 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 the second normal influence parameter. The second dot product result is a vector dot product result between the normal vector of the reference texel in the 3D virtual scene and the normal vector of the seam texel to be repaired in the 3D virtual scene.
[0139] 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. w i (p,q)=w p w n w l w n′ ;
[0140] 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(p) 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 noise reduction 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, 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 l Indicates the brightness impact parameter, w i (p,q) represents the illumination contribution parameter of the reference texel to the repaired seam texel after the previous round of noise reduction 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 color values or other lighting data other than color values). Represents the lighting data recorded for the seam texels to be repaired in the light map after this round of noise reduction and repair processing.
[0141] 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.
[0142] In one embodiment, as shown in Figure 8, (a) is a schematic diagram of an initial 3D mesh model before seam repair. It can be seen that the initial 3D mesh model in (a) has obvious seam defects 801, resulting in low model rendering quality. The model seam repair method of the present application is used to repair the seams of the initial 3D mesh model, resulting in the target 3D mesh model after seam repair in (b). It can be seen that the target 3D mesh model in (b) has no seam defects, improving the model rendering quality.
[0143] In one embodiment, as shown in FIG9 , (a) is a schematic diagram of multiple initial three-dimensional mesh models (such as 5 three-dimensional mesh models in FIG9 ) that are continuous in a three-dimensional virtual scene before seam repair. It can be seen that there are obvious seam defects 901 in the area where the multiple initial three-dimensional mesh models in (a) are connected, resulting in low rendering quality of the multiple models that are continuous in the three-dimensional virtual scene. By repairing the seams of multiple initial three-dimensional mesh models that are continuous in a three-dimensional virtual scene using the model seam repair method of the present application, multiple target three-dimensional mesh models that are continuous in the three-dimensional virtual scene after seam repair in (b) can be obtained. It can be seen that there are no seam defects in the multiple target three-dimensional mesh models that are continuous in the three-dimensional virtual scene in (b), which improves the rendering quality of the multiple models that are continuous in the three-dimensional virtual scene.
[0144] As shown in FIG10 , 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 independently by the terminal or server itself, or through interaction between the terminal and the server. This embodiment uses the method applied to a computer device as an example to illustrate the method. The method specifically includes the following steps:
[0145] 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.
[0146] Step 1004 : Use each non-ignored texel in the initial three-dimensional mesh model as a sampling texel, and construct a ray emission region perpendicular to the normal direction of each sampling texel in the initial three-dimensional mesh model.
[0147] Step 1006: Take the point in the ray emission area as the ray starting point, 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 any ray in the at least one ray to obtain the intersecting texels.
[0148] 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 3D grid models, the intersecting texel is used as a candidate texel.
[0149] 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.
[0150] Step 1012: If at least one candidate texel has at least one spatially adjacent texel to the sampled texel, the sampled texel is determined to be a first seam texel.
[0151] Step 1014, based on at least one of the following: an illumination difference between the illumination data of the spatially adjacent texel and the illumination data of the first seam texel, a planar difference between the mesh patch where the spatially adjacent texel is located and the mesh patch where the first seam texel is located, a spatial distance between the spatially adjacent texel and the first seam texel in the three-dimensional virtual scene, or an intersection area between 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, spatially adjacent texels that meet the target conditions are screened out from at least one spatially adjacent texel.
[0152] Step 1016: Determine a second seam texel from the screened spatially adjacent texels.
[0153] 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.
[0154] Step 1020 , 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 based on the seam texel to be repaired and the seam texels that are adjacent to the seam texel to be repaired in the initial light map.
[0155] 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.
[0156] 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.
[0157] In 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.
[0158] Step 1028 : Mix the denoised illumination data 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.
[0159] Step 1030 : Write the mixed lighting data corresponding to each seam texel to be repaired back into the initial light map to obtain a mixed light map.
[0160] Step 1032 : Determine, from the mixed light map, the secondary texels adjacent to the seam texel to be repaired along the direction of the edge normal of the seam texel to be repaired.
[0161] 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 are adjacent to the seam texels to be repaired.
[0162] 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.
[0163] The present application also provides an application scenario, in which the above-mentioned model seam repair method is applied. Specifically, the model seam repair method can be applied to the seam repair scenario of game models in the gaming field.
[0164] It is 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 is understood that the game models in the game scene may have seam effects, and the model seam repair method of the present application can be used to repair the seams of the game models 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 models in the game scene.
[0165] Specifically, for each texel in the initial game model of the game scene, if there is an occluding mesh patch within a preset range along the texel's normal direction from the texel in the game scene, the computer device may ignore the texel. Each texel in the initial game model that is not ignored is used as a sampling texel. For each sampling texel in the initial game model, a ray emission region perpendicular to the normal direction of the sampling texel is constructed. A point in the ray emission region is used as the ray starting point, and at least one ray is constructed with the direction opposite to the normal direction of the sampling texel as the ray direction. The texels in the initial game model that intersect with each ray are determined to obtain intersecting texels. For each intersecting texel, if the coordinates of the intersecting texel in the planar grid model are discontinuous with the coordinates of the sampling texel in the planar grid model, or if the intersecting texel and the sampling texel are located in different initial game models, the intersecting texel is selected 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 sampled texel are continuous in the game scene, the candidate texel is determined to be a spatially adjacent texel of the sampled texel. If at least one candidate texel has at least one spatially adjacent texel of the sampled texel, the sampled texel is determined to be a first seam texel.
[0166] The computer device may screen spatially adjacent texels that meet target conditions from at least one spatially adjacent texel based on at least one of a lighting difference between lighting data of the spatially adjacent texel and lighting data 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 the game scene, or an intersection area between a coverage area of the spatially adjacent texel in the initial game model and a coverage area of the first seam texel in the initial game model. The second seam texel may be determined from the screened spatially adjacent texels.
[0167] The computer device may determine, from an initial light map corresponding to the initial game model, texels mapped to each of the first and second seam texels as seam texels to be repaired. For each seam texel to be repaired, a denoising reference area corresponding to the seam texel to be repaired in the initial light map is determined based on the seam texel to be repaired and seam texels that are adjacent to the seam texel to be repaired in the initial light map. For each reference texel in the denoising reference area, a first normal influence parameter is determined based on the angle between the edge normal of the reference texel and the edge normal of the seam texel to be repaired. An illumination contribution parameter corresponding to the reference texel is determined based on at least one of the first normal influence parameter, the second normal influence parameter, the distance influence parameter, and the brightness influence parameter. 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.
[0168] The computer device can mix the denoised lighting data corresponding to the seam texels to be repaired with the lighting data before denoising to obtain mixed lighting data corresponding to the seam texels to be repaired. The mixed lighting data corresponding to each seam texel to be repaired is written back to the initial light map to obtain a mixed light map. The secondary texels adjacent to the seam texels to be repaired are determined from the mixed light map along the direction of the edge normal of the seam texels to be repaired. The lighting data recorded in the mixed light map for the secondary texels is mixed with the lighting data recorded in the mixed light map for the adjacent seam texels to be repaired 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. The initial game model is illuminated and rendered according to the target light map to obtain a target game model after the seams of the initial game model have been repaired. The model seam repair method of the present application can improve the efficiency of game model repair in game scenes and improve the rendering quality of game models.
[0169] The present application also provides some application scenarios, and these application scenarios 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.
[0170] For example, the present application can be applied to an industrial simulation scenario. The three-dimensional virtual scene includes the industrial simulation scene, the initial three-dimensional mesh model includes the initial industrial model, and the target three-dimensional mesh model includes the target industrial model. It is understood that the industrial models in the industrial simulation scene may exhibit seam effects. The model seam repair method of the present application can be used to repair seams in the industrial models in the industrial simulation scene, thereby improving the rendering quality of the industrial models in the industrial simulation scene.
[0171] It should be understood that, although the various steps in the flow chart of the above-mentioned embodiments are shown in sequence, these steps are not necessarily performed in sequence. Unless clearly stated herein, the execution of these steps does not have strict order restrictions, and these steps can be performed in other sequences. 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 sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0172] In one embodiment, as shown in FIG11 , a model seam repairing device 1100 is provided, which specifically includes:
[0173] A construction module 1102 is configured to determine sampled texels obtained by sampling texels of an initial three-dimensional mesh model in a three-dimensional virtual scene, and construct, for each sampled texel, a ray emission region perpendicular to a normal direction of the sampled texel;
[0174] A determination module 1104 is 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 a normal direction of the sampled texel as a ray direction, and determine a texel in the initial three-dimensional mesh model that intersects with any ray of the at least one ray to obtain at least one candidate texel;
[0175] A determination module 1106 is configured to determine that the sampled texel is a first seam texel if at least one spatially adjacent texel of the sampled texel exists in the at least one candidate texel;
[0176] The determining 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;
[0177] The repair module 1108 is configured 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.
[0178] 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 occluding mesh patch within a preset range along the normal direction of the texel from 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 each texel in the initial three-dimensional mesh model that is not ignored is used as a sampling texel.
[0179] In one embodiment, the determination module 1104 is further used to determine the texels in the initial three-dimensional mesh model that intersect with any ray of at least one 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.
[0180] 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.
[0181] In one embodiment, the determination module 1104 is further used to filter out spatially adjacent texels that meet the target conditions from at least one spatially adjacent texel based on at least one of the following: the illumination difference between the illumination data of the spatially adjacent texel and the illumination data of the first seam texel, the planar difference between the mesh surface where the spatially adjacent texel is located and the mesh surface where the first seam texel is located, the spatial distance between the spatially adjacent texel and the first seam texel in the three-dimensional virtual scene, or the intersection area between 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 determine the second seam texel from the filtered spatially adjacent texels.
[0182] In one embodiment, the determination module 1104 is further used to determine, for each spatially adjacent texel, the normal angle between the mesh surfaces corresponding to the spatially adjacent texel and the first seam texel, while screening at least one spatially adjacent texel based on the illumination difference between the illumination data of the spatially adjacent texel and the illumination data of 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 from at least one spatially adjacent texel, screen the spatially adjacent texels whose first angle is less than or equal to the preset angle.
[0183] In one embodiment, the determination module 1104 is further 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 then 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.
[0184] In one embodiment, the determination module 1104 is further used to, when 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, 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.
[0185] 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, when at least one spatially adjacent texel is screened 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; 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.
[0186] 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, based on 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; based on 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 denoised and repaired 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.
[0187] In one embodiment, the repair module 1108 is further 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.
[0188] 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 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 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 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 to obtain the target light map.
[0189] In one embodiment, the repair module 1108 is further 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 texel 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.
[0190] In one embodiment, the repair module 1108 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 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, determine from the denoised light map the unmapped texels adjacent to the seam texel to be repaired and having no illumination data recorded therein; fill the illumination data recorded in the denoised light map of 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.
[0191] 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 based on 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 based on 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.
[0192] The model seam repair device constructs a ray emission region perpendicular to the normal direction of the sampled texel for each sampled texel in the initial 3D virtual scene. Using a point in the ray emission region as the ray starting point and at least one ray with the direction opposite to the normal direction of the sampled texel as the ray direction, the device then determines the texel in the initial 3D mesh model that intersects with any of the at least one ray, thereby obtaining at least one candidate texel. If at least one candidate texel contains at least one spatially adjacent texel to the sampled texel, the sampled texel can be quickly determined to be a first seam texel. From the at least one spatially adjacent texel, a second seam texel that is seam-adjacent to the first seam texel can be quickly determined. The device then quickly repairs the first and second seam texels in the initial 3D mesh model to obtain a target 3D mesh model after seam repair. Compared to the traditional method of searching for seam texels by traversing model vertices one by one, the seam search method of this application does not require traversing model vertices to search for seam texels. Instead, it constructs a ray emission region and generates rays from the ray emission region to intersect with the initial three-dimensional mesh model to search for seam texels, thereby improving the efficiency of seam texel search in the model. Furthermore, by repairing the first and second seam texels that are quickly found, the efficiency of model seam repair can be improved.
[0193] Each module in the aforementioned model seam repair device can be implemented in whole or in part through software, hardware, or 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 computer device's memory in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0194] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in Figure 12. The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. The processor, memory, and I / O interface are connected via a system bus, and the communication interface is connected to the system bus via the I / O 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 computer program in the non-volatile storage medium. The I / O 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 via a network connection. When the computer program is executed by the processor, it implements a model seam repair method.
[0195] In one embodiment, a computer device is provided, which may be a terminal. Its internal structure diagram may be as shown in Figure 13. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and computer program stored in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via wired or wireless communication. The wireless communication may be achieved via Wi-Fi, a mobile cellular network, NFC (near-field communication), or other technologies. When executed by the processor, the computer program implements a model seam repair method. 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 covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0196] Those skilled in the art will understand that the structures shown in Figures 12 and 13 are merely block diagrams of partial structures related to the solution of the present application, and do 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 shown in the figures, or combine certain components, or have a different component arrangement.
[0197] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0198] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above-mentioned method embodiments when executed by a processor.
[0199] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0200] 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 the relevant laws, regulations and standards of relevant countries and regions.
[0201] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented 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 may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may 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).
[0202] The technical features of the above embodiments can 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.
[0203] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that variations and improvements are possible within the scope of the present application, as would be apparent to one skilled in the art. These variations and improvements fall within the scope of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A model seam repair method, executed by a computer device, the method include: Determine sampling texels obtained by sampling texels of an initial three-dimensional mesh model in a three-dimensional virtual scene, and construct a ray emission area perpendicular to the normal direction of the sampling texel for each of the sampling texels; Taking a point in the ray emission area as a ray starting point, constructing at least one ray with a direction opposite to the normal direction of the sampled texel as a ray direction, and determining a texel in the initial three-dimensional mesh model that intersects with any ray of the at least one ray, to obtain at least one candidate texel; If at least one spatially adjacent texel of the sampled texel exists in the at least one candidate texel, determining that the sampled texel is a first seam texel; 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; and 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, wherein the determining of the sampled texels is obtained by sampling the texels of the initial three-dimensional mesh model in the three-dimensional virtual scene. include: For each texel in 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 from the texel, the texel is ignored; The occluded mesh patch is a mesh patch in the initial three-dimensional mesh model except for the mesh patch 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 or 2, wherein determining a texel in the initial three-dimensional mesh model that intersects with any ray of the at least one ray to obtain at least one candidate texel, include: Determine a texel in the initial three-dimensional mesh model that intersects with any ray of the at least one ray to obtain an intersecting texel; 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 any one of claims 1 to 3, further comprising: include: 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 any one of claims 1 to 4, wherein determining a second seam texel having a seam adjacent relationship with the first seam texel from at least one of the spatially adjacent texels, include: 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: an illumination difference between illumination data of the spatially adjacent texel and illumination data of the first seam texel, a plane difference between a mesh surface patch where the spatially adjacent texel is located and a mesh surface patch where the first seam texel is located, a spatial distance between the spatially adjacent texel and the first seam texel in the three-dimensional virtual scene, and an intersection area between a coverage area of the spatially adjacent texel 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, wherein the step of selecting the spatially adjacent texels that meet the target condition from at least one of the spatially adjacent texels, include: In the case where at least one of the spatially adjacent texels is screened according to the illumination difference between the illumination data of the spatially adjacent texels and the illumination data of the first seam texel, for each of the spatially adjacent texels, determining The normal angle between the mesh patches corresponding to the spatially adjacent texels and the first seam texels is used to obtain a first angle corresponding to the spatially adjacent texels; 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 or 6, wherein the step of selecting the spatially adjacent texels that meet the target condition from at least one of the spatially adjacent texels, include: 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 any one of claims 5 to 7, wherein the step of selecting the spatially adjacent texels that meet the target condition from at least one of the spatially adjacent texels, include: 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 any one of claims 5 to 8, wherein the step of selecting the spatially adjacent texels that meet the target condition from at least one of the spatially adjacent texels, include: 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 any one of claims 1 to 9, wherein the initial three-dimensional mesh model has a corresponding initial light map; and 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. include: 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, wherein the denoising reference area corresponding to the seam texel to be repaired in the initial light map is determined 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, include: 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 or 11, wherein 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, 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 a target light map, include: 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, wherein the mixed illumination data corresponding to each of the seam texels to be repaired is written back to the initial illumination map to obtain a target illumination map, include: 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 any one of claims 10 to 13, wherein 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, 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 a target light map, include: 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 any one of claims 10 to 14, wherein the illumination contribution parameter corresponding to the reference texel is determined 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, include: 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 distance between the seam texel to be repaired and the reference texel in the three-dimensional virtual How much distance in the scene affects the lighting 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 joint repair device, the device include: A construction module, used to determine sampled texels obtained by sampling texels of an initial three-dimensional mesh model in a three-dimensional virtual scene, and for each sampled texel, construct 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 a texel in the initial three-dimensional mesh model that intersects with any ray in the at least one ray to obtain at least one candidate texel; a determination module, configured to determine that the sampled texel is a first seam texel if at least one spatially adjacent texel of the sampled texel exists in the at least one candidate texel; 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, and the processor implements the steps of the method according to any one of claims 1 to 15 when executing the computer program.
18. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 15.
19. A computer program product, comprising a computer program, wherein 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
Patent Citations
Mapping processing method and device and electronic equipment
CN111714883A
Image rendering method and device, electronic equipment and storage medium
CN111932664A
Three-dimensional model lightweight method and system, storage medium and image processing device
CN112734930A
Real-time multi-scale high-frequency material rendering method and system based on normal mapping
CN114092625A
Interpolation optimizations for a display engine for post-rendering processing
US11138747B1
