A method for organizing and scheduling static meshes in Unreal Engine
By designing the tile geometric measurement error calculation method and geometric measurement error achievement rate concept in Unreal Engine, the quad-tree tile pyramid structure and binding set are used to organize static meshes, which solves the problems of low automation and waste of resources in the existing technology, and achieves more efficient static mesh management and rendering.
Patent Information
- Application Number
- CN202411431850.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2044-10-14
AI Technical Summary
The organizational automation level of static meshes in the existing Unreal Engine is low, and the organization and scheduling strategies are unreasonable, resulting in waste of resources and low rendering efficiency.
Design a calculation method for tile geometric errors, and propose the concept of geometric error achievement rate. Simplify and organize static meshes through the quadrant tile pyramid structure and binding set to improve the level of automation.
It improves the automation organization efficiency of static mesh, reduces resource consumption and traversal time, and improves rendering efficiency and visual experience.
Smart Images

Figure CN119494907B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method for organizing and scheduling static meshes in an Unreal Engine. Background Art
[0002] In the creation of open world scenes in Unreal Engine, tens of thousands or even hundreds of thousands of static meshes need to be processed. If such a large number is loaded at once without organization, especially in Unreal Engine, the real-time lighting effects of the static bodies need to be calculated, and it is difficult to load and render smoothly with the computing power of the GPU. To solve this problem, Unreal Engine has specially launched the world partition technology, which is its latest technology. This technology uses a two-dimensional grid to divide the entire scene in detail, and retrieves and judges the surrounding grids to load with the projection of the perspective as the center.
[0003] The prior art has the following disadvantages:
[0004] (1) Although Unreal Engine provides world partitioning technology, its automation level is low, and the size of the partition grid needs to be determined manually based on the size of the static mesh. In addition, only two dimensions are considered during retrieval. No matter how far the viewpoint is from the partition grid in the vertical direction, the static mesh in the partition grid will be loaded, which will cause extreme waste of resources. Only the static meshes around the viewpoint are loaded, without considering the size of the screen pixels occupied by the meshes. Even if some distant meshes occupy a large number of screen pixels, they will be eliminated.
[0005] (2) In patent announcement number CN113628331B, the current node error of the corresponding level of the current node is obtained according to the area of the mesh model and the resolution of the texture image, and then the loading of the tile is determined according to the relationship between the node error and the maximum screen error. However, this method only loads the tilted model and does not process the static mesh in the open world scene.
[0006] (3) In patent announcement number CN117372599B, when organizing the BIM model, it is necessary to calculate the geometric metric error of each model, and when loading and scheduling, it is necessary to traverse and compare the model screen error and the maximum screen error. Too many static meshes in the open world scene also cause huge resource consumption. Summary of the invention
[0007] The purpose of the present invention is to provide a method for organizing and scheduling static meshes in an Unreal Engine, so as to solve the technical problems of low automation level of static mesh organization and unreasonable organization and scheduling strategies in existing Unreal Engines.
[0008] By designing a calculation method for tile geometric metric error and proposing the concept of geometric metric error achievement rate, static meshes are simplified and organized based on this, improving the level of automation. Binding collections are used to organize and schedule static meshes, improving the visual experience and reducing traversal time.
[0009] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0010] A method for organizing and scheduling static meshes in an Unreal Engine, the method comprising the following steps:
[0011] Step 1: First, divide the static meshes of the specified level of Unreal Engine into two categories: indoor and outdoor according to the topology information;
[0012] Step 2: Generate a quadtree tile pyramid structure for the entire scene and calculate the geometric metric error of each quadtree tile;
[0013] Step 3: Propose the concept of geometric metric error achievement rate, and use the error achievement rate control QEM algorithm to simplify the model to obtain the target hierarchical model;
[0014] Step 4: Associate the level of detail model to the target quadtree tile to obtain a binding set;
[0015] Step 5: Organize the static meshes in the room in an orderly manner;
[0016] Step 6: Schedule indoor and outdoor static meshes.
[0017] Furthermore, in step 1, the specific process of dividing the static mesh into indoor and outdoor categories is as follows:
[0018] Traverse the static mesh data under the specified level, determine the topological information attributes in each static mesh, if it contains topological attributes representing the building, determine whether it contains indoor and outdoor attributes, if it is missing, it needs to be supplemented manually, then re-traverse the static mesh, if it contains indoor identification information, move the uasset assets belonging to the indoor static mesh to the memory that saves the indoor static mesh, and invert it, and move the uasset assets of the remaining static meshes to the memory that saves the outdoor static meshes.
[0019] Furthermore, in step 2, the specific process of calculating the geometric metric error of each quadtree tile is:
[0020] Get the bounding box containing all static meshes, and divide the bounding box equally in a recursive way, that is, the length and width of the child bounding box are half of the length and width of the parent bounding box, and the height of the bounding box is the height of the bounding box of all static meshes in the area. Build a quadtree pyramid structure from top to bottom. When the quadtree depth is 6, stop dividing. Use the composite Morton code to compile the unique number of the tile, where the first digit on the left is the quadtree depth, followed by the row and column numbers representing the calculated Morton code. The calculation of the composite Morton code is as shown in formula (1):
[0021]
[0022] Where: l represents the depth of the quadtree, & represents the combination of two values, i is the tile row number when the quadtree depth is l, j is the tile column number when the quadtree depth is l, 0≤i, j≤2n, k is a positive integer, It means round down, and mod() means remainder;
[0023] According to the known parameters, the relationship between the screen error and the geometric error and the distance weight, the geometric metric error GE of each tile is calculated using formula (2): m :
[0024]
[0025] In the formula: GE m Indicates the geometric metric error of tile number m, mSSE is the maximum screen error set, fov indicates the field of view of the camera during rendering, h is the height of the display, s m represents the product of the length, width and height of the tile numbered m, ds is the distance from the view angle A to the center of the tile B when the tile is parallel to the near and far clipping planes at a depth of 0 and the tile is just surrounded by the viewing frustum at the same time, and s 0 Represents the product of the length, width and height of the tile when the quadtree depth is 0.
[0026] Furthermore, the specific process of step 3 is:
[0027] According to the geometric metric error value of the quadtree tile, the mesh data in the tile area is read from the static mesh memory outside the storage room, and the hierarchical detail model of the static mesh is calculated by edge folding simplification based on quadratic error. The geometric metric error rate is used as the control amount of the edge folding simplification rate, and the model that conforms to the tile geometric metric error is iteratively folded. The specific steps are as follows:
[0028] (1) Take out the file from the static mesh memory where the room is saved, and determine whether the detailed model of the current level has been generated. If it has been generated, traverse the next model. If it has not been generated, use the QEM algorithm to simplify the triangulated network of the model to 90% of the original to obtain the level detailed model M.1 ;
[0029] (2) Calculate the geometric metric error GE between the simplified model and the original model 2 , specifically, the maximum value of the minimum distance between the models before and after simplification is calculated as the geometric metric error of the two models;
[0030] (3) Calculate the achievement rate A of the geometric metric error ge , if 98%≤A ge ≤100% ended;
[0031]
[0032] In the formula: GE m Represents the geometric metric error of tile numbered m;
[0033] (4) When A ge <98%, calculate the error rate A of the measurement error err =1-A ge , calculate the simplification rate S of the current model and the original model n , that is, the proportion of the current number of triangulated networks to the original number of triangulated networks;
[0034] The simplification rate S to be continued on the basis of the current model is obtained from formula (5), and the model is simplified using the QEM algorithm based on this as a limiting condition, and then steps (2) and (3) are entered;
[0035]
[0036] (5)When A ge >100%, calculate the error rate A of the measurement error err =A ge -1, calculate the simplification rate S of the current model and the original model n , abandon the folding result, and then use QEM to simplify the model based on the last simplified model. When the simplification rate is S, stop entering step (6), otherwise enter step (2) and step (3):
[0037]
[0038] (6) Determine whether the memory for saving the level of detail model uasset asset has been specified. If not, open the memory L0, L1, L2, L3, L4, L5, L6 to store the level of detail models of different tile depths, and save the result to the specified memory. If it has been opened, save it to the specified memory.
[0039] Furthermore, the specific process of step 4 is:
[0040] Traverse the tiles, get the names of the static meshes in the area, take out the hierarchical detail models from the memory L0, L1, L2, L3, L4, L5, L6, bind the tiles in the target level to obtain the associated hierarchical detail model set, and finally delete the outdoor static meshes of the non-hierarchical detail models in the target level scene. In addition, based on the observation position of the current tile, calculate the pixel size occupied by the bounding box of each model of the current tile. If the bounding box occupies less than 10 pixels, the model is removed from the set. Finally, sort the models in the set by the bounding box size. The specific representation of the set is as follows:
[0041] T m ={M 1 L i ,M 2 L i ,....,M n-1 L i ,M n L i} (12)
[0042] Where: T m Represents the hierarchical model set associated with tile number m, M 1 L i The i-level hierarchical detail model represents the model with the largest bounding box volume in the tile area. The other models in the set are arranged in order of volume size.
[0043] Furthermore, the specific process of step 5 is:
[0044] From the memory that stores the static meshes in the room, iterate over the name of each uasset asset, find the static mesh from the specified level scene, generate the collision bounding box of the static mesh, and associate the static mesh with the collision bounding box. The specific steps are as follows:
[0045] (1) Traverse the static meshes with building topology information, generate collision bounding boxes for the static meshes classified into a building, and associate all models in the building with the bounding boxes;
[0046] (2) If the static mesh in step (1) has detailed floor information, generate a bounding box for each floor and associate the static mesh of each floor to the bounding box of each floor. If the static mesh is bound to the building bounding box, disconnect the binding relationship.
[0047] (3) If the static mesh in step (2) has detailed room information, generate a bounding box for each room and associate the static mesh of each room to the bounding box of each room. If the static mesh is bound to the floor bounding box, disconnect the binding relationship.
[0048] Furthermore, the specific process of step 6 is:
[0049] Based on the classification and organization of static meshes, different scheduling methods are adopted for indoor and outdoor meshes. For the outdoor part, the tile loading timing is controlled according to the maximum screen error, and the loading order is loaded in the order of the associated set. When the rendering frame rate is less than 30fps, the amount of data loaded for the next frame is reduced. For the indoor part, a spherical bounding box with a radius of 3 meters centered on the viewpoint is made. When the viewpoint bounding box collides with the bounding box of the indoor static mesh, the static mesh associated with the indoor collision bounding box is loaded. When the viewpoint bounding box collides with the bounding box of the indoor static mesh, the static mesh associated with the indoor collision bounding box is unloaded.
[0050] The present invention has the following beneficial effects due to the adoption of the above technical solution:
[0051] The present invention adopts an automated process to organize static meshes in an orderly manner. Compared with the world partitioning technology that relies on manual experience, it can greatly improve the optimization efficiency of model data. It adopts the screen error angle to consider the loading timing. Compared with the world partitioning technology, it can consider the loading of static meshes from a three-dimensional perspective and will not eliminate large objects in the distance. It can more reasonably express the static meshes in the scene. By using the tile binding model, the tile represents all outdoor static meshes in the area, which improves the retrieval and rendering efficiency compared with the method of using a single mesh as the retrieval unit. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 is a flow chart of the method of the present invention;
[0053] Figure 2 It is a schematic diagram of the quadtree tile partitioning principle of the present invention;
[0054] Figure 3 This is a diagram of the situation when the 0th level tile of the present invention is just surrounded by the visual frustum;
[0055] Figure 4 is a hierarchical detail model set diagram of the quadtree tile of the present invention;
[0056] Figure 5 It is a diagram of the experimental area of the present invention;
[0057] Figure 6 is a comparison diagram of the present invention and the world partition scheme at a top-down viewing angle of -90°;
[0058] Figure 7 It is a comparison diagram between the present invention and the world partition scheme at a top-down viewing angle of -60°. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and preferred embodiments. However, it should be noted that many details listed in the specification are only for the purpose of enabling the reader to have a thorough understanding of one or more aspects of the present invention, and these aspects of the present invention can be implemented even without these specific details.
[0060] like Figure 1 As shown in the figure, a method for organizing and scheduling static meshes in Unreal Engine, the specific steps are as follows: 1. First, according to the topological information, the static meshes of the specified level of Unreal Engine are divided into indoor and outdoor categories; 2. The quadtree tile pyramid structure of the entire scene is generated, and the geometric metric error of each quadtree tile is calculated; 3. The concept of geometric metric error achievement rate is proposed, and it is used to control the QEM algorithm to simplify the model; 4. The hierarchical detail model is associated with the target quadtree tile to obtain a binding set; 5. The indoor static meshes are organized in an orderly manner; 6. The indoor and outdoor static meshes are scheduled.
[0061] 1. Classification of indoor and outdoor static meshes
[0062] Traverse the static mesh data under the specified level, determine the topological information attributes in each static mesh, and if it contains the topological attributes representing the building, determine whether it contains indoor and outdoor attributes. If it is missing, it needs to be supplemented manually. Then, traverse the static mesh again. If it contains indoor identification information, move the uasset assets belonging to the indoor static mesh to the memory that stores the indoor static mesh. Inversely, move the uasset assets of the remaining static meshes to the memory that stores the outdoor static meshes.
[0063] 2. Quadtree tile generation and geometric metric error calculation
[0064] Get the bounding box containing all static meshes, and divide the bounding box equally in a recursive way. That is, the length and width of the child bounding box are half of the length and width of the parent bounding box, and the height of the bounding box is the height of the bounding box of all static meshes in the area. Build a quadtree pyramid structure from top to bottom, and stop dividing when the quadtree depth is 6. Figure 2 The figure shows a schematic diagram of the step-by-step division from depth 0 to depth 1 and to depth 2. Then, the composite Morton code is used to compile the unique number of the tile, where the first digit on the left is the quadtree depth, followed by the row and column numbers representing the calculated Morton code, where the calculation of the composite Morton code is as shown in formula (1). Then, according to the known parameters, the relationship between the screen error and the geometric error and the distance weight, the geometric metric error GE of each tile is calculated using formula (2): m .
[0065]
[0066] Where: l represents the depth of the quadtree, & represents the combination of two values, i is the tile row number when the quadtree depth is l, j is the tile column number when the quadtree depth is l, 0≤i, j≤2n, It means round down, and mod() means remainder.
[0067]
[0068] In the formula: GE m Indicates the geometric metric error of tile number m, mSSE is the maximum screen error set, fov indicates the field of view of the camera during rendering, h is the display height (pixels), s m It represents the product of the length, width and height of tile numbered m, ds is as follows Figure 3 When the tile is parallel to the near and far clipping planes at depth 0 and the tile is just surrounded by the viewing frustum at the same time, the distance from the viewing angle A to the tile center B, s 0 Indicates the product of the length, width and height of the tile when the quadtree depth is 0 (such as Figure 3 ).
[0069] 3. Simplification of the QEM model considering the geometric metric error achievement rate
[0070] According to the geometric metric error value of the quadtree tile, the mesh data in the tile area is read from the static mesh memory outside the storage room, and the hierarchical detail model of the static mesh is simplified and calculated using the quadratic error-based edge folding (Quadic Error Metrics, QEM), in which the geometric metric error rate is used as the control amount of the edge folding simplification rate, and the model that conforms to the tile geometric metric error is iteratively folded. The specific steps are as follows.
[0071] (1) Take out the file from the static mesh memory outside the storage room and determine whether the detailed model of the current level has been generated. If it has been generated, traverse the next model. If it has not been generated, use the QEM algorithm to simplify the triangulated mesh of the model to 90% of the original to obtain the level detailed model M 1 .
[0072] (2) Calculate the geometric metric error GE between the simplified model and the original model 2 Specifically, the maximum value of the minimum distance between the models before and after simplification is calculated as the geometric metric error of the two models, which is specifically defined as follows: Formula (3).
[0073] GE(M 1 ,M 2 )=max(d v1 (M 2 ),d v2 (M1 )),v1∈M 1 ,v2∈M 2 (3)
[0074] In the formula: GE(M 1 ,M 2 ) is the original model M 1 With the simplified model M 2 Geometric metric error, d v1 (M 2 ) represents the model M 1 Up point to model M 2 The maximum value of the shortest distance on v2 (M 1 )Same.
[0075] (3) Calculate the achievement rate A of the geometric metric error ge , if 98%≤A ge ≤100% finished.
[0076]
[0077] In the formula: GE m Represents the geometric metric error of tile number m.
[0078] (4) When A ge <98%, calculate the error rate A of the measurement error err =1-A ge , calculate the simplification rate S of the current model and the original model n , that is, the proportion of the current number of triangulated meshes to the original number of triangulated meshes.
[0079] The simplification rate S to be continued on the basis of the current model is obtained from formula (5). Based on this, the QEM algorithm is used to simplify the model, and then steps (2) and (3) are entered.
[0080]
[0081] (5)When A ge >100%, calculate the error rate A of the measurement error err =A ge -1, calculate the simplification rate S of the current model and the original model n , abandon the folding result. Then, based on the last simplified model, use QEM to simplify the model. When the simplification rate is S, stop entering step (6), otherwise enter step (2) and step (3).
[0082]
[0083] (6) Determine whether the memory for saving the level of detail model uasset asset has been specified. If not, open the memory L0, L1, L2, L3, L4, L5, L6 to store the level of detail models of different tile depths, and save the result to the specified memory. If it has been opened, save it to the specified memory.
[0084] The detailed steps to simplify the QEM algorithm model are as follows:
[0085] Let any vertex P in the model = [Px, Py, Pz] T , the set of triangles containing point P is Triangles, t is a triangle in Triangles, let the equation of the plane where t is located be ax+bx+cz+d=0, where a 2 +b 2 +c 2 =1, d is a constant, then the quadratic error matrix of the i-th vertex Pi is:
[0086]
[0087] From the vertex P i and P j The folding cost of the edge e is .
[0088] Δ(e)=Q i +Q j (8)
[0089] Fold the two vertices to a new coordinate. The calculation method of the new vertex coordinate is as follows. Let the coordinate of the new vertex after folding be P new , whose error matrix is Q new =Q i +Q i , the folding cost is Then the equation for the quadratic error can be expressed as:
[0090] Δ(P new )=q 11 x 2 +2q 12 xy+2q 13 xz+2q 14 x+q 22 y 2 +2q 23 yz+2q 24 y+q 33 z 2 +2q 34 z+q 44 (9)
[0091] where q ij It's Q newThe elements at the corresponding positions in can be written in the following form:
[0092]
[0093] If the above formula q ij The matrix formed is invertible, so we can find:
[0094]
[0095] Otherwise P i , P j , Sort and select the point with the minimum folding cost as the coordinate of the new vertex.
[0096] 4. Generate binding collection
[0097] Traverse the tiles, get the names of the static meshes in the area, take out the hierarchical detail models from the memory L0, L1, L2, L3, L4, L5, L6, bind the tiles in the target level to obtain the associated hierarchical detail model set. Finally, delete the outdoor static meshes of the non-hierarchical detail models in the target level scene. In addition, based on the observation position of the current tile, calculate the pixel size occupied by the bounding box of each model of the current tile. If the bounding box occupies less than 10 pixels, the model is removed from the set. Finally, sort the models in the set by the size of the bounding box. The specific representation of the set is defined as follows, and the schematic diagram is as follows: Figure 4 .
[0098] T m ={M 1 L i ,M 2 L i ,....,M n-1 L i ,M n L i} (12)
[0099] Where: T m Represents the hierarchical model set associated with tile number m, M 1 L i The i-level hierarchical detail model represents the model with the largest bounding box volume in the tile area. The other models in the set are arranged in order of volume size.
[0100] 5Interior Static Mesh Organization
[0101] Iterate over the name of each uasset asset from the memory that holds the static meshes in the room, find the static mesh from the specified level scene, generate the collision bounding box of the static mesh, and associate the static mesh with the collision bounding box. The specific steps are as follows.
[0102] (1) Traverse the static meshes that represent the building topology information, generate a collision bounding box for the static meshes that are classified into a building, and associate all models in the building with this bounding box.
[0103] (2) If the static mesh in (1) has detailed floor information, generate a bounding box for each floor and associate the static mesh of each floor to the bounding box of each floor. If the static mesh is bound to the building bounding box, disconnect the binding relationship.
[0104] (3) If the static mesh in (2) has detailed room information, generate a bounding box for each room and associate the static mesh of each room to the bounding box of each room. If the static mesh is bound to the floor bounding box, disconnect the binding relationship.
[0105] 6Indoor and Outdoor Static Mesh Scheduling
[0106] Different scheduling methods are adopted for indoor and outdoor meshes according to the classification and organization of static meshes. For the outdoor part, the timing of tile loading is controlled according to the maximum screen error, and the loading order is loaded in the order of the associated set. When the rendering frame rate is less than 30fps, the amount of data loaded for the next frame is reduced. For the indoor part, a spherical bounding box with a radius of 3 meters centered on the viewpoint is made. When the viewpoint bounding box collides with the bounding box of the indoor static mesh, the static mesh associated with the indoor collision bounding box is loaded. When the viewpoint bounding box collides with the bounding box of the indoor static mesh, the static mesh associated with the indoor collision bounding box is unloaded.
[0107] The steps to determine whether tiles are loaded based on the maximum screen error are as follows:
[0108] For each visible tree node that passes the frustum intersection test, a scheduling algorithm is used to select the appropriate tile level along the tile pyramid tree. Specifically, the parameters screen space error (SSE) and maximum screen space error (mSSE) determine which layer of nodes to load. SSE is calculated based on the metadata of the tile and the relative position relationship between the viewpoint and the tile (Equations (13) and (14)). The preset mSSE represents the accuracy required for screen display. If SSE is greater than mSSE, the error of the current node is greater than the threshold and the child node needs to be loaded. Otherwise, the current node should be loaded.
[0109]
[0110]
[0111] Where: SSE is the maximum screen error set, GE is the geometric metric error of the tile, K is a constant determined by H and fov, D is the distance from the world coordinate position of the camera to the center of the tile, h is the display height (pixels), and fov represents the field of view angle of the camera during rendering.
[0112] Since the present invention uses an automated process to organize static meshes in an orderly manner, compared with the method of world partitioning technology that relies on manual experience, it can greatly improve the optimization efficiency of model data ( Figure 5 ); Since the present invention considers the loading timing from the perspective of screen error, compared with the world partitioning technology, it can consider the loading of static meshes from a three-dimensional perspective, and will not remove large objects in the distance, and can more reasonably express the static meshes in the scene ( Figure 6 and Figure 7 ); Since the present invention uses a tile binding model, the tiles represent all outdoor static meshes in the area, which improves the retrieval and rendering efficiency compared to the method of using a single mesh as a retrieval unit.
[0113] Figure 5 The static grid data organized by this scheme covers an area of about 73km 2 , the number of static meshes is 17005.
[0114] Figure 6 In the figure, (a) the scheduling and rendering of the scene at an altitude of 3746m in this case (b) the scheduling and rendering of the scene at an altitude of 750m in this case (c) the scheduling and rendering of the scene at an altitude of 3746m in the world partition scheme (d) the scheduling and rendering of the scene at an altitude of 750m in the world partition scheme. The above perspective pitch angle is -90°, and the plane positions and rotation angles of (a) and (c) and (b) and (d) are the same, but the heights are different. From the comparison between Figure (a) and Figure (c) and Figure (b) and Figure (d), it can be seen that the world partition scheme only considers the loading of the regional static mesh under the perspective orthographic projection, and the areas outside are not reasonably loaded, which seems very abrupt. This scheme better considers the static meshes in the distance and the overall effect, and is more superior. In Figure (c), a larger building is loaded (such as building A) because it spans two partition grids of the world partition and is not surrounded by a single partition grid, so it is judged as loaded.
[0115] Figure 7In the figure, (a) the scheduling rendering of the scene at an altitude of 3746m in this case (b) the scheduling rendering of the scene at an altitude of 750m in this case (c) the scheduling rendering of the scene at an altitude of 3746m in the world partition scheme (d) the scheduling rendering of the scene at an altitude of 750m in the world partition scheme. The above perspective pitch angle is -60°, and the plane position and rotation angle of (a) and (c) as well as (b) and (d) are the same, but the height is different. Changing the pitch angle to -60°, the advantages of this case are more prominent. Because in (a) and (b), this case will judge and load the static mesh of the entire scene. In (b) and (d), it can be found that the mesh in the distance is not loaded.
[0116] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for organizing and scheduling static meshes in an Unreal Engine, characterized in that: The method comprises the following steps: Step 1: First, divide the static meshes of the specified level of Unreal Engine into two categories: indoor and outdoor according to the topology information; Step 2: Generate a quadtree tile pyramid structure for the entire scene and calculate the geometric metric error of each quadtree tile; Step 3: Propose the concept of geometric metric error achievement rate, and use the error achievement rate control QEM algorithm to simplify the model to obtain the target hierarchical model; Step 4: Associate the level of detail model to the target quadtree tile to obtain a binding set; Step 5: Organize the static meshes in the room in an orderly manner; Step 6: Schedule indoor and outdoor static meshes; The specific process of step 3 is: According to the geometric metric error value of the quadtree tile, the mesh data in the tile area is read from the static mesh memory outside the storage room, and the hierarchical detail model of the static mesh is calculated by edge folding simplification based on quadratic error. The geometric metric error rate is used as the control amount of the edge folding simplification rate, and the model that conforms to the tile geometric metric error is iteratively folded. The specific steps are as follows: (1) Take out the file from the static mesh memory outside the storage room, determine whether the detailed model of the current level has been generated, if it has been generated, traverse the next model, if not, use the QEM algorithm to simplify the triangulated network of the model to 90% of the original to obtain the level detailed model M1; (2) Calculate the geometric metric error GE2 between the simplified model and the original model. Specifically, calculate the maximum value of the minimum distance between the models before and after simplification as the geometric metric error of the two models. (3) Calculate the achievement rate A of the geometric metric error ge , if 98%≤A ge ≤100% completed; In the formula: GE m Represents the geometric metric error of tile numbered m; (4) When A ge <98%, calculate the error rate of geometric measurement error A err =1-A ge , calculate the simplification rate S of the current model and the original model n , that is, the proportion of the current number of triangulated networks to the original number of triangulated networks; The simplification rate S to be continued on the basis of the current model is obtained by formula (5), and the model is simplified using the QEM algorithm based on this as a limiting condition, and then steps (2) and (3) are entered; (5)When A ge >100%, calculate the error rate of geometric measurement error A err =A ge -1, calculate the simplification rate S of the current model and the original model n , abandon the folding result, and then use QEM to simplify the model based on the last simplified model. When the simplification rate is S, stop entering step (6), otherwise enter step (2) and step (3): (6) Determine whether the memory for saving the level of detail model uasset asset has been specified. If not, open the memory L0, L1, L2, L3, L4, L5, L6 to store the level of detail models of different tile depths, and save the result to the specified memory. If it has been opened, save it to the specified memory.
2. The method for organizing and scheduling static meshes in an Unreal Engine according to claim 1, characterized in that: In step 1, the specific process of dividing the static mesh into indoor and outdoor categories is as follows: Traverse the static mesh data under the specified level, determine the topological information attributes in each static mesh, if it contains topological attributes representing the building, determine whether it contains indoor and outdoor attributes, if it is missing, it needs to be supplemented manually, then re-traverse the static mesh, if it contains indoor identification information, move the uasset assets belonging to the indoor static mesh to the memory that saves the indoor static mesh, conversely, move the uasset assets of the remaining static meshes to the memory that saves the outdoor static meshes.
3. The method for organizing and scheduling static meshes in Unreal Engine according to claim 1, characterized in that: In step 2, the specific process of calculating the geometric metric error of each quadtree tile is as follows:
1. Obtain the bounding box containing all static meshes, and divide the bounding box equally in a recursive manner, that is, the length and width of the child bounding box are half of the length and width of the parent bounding box, and the height of the bounding box is the height of the bounding box of all static meshes in the area. A quadtree pyramid structure is established from top to bottom. When the quadtree depth is 6, the division is stopped. The unique number of the tile is compiled using the composite Morton code, where the first digit on the left is the quadtree depth, followed by the row and column numbers representing the calculated Morton code, where the calculation of the composite Morton code is as shown in formula (1): Where: l represents the depth of the quadtree, & represents the combination of two values, i is the tile row number when the quadtree depth is l, j is the tile column number when the quadtree depth is l, 0≤i, j≤2n, k is a positive integer, It means round down, and mod() means remainder; According to the known parameters, the relationship between the screen error and the geometric error and the distance weight, the geometric metric error GE of each tile is calculated using formula (2): m : In the formula: GE m Indicates the geometric metric error of tile number m, mSSE is the maximum screen error set, fov indicates the field of view of the camera during rendering, h is the height of the display, s m It represents the product of the length, width and height of the tile numbered m. ds is the distance from the viewing angle A to the center of the tile B when the tile is parallel to the near and far clipping planes when the depth is 0 and the tile is just surrounded by the viewing frustum at the same time. s0 represents the product of the length, width and height of the tile when the depth of the quadtree is 0.
4. The method for organizing and scheduling static meshes in Unreal Engine according to claim 1, characterized in that: The specific process of step 4 is: Traverse the tiles, get the names of the static meshes in the area, take out the hierarchical detail models from the memory L0, L1, L2, L3, L4, L5, L6, bind the tiles in the target level to obtain the associated hierarchical detail model set, and finally delete the outdoor static meshes of the non-hierarchical detail models in the target level scene. In addition, based on the observation position of the current tile, calculate the pixel size occupied by the bounding box of each model of the current tile. If the bounding box occupies less than 10 pixels, the model is removed from the set. Finally, sort the models in the set by the bounding box size. The specific representation of the set is as follows: T m ={M1L i ,M2L i ,....,M n-1 L i ,M n L i } (12) Where: T m Represents the hierarchical model set associated with tile number m, M1L i The i-level hierarchical detail model represents the model with the largest bounding box volume in the tile area. The other models in the set are arranged in order of volume size.
5. The method for organizing and scheduling static meshes in Unreal Engine according to claim 1, characterized in that: The specific process of step 5 is: From the memory that stores the static meshes in the room, iterate over the name of each uasset asset, find the static mesh from the specified level scene, generate the collision bounding box of the static mesh, and associate the static mesh with the collision bounding box. The specific steps are as follows: (1) Traverse the static meshes with building topology information, generate collision bounding boxes for the static meshes classified into a building, and associate all models in the building with the bounding boxes; (2) If the static mesh in step (1) has detailed floor information, generate a bounding box for each floor and associate the static mesh of each floor to the bounding box of each floor. If the static mesh is bound to the building bounding box, disconnect the binding relationship. (3) If the static mesh in step (2) has detailed room information, generate a bounding box for each room and associate the static mesh of each room with the bounding box of each room. If the static mesh is bound to the floor bounding box, disconnect the binding relationship.
6. The method for organizing and scheduling static meshes in Unreal Engine according to claim 1, characterized in that: The specific process of step 6 is: Based on the classification and organization of static meshes, different scheduling methods are adopted for indoor and outdoor meshes. For the outdoor part, the tile loading timing is controlled according to the maximum screen error, and the loading order is loaded in the order of the associated set. When the rendering frame rate is less than 30fps, the amount of data loaded for the next frame is reduced. For the indoor part, a spherical bounding box with a radius of 3 meters centered on the viewpoint is made. When the viewpoint bounding box collides with the bounding box of the indoor static mesh, the static mesh associated with the indoor collision bounding box is loaded. When the viewpoint bounding box collides with the bounding box of the indoor static mesh, the static mesh associated with the indoor collision bounding box is unloaded.
Citation Information
Patent Citations
A Data Organization and Scheduling Method for Photogrammetric Models in Unreal Engine
CN113628331B
A method for optimizing massive true 3D model loading
CN117372599B
CAD (Computer-Aided Design) model geometrical characteristic interaction method and CAD model geometrical characteristic interaction system for Unreal Engine
CN112131626A
Photogrammetry model data organization and scheduling method in unreal engine
CN113628331A