Model rendering method and related apparatus
By simplifying and simulating lighting, the system automatically reconstructs and renders 3D models, solving the problems of low reconstruction efficiency and high labor costs when 3D model rendering fails, and achieving efficient 3D model reconstruction and realistic rendering effects.
Patent Information
- Application Number
- PCT/CN2025/107619
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-15
- Filing Date
- 2025-07-09
- Publication Date
- 2026-01-22
AI Technical Summary
In existing technologies, when 3D model rendering fails, reconstruction is inefficient and labor-intensive, requiring a considerable amount of time for manual reconstruction.
By simplifying the number of model meshes based on the topological features of the initial 3D model, and combining lighting simulation processing, the simplified 3D model is automatically reconstructed and rendered to ensure that its lighting effects are realistic in the preset virtual environment.
It improves the rendering success rate and reconstruction efficiency of 3D models, reduces labor costs, and ensures that the rendering effect is close to the initial model.
Smart Images

Figure CN2025107619_22012026_PF_FP_ABST
Abstract
Description
A model rendering method and related device
[0001] The present application claims priority to the Chinese patent application No. 202410947204X, filed on July 15, 2024, and titled "A model rendering method and related device", the whole content of which is incorporated herein by reference. TECHNICAL FIELD
[0002] The present application relates to the technical field of computer, in particular to model rendering. BACKGROUND
[0003] A three-dimensional (3D) model refers to a three-dimensional model constructed by a three-dimensional software. Since the three-dimensional model can flexibly represent various objects in the real world and fictional objects, it is widely used in various fields, such as games, medical treatment, film and television production, engineering design, etc.
[0004] In actual application, the three-dimensional model rendering may fail due to factors such as the complexity of the three-dimensional model. In this case, two-dimensional image information of a basic object on which the three-dimensional model is constructed is usually collected, and then the contour information of the basic object is manually reconstructed based on the collected two-dimensional image information and the related theory of model enhancement rendering by artificial, so as to reconstruct the corresponding three-dimensional model.
[0005] However, the above-mentioned method usually needs to consume a long time to reconstruct a new three-dimensional model that can be successfully rendered, that is, the reconstruction efficiency of the three-dimensional model is low, and the human cost consumed is high. SUMMARY
[0006] The embodiments of the present application provide a model rendering method and related device, which can automatically reconstruct and render a three-dimensional model, improve the reconstruction efficiency of the three-dimensional model, and reduce the human cost.
[0007] The first aspect of the present application provides a model rendering method, the method comprising:
[0008] Based on the topological structure features of the initial three-dimensional model, the initial three-dimensional model is simplified by reducing the number of model meshes to obtain a simplified three-dimensional model; wherein the simplified three-dimensional model and the initial three-dimensional model satisfy a preset similarity requirement;
[0009] By light simulation processing, the light intensity corresponding to the vertex in the simplified three-dimensional model when the simplified three-dimensional model is in a preset virtual environment is determined;
[0010] Based on the simplified three-dimensional model and the light intensity, the simplified three-dimensional model is rendered to obtain a model image corresponding to the simplified three-dimensional model.
[0011] The second aspect of the present application provides a model rendering device, the device comprising:
[0012] a simplification module configured to simplify the initial three-dimensional model by reducing the number of model meshes based on the topological structure features of the initial three-dimensional model, to obtain a simplified three-dimensional model; wherein the simplified three-dimensional model and the initial three-dimensional model satisfy a preset similarity requirement;
[0013] a light simulation module configured to determine the light intensity corresponding to the vertex in the simplified three-dimensional model when the simplified three-dimensional model is in a preset virtual environment by light simulation processing;
[0014] a rendering module configured to render the simplified three-dimensional model based on the simplified three-dimensional model and the light intensity, to obtain a model image corresponding to the simplified three-dimensional model.
[0015] The third aspect of the present application provides a computer device, the device comprising a processor and a memory:
[0016] The memory is configured to store a computer program;
[0017] The processor is configured to execute the steps of the model rendering method according to the computer program.
[0018] The fourth aspect of the present application provides a computer readable storage medium, the computer readable storage medium is used for storing a computer program, the computer program is used for executing the steps of the model rendering method in the first aspect.
[0019] The fifth aspect of the present application provides a computer program product comprising a computer program which, when executed on a computer, causes the computer to carry out the method of the above aspects.
[0020] From the above technical solutions, the embodiments of the present application have the following advantages:
[0021] The embodiment of the present application provides a model rendering method, which innovatively proposes a scheme for realizing model enhancement rendering based on an existing three-dimensional model. The method comprises the following steps: firstly, for an initial three-dimensional model to be processed, based on the topological structure characteristics of the initial three-dimensional model, the initial three-dimensional model is simplified by reducing the number of model meshes, so that a simplified three-dimensional model comprising a smaller number of meshes is obtained compared with the initial three-dimensional model. Since the model complexity of the simplified three-dimensional model is relatively lower, the subsequent rendering of the simplified three-dimensional model is more likely to be successfully completed, that is, the rendering success rate of the model can be improved. In order to ensure the rendering effect of the simplified three-dimensional model, the simplified three-dimensional model and the initial three-dimensional model need to meet a preset similarity requirement, so as to ensure that the appearance of the simplified three-dimensional model is as close as possible to that of the initial three-dimensional model, and then ensure that the rendering effect of the simplified three-dimensional model is as close as possible to that of the initial three-dimensional model, thereby avoiding distortion caused by simplification. Then, the light intensity corresponding to the vertex in the simplified three-dimensional model when the simplified three-dimensional model is in a preset virtual environment can be determined through light simulation processing, that is, the light effect of the simplified three-dimensional model in the preset virtual environment is simulated. The light effect can assist in improving the rendering effect in the subsequent rendering process, so that the final rendering effect is more realistic. Finally, based on the simplified three-dimensional model and the light effect (i.e. the light intensity corresponding to the vertex in the simplified three-dimensional model) of the simplified three-dimensional model in the preset virtual environment, the simplified three-dimensional model is rendered, so that a model image corresponding to the simplified three-dimensional model is obtained. The model rendering based on the processing results obtained through the above simplification and light simulation processing can ensure a high rendering success rate and an optimal rendering effect, which is close to the expected rendering effect of the initial three-dimensional model. Therefore, the model enhancement rendering can be automatically completed based on the original initial three-dimensional model through the above method, without manually reconstructing and rendering the model based on a two-dimensional image, thereby improving the reconstruction efficiency of the three-dimensional model and reducing the labor cost. BRIEF DESCRIPTION OF DRAWINGS
[0022] FIG. 1 is a schematic diagram of an application scenario of a model rendering method provided by the embodiment of the present application;
[0023] FIG. 2 is a flowchart of a model rendering method provided by the embodiment of the present application;
[0024] FIG. 3 is a flowchart of a simplification process provided by the embodiment of the present application;
[0025] FIG. 4 is a schematic diagram of an importance evaluation result of a sub-model region provided by the embodiment of the present application;
[0026] FIG. 5 is a structural schematic diagram of a difference measurement process provided by the embodiment of the present application;
[0027] FIG. 6 is a structural schematic diagram of another difference measurement process provided by an embodiment of the present application;
[0028] FIG. 7 is a flowchart of a light simulation process provided by an embodiment of the present application;
[0029] FIG. 8 is a structural schematic diagram of a model rendering device provided by an embodiment of the present application;
[0030] FIG. 9 is a structural schematic diagram of a terminal device provided by an embodiment of the present application;
[0031] FIG. 10 is a structural schematic diagram of a server provided by an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative work fall within the scope of protection of the present application.
[0033] The terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0034] The model rendering method provided by the embodiments of the present application can be executed by a computer device, which can be a terminal device or a server. The terminal device includes but is not limited to a mobile phone, a computer, a smart voice interactive device, a smart home appliance, a vehicle-mounted terminal, an aircraft, etc. The server can be a stand-alone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server.
[0035] It should be noted that the information, data and signals involved in the embodiments of the present application are all authorized by the relevant objects or fully authorized by all parties, and the collection, use and processing of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0036] In order to facilitate understanding of the model rendering method provided by the embodiments of the present application, the application scenario of the model rendering method is exemplarily introduced below taking the execution subject of the model rendering method as a server for example.
[0037] Referring to FIG. 1, FIG. 1 is a schematic diagram of an application scenario of a model rendering method provided by an embodiment of the present application. As shown in FIG. 1, the application scenario includes a terminal device 110 and a server 120. The terminal device 110 and the server 120 can communicate directly or indirectly through a wired network or a wireless network.
[0038] A target application program (such as a game application program, a social application program, a debugging application program, etc.) supporting rendering and displaying a three-dimensional model is running in the terminal device 110. When the target application program running in the terminal device 110 fails to render a certain three-dimensional model, the terminal device 110 can take the three-dimensional model as an initial three-dimensional model and send related data of the initial three-dimensional model to the server 120, so that the server 120 performs model enhancement rendering based on the initial three-dimensional model.
[0039] After the server 120 obtains the related data of the initial three-dimensional model, the server 120 can simplify the initial three-dimensional model by reducing the number of model meshes based on the topological structure characteristics of the initial three-dimensional model, thereby obtaining a simplified three-dimensional model including a smaller number of meshes compared with the initial three-dimensional model. Since the model complexity of the simplified three-dimensional model is relatively lower, the subsequent rendering of the simplified three-dimensional model is more likely to be successfully completed, that is, the rendering success rate of the model can be improved. In order to ensure the rendering effect of the simplified three-dimensional model, the difference between the simplified three-dimensional model and the initial three-dimensional model needs to meet a preset similarity requirement, so as to ensure that the appearance of the simplified three-dimensional model is as close as possible to that of the initial three-dimensional model, thereby ensuring that the rendering effect of the simplified three-dimensional model is as close as possible to that of the initial three-dimensional model, and avoiding distortion caused by simplification. The server 120 can determine the light intensity corresponding to the vertex in the simplified three-dimensional model when the simplified three-dimensional model is in a preset virtual environment through a light simulation processing manner, that is, simulate the light effect of the simplified three-dimensional model in the preset virtual environment. The light effect can assist in improving the rendering effect in the subsequent rendering process, so that the final rendering effect is more realistic.
[0040] Finally, the server 120 can render the simplified three-dimensional model based on the simplified three-dimensional model and the lighting effect of the simplified three-dimensional model in the preset virtual environment (i.e., the lighting intensity corresponding to the vertex in the simplified three-dimensional model), and obtain a model image for representing the simplified three-dimensional model. The model rendering based on the processing results obtained through the above simplification and lighting simulation processing can ensure a high rendering success rate and obtain a relatively optimal rendering effect similar to the expected rendering effect of the initial three-dimensional model. Thus, the model enhancement rendering can be automatically completed based on the original initial three-dimensional model through the above method, without the need for manual reconstruction and rendering of the model based on the two-dimensional image, thereby improving the reconstruction efficiency of the three-dimensional model and reducing the labor cost.
[0041] It should be understood that the application scenario shown in FIG. 1 is only an example, and in actual applications, the model rendering method provided by the embodiments of the present application can also be applied to other scenarios, for example, the model rendering method can be independently executed by a terminal device, and the application scenario of the model rendering method provided by the embodiments of the present application is not limited herein.
[0042] The model rendering method provided by the present application will be described in detail below through method embodiments.
[0043] Referring to FIG. 2, FIG. 2 is a flowchart of the model rendering method provided by the embodiments of the present application. As shown in FIG. 2, the model rendering method includes the following steps:
[0044] S201: Based on the topological structure characteristics of the initial three-dimensional model, the initial three-dimensional model is simplified by reducing the number of model meshes to obtain a simplified three-dimensional model; wherein the simplified three-dimensional model and the initial three-dimensional model satisfy a preset similarity requirement.
[0045] The initial three-dimensional model refers to the original processing object of the model rendering method provided by the embodiments of the present application, which can be any form of three-dimensional model. The three-dimensional model refers to a mathematical representation of geometric modeling of an object in a three-dimensional space, and the basic structure of the three-dimensional model is composed of vertices, edges and faces.
[0046] As an example, the initial three-dimensional model can be a three-dimensional model that fails to render. Rendering refers to the process of converting the shape, material, lighting, and other information of a three-dimensional model into a two-dimensional image, i.e., the process of converting a three-dimensional virtual model into a two-dimensional image. A three-dimensional model that fails to render refers to a three-dimensional model that takes too long to render during debugging (such as a three-dimensional model that takes longer than a preset time threshold to render, which would affect user experience in actual application due to the long rendering time), or a three-dimensional model whose rendering effect is different from the expected effect (such as a three-dimensional model that has problems such as missing special effects, missing details, etc.). As an example, during the rendering process of a three-dimensional model, real-time extraction and export of the three-dimensional model can be performed through a real-time rendering engine, such as the debug toolbox of Unreal Engine 4 (UE4), and at the same time, three-dimensional models that have problems such as too long rendering time and abnormal rendering effect can be marked as three-dimensional models that fail to render.
[0047] The topological structure feature of the initial three-dimensional model refers to a feature that reflects the layout, structure, and connection between points, lines, and surfaces of the initial three-dimensional model, i.e., the topological structure feature can reflect the appearance structure of the initial three-dimensional model. As an example, the topological structure feature of the initial three-dimensional model can be determined according to each vertex and / or each mesh included in the initial three-dimensional model, where the mesh is a basic unit of the initial three-dimensional model, which can be any polygonal mesh (such as a triangular mesh, a quadrilateral mesh, etc.). More specifically, the topological structure feature of the initial three-dimensional model can be calculated according to vertex data and / or mesh data in the initial three-dimensional model through a topological structure feature calculation formula.
[0048] As an example, based on the topological structure feature of the initial three-dimensional model, the model structure of the initial three-dimensional model is simplified, i.e., the initial three-dimensional model is preprocessed by mesh to reduce the number of meshes in the topological structure feature of the initial three-dimensional model, to obtain a simplified three-dimensional model. For example, the simplification method can include but is not limited to vertex deletion (deleting vertices), edge folding (merging two vertices of an edge into one vertex and recalculating the vertices of adjacent surfaces), and mesh folding (folding a group of adjacent meshes into one vertex and recalculating the vertices of adjacent meshes). The application does not specifically limit the simplification method.
[0049] The simplified three-dimensional model refers to a three-dimensional model obtained by simplifying an initial three-dimensional model, and the number of meshes of the simplified three-dimensional model is less than that of the initial three-dimensional model. Meanwhile, in the simplification process, in order to ensure that the rendering effect of the obtained simplified three-dimensional model is close to that of the original three-dimensional model, it is also necessary to limit the simplified three-dimensional model and the initial three-dimensional model to meet a preset similarity requirement, that is, the simplified three-dimensional model and the initial three-dimensional model should be as close as possible in shape structure and rendering effect, so that the rendering images of the simplified three-dimensional model and the initial three-dimensional model can be as close as possible. The preset similarity requirement is a difference requirement (that is, the difference between the simplified three-dimensional model and the initial three-dimensional model should be as small as possible) for measuring whether the simplified three-dimensional model and the initial three-dimensional model meet the condition of close rendering effect, which is preset, for example, the preset similarity requirement can include a preset visual quality difference requirement (a difference requirement set from the perspective of model visual effect, that is, to ensure that the initial three-dimensional model and the simplified three-dimensional model are as close as possible in visual effect) and a preset performance difference requirement (a difference requirement set from the perspective of model performance, that is, to ensure that the initial three-dimensional model and the simplified three-dimensional model are as close as possible in model performance), accordingly, the difference between the simplified three-dimensional model and the initial three-dimensional model can include visual difference and performance difference, and the present application does not specifically limit the preset similarity requirement and the type of difference between the simplified three-dimensional model and the initial three-dimensional model.
[0050] S202: Determine the light intensity corresponding to the vertex in the simplified three-dimensional model when the simplified three-dimensional model is in the preset virtual environment through light simulation processing.
[0051] The preset virtual environment refers to the virtual environment in which the simplified three-dimensional model should be located, for example, the virtual environment in which the initial three-dimensional model is originally located, or other virtual environments. The preset virtual environment is usually a three-dimensional virtual environment, for example, the preset virtual environment is a virtual game scene in which the initial three-dimensional model is located, and the present application does not specifically limit the preset virtual environment.
[0052] With reference to the light effect of the initial three-dimensional model in the preset virtual environment, the light intensity corresponding to each vertex in the simplified three-dimensional model when the simplified three-dimensional model is in the preset virtual environment can be determined through a light simulation processing method. For example, the light simulation processing method can be implemented by using a Lambertian model and other physical-based rendering models to determine the light effect of the simplified three-dimensional model in the preset virtual environment. The present application does not specifically limit the light simulation processing method.
[0053] S203: Render the simplified three-dimensional model based on the simplified three-dimensional model and the light intensity corresponding to the vertex in the simplified three-dimensional model, to obtain a model image for representing the simplified three-dimensional model.
[0054] After the simplified three-dimensional model and the light intensity corresponding to each vertex in the simplified three-dimensional model (i.e., the lighting effect of the simplified three-dimensional model in the preset virtual environment) are determined, the simplified three-dimensional model can be rendered based on the simplified three-dimensional model and the lighting effect of the simplified three-dimensional model in the preset virtual environment, i.e., a model image for representing the simplified three-dimensional model can be obtained, and the model image is specifically a two-dimensional image including the simplified three-dimensional model.
[0055] As an example, the simplified three-dimensional model and the light intensity corresponding to each vertex in the simplified three-dimensional model can be input into a rendering tool for rendering, and a two-dimensional model image corresponding to the simplified three-dimensional model can be obtained. For example, the rendering tool can be rendering software VRay, Blender, and Omniverse RTX, etc. In this regard, the rendering tool is not specifically limited in the present application.
[0056] In addition, in the present application, the rendering effect of the initial three-dimensional model and the simplified three-dimensional model can be compared, which is beneficial to timely detecting and previewing the rendering effect of the simplified three-dimensional model.
[0057] In the model rendering method provided in the embodiments of the present application, the method innovatively proposes a scheme for realizing model enhancement rendering on the basis of an existing three-dimensional model. The method comprises the following steps: firstly, for an initial three-dimensional model to be processed, based on the topological structure features of the initial three-dimensional model, the model structure of the initial three-dimensional model is simplified by reducing the number of model meshes, so as to obtain a simplified three-dimensional model comprising a smaller number of meshes compared with the initial three-dimensional model. Since the model complexity of the simplified three-dimensional model is relatively lower, the subsequent rendering of the simplified three-dimensional model is more likely to be successfully completed, that is, the success rate of model rendering is improved. In order to ensure the rendering effect of the simplified three-dimensional model, the simplified three-dimensional model and the initial three-dimensional model need to meet a preset similarity requirement, so as to ensure that the appearance of the simplified three-dimensional model is as similar as possible to that of the initial three-dimensional model, and then ensure that the rendering effect of the simplified three-dimensional model is as similar as possible to that of the initial three-dimensional model, thereby avoiding distortion caused by simplification. Then, the light intensity corresponding to the vertices in the simplified three-dimensional model when the simplified three-dimensional model is in a preset virtual environment can be determined through light simulation processing, that is, the light effect of the simplified three-dimensional model when the simplified three-dimensional model is in the preset virtual environment is simulated. The light effect can assist in improving the rendering effect in the subsequent rendering process, so that the final rendering effect is more realistic. Finally, based on the simplified three-dimensional model and the light effect (i.e., the light intensity corresponding to the vertices in the simplified three-dimensional model) of the simplified three-dimensional model in the preset virtual environment, the simplified three-dimensional model is rendered, so as to obtain a model image for representing the simplified three-dimensional model. The model rendering based on the processing results obtained through the above simplification and light simulation processing can ensure a high success rate of rendering and an optimal rendering effect, which is similar to the expected rendering effect of the initial three-dimensional model. Therefore, the model enhancement rendering can be automatically completed based on the original initial three-dimensional model through the above method, without the need for manual model reconstruction and rendering based on a two-dimensional image, thereby improving the reconstruction efficiency of the three-dimensional model and reducing the labor cost.
[0058] In a possible implementation, referring to FIG. 3, which is a flow diagram of the simplification process provided in the embodiments of the present application, the above S201 “simplifying the model structure of the initial three-dimensional model based on the topological structure features of the initial three-dimensional model to obtain a simplified three-dimensional model” can specifically include S2011-S2013:
[0059] S2011: simplifying the initial three-dimensional model by reducing the number of model meshes based on the topological structure features of the initial three-dimensional model to obtain a simplified candidate three-dimensional model.
[0060] As an example, the initial three-dimensional model can be simplified by reducing the number of model meshes based on the topological structure features of the initial three-dimensional model to reduce the number of meshes of the initial three-dimensional model, and a simplified candidate three-dimensional model can be obtained. The simplified candidate three-dimensional model refers to a three-dimensional model obtained after simplification processing and serving as a candidate, and only when the simplified candidate three-dimensional model meets the preset similarity requirement with the initial three-dimensional model, the simplified candidate three-dimensional model can be determined as a simplified three-dimensional model.
[0061] As an example, the initial three-dimensional model includes a plurality of sub-model regions, and the S2011 "simplifying the initial three-dimensional model by reducing the number of model meshes based on the topological structure features of the initial three-dimensional model to obtain a simplified candidate three-dimensional model" can include:
[0062] For each sub-model region, based on the topological structure features of the sub-model region, an importance evaluation result of the sub-model region is determined; according to the importance evaluation result, a to-be-reduced mesh number corresponding to the sub-model region is determined; and the sub-model region is subjected to regional simplification processing according to the to-be-reduced mesh number, to obtain a sub-simplified model region corresponding to the sub-model region.
[0063] The simplified candidate three-dimensional model is determined according to the sub-simplified model regions corresponding to the plurality of sub-model regions.
[0064] The initial three-dimensional model can include a plurality of sub-model regions, and the plurality of sub-model regions can be divided according to the model structure of the initial three-dimensional model, for example, the initial three-dimensional model can be divided into a face sub-model region, a limb sub-model region, and a trunk sub-model region, etc. For this, the present application does not specifically limit the plurality of sub-model regions.
[0065] As an example, the topological structure features of each sub-model region can be calculated by a topological structure feature calculation formula. Then, the importance of each sub-model region can be calculated based on the topological structure features of each sub-model region by an evaluation function to obtain an importance evaluation result of the sub-model region. The importance evaluation result of the sub-model region is used to indicate the influence degree of the change of the number of meshes in the sub-model region on the rendering effect of the sub-model region. If the number of meshes in the sub-model region changes a little, it will cause a large change in the rendering effect of the sub-model region, and the importance evaluation result of the sub-model region will correspondingly indicate that the importance of the sub-model region is high, and vice versa. If the number of meshes in the sub-model region changes a lot, it will not cause a large change in the rendering effect of the sub-model region, and the importance evaluation result of the sub-model region will correspondingly indicate that the importance of the sub-model region is low. For example, the importance evaluation result of each sub-model region can be represented by an importance score.
[0066] In a possible implementation, the topological structure feature of the sub-model region can be determined in the following manner:
[0067] The topological structure feature of the sub-model region is determined according to the position data of each vertex in the sub-model region and the respective associated map patch thereof by using a scale-invariant feature transform algorithm.
[0068] The scale-invariant feature transform algorithm (SIFT) is a feature extraction algorithm widely used in the field of computer vision, which can extract the local structure feature of a model. The scale-invariant feature transform algorithm can find extreme points in the spatial scale and extract the position, scale, and rotation invariant of the extreme points. These feature points are invariant to changes in the scale, rotation, and illumination of the model. Therefore, the topological structure feature of a sub-model region can be determined according to the position data of each vertex in the sub-model region and the respective associated map patch thereof by using the scale-invariant feature transform algorithm, as shown in Formula 1. The map patch associated with a vertex refers to the sub-map data corresponding to the vertex.
[0069] In Formula 1, f represents the topological structure feature of a sub-model region, n represents the number of vertices in the sub-model region, V i represents the i th vertex in the sub-model region, S i represents the map patch associated with the i th vertex, w i represents the preset weight coefficient corresponding to the i th vertex. It should be noted that the preset weight coefficient corresponding to a vertex can be determined according to the importance of the vertex. The higher the importance of the vertex, the greater the preset weight coefficient corresponding to the vertex. The importance of a vertex can be determined according to the degree of attention of the vertex in the sub-model region. If a vertex is located in a more obvious position in the sub-model region and is more likely to be noticed, the importance of the vertex is higher.
[0070] As an example, the set of topological structure features of all sub-model regions in the initial three-dimensional model can be represented by F(Z) = {f1, f2, …, f z} where f z represents the topological structure feature of the Z th sub-model region, and Z represents the number of sub-model regions in the initial three-dimensional model.
[0071] Thus, the topological structure features of the sub-model region can be extracted by the scale invariant feature transform algorithm. Since the scale invariant feature transform algorithm has the features of scale invariance, rotation invariance, and illumination invariance, the topological structure features of the sub-model region can be accurately extracted based on the position data of each vertex in the sub-model region and the respective associated map fragments, and then the importance of the sub-model region can be accurately evaluated based on the topological structure features of the sub-model region, and the sub-model region can be correspondingly simplified.
[0072] In a possible implementation, the "determining the importance evaluation result of the sub-model region based on the topological structure features of the sub-model region" can include:
[0073] determining a visual quality evaluation result and a geometric quality evaluation result of the sub-model region based on the topological structure features of the sub-model region; the visual quality evaluation result is used to represent the influence degree of the change of the number of meshes in the sub-model region on the corresponding map effect of the sub-model region, and the geometric quality evaluation result is used to represent the influence degree of the change of the number of meshes in the sub-model region on the shape of the sub-model region;
[0074] determining the importance evaluation result of the sub-model region according to the visual quality evaluation result and the geometric quality evaluation result.
[0075] When determining the importance evaluation result of the sub-model region, the overall importance of the sub-model region can be determined from the visual importance and the geometric importance.
[0076] The visual quality evaluation result of the sub-model region is used to indicate the visual importance of the sub-model region, that is, to represent the influence degree of the change of the number of meshes in the sub-model region on the corresponding map effect of the sub-model region. It should be understood that if the number of meshes in the sub-model region changes slightly, the corresponding map effect of the sub-model region will change greatly, and then the visual quality evaluation result of the sub-model region will indicate that the visual importance of the sub-model region is high, and vice versa. If the number of meshes in the sub-model region changes greatly, the corresponding map effect of the sub-model region will not change greatly, and then the visual quality evaluation result of the sub-model region will indicate that the visual importance of the sub-model region is low.
[0077] As an example, the visual importance of the sub-model region can be calculated by dividing the area of each mesh in the sub-model region by the area of the corresponding map of the sub-model region, to obtain the visual quality evaluation result V(f i ) of the sub-model region, where f i represents the topological structure features of the sub-model region i. For this purpose, the application does not specifically limit the implementation method of evaluating the visual importance of the sub-model region.
[0078] The geometric quality evaluation result of the sub-model region is used to indicate the geometric importance of the sub-model region, that is, to characterize the degree of influence of the change in the number of grids in the sub-model region on the shape of the region of the sub-model region. It should be understood that if a small change in the number of grids in the sub-model region leads to a large change in the shape of the region of the sub-model region, the geometric quality evaluation result of the sub-model region will correspondingly indicate that the geometric importance of the sub-model region is high, and vice versa. If a large change in the number of grids in the sub-model region does not lead to a large change in the shape of the region of the sub-model region, the geometric quality evaluation result of the sub-model region will correspondingly indicate that the geometric importance of the sub-model region is low.
[0079] As an example, the geometric importance of the sub-model region can be determined by comparing whether the number of grids of the sub-model region is within a preset range of region grid number, to obtain a geometric quality evaluation result G(f i ) of the sub-model region, where f i represents the topological structure feature of the sub-model region i. The preset range of region grid number is used to indicate the geometric importance of the sub-model region. For example, when the number of grids of the sub-model region is within the preset range of region grid number, it is considered that the geometric quality evaluation result of the sub-model region is excellent (corresponding to a higher score), and when the number of grids of the sub-model region is not within the preset range of region grid number, it is considered that the geometric quality evaluation result of the sub-model region is poor (corresponding to a lower score). The application does not specifically limit the implementation method of evaluating the geometric importance of the sub-model region.
[0080] Referring to FIG. 4, FIG. 4 is a schematic diagram for determining the importance evaluation result of the sub-model region provided by the embodiment of the application. After the visual quality evaluation result and the geometric quality evaluation result of the sub-model region are determined, the importance evaluation result of the sub-model region can be determined according to the visual quality evaluation result and the geometric quality evaluation result corresponding to the sub-model region, which can be referred to Formula 2. I(f i )=w v *V(f i )+w g G(f i ) Formula 2
[0081] I(f i ) in the above Formula 2 represents the importance evaluation result of the sub-model region, V(f i ) represents the visual quality evaluation result of the sub-model region, w v represents the preset weight coefficient of visual importance, G(f i ) represents the geometric quality evaluation result of the sub-model region, and w g represents the preset weight coefficient of geometric importance.
[0082] Thus, based on the topological structure features of the sub-model region, the visual quality evaluation result and the geometric quality evaluation result of the sub-model region can be determined, and finally, the importance evaluation result of the sub-model region can be determined according to the visual quality evaluation result and the geometric quality evaluation result of the sub-model region. It can be seen that through the above method, the importance evaluation result of the sub-model region can be accurately and comprehensively determined from the visual importance and the geometric importance.
[0083] After determining the importance evaluation result of each sub-model region, the corresponding relationship between the importance evaluation result and the number of grids to be reduced (which can be set according to historical experience in advance) can be further used to determine the number of grids to be reduced corresponding to each sub-model region in the simplification process based on the importance evaluation result of each sub-model region. The number of grids to be reduced refers to the number of grids that need to be reduced in the sub-model region in the simplification process. It should be understood that the higher the importance evaluation result of the sub-model region, the greater the influence of the change in the number of grids in the sub-model on the rendering effect of the sub-model region, and the smaller the number of grids to be reduced corresponding to the sub-model region; on the contrary, the lower the importance evaluation result of the sub-model region, the smaller the influence of the change in the number of grids in the sub-model on the rendering effect of the sub-model region, and the larger the number of grids to be reduced corresponding to the sub-model region.
[0084] After determining the number of grids to be reduced corresponding to the sub-model region, the sub-model region can be subjected to regional simplification processing according to the number of grids to be reduced corresponding to the sub-model region, so as to obtain a sub-simplified model region corresponding to the sub-model region. The sub-simplified model region refers to the simplification result obtained by simplifying the sub-model region. It should be noted that in the process of subjecting the sub-model region to regional simplification processing according to the number of grids to be reduced corresponding to the sub-model region, a vertex or a grid can be randomly selected from the topological structure features of the sub-model region for corresponding deletion, or the sub-model region can be subjected to regional simplification processing according to a specific vertex rejection mechanism or edge folding mechanism.
[0085] The formula of the number of grids included in the sub-simplified model region can be shown as formula 3. new = T old - δ(I(f i )) Formula 3
[0086] T new in the above formula 3 represents the number of grids of the sub-simplified model region obtained after simplification processing, T old represents the number of grids of the sub-model region before simplification processing, and δ(I(f i )) represents the number of grids to be reduced determined based on the importance evaluation result of the sub-model region.
[0087] Finally, the simplified candidate three-dimensional model of the whole can be determined by combining the respective sub-simplified model regions of the plurality of sub-model regions, and then difference measurement processing can be performed based on the simplified candidate three-dimensional model of the whole to determine the simplified three-dimensional model that finally meets the preset similarity requirement.
[0088] Thus, for the plurality of sub-model regions in the initial three-dimensional model, the importance evaluation result of each sub-model region can be determined based on the topological structure characteristics of the sub-model region. Then, the number of grids to be reduced corresponding to each sub-model region can be determined according to the importance evaluation result of the sub-model region, that is, the higher the importance evaluation result of the sub-model region, the fewer the number of grids to be reduced corresponding to the sub-model region. Subsequently, the sub-model region is subjected to regional simplification processing according to the number of grids to be reduced, and the simplified result corresponding to the sub-model region, that is, the sub-simplified model region, can be obtained. Finally, the simplified candidate three-dimensional model of the whole can be determined by combining the respective sub-simplified model regions of the plurality of sub-model regions. It can be seen that the initial three-dimensional model can be simplified by region through the above method, which simplifies the model complexity of the initial three-dimensional model, thereby realizing the detailed simplification processing of the initial three-dimensional model. Moreover, each sub-model region is subjected to simplification processing with reference to the importance evaluation result of the sub-model region, which can reasonably simplify each sub-model region, thereby facilitating the improvement of the effect of the final simplified candidate three-dimensional model, facilitating the rapid acquisition of the simplified three-dimensional model that meets the preset similarity requirement, and further reducing the calculation burden in the rendering process and improving the rendering efficiency of the simplified three-dimensional model.
[0089] In addition, in the embodiments of the present application, in order to improve the processing efficiency of the simplification processing process, the simplification processing process can also be optimized, for example, the simplification processing of each sub-model region is performed in parallel, that is, the simplification processing of the plurality of sub-model regions in the initial three-dimensional model is simultaneously performed through a plurality of processing threads. According to Formula 4, the processing time of the simplification processing process can be effectively reduced through the above parallel processing manner. new )=O(T old ) / j*log(z) Formula 4
[0090] O(T new ) in the above Formula 4 represents the processing time of the optimized simplification processing process, O(T old ) represents the processing time of the simplification processing process before optimization, j represents the number of processing threads for performing the simplification processing in parallel, and z represents the number of sub-model regions in the initial three-dimensional model.
[0091] S2012: performing difference measurement on the simplified candidate three-dimensional model; the difference measurement comprises: determining whether the simplified candidate three-dimensional model and the initial three-dimensional model satisfy a preset similarity requirement according to the visual quality evaluation result and the performance evaluation result corresponding to the simplified candidate three-dimensional model and the visual quality evaluation result and the performance evaluation result corresponding to the initial three-dimensional model.
[0092] In order to ensure that the rendering effect of the model is not affected by the simplification process, and to make the rendering effect of the simplified three-dimensional model as close as possible to the rendering effect of the original three-dimensional model, the difference measurement can be performed on the simplified candidate three-dimensional model to determine whether the simplified candidate three-dimensional model and the initial three-dimensional model satisfy a preset similarity requirement, and if so, the simplified candidate three-dimensional model is taken as the simplified three-dimensional model on which the final rendering is based.
[0093] Referring to FIG. 5, which is a structural schematic diagram of a difference measurement process provided by an embodiment of the present application, the difference measurement performed on the simplified candidate three-dimensional model can comprise: determining whether the simplified candidate three-dimensional model and the initial three-dimensional model satisfy a preset similarity requirement according to the difference between the visual quality evaluation result corresponding to the simplified candidate three-dimensional model and the visual quality evaluation result corresponding to the initial three-dimensional model and the difference between the performance evaluation result corresponding to the simplified candidate three-dimensional model and the performance evaluation result corresponding to the initial three-dimensional model.
[0094] As an example, the visual quality (the similarity of the model contour) of the simplified candidate three-dimensional model and the initial three-dimensional model can be calculated respectively by a visual quality evaluation method (such as a visual quality evaluation function) to obtain the visual quality evaluation result corresponding to the simplified candidate three-dimensional model and the visual quality evaluation result corresponding to the initial three-dimensional model. The visual quality evaluation result corresponding to the simplified candidate three-dimensional model is used to indicate the visual quality of the simplified candidate three-dimensional model, that is, to characterize the influence degree of the change of the number of meshes in the simplified candidate three-dimensional model (compared with the number of meshes of the initial three-dimensional model) on the visual effect corresponding to the simplified candidate three-dimensional model.
[0095] In the embodiments of the present application, the visual quality can evaluate the difference in the model contour of the simplified candidate three-dimensional model and the initial three-dimensional model when displayed. Generally, the greater the difference in the number of model meshes included by the two three-dimensional models, the greater the difference in the model contour of the two three-dimensional models. Or, the greater the difference in the number of model meshes of the two three-dimensional models in the same region, the greater the difference in the model contour of the region. For example, when the initial three-dimensional model is a human model, for the head region, if the difference in the number of model meshes of the head between the simplified candidate three-dimensional model and the initial three-dimensional model is too large relative to other parts (such as the torso and limbs) during the simplification process, it will result in too large a difference in the head contour between the simplified candidate three-dimensional model and the initial three-dimensional model, which is difficult to evaluate by visual quality.
[0096] For example, the visual quality evaluation result corresponding to the simplified candidate three-dimensional model can be represented in the form of a visual quality score. Correspondingly, the visual quality evaluation result corresponding to the initial three-dimensional model is used to indicate the visual quality of the initial three-dimensional model, that is, to characterize the degree of influence of the change in the number of mesh in the initial three-dimensional model on the visual effect corresponding to the initial three-dimensional model. For example, the visual quality evaluation result corresponding to the initial three-dimensional model can be represented in the form of a visual quality score. In this regard, the present application does not specifically limit the form of the visual quality evaluation result. In the form of a visual quality score, the model simplification (reduction in the number of mesh in the initial three-dimensional model) can be performed on the basis of minimizing the influence of the model contour, so that the difference in the number of mesh in the initial three-dimensional model and the simplified candidate three-dimensional model in each region is uniform and not too large, so as to avoid too large difference between the model contour of the simplified three-dimensional model (for example, the simplified three-dimensional model) and the model contour of the initial three-dimensional model.
[0097] Correspondingly, the performance of the simplified candidate three-dimensional model and the initial three-dimensional model can be calculated by a performance evaluation method (such as a model accuracy calculation method), to obtain the performance evaluation result corresponding to the simplified candidate three-dimensional model and the performance evaluation result corresponding to the initial three-dimensional model. The performance evaluation result corresponding to the simplified candidate three-dimensional model is used to indicate the performance of the simplified candidate three-dimensional model, which can be determined by the number of mesh included in the simplified candidate three-dimensional model. Generally, the more the number of mesh included, the better the performance of the simplified candidate three-dimensional model. For example, the performance evaluation result of the simplified candidate three-dimensional model can be represented by a model accuracy calculation result. Correspondingly, the performance evaluation result corresponding to the initial three-dimensional model is used to indicate the performance of the initial three-dimensional model, which can also be determined by the number of mesh included in the initial three-dimensional model. For example, the performance evaluation result of the initial three-dimensional model can be represented by a model accuracy calculation result. In this regard, the present application does not specifically limit the form of the performance evaluation result.
[0098] The performance of the three-dimensional model can be understood as the modeling fineness of the three-dimensional model. Generally, the more the number of mesh included in a three-dimensional model, the smoother the surface of the three-dimensional model and the higher the shape fineness. The fewer the number of mesh included in a three-dimensional model, the more angular the surface of the three-dimensional model and the lower the shape fineness. It can be seen that the performance evaluation result corresponding to a three-dimensional model with a large number of mesh can be better than that of a three-dimensional model with a small number of mesh.
[0099] As an example, the preset similarity requirement can include a preset visual quality difference requirement and a preset performance difference requirement, and the visual quality difference between the simplified candidate three-dimensional model and the initial three-dimensional model can be determined according to the visual quality evaluation result corresponding to the simplified candidate three-dimensional model and the visual quality evaluation result corresponding to the initial three-dimensional model, and compared with the preset visual quality difference requirement. Correspondingly, the performance difference between the simplified candidate three-dimensional model and the initial three-dimensional model can also be determined according to the performance evaluation result corresponding to the simplified candidate three-dimensional model and the performance evaluation result corresponding to the initial three-dimensional model, and compared with the preset performance difference requirement.
[0100] In a possible implementation, the "determining whether the simplified candidate three-dimensional model and the initial three-dimensional model meet the preset similarity requirement according to the visual quality evaluation result and the performance evaluation result corresponding to the simplified candidate three-dimensional model, and the visual quality evaluation result and the performance evaluation result corresponding to the initial three-dimensional model" in S2012 can include:
[0101] determining a first visual quality difference between the simplified candidate three-dimensional model and the initial three-dimensional model according to the region pair, the region pair including the sub-simplified model region and the sub-model region having a corresponding relationship, and the region visual quality difference being determined according to the visual quality evaluation result of the sub-simplified model region and the visual quality evaluation result of the sub-model region;
[0102] determining a second visual quality difference according to the visual quality evaluation result of the simplified candidate three-dimensional model and the visual quality evaluation result of the initial three-dimensional model;
[0103] determining a performance difference according to the performance evaluation result of the simplified candidate three-dimensional model and the performance evaluation result of the initial three-dimensional model;
[0104] determining whether the simplified candidate three-dimensional model and the initial three-dimensional model meet the preset similarity requirement according to the first visual quality difference, the second visual quality difference and the performance difference.
[0105] The region pair includes the sub-simplified model region and the sub-model region having a corresponding relationship, that is, the region pair includes the sub-model region before simplification and the corresponding sub-simplified model region after simplification.
[0106] The region visual quality difference is determined based on the difference between the visual quality evaluation result of the sub-model region and the visual quality evaluation result of the corresponding sub-simplified model region, and is used to indicate the visual quality difference of the sub-model region before and after simplification. For example, the region visual quality difference can be represented by visual quality score. The calculation method of the visual quality evaluation result of the sub-simplified model region can be the same as the calculation method of the visual quality evaluation result of the sub-model region.
[0107] Referring to FIG. 6, which is a structural schematic diagram of another difference measurement process provided by the embodiments of the present application, after the visual quality difference of each region pair is calculated, the first visual quality difference between the simplified candidate three-dimensional model and the initial three-dimensional model can be further determined according to the visual quality difference of each region pair. The first visual quality difference is used to reflect the difference between the simplified candidate three-dimensional model and the initial three-dimensional model from the perspective of local visual quality.
[0108] For example, referring to formula 5, the first visual quality difference between the simplified candidate three-dimensional model and the initial three-dimensional model can be determined based on the visual quality difference of each region pair.
[0109] In formula 5 above, Q(M new , M old ) represents the first visual quality difference between the simplified candidate three-dimensional model and the initial three-dimensional model, m represents the number of region pairs, i.e., the number of sub-model regions in the simplified candidate three-dimensional model, V(f i,new ) represents the visual quality evaluation result of the i-th sub-simplified model region, and V(f i,old ) represents the visual quality evaluation result of the i-th sub-model region. The i-th sub-simplified model region and the i-th sub-model region have a corresponding relationship, and both belong to the i-th region pair.
[0110] In addition, the second visual quality difference between the simplified candidate three-dimensional model and the initial three-dimensional model can also be determined according to the visual quality evaluation result of the simplified candidate three-dimensional model and the visual quality evaluation result of the initial three-dimensional model. The second visual quality difference is used to reflect the difference between the simplified candidate three-dimensional model and the initial three-dimensional model from the perspective of overall visual quality difference. For example, referring to formula 6, the difference between the visual quality evaluation result of the simplified candidate three-dimensional model and the visual quality evaluation result of the initial three-dimensional model is taken as the second visual quality difference. V(M new ) ≥ V(M old ) - ∈ Formula 6
[0111] In formula 6 above, V(M new ) represents the visual quality evaluation result of the simplified candidate three-dimensional model, V(M old ) represents the visual quality evaluation result of the initial three-dimensional model, and ∈ represents the acceptable visual quality evaluation error range. As an example, a visual quality evaluation function can be used to determine the visual quality evaluation result V(M newAccordingly, the manner of calculating the visual quality evaluation result of the initial three-dimensional model can be the same as the manner of calculating the visual quality evaluation result of the simplified candidate three-dimensional model.
[0112] In addition, the performance difference between the simplified candidate three-dimensional model and the initial three-dimensional model can be determined according to the performance evaluation result of the simplified candidate three-dimensional model and the performance evaluation result of the initial three-dimensional model. For example, the difference between the performance evaluation result of the simplified candidate three-dimensional model and the performance evaluation result of the initial three-dimensional model can be taken as the performance difference according to formula 7.
[0113] P(M new ) in formula 7 above represents the performance evaluation result of the simplified candidate three-dimensional model, and P(M old ) represents the performance evaluation result of the initial three-dimensional model. represents an acceptable performance evaluation error range. As an example, a performance quality evaluation function can be used to determine the performance evaluation result P(M new ) of the simplified three-dimensional model according to the number of vertices included in the simplified candidate three-dimensional model. Accordingly, the manner of calculating the performance evaluation result of the initial three-dimensional model can be the same as the manner of calculating the performance evaluation result of the simplified candidate three-dimensional model.
[0114] Finally, after the first visual quality difference, the second visual quality difference and the performance difference are determined, whether the simplified candidate three-dimensional model and the initial three-dimensional model meet the preset similarity requirement can be determined based on the above differences.
[0115] For example, if the first visual quality difference meets the preset local visual quality difference requirement, such as the first visual quality difference calculated by formula 5 is within the preset first difference threshold, and the second visual quality difference meets the requirement of formula 6, and the performance difference meets the requirement of formula 7, it can be considered that the simplified candidate three-dimensional model and the initial three-dimensional model meet the preset similarity requirement. The preset local visual quality difference requirement is used to measure whether the rendering effect of the simplified candidate three-dimensional model is close to the rendering effect of the initial three-dimensional model from the perspective of local vision.
[0116] On the contrary, if any one of the first visual quality difference, the second visual quality difference and the performance difference does not meet the corresponding difference requirement, it is considered that the simplified candidate three-dimensional model and the initial three-dimensional model do not meet the preset similarity requirement, and a new simplified candidate three-dimensional model needs to be determined again.
[0117] Thus, the simplified candidate three-dimensional model can be judged and compared in detail from the dimensions of local visual quality, the dimension of overall visual quality and the dimension of performance, so as to ensure that the rendering effect of the finally determined simplified three-dimensional model can be as close as possible to the rendering effect of the original three-dimensional model.
[0118] S2013: If the simplified candidate three-dimensional model meets the preset similarity requirement with the initial three-dimensional model, the simplified candidate three-dimensional model is determined as the simplified three-dimensional model; if the simplified candidate three-dimensional model does not meet the preset similarity requirement with the initial three-dimensional model, the simplification processing is re-executed to obtain a new simplified candidate three-dimensional model, and the difference measurement processing is performed on the new simplified candidate three-dimensional model.
[0119] As an example, if the visual quality difference (which can include the first visual quality difference and the second visual quality difference) between the simplified candidate three-dimensional model and the initial three-dimensional model meets the preset visual quality difference requirement, and the performance difference between the simplified candidate three-dimensional model and the initial three-dimensional model meets the preset performance difference requirement, it is considered that the simplified candidate three-dimensional model meets the preset similarity requirement with the initial three-dimensional model, and the simplified candidate three-dimensional model can be determined as the simplified three-dimensional model.
[0120] If any one of the visual quality difference and the performance difference between the simplified candidate three-dimensional model and the initial three-dimensional model does not meet the corresponding difference requirement, it is considered that the simplified candidate three-dimensional model does not meet the preset similarity requirement with the initial three-dimensional model, and at this time, the above S2011 and S2012 can be re-executed, that is, the model structure of the initial three-dimensional model is re-simplified based on the topological structure characteristics of the initial three-dimensional model to obtain a new simplified candidate three-dimensional model, so that the difference measurement processing can be performed on the new simplified candidate three-dimensional model until the simplified candidate three-dimensional model meeting the preset similarity requirement is determined as the simplified three-dimensional model.
[0121] Thus, first, the model structure of the initial three-dimensional model can be simplified based on the topological structure features of the initial three-dimensional model to obtain a simplified candidate three-dimensional model, and then the difference measurement of the simplified candidate three-dimensional model can be performed, that is, the difference measurement from the visual and performance aspects can be performed to determine whether the simplified candidate three-dimensional model and the initial three-dimensional model meet the preset similarity requirement. If the simplified candidate three-dimensional model and the initial three-dimensional model meet the preset similarity requirement, the simplified candidate three-dimensional model can be determined as the simplified three-dimensional model, and if the simplified candidate three-dimensional model and the initial three-dimensional model do not meet the preset similarity requirement, the simplification processing operation can be re-executed to determine a new simplified candidate three-dimensional model, and the difference measurement of the new simplified candidate three-dimensional model is continued until the simplified candidate three-dimensional model meeting the preset similarity requirement is determined as the simplified three-dimensional model. It can be seen that the difference between the simplified candidate three-dimensional model and the initial three-dimensional model can be measured from the visual and performance aspects by the above method, and the rendering effect of the finally determined simplified three-dimensional model in the visual and performance aspects is close to that of the initial three-dimensional model.
[0122] In a possible implementation, referring to FIG. 7, which is a flowchart of a light simulation process provided by an embodiment of the present application, the “determining the light intensity corresponding to the vertex in the simplified three-dimensional model when the simplified three-dimensional model is in the preset virtual environment through the light simulation process” in S202 can include S2021-S2024:
[0123] S2021: performing clustering processing on each vertex in the simplified three-dimensional model to determine a plurality of representative vertices in the simplified three-dimensional model.
[0124] The clustering processing is a process of clustering and merging adjacent similar classification regions by using morphological operators. The similarity or distance between data points can be calculated by a clustering algorithm, and data points with high similarity are divided into the same clustering cluster, and data points with low similarity are divided into different clustering clusters. For example, the clustering algorithm can include K-means clustering algorithm, hierarchical clustering algorithm, and spectral clustering algorithm, and the present application does not specifically limit the clustering algorithm.
[0125] As an example, referring to formula 8, the K-means algorithm can be used to perform clustering processing on each vertex in the simplified three-dimensional model, so that a plurality of representative vertices in the simplified three-dimensional model can be determined. The representative vertex refers to the representative result in the clustering cluster after the clustering processing of each vertex in the simplified three-dimensional model. processed = Kmean(V original ) Formula 8
[0126] V processedrepresentative vertices in the simplified three-dimensional model after the clustering processing, V original Kmean algorithm refers to an improved K-means algorithm, which is used to optimize the vertex data in the simplified three-dimensional model to reduce redundancy and improve the processing efficiency of the light simulation processing.
[0127] Optionally, among the vertices in a cluster, one vertex (for example, the vertex of the cluster center) can be selected as a representative vertex, and in this implementation manner, the cluster and the representative vertex are in one-to-one correspondence. Alternatively, multiple representative vertices can be selected in a cluster, which is not limited in the present application.
[0128] S2022: performing spatial transformation processing on the multiple representative vertices to determine the positions of the multiple representative vertices in the projection space.
[0129] The spatial transformation processing refers to mapping a point in a three-dimensional model from one space to another space. After the multiple representative vertices in the simplified three-dimensional model are determined, spatial transformation processing can be performed on the multiple representative vertices to transform the multiple representative vertices from the model space to the projection space, i.e., to determine the positions of the multiple representative vertices in the projection space. The model space refers to the space in which the simplified three-dimensional model originally exists, and the projection space refers to the space that can reflect the light effect of the simplified three-dimensional model.
[0130] In one possible implementation, the above S2022 "performing spatial transformation processing on the multiple representative vertices to determine the positions of the multiple representative vertices in the projection space" can include:
[0131] transforming the positions of the multiple representative vertices in the model space to obtain the positions of the multiple representative vertices in the world space;
[0132] transforming the positions of the multiple representative vertices in the world space to obtain the positions of the multiple representative vertices in the view space;
[0133] transforming the positions of the multiple representative vertices in the view space to obtain the positions of the multiple representative vertices in the projection space.
[0134] The model space refers to the coordinate space associated with the three-dimensional model. The world space refers to a three-dimensional region occupied by matter and motion, and the position of an object in the world space is defined based on a global coordinate system. The view space is a space defined from the perspective of a camera or an observer. The projection space is a space that can reflect the light effect of the three-dimensional model.
[0135] As an example, referring to Formula 9, based on the positions of multiple representative vertices in the model space, multiplying them by the transformation matrix in the world space, we can obtain the positions of multiple representative vertices in the world space. world =M world *V model Formula 9
[0136] V in Formula 9 above world M represents the position of each of the multiple representative vertices in world space. world V represents the transformation matrix from model space to world space. model This represents the position of multiple representative vertices in model space. The transformation matrix in world space indicates the changes in position, orientation, and scale of each representative vertex in world space. The transformation matrix can be viewed as a set of spatial transformations (such as scaling, rotation, and translation).
[0137] After determining the positions of multiple representative vertices in world space, we can refer to Formula 10 and multiply these positions by the transformation matrix in view space to obtain the positions of the multiple representative vertices in view space. V view =M view *V world Formula 10
[0138] V in Formula 10 above view M represents the position of each of the multiple representative vertices in view space. view This represents the transformation matrix from world space to view space. The transformation matrix in view space indicates the changes in position, orientation, and scale of each representative vertex in view space.
[0139] After determining the positions of multiple representative vertices in the view space, we can refer to Formula 11 and multiply them by the transformation matrix in the projection space to obtain the positions of the multiple representative vertices in the projection space. proj =M proj *V view Formula 11
[0140] V in Formula 11 above proj M represents the position of each of the multiple representative vertices in the projection space. proj This represents the transformation matrix from view space to projection space. The transformation matrix in projection space indicates the changes in position, orientation, and scale of each representative vertex in projection space.
[0141] Thus, by the above formula, the positions of the plurality of representative vertices in the model space can be transformed to the world space, the view space and the projection space in sequence, so that the positions of the plurality of representative vertices in the projection space in the simplified three-dimensional model can be accurately determined, facilitating subsequent rendering and display.
[0142] S2023: determining, by the light simulation processing, the light intensity corresponding to each of the plurality of representative vertices when the simplified three-dimensional model is in the preset virtual environment based on the position of each of the plurality of representative vertices in the projection space.
[0143] The light simulation processing refers to a processing method for simulating the propagation, reflection and refraction of light in space based on the knowledge of optics and physics, so as to determine the light effect of the processing target. After the positions of the plurality of representative vertices in the projection space are determined, the light simulation processing method can be used to determine the light intensity corresponding to each of the plurality of representative vertices in the simplified three-dimensional model when the simplified three-dimensional model is in the preset virtual environment based on the position of each of the plurality of representative vertices in the projection space.
[0144] In one possible implementation, the above-mentioned "determining, by the light simulation processing, the light intensity corresponding to each of the plurality of representative vertices when the simplified three-dimensional model is in the preset virtual environment based on the position of each of the plurality of representative vertices in the projection space" can include:
[0145] For each representative vertex, the normal direction, the reflection vector and the line-of-sight direction corresponding to the representative vertex are determined according to the position of the representative vertex in the projection space, and the light intensity corresponding to the representative vertex is determined according to the simulated light intensity, the diffuse reflection light intensity, the reflection light intensity, the light source direction and the highlight index of the preset virtual environment, and the normal direction, the reflection vector and the line-of-sight direction.
[0146] The normal direction refers to the direction of the vector perpendicular to the surface where the representative vertex is located, and is used to describe the orientation of the surface where the representative vertex is located. For example, the normal vectors of all the faces sharing the representative vertex can be first calculated, and then the normal vectors can be added and normalized to determine the normal vector of the representative vertex, and the normal direction of the representative vertex can be determined based on the normal vector of the representative vertex. The reflection vector refers to the vector of the light reflected on the surface where the representative vertex is located, for example, the reflection vector of the representative vertex can be calculated based on the incident light vector and the plane normal vector of the surface where the representative vertex is located by using the reflection vector calculation formula. The line-of-sight direction refers to the direction of the vector from the perspective of the observer to the representative vertex in the scene, for example, the vector from the perspective of the observer to the representative vertex in the scene can be determined based on the difference between the position of the representative vertex and the position of the observer, and then the line-of-sight direction can be determined based on the direction of the vector.
[0147] Thus, according to the above method, for each representative vertex, the normal direction, the reflection vector and the view direction corresponding to the representative vertex can be determined according to the position of the representative vertex in the projection space. Then, referring to formula 12, the illumination intensity corresponding to the representative vertex can be determined according to the simulated light intensity, the diffuse reflection light intensity, the reflection light intensity, the light source direction and the highlight index corresponding to the preset virtual environment, and the normal direction, the reflection vector and the view direction. a *k a +∑ lights (I d *(L*N)*k d +I s *(R*V)a*k s ) Formula 12
[0148] T in formula 12 above represents the illumination intensity corresponding to the representative vertex, I a represents the simulated light intensity corresponding to the preset virtual environment, k a represents the material coefficient when the simulated light intensity is determined in the preset virtual environment, I d represents the diffuse reflection light intensity corresponding to the preset virtual environment, k d represents the material coefficient when the diffuse reflection light intensity is determined in the preset virtual environment, L represents the light source direction corresponding to the preset virtual environment, N represents the normal direction corresponding to the representative vertex, I s represents the reflection light intensity corresponding to the preset virtual environment, k s represents the material coefficient when the reflection light intensity is determined in the preset virtual environment, R represents the reflection vector corresponding to the representative vertex, V represents the view direction corresponding to the representative vertex, and a represents the highlight index corresponding to the preset virtual environment.
[0149] The simulated light intensity refers to the light intensity in the preset virtual environment generated by simulation. For example, the light intensity in the preset virtual environment can be simulated by simulation tools to obtain the simulated light intensity. The diffuse reflection light intensity refers to the intensity of light reflected in all directions after the light is projected onto a rough surface in the preset virtual environment. For example, the intensity of the diffuse reflection light can be calculated according to the law that the intensity of the diffuse reflection light is proportional to the cosine of the angle between the surface normal and the light source direction, based on the surface material of the reflecting object, the light source parameters and other information, by simulation software. The reflection light intensity refers to the intensity of light reflected from the object surface in the preset virtual environment. For example, the reflection light intensity can be calculated according to the Fresnel law (the law of reflection and refraction of light on the interface between two media). The light source direction refers to the direction of light emitted from the light source. For example, the light source direction in the preset virtual environment can be determined by setting the light source direction in the simulation software. The highlight index is a parameter for measuring the mirror reflection ability of the object surface in the preset virtual environment, which can reflect the intensity and range of the highlight effect of the object surface in the preset virtual environment when irradiated by the light source. For example, the highlight index can be determined by adjusting the material parameters in the simulation software.
[0150] Therefore, for the position of each representative vertex in the projection space, the normal direction, the reflection vector and the line of sight direction corresponding to the representative vertex can be determined, and then the illumination intensity corresponding to the representative vertex can be calculated based on the normal direction, the reflection vector and the line of sight direction corresponding to the representative vertex, and the simulated light intensity, the diffuse reflection light intensity, the reflection light intensity, the light source direction and the highlight index corresponding to the preset virtual environment, according to the above formula. It can be seen that in the illumination simulation process, not only the lighting environment in the preset virtual environment is considered, but also the influence of the representative vertex on the lighting environment. Therefore, by using the illumination simulation method, the lighting effect of the simplified three-dimensional model in the preset virtual environment can be accurately determined, and the rendering effect can be improved in the subsequent rendering process, so that the final rendering effect is more realistic.
[0151] S2024: Determine the illumination intensity corresponding to each vertex in the simplified three-dimensional model according to the illumination intensity corresponding to each representative vertex.
[0152] As an example, in a case that the light intensities corresponding to the plurality of representative vertices are determined, the light intensity of each vertex can be considered as the same as the light intensity of the representative vertex to which the vertex belongs. Alternatively, the light intensity of each vertex can be adjusted according to the distance between the representative vertex and each vertex in the same cluster, and the distance between each vertex and the light source. For example, if the distance between the representative vertex and a vertex A in the same cluster is within a first distance threshold range, and the vertex A is closer to the light source than the representative vertex, the light intensity corresponding to the representative vertex can be appropriately enhanced, and the enhanced light intensity can be taken as the light intensity of the vertex A. If the distance between the representative vertex and a vertex B in the same cluster is within a second distance threshold range (greater than the first distance threshold range), and the vertex B is farther from the light source than the representative vertex, the light intensity corresponding to the representative vertex can be appropriately weakened, and the weakened light intensity can be taken as the light intensity of the vertex B. Thus, according to the light intensities corresponding to the plurality of representative vertices, the light intensity corresponding to each vertex in the simplified three-dimensional model can be determined.
[0153] Thus, first, the clustering processing is performed on each vertex in the simplified three-dimensional model, and the plurality of representative vertices in the simplified three-dimensional model can be determined. Then, the spatial transformation processing is performed on the plurality of representative vertices, and the display positions of the plurality of representative vertices in the projection space can be determined. After that, the light simulation processing is performed, and the light intensities corresponding to the plurality of representative vertices when the simplified three-dimensional model is in the preset virtual environment can be determined. Finally, according to the light intensities corresponding to the plurality of representative vertices, the light intensity corresponding to each vertex in the simplified three-dimensional model can be determined. It can be seen that, in the light simulation processing, the representative vertices obtained by the clustering processing are taken as the execution units for processing, which can improve the processing efficiency of the light simulation processing, and reduce the calculation amount in the light simulation processing. Moreover, according to the light intensities corresponding to the plurality of representative vertices, the light intensity corresponding to each vertex in the simplified three-dimensional model can be accurately determined, so that the light effect of the simplified three-dimensional model in the preset virtual environment can be accurately determined, and the rendering performance is improved.
[0154] In a possible implementation, in the process of performing S203, the method provided by the embodiment of the present application can further include:
[0155] In the process of rendering the simplified three-dimensional model, rendering enhancement processing is performed. The rendering enhancement processing includes at least one of the following: high-frequency detail enhancement processing, light ray following processing, ambient light occlusion processing, and dynamic blur processing for a motion region in the simplified three-dimensional model.
[0156] The rendering enhancement processing refers to a processing method for improving the quality of a two-dimensional image obtained by rendering through a series of technical means in the rendering process of a simplified three-dimensional model, so that the two-dimensional image is clearer, more realistic, and meets specific visual effect requirements. For example, the rendering enhancement processing can include any one or more of high-frequency detail enhancement processing, light ray following processing, ambient light occlusion processing, and dynamic blur processing for motion regions in the simplified three-dimensional model.
[0157] The high-frequency detail enhancement processing is an algorithm for enhancing the rendering effect of high-frequency details in an image, which improves the clarity and information amount of the image by extracting and enhancing the high-frequency details in the image. The high-frequency details in the image can be details, edges, and texture information in the image, and the high-frequency details in the simplified three-dimensional model can be determined according to the attention degree of different regions in the simplified three-dimensional model, that is, a region in the simplified three-dimensional model is in a more obvious position and is more easily paid attention to, and the region can be considered as a high-frequency detail region in the simplified three-dimensional model, and the high-frequency detail enhancement processing can be performed on the region in the rendering process.
[0158] As an example, the high-frequency detail enhancement processing can be implemented in the following way:
[0159] Based on the Gaussian blur function, target vertices belonging to the high-frequency detail region are extracted from each vertex included in the simplified three-dimensional model.
[0160] Based on the target vertices, image enhancement processing is performed on the texture associated with the simplified three-dimensional model.
[0161] The Gaussian blur function is used to reduce noise and detail levels in an image to simulate the effect that objects seen by the human eye become blurred as the distance increases. The Gaussian blur function is implemented by weighted averaging of a pixel point and its surrounding pixel points in the image. The target vertex is used to indicate the vertex in the simplified three-dimensional model that belongs to the high-frequency detail region. For example, based on the Gaussian blur function, the target vertices belonging to the high-frequency detail region are extracted from each vertex of the simplified three-dimensional model, as shown in formula 13. hf = a * (V - G(V, s)) Formula 13
[0162] D in the above formula 13 hf represents the vertex corresponding to the high-frequency detail region in the simplified three-dimensional model, i.e. the target vertex, G(V, s) represents the Gaussian blur function applied to each vertex in the simplified three-dimensional model, s represents the standard deviation of the Gaussian kernel, which is used to control the degree of blurring in the Gaussian blur function. a represents the coefficient for controlling the enhancement intensity when extracting the target vertex.
[0163] After the target vertex is determined, the image enhancement processing can be performed based on the target vertex and the map associated with the simplified three-dimensional model for representing the high-frequency detail area in the simplified three-dimensional model according to Formula 14. enhanced = I + l * D hf Formula 14
[0164] I in Formula 14 above enhanced represents the map obtained after the image enhancement processing based on the high-frequency detail area in the simplified three-dimensional model, I represents the map associated with the simplified three-dimensional model, and l represents a coefficient for controlling the enhancement intensity of the image enhancement processing. The image enhancement processing refers to a processing method for improving the quality of the map image corresponding to the high-frequency detail area in the simplified three-dimensional model to achieve better visual effects.
[0165] Therefore, the target vertex for representing the high-frequency detail area in the simplified three-dimensional model can be determined by the above formula, and then the image enhancement processing can be performed based on the target vertex and the map associated with the simplified three-dimensional model, and the map obtained after the image enhancement processing based on the high-frequency detail area in the simplified three-dimensional model can be obtained. It can be seen that the high-frequency detail enhancement processing method can enhance the high-frequency detail area in the simplified three-dimensional model to improve the clarity of the two-dimensional image containing the simplified three-dimensional model.
[0166] The ray tracing processing is a method for realistically displaying an object, which mainly simulates the propagation and reflection of light in a scene by tracing the light rays interacting with optical surfaces, and is used to realistically simulate the propagation and reflection of light in a scene to generate a high-quality two-dimensional image containing the simplified three-dimensional model.
[0167] As an example, the ray tracing processing can be implemented in the following way:
[0168] For each pixel point in the model image to be generated, determine the reflection light rays corresponding to the pixel point; and determine the color value corresponding to the pixel point according to the reflection light rays corresponding to the pixel point and their light intensities by using a ray tracing function.
[0169] The model image to be generated refers to a two-dimensional image containing the simplified three-dimensional model obtained after rendering the simplified three-dimensional model. For example, for each pixel point in the two-dimensional image, the reflection light rays corresponding to the pixel point can be determined according to Formula 15. i = R(o i , d i ) Formula 15
[0170] r in Formula 15 above i represents the reflection light ray corresponding to a pixel point in the model image to be generated, R(oi , d i ) is a function for calculating the reflected light ray of the pixel point, o i represents the position of the observer, i.e., the observation point, d i represents the direction of the reflected light ray from the observation point direction.
[0171] After determining the reflected light rays corresponding to the pixel point, the color value corresponding to the pixel point can be determined according to the reflected light rays corresponding to the pixel point and the light ray intensity thereof by referring to formula 16 through the light ray tracing function.
[0172] C ray in the above formula 16 represents the color value corresponding to the pixel point, x represents the number of reflected light rays related to the pixel point, L represents the light ray tracing function, and T represents the light ray intensity of the reflected light ray corresponding to the pixel point. The light ray tracing function is used to simulate the process of light rays from the light source, passing through the objects in the scene, and finally reaching the observer's eyes to generate a highly realistic image.
[0173] Therefore, the reflected light rays corresponding to the pixel point in the two-dimensional image containing the simplified three-dimensional model can be determined through the above formula, and then the color value corresponding to the pixel point can be determined according to the reflected light rays corresponding to the pixel point and the light ray intensity thereof through the light ray tracing function. It can be seen that the rendering enhancement of the simplified three-dimensional model through the light ray tracing processing method can realistically simulate the propagation and reflection process of light rays in the preset virtual environment, so as to ensure that the color value of the pixel point can be close to the rendering effect of the original three-dimensional model, thereby improving the reality of the two-dimensional image containing the simplified three-dimensional model.
[0174] Ambient occlusion processing is a technique for improving the shadow effect generated when objects in an image occlude each other. By simulating the occlusion of ambient light on the surface of objects and gaps, the details and levels of the image are enhanced. That is, when objects are close to or intersect with each other, they will block the surrounding light, resulting in the generation of shadows and dark parts. The ambient occlusion technique enhances the dark details and levels of the image by calculating the impact of these blocked light rays on the surface of the object.
[0175] As an example, ambient occlusion processing can be implemented in the following way:
[0176] For each pixel point in the model image to be generated, the ambient occlusion value corresponding to the pixel point is determined according to the visible relationship between the pixel point and each vertex in the simplified three-dimensional model.
[0177] The ambient occlusion value is used to indicate the strength value of the indirect light received by the pixel point in the model image to be generated due to the occlusion of the surrounding environment.
[0178] For example, by referring to Formula 17, the ambient light occlusion value corresponding to a pixel can be determined based on the visibility relationship between the pixel and each vertex in the simplified 3D model.
[0179] In Formula 17 above, A0(p) represents the ambient occlusion value corresponding to pixel p, X represents the number of vertices in the simplified 3D model, and V(p, p) represents the number of vertices in the model. i V(p, p) refers to the visibility function used to characterize the visibility relationship between a pixel and the vertices in a simplified 3D model. For example, when V(p, p) = ... i When ) = 1, it represents the i-th vertex p in the simplified 3D model. i It is visible to pixel p, meaning that the i-th vertex p can be seen from pixel p. i When V(p, p) i When ) = 0, it represents the i-th vertex p in the simplified 3D model. i It is invisible to pixel p, meaning that the i-th vertex p cannot be seen from pixel p. i .
[0180] Therefore, the above formula can be used to determine the ambient occlusion value of a pixel based on the visibility relationship between the pixel and the vertices in the simplified 3D model. It is evident that by using ambient occlusion processing to enhance the rendering of the simplified 3D model, the impact of occluded light on pixels in the 2D image can be calculated, thereby enhancing the depth and detail richness of the 2D image containing the simplified 3D model.
[0181] Dynamic blurring of moving regions in simplified 3D models is a technique used to enhance the realism of moving scenes. When a simplified 3D model or camera moves rapidly, dynamic blurring is applied to the moving regions to simulate the blurring effect produced by a slow camera shutter speed in actual shooting, thereby enhancing the realism of the 2D image containing the simplified 3D model. The moving regions in the simplified 3D model are identified and judged based on algorithms. For example, if the algorithm identifies key features of the moving region, such as joints and rotation axes, the area containing these key features is considered to belong to the moving region in the simplified 3D model. This application does not specifically limit the moving regions in the simplified 3D model.
[0182] As an example, motion blurring of moving regions in a simplified 3D model can be achieved in the following way:
[0183] For each pixel in the model image to be generated that corresponds to the motion region, the dynamic blur value corresponding to the pixel is determined based on the model motion speed at each dynamic sampling moment and the time interval between every two adjacent dynamic sampling moments.
[0184] The dynamic sampling time refers to a sampling time when a vertex in the motion region moves. The dynamic blur value corresponding to the pixel point refers to a result value of a dynamic blur effect achieved when the camera or the simplified three-dimensional model moves in a rendering process.
[0185] For example, referring to formula 18, the dynamic blur value corresponding to the pixel point can be determined according to the model motion speed at each dynamic sampling time and the time interval between each two adjacent dynamic sampling times.
[0186] B in formula 18 above motion (p) represents the dynamic blur value of the pixel point p corresponding to the motion region in the model image to be generated, Y represents the total number of dynamic sampling times, I represents an image function for determining the dynamic blur effect of the pixel point in the motion region, s i represents the model motion speed at the i th dynamic sampling time, and Δt represents the time interval between two adjacent dynamic sampling times.
[0187] Therefore, the dynamic blur value corresponding to the pixel point can be determined according to the model motion speed at the dynamic sampling time and the time interval between each two adjacent dynamic sampling times by using the formula. It can be seen that the rendering of the motion region in the simplified three-dimensional model is enhanced by using the dynamic blur processing method for the motion region in the simplified three-dimensional model, so that the visual effect of the motion region is enhanced, and the two-dimensional image containing the simplified three-dimensional model obtained by rendering is more dynamic and realistic.
[0188] It should be noted that the rendering enhancement processing method can be applied in one or multiple ways in the rendering process, and the number and type of the rendering enhancement processing method used in the process of rendering the simplified three-dimensional model are not specifically limited in the present application.
[0189] Therefore, in the process of rendering the simplified three-dimensional model, the rendering of the simplified three-dimensional model is enhanced by using the rendering enhancement processing method, so that the rendering effect of the simplified three-dimensional model is enhanced from different dimensions, the rendering quality of the simplified three-dimensional model is improved, and the realism of the simulated lighting and the map is increased, so as to obtain a two-dimensional image with more realistic and more close-to-original three-dimensional model rendering effect.
[0190] Based on the model rendering method provided in the foregoing embodiments, a model rendering device is also provided in the present application. The following is described in combination with FIG. 8, which is a structural schematic diagram of a model rendering device 800 provided in an embodiment of the present application. The device comprises:
[0191] The simplification module 801 is configured to simplify the initial three-dimensional model by reducing the number of model meshes based on the topological structure features of the initial three-dimensional model, to obtain a simplified three-dimensional model; wherein the simplified three-dimensional model meets the preset similarity requirement with the initial three-dimensional model.
[0192] The light simulation module 802 is configured to determine the light intensity corresponding to the vertex in the simplified three-dimensional model when the simplified three-dimensional model is in a preset virtual environment through light simulation processing.
[0193] The rendering module 803 is configured to render the simplified three-dimensional model based on the simplified three-dimensional model and the light intensity corresponding to the vertex in the simplified three-dimensional model, to obtain a model image corresponding to the simplified three-dimensional model.
[0194] Optionally, the simplification module 801 comprises:
[0195] The simplification processing unit is configured to simplify the initial three-dimensional model by reducing the number of model meshes based on the topological structure features of the initial three-dimensional model, to obtain a simplified candidate three-dimensional model.
[0196] The difference measurement processing unit is configured to perform difference measurement processing on the simplified candidate three-dimensional model; the difference measurement processing comprises: determining whether the simplified candidate three-dimensional model meets the preset similarity requirement with the initial three-dimensional model according to the visual quality evaluation result and the performance evaluation result corresponding to the simplified candidate three-dimensional model, and the visual quality evaluation result and the performance evaluation result corresponding to the initial three-dimensional model.
[0197] The first determination unit is configured to determine the simplified candidate three-dimensional model as the simplified three-dimensional model if the simplified candidate three-dimensional model meets the preset similarity requirement with the initial three-dimensional model; and to perform the simplification processing again to obtain a new simplified candidate three-dimensional model, and perform the difference measurement processing on the new simplified candidate three-dimensional model if the simplified candidate three-dimensional model does not meet the preset similarity requirement with the initial three-dimensional model.
[0198] Optionally, the initial three-dimensional model comprises a plurality of sub-model regions; and the simplification module 801 comprises:
[0199] The second determination unit is configured to determine, for each sub-model region, an importance evaluation result of the sub-model region based on the topological structure features of the sub-model region, and determine the number of to-be-reduced meshes corresponding to the sub-model region according to the importance evaluation result, and perform regional simplification processing on the sub-model region according to the number of to-be-reduced meshes, to obtain a sub-simplified model region corresponding to the sub-model region.
[0200] A third determining unit is configured to determine the simplified candidate three-dimensional model according to the sub-simplified model region corresponding to each of the sub-model regions.
[0201] Optionally, the apparatus further comprises a unit for determining the topological structure feature of the sub-model region.
[0202] A fourth determining unit is configured to determine the topological structure feature of the sub-model region by a scale-invariant feature transformation algorithm according to the position data of each vertex in the sub-model region and the respective associated texture patch.
[0203] Optionally, the second determining unit comprises:
[0204] A fifth determining unit is configured to determine the visual quality evaluation result and the geometric quality evaluation result of the sub-model region based on the topological structure feature of the sub-model region; the visual quality evaluation result is used to represent the influence degree of the change of the number of meshes in the sub-model region on the corresponding texture effect of the sub-model region, and the geometric quality evaluation result is used to represent the influence degree of the change of the number of meshes in the sub-model region on the shape of the region.
[0205] A sixth determining unit is configured to determine the importance evaluation result of the sub-model region according to the visual quality evaluation result and the geometric quality evaluation result.
[0206] Optionally, the difference measurement processing unit comprises:
[0207] A seventh determining unit is configured to determine the first visual quality difference between the simplified candidate three-dimensional model and the initial three-dimensional model according to the respective region visual quality difference of each group of regions; the region pair in the group of regions comprises the sub-simplified model region and the sub-model region having a corresponding relationship, and the region visual quality difference is determined according to the respective visual quality evaluation result of the sub-simplified model region and the sub-model region.
[0208] The seventh determining unit is configured to determine the second visual quality difference according to the respective visual quality evaluation result of the simplified candidate three-dimensional model and the initial three-dimensional model.
[0209] An eighth determining unit is configured to determine the performance difference according to the respective performance evaluation result of the simplified candidate three-dimensional model and the initial three-dimensional model.
[0210] A ninth determining unit is configured to determine whether the simplified candidate three-dimensional model and the initial three-dimensional model meet the preset similarity requirement according to the first visual quality difference, the second visual quality difference and the performance difference.
[0211] Optionally, the light simulation module 802 comprises:
[0212] a clustering processing unit configured to perform clustering processing on each vertex in the simplified three-dimensional model to determine a plurality of representative vertices in the simplified three-dimensional model;
[0213] a spatial transformation processing unit configured to perform spatial transformation processing on the plurality of representative vertices to determine a position of each of the plurality of representative vertices in a projection space;
[0214] a tenth determination unit configured to determine, through light simulation processing, a light intensity corresponding to each of the plurality of representative vertices when the simplified three-dimensional model is in the preset virtual environment based on the position of each of the plurality of representative vertices in the projection space;
[0215] a light intensity determination unit configured to determine a light intensity corresponding to each vertex in the simplified three-dimensional model according to the light intensity corresponding to each of the plurality of representative vertices.
[0216] Optionally, the spatial transformation processing unit comprises:
[0217] a first transformation unit configured to transform the position of each of the plurality of representative vertices in a model space to obtain a position of each of the plurality of representative vertices in a world space;
[0218] a second transformation unit configured to transform the position of each of the plurality of representative vertices in the world space to obtain a position of each of the plurality of representative vertices in a view space;
[0219] a third transformation unit configured to transform the position of each of the plurality of representative vertices in the view space to obtain the position of each of the plurality of representative vertices in the projection space.
[0220] Optionally, the tenth determination unit comprises:
[0221] an eleventh determination unit configured to determine, for each of the representative vertices, a normal direction, a reflection vector and a line-of-sight direction corresponding to the representative vertex according to the position of the representative vertex in the projection space, and determine the light intensity corresponding to the representative vertex according to the simulation light intensity, the diffuse reflection light intensity, the reflection light intensity, the light source direction and the highlight index corresponding to the preset virtual environment, and the normal direction, the reflection vector and the line-of-sight direction.
[0222] Optionally, the apparatus further comprises:
[0223] The rendering enhancement processing unit is configured to perform a rendering enhancement processing during the rendering of the simplified three-dimensional model, and the rendering enhancement processing includes at least one of high-frequency detail enhancement processing, ray tracing processing, ambient occlusion processing, and dynamic blur processing for a motion region in the simplified three-dimensional model.
[0224] Optionally, the apparatus further includes the following units for implementing the high-frequency detail enhancement processing:
[0225] The extraction unit is configured to extract target vertices belonging to the high-frequency detail region from each vertex included in the simplified three-dimensional model based on a Gaussian blur function.
[0226] The image enhancement processing unit is configured to perform image enhancement processing on a texture associated with the simplified three-dimensional model based on the target vertices.
[0227] Optionally, the apparatus further includes the following units for implementing the ray tracing processing:
[0228] The color value determination unit is configured to determine, for each pixel in the model image to be generated, a plurality of reflection rays corresponding to the pixel, and determine a color value corresponding to the pixel based on the reflection rays and their intensities corresponding to the pixel by using a ray tracing function.
[0229] Optionally, the apparatus further includes the following units for implementing the ambient occlusion processing:
[0230] The ambient occlusion value determination unit is configured to determine, for each pixel in the model image to be generated, an ambient occlusion value corresponding to the pixel based on a visibility relationship between the pixel and each vertex in the simplified three-dimensional model.
[0231] Optionally, the apparatus further includes the following units for implementing the dynamic blur processing:
[0232] The dynamic blur value determination unit is configured to determine, for each pixel in the model image to be generated corresponding to the motion region, a dynamic blur value corresponding to the pixel based on a model motion speed at each dynamic sampling time and a time interval between each two adjacent dynamic sampling times.
[0233] Embodiments of the present application also provide a computer device, which can be a terminal device or a server. In the following, the terminal device and the server provided by embodiments of the present application will be introduced from the perspective of hardware realization.
[0234] Referring to FIG. 9, FIG. 9 is a structural schematic diagram of a terminal device provided in an embodiment of the present application. As shown in FIG. 9, for the convenience of description, only parts related to the embodiments of the present application are shown, and specific technical details not disclosed are referred to the method part of the embodiments of the present application. The terminal can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (PDA), a point of sales (POS), a vehicle-mounted computer, etc. Take the terminal as a computer for example:
[0235] FIG. 9 shows a block diagram of part of the structure of a computer related to the terminal provided in the embodiments of the present application. Referring to FIG. 9, the computer includes a radio frequency (RF) circuit 1210, a memory 1220, an input unit 1230 (including a touch panel 1231 and other input devices 1232), a display unit 1240 (including a display panel 1241), a sensor 1250, an audio circuit 1260 (connected with a speaker 1261 and a microphone 1262), a wireless fidelity (WiFi) module 1270, a processor 1280, and a power supply 1290, etc. Those skilled in the art can understand that the structure of the computer shown in FIG. 9 does not constitute a limitation on the computer, and the computer can include more or less components than those shown in the figure, or combine some components, or have a different arrangement of components.
[0236] The memory 1220 can be used to store software programs and modules, and the processor 1280 executes various function applications and data processing of the computer by running the software programs and modules stored in the memory 1220. The memory 1220 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc.; and the data storage area can store data created according to the use of the computer (such as audio data, a phone book, etc.), etc. In addition, the memory 1220 can include a high-speed random access memory, and can also include a non-volatile memory, for example, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device.
[0237] The processor 1280 is the control center of the computer, connecting various parts of the computer through various interfaces and lines, performing various functions of the computer and processing data by running or executing software programs and / or modules stored in the memory 1220 and calling data stored in the memory 1220. Optionally, the processor 1280 can include one or more processing units; preferably, the processor 1280 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 1280.
[0238] In the embodiment of the application, the processor 1280 included in the terminal is configured to perform the steps in the model rendering method described in the above various embodiments.
[0239] Referring to FIG. 10, FIG. 10 is a structural schematic diagram of a server 1300 provided by an embodiment of the application. The server 1300 can be quite different due to different configurations or performances, and can include one or more central processing units (CPUs) 1322 (for example, one or more processors) and a memory 1332, and one or more storage media 1330 (for example, one or more mass storage devices) storing application programs 1342 or data 1344. The memory 1332 and the storage media 1330 can be temporary storage or persistent storage. The programs stored in the storage media 1330 can include one or more modules (not shown in the figure), each of which can include a series of instruction operations in the server. Further, the central processing unit 1322 can be configured to communicate with the storage media 1330 and execute the series of instruction operations in the storage media 1330 on the server 1300.
[0240] The server 1300 can also include one or more power supplies 1326, one or more wired or wireless network interfaces 1350, one or more input / output interfaces 1358, and / or one or more operating systems, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM , etc.
[0241] The steps performed by the server in the above embodiments can be based on the server structure shown in FIG. 10.
[0242] The CPU 1322 is configured to execute the steps of the model rendering method described in the above embodiments.
[0243] The embodiments of the present application further provide a computer readable storage medium for storing a computer program, which is configured to execute the steps of the model rendering method described in the above embodiments.
[0244] The embodiments of the present application further provide a computer program product including a computer program, which, when executed on a computer, causes the computer to perform the method provided by the above embodiments.
[0245] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the above method embodiments, which will not be repeated here.
[0246] In the several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented by other ways. For example, the device embodiments described above are only schematic, and for the convenience of description, the division of the units is only a logical function division, and there can be another division way in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection between the units can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0247] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the present embodiment scheme.
[0248] In addition, each functional unit in the embodiments of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0249] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various computer program storage media.
[0250] It should be understood that in the present application, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" is used to describe the association relationship of the associated objects, which means that there can be three kinds of relationships, for example, "A and / or B" can represent: only A, only B, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally represents that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0251] The above-described and above-mentioned embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A model rendering method, the method being performed by a computer device, the method comprising: simplifying an initial three-dimensional model by reducing a number of model meshes based on a topological structure feature of the initial three-dimensional model to obtain a simplified three-dimensional model, wherein the simplified three-dimensional model meets a preset similarity requirement with the initial three-dimensional model; determining, by a light simulation process, a light intensity corresponding to a vertex in the simplified three-dimensional model when the simplified three-dimensional model is in a preset virtual environment; rendering the simplified three-dimensional model based on the simplified three-dimensional model and the light intensity to obtain a model image corresponding to the simplified three-dimensional model.
2. The method of claim 1, wherein the simplifying the initial three-dimensional model by reducing a number of model meshes based on a topological structure feature of the initial three-dimensional model to obtain a simplified three-dimensional model comprises: simplifying the initial three-dimensional model by reducing a number of model meshes based on a topological structure feature of the initial three-dimensional model to obtain a simplified candidate three-dimensional model; performing a difference measurement process on the simplified candidate three-dimensional model, the difference measurement process comprising: determining whether the simplified candidate three-dimensional model meets the preset similarity requirement with the initial three-dimensional model according to a visual quality evaluation result and a performance evaluation result corresponding to the simplified candidate three-dimensional model and a visual quality evaluation result and a performance evaluation result corresponding to the initial three-dimensional model; if the simplified candidate three-dimensional model meets the preset similarity requirement with the initial three-dimensional model, determining that the simplified candidate three-dimensional model is the simplified three-dimensional model, and if the simplified candidate three-dimensional model does not meet the preset similarity requirement with the initial three-dimensional model, re-executing the simplifying process to obtain a new simplified candidate three-dimensional model and performing the difference measurement process on the new simplified candidate three-dimensional model.
3. The method of claim 2, wherein the initial three-dimensional model comprises a plurality of sub-model regions, and the simplifying the initial three-dimensional model by reducing a number of model meshes based on a topological structure feature of the initial three-dimensional model to obtain a simplified candidate three-dimensional model comprises: for each of the sub-model regions, determining an importance evaluation result of the sub-model region based on a topological structure feature of the sub-model region, and determining a number of meshes to be reduced corresponding to the sub-model region according to the importance evaluation result; performing a regional simplification process on the sub-model region according to the number of meshes to be reduced to obtain a sub-simplified model region corresponding to the sub-model region; and determining the simplified candidate three-dimensional model according to the sub-simplified model regions corresponding to the plurality of sub-model regions.
4. The method of claim 3, wherein the topological structure feature of the sub-model region is determined by: determining the topological structure feature of the sub-model region based on position data of each vertex in the sub-model region and a respective associated texture patch of each vertex by a scale-invariant feature transform algorithm.
5. The method of claim 3 or 4, wherein the determining the importance evaluation result of the sub-model region based on the topological structure feature of the sub-model region comprises: determining a visual quality evaluation result and a geometric quality evaluation result of the sub-model region based on the topological structure feature of the sub-model region, the visual quality evaluation result being used to represent an influence degree of a change in the number of meshes in the sub-model region on a corresponding mapping effect of the sub-model region, and the geometric quality evaluation result being used to represent an influence degree of the change in the number of meshes in the sub-model region on a shape of the sub-model region; and determining the importance evaluation result of the sub-model region according to the visual quality evaluation result and the geometric quality evaluation result.
6. The method of any one of claims 3 to 5, wherein the determining whether the simplified candidate three-dimensional model and the initial three-dimensional model satisfy the preset similarity requirement according to the visual quality evaluation result and the performance evaluation result of the simplified candidate three-dimensional model and the visual quality evaluation result and the performance evaluation result of the initial three-dimensional model comprises: determining a first visual quality difference between the simplified candidate three-dimensional model and the initial three-dimensional model according to a visual quality difference of each group of regions corresponding to each other; wherein the group of regions comprises the sub-simplified model region and the sub-model region having a corresponding relationship, and the visual quality difference is determined according to the visual quality evaluation result of the sub-simplified model region and the sub-model region; determining a second visual quality difference according to the visual quality evaluation result of the simplified candidate three-dimensional model and the initial three-dimensional model; determining a performance difference according to the performance evaluation result of the simplified candidate three-dimensional model and the initial three-dimensional model; and determining whether the simplified candidate three-dimensional model and the initial three-dimensional model satisfy the preset similarity requirement according to the first visual quality difference, the second visual quality difference, and the performance difference.
7. The method of any one of claims 1 to 6, wherein the determining the light intensity corresponding to each vertex in the simplified three-dimensional model when the simplified three-dimensional model is in the preset virtual environment through the light simulation processing comprises: performing clustering processing on each vertex in the simplified three-dimensional model to determine a plurality of representative vertices in the simplified three-dimensional model; performing spatial transformation processing on the plurality of representative vertices to determine a position of each of the plurality of representative vertices in a projection space; determining a light intensity corresponding to each of the plurality of representative vertices when the simplified three-dimensional model is in the preset virtual environment based on the position of each of the plurality of representative vertices in the projection space through the light simulation processing; and determining a light intensity corresponding to each vertex in the simplified three-dimensional model based on the light intensity corresponding to each of the plurality of representative vertices.
8. The method of claim 7, wherein the performing spatial transformation processing on the plurality of representative vertices to determine the position of each of the plurality of representative vertices in the projection space comprises: transforming, based on the positions of the plurality of representative vertices in the model space, positions of the plurality of representative vertices in a world space; transforming, based on the positions of the plurality of representative vertices in the world space, positions of the plurality of representative vertices in a view space; transforming, based on the positions of the plurality of representative vertices in the view space, positions of the plurality of representative vertices in a projection space.
9. The method of claim 7 or 8, wherein the determining, based on the positions of the plurality of representative vertices in the projection space, the respective lighting intensities of the plurality of representative vertices when the simplified three-dimensional model is in the preset virtual environment, comprises: for each representative vertex, determining a normal direction, a reflection vector, and a view direction corresponding to the representative vertex according to the position of the representative vertex in the projection space; and determining the lighting intensity corresponding to the representative vertex according to the simulated light intensity, the diffuse reflection light intensity, the reflection light intensity, the light source direction, and the highlight index of the preset virtual environment, and the normal direction, the reflection vector, and the view direction.
10. The method of any one of claims 1 to 9, further comprising: in the process of rendering the simplified three-dimensional model, performing a rendering enhancement process, the rendering enhancement process comprising at least one of a high-frequency detail enhancement process, a ray tracing process, an ambient light occlusion process, and a dynamic blur process for a motion region in the simplified three-dimensional model.
11. The method of claim 10, wherein the high-frequency detail enhancement process is implemented by: extracting, from each vertex included in the simplified three-dimensional model, a target vertex belonging to a high-frequency detail region based on a Gaussian blur function; and performing an image enhancement process on a texture map associated with the simplified three-dimensional model based on the target vertex.
12. The method of claim 10, wherein the ray tracing process is implemented by: for each pixel point in the model image to be generated, determining a plurality of reflection rays corresponding to the pixel point; and determining a color value corresponding to the pixel point according to the plurality of reflection rays and their light intensities corresponding to the pixel point by a ray tracing function.
13. The method of claim 10, wherein the ambient light occlusion process is implemented by: for each pixel point in the model image to be generated, determining an ambient light occlusion value corresponding to the pixel point according to a visible relationship between the pixel point and each vertex in the simplified three-dimensional model.
14. The method of claim 10, wherein the dynamic blur process is implemented by: for each pixel point in the model image to be generated corresponding to the motion region, determining a dynamic blur value corresponding to the pixel point according to a model motion speed at each dynamic sampling time and a time interval between each two adjacent dynamic sampling times.
15. A model rendering device, the device comprising: simplify the initial three-dimensional model by reducing the number of model meshes based on a topological structure feature of the initial three-dimensional model, to obtain a simplified three-dimensional model; wherein the simplified three-dimensional model and the initial three-dimensional model satisfy a preset similarity requirement; simulate the light of the simplified three-dimensional model in a preset virtual environment, to determine a light intensity corresponding to a vertex in the simplified three-dimensional model; render the simplified three-dimensional model based on the simplified three-dimensional model and the light intensity, to obtain a model image corresponding to the simplified three-dimensional model.
16. A computer device, comprising a processor and a memory; the memory is configured to store a computer program; the processor is configured to execute the model rendering method according to any one of claims 1 to 14 based on the computer program.
17. A computer readable storage medium configured to store a computer program, wherein the computer program is executed by an electronic device to implement the model rendering method according to any one of claims 1 to 14.
18. A computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the model rendering method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Illumination environment simulation system and method thereof
CN102087752A
Model simplification processing method and device, electronic equipment and storage medium
CN111080792A
Three-dimensional model rendering method and device, medium and computer equipment
CN114898048A
Large-scale virtual reality system based on grid compression
CN116843841A
Rapid illumination model rendering method based on image space and cloud rendering method
CN118037935A
Cited By
High-efficiency and high-fidelity rendering method for large-scale CAE (Computer Aided Engineering) simulation data
CN122023629A