A scene data scheduling and rendering method based on dual PVS
Through the scene data scheduling and rendering method based on dual PVS, the target scene unit and view cone are determined, and the appropriate level of detail model is selected for loading and rendering, which solves the problem of high computing resource consumption in traditional methods and achieves a more efficient rendering process.
Patent Information
- Application Number
- CN202510857009.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-06-25
AI Technical Summary
Traditional 3D scene rendering methods consume high computing resources when processing large-scale scenes, especially when dealing with a large amount of invisible objects or long-distance model data.
A dual PVS-based scene data scheduling and rendering method is adopted. By determining the target scene unit where the camera viewpoint is located, the rendering scene tree of the target scene unit is obtained, and the target rendering object is selected using the view frustum. The level of detail model is determined according to the distance between the object and the camera viewpoint for loading and rendering.
It effectively reduces the calculation of invisible objects, reduces the computing load of the GPU, improves rendering efficiency, and avoids resource waste and computing redundancy.
Smart Images

Figure CN120374817B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a scene data scheduling and rendering method based on dual PVS. Background Art
[0002] With the rapid development of applications such as virtual reality, open-world games, and digital twins, the complexity of three-dimensional scenes is growing exponentially. For example, a city-level digital twin scene may contain millions of objects such as buildings, vehicles, and pedestrians. Traditional rendering methods typically load all object data for unified processing, then pass the objects to be rendered into the rendering pipeline for rendering. However, this rendering method requires high computing resources when dealing with large-scale scenes, as the GPU needs to process a large amount of model data for invisible objects or distant objects.
[0003] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention
[0004] The main purpose of this application is to provide a scene data scheduling and rendering method based on dual PVS, aiming to solve the technical problem of how to reduce the computing resource consumption of model rendering.
[0005] To achieve the above objectives, the present application proposes a scene data scheduling and rendering method based on dual PVS, the method comprising:
[0006] Determine the target scene unit where the camera viewpoint is located, and obtain a rendering scene tree corresponding to the target scene unit from the PVS of the target scene unit, where the nodes of the rendering scene tree are target visible objects corresponding to the target scene unit;
[0007] Determine a viewing cone corresponding to the camera viewpoint, and select a target node in the rendering scene tree as a target rendering object according to the viewing cone;
[0008] According to the distance between the target rendering object and the camera viewpoint, a level of detail model corresponding to the target rendering object is determined, and the level of detail model is loaded from the rendering scene tree to the rendering pipeline to render the target rendering object.
[0009] In one embodiment, before the steps of determining the target scene unit where the camera viewpoint is located and obtaining the rendering scene tree corresponding to the target scene unit from the PVS of the target scene unit, the step further includes:
[0010] Traversing the convex polygons on each scene unit in the three-dimensional scene, and taking the currently traversed convex polygon as the target convex polygon, wherein the convex polygon represents an open area between two adjacent scene units;
[0011] Determining a projection interval of the target convex polygon according to normal vectors of each edge of the target convex polygon, and after determining adjacent scene units connected to the target convex polygon, determining whether there are other convex polygons connected to the adjacent scene units within the projection interval;
[0012] If the other convex polygon does not exist in the projection interval, other scene units connected to the traversed target convex polygon are used as visible scene units of the scene unit;
[0013] A rendering scene tree corresponding to the scene unit is constructed according to the level of detail model of each visible object in the visible scene unit.
[0014] In one embodiment, after determining the adjacent scene unit connected to the target convex polygon, and then determining whether there are other convex polygons connected to the adjacent scene unit within the projection interval, the method further includes:
[0015] If there are other convex polygons connected to the adjacent scene units in the projection interval, the other convex polygons are used as the target convex polygons;
[0016] Execute the steps of determining the projection interval of the target convex polygon according to the normal vectors of each edge of the target convex polygon, and after determining the adjacent scene units connected to the target convex polygon, determining whether there are other convex polygons connected to the adjacent scene units in the projection interval, until no other convex polygons exist in the projection interval.
[0017] In one embodiment, the steps of determining a viewing cone corresponding to the camera viewpoint and selecting a target node in the rendering scene tree as a target rendering object according to the viewing cone include:
[0018] Determine the viewing cone corresponding to the camera viewpoint according to the direction vector and the viewing angle of the camera;
[0019] Traversing the target visible object in the rendering scene tree, and determining vector distances from each vertex of the bounding volume of the target visible object to each plane of the viewing cone;
[0020] If the vector distance corresponding to any vertex of the bounding volume of the target visible object is greater than zero, the target visible object is determined to be the target rendering object.
[0021] In one embodiment, after the step of traversing the target visible object in the rendering scene tree and determining the vector distances from each vertex of the bounding volume of the target visible object to each plane of the viewing cone, the method further includes:
[0022] If the vector distance corresponding to any vertex of the bounding volume of the target visible object is greater than zero, generating a first sampling point in the target scene unit, and generating a second sampling point in the bounding volume of the target visible object;
[0023] A connecting line is generated between each of the first sampling points and each of the second sampling points. If there is a connecting line that does not intersect with the bounding volume of another object, the target visible object is determined to be the target rendering object, wherein the other object is an object in the rendering scene tree other than the currently traversed target visible object.
[0024] In one embodiment, the step of determining a level of detail model corresponding to the target rendering object based on the distance between the target rendering object and the camera viewpoint, and loading the level of detail model from the rendering scene tree into the rendering pipeline includes:
[0025] Get the camera's screen resolution and screen pixel error;
[0026] Determining a model level of the target rendering object according to a product of a bounding volume size of the target rendering object and a screen resolution, and a product of a distance between the target rendering object and the camera viewpoint and a screen pixel error;
[0027] The level-of-detail model corresponding to the model level is loaded into the rendering pipeline.
[0028] In one embodiment, after the steps of determining the level of detail model corresponding to the target rendering object based on the distance between the target rendering object and the camera viewpoint, and loading the level of detail model from the rendering scene tree into the rendering pipeline, the process further includes:
[0029] Acquire a movement trajectory of the camera viewpoint, wherein the movement trajectory includes at least one stop scene unit;
[0030] Determining at least one candidate route from the historical trajectory map based on a similarity between the movement trajectory of the camera viewpoint and the movement routes in the historical trajectory map;
[0031] According to the movement trajectory of the camera viewpoint, interesting scene units are determined in the candidate routes, and rendering scene trees corresponding to the respective interesting scene units are loaded.
[0032] In one embodiment, the step of determining the scene of interest unit in the candidate route according to the movement trajectory of the camera viewpoint includes:
[0033] Determining the dwell time and movement acceleration corresponding to each dwell scene unit in the movement trajectory according to the movement trajectory;
[0034] Taking a weighted sum of the dwell time and the movement acceleration to obtain an interest score for each dwell scene unit;
[0035] The scene type of the stop scene unit having an interest score greater than a preset interest threshold is determined, and the interest scene unit is determined from the candidate routes according to the scene type.
[0036] This application provides a scene data scheduling and rendering method based on dual PVS. By determining the target scene unit where the camera viewpoint is located, the rendering scene tree corresponding to the target scene unit is obtained from the PVS of the target scene unit. The nodes of the rendering scene tree are the target visible objects corresponding to the target scene unit. Then, the view cone corresponding to the camera viewpoint is determined. The target node in the rendering scene tree is selected as the target rendering object based on the view cone. The level of detail model corresponding to the target rendering object is determined based on the distance between the target rendering object and the camera viewpoint. The level of detail model is loaded from the rendering scene tree to the rendering pipeline to render the target rendering object. The method first filters the target visible objects through the rendering scene tree to avoid invalid calculations for invisible objects, and then uses the view cone to more accurately determine the target rendering object among the target visible objects, further narrowing the range of objects that need to be rendered and reducing the computing resource consumption of model rendering. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0039] Figure 1 A flowchart of the first embodiment of the scene data scheduling and rendering method based on dual PVS of the present application is provided;
[0040] Figure 2 A flowchart of the second embodiment of the scene data scheduling and rendering method based on dual PVS of this application is provided;
[0041] Figure 3 A flowchart of the third embodiment of the scene data scheduling and rendering method based on dual PVS of this application is provided;
[0042] Figure 4 A schematic diagram of a method flow chart for providing a scene data scheduling and rendering method based on dual PVS in an embodiment of the present application;
[0043] Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the scene data scheduling and rendering method based on dual PVS in the embodiment of the present application.
[0044] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0045] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not intended to limit the present application.
[0046] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0047] With the rapid development of applications such as virtual reality, open-world games, and digital twins, the complexity of three-dimensional scenes is growing exponentially. For example, a city-level digital twin scene may contain millions of objects such as buildings, vehicles, and pedestrians. Traditional rendering methods typically load all object data for unified processing, then pass the objects to be rendered into the rendering pipeline for rendering. However, this rendering method requires high computing resources when dealing with large-scale scenes, as the GPU needs to process a large amount of model data for invisible objects or distant objects.
[0048] In view of the above problems, this application proposes a scene data scheduling and rendering method based on dual PVS. First, the target scene unit where the camera viewpoint is located is determined, and the rendering scene tree corresponding to the target scene unit is obtained from the PVS of the target scene unit. The nodes of the rendering scene tree are the target visible objects corresponding to the target scene unit. Then, the viewing cone corresponding to the camera viewpoint is determined, and the target node in the rendering scene tree is selected as the target rendering object according to the viewing cone. According to the distance between the target rendering object and the camera viewpoint, the level of detail model corresponding to the target rendering object is determined, and the level of detail model is loaded from the rendering scene tree to the rendering pipeline to render the target rendering object. This method first filters the target visible objects through the rendering scene tree to avoid invalid calculations for invisible objects, and then uses the viewing cone to more accurately determine the target rendering object among the target visible objects, further narrowing the range of objects that need to be rendered and reducing the computing resource consumption of model rendering.
[0049] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, personal computer, etc., or an electronic device that can realize the above functions.
[0050] Based on this, the first embodiment proposed in this application provides a scene data scheduling and rendering method based on dual PVS, referring to Figure 1In this embodiment, the scene data scheduling and rendering method based on dual PVS includes steps S10 to S30:
[0051] Step S10 , determining the target scene unit where the camera viewpoint is located, and obtaining a rendering scene tree corresponding to the target scene unit from the PVS of the target scene unit, wherein the nodes of the rendering scene tree are target visible objects corresponding to the target scene unit.
[0052] It should be noted that a scene unit refers to the independent management area into which the entire 3D scene is logically divided. For example, a 3D scene space can be evenly divided into cubic or rectangular cells using a grid, or the 3D scene space can be recursively divided using a quadtree, octree, or BSP tree (Binary Space Partitioning Tree), with the resulting recursively divided space being the scene unit.
[0053] Optionally, before rendering, the visible scene units of each scene unit in the three-dimensional scene are determined, and the PVS (Potentially Visible Set) of each scene unit is obtained in advance. Then, when loading rendering data, it is only necessary to determine the target scene unit where the camera viewpoint is located, and the PVS of the target scene unit can be directly called to determine the visible scene units of the target scene unit, and the objects in the visible scene unit can be used as the target visible objects. When rendering is required, the rendering scene tree corresponding to the target scene unit, that is, the level of detail model data of all target visible objects in the visible scene units corresponding to the target scene unit, is loaded from disk to the GPU video memory to process the model data of the target visible objects.
[0054] Traditional 3D scene data scheduling and rendering methods typically load all model data at once, forcing the GPU to process large amounts of geometric data and perform unnecessary transformations, clipping, and rendering preparation, such as transformation matrix calculations, collision detection, and animation updates. By implementing these steps, the GPU can reduce the number of 3D objects processed per frame and eliminate the processing of invisible scene elements, thereby reducing the GPU's computational load.
[0055] Step S20 : determining a viewing cone corresponding to the camera viewpoint, and selecting a target node in the rendering scene tree according to the viewing cone as a target rendering object.
[0056] After loading the render scene tree, to further reduce the rendering load, you can use the camera's view frustum to further cull objects that are within the camera's visible range but not actually in the camera's field of view (i.e., the area visible to the user on the camera screen). Target visible objects within the view frustum are used as target render objects and loaded into the render pipeline, further reducing the number of objects entering the render pipeline, improving rendering efficiency, and avoiding screen lag.
[0057] Optionally, step S20 includes steps S21 to S23:
[0058] Step S21: determining a viewing cone corresponding to the camera viewpoint according to the direction vector and the viewing angle of the camera.
[0059] The camera's direction vector is the unit vector pointing from the camera's position, i.e., the camera's viewpoint, to the target it is observing, defining the camera's orientation. The direction vector can be a three-dimensional unit vector, expressed as The field of view is the angle range in the direction pointed by the direction vector. In the current frame of the camera, the view frustum corresponding to the camera viewpoint is calculated based on the coordinates of the current camera viewpoint, the camera's direction vector and field of view, as well as parameter information such as the camera's near plane distance and far plane distance.
[0060] Step S22 , traversing the target visible object in the rendering scene tree, and determining vector distances from each vertex of the bounding volume of the target visible object to each plane of the viewing cone.
[0061] Step S23 : If the vector distance corresponding to any vertex of the bounding volume of the target visible object is greater than zero, then the target visible object is determined to be the target rendering object.
[0062] For example, the viewing cone is composed of 6 planes (near plane, far plane, left plane, right plane, top plane, bottom plane), and each plane can be represented by the equation Cx+Dy+Ez+F=0. C, D, E are the normal vectors of the plane pointing to the inside of the viewing cone, and F is the offset of the plane to the origin of the coordinate system. Traverse each vertex (x, y, z) of the bounding volume corresponding to the target visible object, and calculate the vector distance d=Cx+Dy+Ez+F from each vertex of the bounding volume to the viewing cone plane. If any vertex of the bounding volume corresponding to the target visible object satisfies d for all planes of the viewing cone , then the vertex is within the viewing cone. If all vertices of the bounding volume corresponding to the target visible object satisfy d , the target visible object is completely within the viewing frustum.
[0063] To ensure the rendering effect, if the vector distance from any vertex of the bounding volume of the target visible object to the viewing cone plane is greater than zero, that is, a part of the target visible object can be seen in the camera field of view, then the target visible object is determined to be the target rendering object.
[0064] Optionally, after step S22, the dual PVS-based scene data scheduling and rendering method further includes steps S24-S25:
[0065] Step S24 : if the vector distance corresponding to any vertex of the bounding volume of the target visible object is greater than zero, a first sampling point is generated in the target scene unit, and a second sampling point is generated in the bounding volume of the target visible object.
[0066] Step S25: Generate a connecting line between each of the first sampling points and each of the second sampling points. If there is a connecting line that does not intersect with the bounding volume of another object, determine that the target visible object is the target rendering object, wherein the other object is an object in the rendering scene tree other than the currently traversed target visible object.
[0067] To further save computing resources, some of the target visible objects within the view frustum may be obscured. Therefore, after filtering out the target visible objects within the view frustum, we can further filter out unobstructed objects from the target visible objects within the view frustum as target rendering objects.
[0068] For example, if the vector distance from any vertex of the bounding volume of the target visible object to the viewing frustum plane is greater than zero, N sampling points are generated within the scene unit to obtain the sampling point coordinate set sample1[N], and M sampling points are generated within the bounding volume of the target visible object to obtain the sampling point coordinate set sample2[M]. The sampling points sample1[i] and sample2[j] in the sampling point coordinate set are then traversed to construct a line segment L from sample1[i] to sample2[j]. Whether line segment L intersects with the bounding volume of another object is checked.
[0069] Specifically, the step of detecting whether a line segment L intersects with the bounding volume of another object includes: determining the endpoint coordinates P1 (x1, y1, z1) and P2 (x2, y2, z2) of the line segment L, and the direction vector W = P2-P1 of the line segment L. Then, the bounding volume data of the other object is determined. Taking the oriented bounding box (OBB) as an example, the center point Q of the bounding box of the other object and the unit vectors U0, U1, and U2 of the three orthogonal axes in the bounding box are obtained. The endpoints of the line segment are projected into the local coordinate system of the bounding box to obtain the projected endpoint coordinates. . Where i = 0 or 1, corresponding to endpoints P1 and P2 respectively. Then for each axis, calculate the dot product of the line segment endpoint and the unit vectors in the three orthogonal axis directions, obtain the projection values a and b of the line segment endpoint on each axis k, and obtain the projection interval of the line segment L on the axis [min(a, b), max(a, b)]. Similarly, calculate the dot product of the vertices of the bounding box and the unit vectors in the three orthogonal axis directions, and obtain the projection interval of the bounding box on each axis k [-L_k, +L_k]. If any axis k satisfies max(a, b) <-L_k or min(a, b) > L_k, it means that the line segment L is separated from the bounding box, that is, the line segment L does not intersect with the bounding box, then the target visible object is not blocked by other objects and is determined to be the target rendering object.
[0070] Step S30 : determining a level of detail model corresponding to the target rendering object according to the distance between the target rendering object and the camera viewpoint, loading the level of detail model from the rendering scene tree to the rendering pipeline, and rendering the target rendering object.
[0071] Optionally, step S30 includes steps S31 to S33:
[0072] Step S31, obtaining the screen resolution and screen pixel error of the camera.
[0073] For example, the frame buffer size of the camera's current frame is obtained as the camera's screen resolution, which represents the total number of pixels the screen can display. A preset screen pixel error is then obtained. This error refers to the threshold for model edge aliasing that the human eye can tolerate. For example, VR devices require a screen pixel error of ≤ 0.3 pixels to prevent motion sickness.
[0074] Step S32 : determining the model level of the target rendering object according to the product of the bounding volume size of the target rendering object and the screen resolution, and the product of the distance between the target rendering object and the camera viewpoint and the screen pixel error.
[0075] The bounding volume of the target rendering object can be a bounding sphere or a bounding box. Taking the bounding sphere as an example, the radius of the bounding sphere is used as the bounding volume size. The screen resolution is converted into pixel density and multiplied by the bounding volume size of the target rendering object to estimate the theoretical pixel area covered by the target rendering object on the screen. In addition, the Euclidean distance from the center of the bounding volume of the target rendering object to the camera viewpoint is determined and multiplied by the screen pixel error to represent the visual accuracy degradation caused by the distance. Then, the model level of the target rendering object is determined. :
[0076]
[0077] Where F represents a direct proportional function.
[0078] Step S33: loading the level-of-detail model corresponding to the model level into the rendering pipeline.
[0079] After determining the model level corresponding to the target rendering object, the level of detail model data of the model level corresponding to the target rendering object is loaded from the rendering scene tree to the rendering pipeline, and the rendering pipeline performs the rendering process according to the level of detail model.
[0080] In this embodiment, the target visible object of the target scene unit where the camera viewpoint is located is first determined during rendering, and only the model data of the target visible object is loaded to reduce the processing of the model data. Then, the camera frustum is further used to eliminate objects that are invisible on the camera screen, and the target rendering object is determined from the target visible objects. According to the distance between the target rendering object and the camera viewpoint, the level of detail model corresponding to the target rendering object is loaded into the rendering pipeline, thereby further reducing the computational load of the GPU and avoiding resource waste and computational redundancy.
[0081] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 2 Before step S10, steps S40 to S70 are also included:
[0082] Step S40 , traversing the convex polygons on each scene unit in the three-dimensional scene, and taking the currently traversed convex polygon as the target convex polygon, wherein the convex polygon represents the open area between two adjacent scene units.
[0083] Step S50: determining the projection interval of the target convex polygon according to the normal vectors of each edge of the target convex polygon, and after determining the adjacent scene units connected to the target convex polygon, determining whether there are other convex polygons connected to the adjacent scene units in the projection interval.
[0084] Optionally, during the preloading phase, all open areas between two adjacent scene units in the three-dimensional scene are determined. Convex polygons are generated on the open areas between two adjacent scene units. The open areas between two adjacent scene units refer to the boundary areas between two logically adjacent scene units that are not completely enclosed by solid geometric objects such as walls, terrain, or obstacles, such as a corridor between two rooms or door and window openings in a building. Using the vertex set on the boundary of the open areas as input, a convex polygon is generated using a convex hull algorithm such as the Graham scan method or QuickHull.
[0085] In a feasible implementation, traverse all the convex polygons on the scene unit, take the currently traversed convex polygon as the target convex polygon, traverse each edge of the target convex polygon, and calculate the normal vector of each edge. Then, according to the normal vectors of each edge of the target convex polygon, calculate the projection interval of the target convex polygon: Assume that the normal vectors of each edge of the target convex polygon A are , calculate the dot product of each vertex of the target convex polygon A and the normal vector , and retain the maximum and minimum values of the dot product of each vertex and the normal vector to form the projection interval [minA, maxA].
[0086] After obtaining the projection interval of the target convex polygon, determine the adjacent scene units connected to the target convex polygon, and within this projection interval, determine whether there are other convex polygons on the adjacent scene units. Here, the other convex polygons connected to the adjacent scene units refer to the convex polygons on the adjacent scene units other than the target convex polygon.
[0087] Exemplarily, first determine the other convex polygon B on the adjacent scene unit other than the target convex polygon A, calculate the normal vectors of each edge of the other convex polygon B, and the dot product of each vertex of the other convex polygon B and the normal vector , retain the maximum and minimum values of the dot product of each vertex and the normal vector to form the projection interval [minB, maxB] of the other convex polygon B. If any edge of the target convex polygon A satisfies maxA < minB or maxB < minA, it means that the projection area of the target convex polygon A does not overlap with the projection area of the other convex polygon B, that is, the other convex polygon B on the adjacent scene unit connected to the target convex polygon A is not within the projection interval of the target convex polygon A. If each edge of the target convex polygon A does not satisfy the above conditions, it is determined that the other convex polygon B is within the projection interval of the target convex polygon A.
[0088] In another feasible implementation, take the convex polygon connected to the scene unit as the target convex polygon, connect the camera viewpoint with the vertices of the target convex polygon to generate a perspective frustum of the target convex polygon, and use this perspective frustum as the projection interval. By determining whether the perspective frustum of the target convex polygon intersects with other convex polygons connected to the adjacent scene unit, it is determined whether there are other convex polygons connected to the adjacent scene unit within the projection interval of the target convex polygon.
[0089] Exemplarily, the projection interval of the target convex polygon is obtained based on the camera viewpoint and the vertices of the target convex polygon, combined with the camera's perspective parameters, the near clipping plane (Near Plane) and the far clipping plane (Far Plane). The near clipping plane represents the visible plane closest to the camera, and the far clipping plane represents the visible plane farthest from the camera. The camera viewpoint is connected to the vertices of the target convex polygon, and together with the near clipping plane and the far clipping plane of the camera viewpoint, a projection cone is formed to obtain the projection interval of the target convex polygon. Then, it is determined whether the vertices of other convex polygons connected to adjacent scene units are within the projection cone. If none of the vertices of other convex polygons are within the projection cone, it is determined that there are no other convex polygons connected to adjacent scene units in the projection interval of the target convex polygon. If the vertices of other convex polygons connected to adjacent scene units are within the projection cone of the target convex polygon A, it means that the adjacent scene units are within the visible range of the camera viewpoint.
[0090] Optionally, the method for determining whether the vertices of other convex polygons connected to adjacent scene units are within the projection view cone includes determining whether the vertex coordinates of other convex polygons are within the projection view cone space, or first determining the vector distances between the vertex coordinates of other convex polygons and each plane of the projection view cone, and then determining whether each vertex is within the projection view cone based on the positive or negative vector distances between the vertex coordinates and each plane of the projection view cone.
[0091] Step S60: If the other convex polygon does not exist in the projection interval, other scene units connected to the traversed target convex polygon are used as visible scene units of the scene unit.
[0092] It is understood that if no other convex polygons exist within the projection interval of the target convex polygon, it means that the camera viewpoint cannot see other scene areas through the adjacent scene cells in the currently traversed scene cell. In this case, the other scene cells connected to the target convex polygon that were previously traversed are regarded as visible scene cells of the currently traversed scene cell.
[0093] Step S70 : constructing a rendering scene tree corresponding to the scene unit according to the level-of-detail model of each visible object in the visible scene unit.
[0094] Optionally, during the data preprocessing stage, different levels of Level of Detail (LOD) models can be generated for the objects in each scene unit and stored on disk, and an LOD rule configuration table can be generated. For example, a different LOD level and a corresponding level of detail model can be set for each object, where the level of detail models corresponding to different LOD levels have different model face ratios and texture resolutions. The higher the LOD level of an object, the finer the level of detail model corresponding to the object. The model data of the level of detail models corresponding to each LOD level can be set by the user, and this is not limited in this embodiment.
[0095] Optionally, the rendering scene tree takes the currently traversed scene unit as the root node, and mounts the hierarchical detail model data of the visible objects in all visible scene units corresponding to the scene unit; the branch node of the root node is the visible scene unit, and mounts the hierarchical detail model data of all visible objects in the visible scene unit; the leaf node of the branch node is the visible object, and mounts the hierarchical detail model data of the visible object, including the detailed hierarchy model obtained by instantiating the hierarchical detail model data.
[0096] Optionally, after step S50, steps S80 to S90 are further included:
[0097] Step S80: If there are other convex polygons connected to the adjacent scene units in the projection interval, use the other convex polygons as the target convex polygons.
[0098] Step S90, executing the step of determining the projection interval of the target convex polygon based on the normal vectors of each edge of the target convex polygon, and after determining the adjacent scene units connected to the target convex polygon, determining whether there are other convex polygons connected to the adjacent scene units in the projection interval, until no other convex polygons exist in the projection interval.
[0099] Optionally, if it is determined that other convex polygons connected to adjacent scene units are within the projection interval of the target convex polygon, that is, the adjacent scene unit is within the visible range of the scene unit, the other convex polygons on the adjacent scene unit are recursively processed as the target convex polygon, and further searches are performed for other visible scene units that can be seen by the currently traversed scene unit through the adjacent scene unit. The steps of the recursive processing are consistent with the above-mentioned step S50 and are not further described here. A recursion threshold can be set to avoid consuming excessive computing resources.
[0100] Based on the above embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction and will not be described in detail later. Figure 3After step S30, the scene data scheduling and rendering method based on dual PVS further includes steps S100 to S120:
[0101] Step S100: Acquire a movement trajectory of the camera viewpoint, wherein the movement trajectory includes at least one stop scene unit.
[0102] Step S110 : determining at least one candidate route from the historical trajectory map according to the similarity between the movement trajectory of the camera viewpoint and the movement routes in the historical trajectory map.
[0103] Obtain the viewpoint coordinates P_t = (x, y, z) for each frame during the camera's previous movement. Determine the scene unit the camera has passed through based on the viewpoint coordinates P_t. When a scene unit switch is detected, calculate the normalized directed vector between the center point of the current scene unit and the center point of the previous scene unit. Ultimately, generate a structured movement trajectory that contains the scene unit's topological relationships and directional information.
[0104] Load the historical trajectory map. The nodes in the historical trajectory map are scene units, and the edges are the transfer paths between scene units. Nodes can also be associated with parameters such as transfer frequency, average movement speed, and dwell time. Then, a graph embedding algorithm is used to calculate the Jaccard similarity between the historical trajectory map and the scene unit sequences in the movement trajectory. The Jaccard similarity is then sorted based on the similarity, and at least one candidate route similar to the camera viewpoint movement trajectory is identified from the historical trajectory map.
[0105] Step S120 : determining interesting scene units in the candidate routes according to the movement trajectory of the camera viewpoint, and loading a rendering scene tree corresponding to each interesting scene unit.
[0106] For example, the camera position sequence of the next N frames is predicted based on the Kalman filter algorithm = +Vt Δt+ / 2. Among them, Represents the predicted coordinates of the camera's viewpoint at a certain moment in the future. The camera's future position is inferred based on its historical motion state, and is used to pre-load the scene model in the direction the camera is moving. Represents the coordinates of the camera viewpoint in the current frame (time t). Vt represents the motion velocity vector of the camera in the current frame, which can be calculated by the position difference of adjacent frames:
[0107]
[0108] in, represents the camera's acceleration vector in the current frame, which can also be calculated from the velocity differential. Δt represents the time difference between the current frame and the predicted future frame. For each candidate route R_i, its overlap with the predicted path is calculated. The route with the highest overlap is marked as the preferred route R_opt. Then, along R_opt, adjacent scene units that may be entered in the future are extracted as units of interest, and the corresponding rendering scene tree of the unit of interest is pre-loaded.
[0109] Optionally, step S120 further includes steps S121 to S123:
[0110] Step S121: determining the dwell time and movement acceleration corresponding to each dwell scene unit in the movement trajectory according to the movement trajectory.
[0111] Step S122: performing weighted summation of the dwell time and the movement acceleration to obtain an interest score for each dwell scene unit.
[0112] Step S123 , determining the scene type of the stop scene unit whose interest score is greater than a preset interest threshold, and determining the interest scene unit from the candidate routes according to the scene type.
[0113] Exemplarily, the camera viewpoint's trajectory is read, and based on the viewpoint coordinates P_t = (x, y, z) of each frame in the trajectory, the scene unit in which the viewpoint resides is determined. The dwell time t_stay of each scene unit and the acceleration of the movement within the scene unit are recorded. The dwell time and the acceleration are weighted and summed to obtain the interest score of each scene unit. The longer the dwell time and the lower the acceleration, the higher the interest score of the scene unit. The mean μ and standard deviation σ of the interest scores of the scene units in the candidate route are calculated. The interest threshold can be preset to μ + 2σ. The scene type of the scene units with an interest score greater than the preset interest threshold is determined, such as entertainment scenes. The scene units corresponding to these scene types are then identified as scene units of interest in the candidate route, and the rendered scene tree corresponding to the scene units of interest is pre-loaded from disk into GPU memory.
[0114] In this embodiment, the camera's viewpoint trajectory is combined with historical trajectory maps to preload relevant scene models through prediction and evaluation, optimizing the rendering process. The trajectory is analyzed to obtain information about scene units where the camera stops. Historical data is used to identify similar candidate routes, predict the camera's future position, identify interesting scene units, and preload models. Furthermore, an interest score is calculated based on dwell time and movement acceleration, accurately locating the scene units of interest. This method allows for pre-prepared rendering resources, reduces latency, and improves rendering smoothness and efficiency.
[0115] For example, in order to help understand the implementation process of the scene data scheduling and rendering method based on dual PVS obtained by combining this embodiment with the above embodiments, please refer to Figure 4 , Figure 4 A simplified flow chart of a scene data scheduling and rendering method based on dual PVS is provided. Specifically, in the pre-calculation stage, the three-dimensional scene is first divided into scene units. Then, a level-of-detail model of each scene unit is calculated, and a spatial index structure, such as an octree or quadtree, is constructed for each scene unit. These index structures can accelerate the retrieval of scene objects and improve the efficiency of dynamic loading. Then, the visible units and visible objects within each scene unit are determined, and a rendering scene tree is constructed for each scene unit. Simultaneously, the rendering scene tree corresponding to the scene unit of interest predicted by the camera viewpoint based on the previous frame can be loaded. Optionally, the scene model data in the rendering scene tree is divided into multiple pages, each containing object model data within a certain range. Page data is dynamically loaded and unloaded based on the current field of view and the predicted field of view. During rendering, the rendering scene tree of the target scene unit where the camera viewpoint of the current frame is located is first loaded, and the target visible objects corresponding to the target scene unit are determined for the first screening. Next, the target rendering object is identified from the visible objects through frustum culling and occlusion culling. Based on the distance between the target rendering object and the camera viewpoint, the corresponding level of detail model is loaded into the rendering pipeline, further reducing the number of objects entering the rendering pipeline and improving rendering efficiency. Rendering performance is then monitored in real time: using metrics such as frame rate, rendering time, and memory usage, the monitoring data is used to analyze performance bottlenecks in the rendering process, such as data loading delays, excessive rendering load, and insufficient memory. Based on the performance monitoring results, the data loading strategy is dynamically adjusted to optimize the rendering process, such as adjusting the predicted loading range and optimizing the hierarchical granularity of the tomographic detail model. An optimization decision is then made. If the optimization effect matches the prediction, user feedback is awaited. If the effect differs significantly from the prediction, the process returns to the data loading phase and the rendering object screening step is re-executed.
[0116] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the scene data scheduling and rendering method based on dual PVS of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0117] The present application provides a dual-PVS-based scene data scheduling and rendering device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the dual-PVS-based scene data scheduling and rendering method in the above-mentioned embodiment 1.
[0118] Reference below Figure 5 , which shows a schematic diagram of the structure of a dual-PVS-based scene data scheduling and rendering device suitable for implementing the embodiments of the present application. The dual-PVS-based scene data scheduling and rendering device in the embodiments of the present application can include, but is not limited to, mobile terminals such as laptops, tablet computers (PADs, Portable Application Descriptions), portable multimedia players (PMPs, Portable Media Players), and fixed terminals such as desktop computers. Figure 5 The dual PVS-based scene data scheduling and rendering device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0119] like Figure 5 As shown, the dual-PVS-based scene data scheduling and rendering device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the dual-PVS-based scene data scheduling and rendering device. Processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, hard disk, etc.; and communication devices 1009. Communication devices 1009 can allow the dual-PVS-based scene data scheduling and rendering device to communicate wirelessly or wired with other devices to exchange data. While the figure shows a dual-PVS-based scene data scheduling and rendering device with various systems, it should be understood that implementation or presence of all the illustrated systems is not required. More or fewer systems may alternatively be implemented or present.
[0120] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are performed.
[0121] The dual-PVS-based scene data scheduling and rendering device provided in this application, which employs the dual-PVS-based scene data scheduling and rendering method of the aforementioned embodiment, can solve the technical problem of reducing computational resource consumption for model rendering. Compared to the prior art, the beneficial effects of the dual-PVS-based scene data scheduling and rendering device provided in this application are the same as those of the dual-PVS-based scene data scheduling and rendering method provided in the aforementioned embodiment. Other technical features of the dual-PVS-based scene data scheduling and rendering device are the same as those disclosed in the aforementioned embodiment and are not further elaborated here.
[0122] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0123] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0124] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, a computer program) stored thereon, wherein the computer-readable program instructions are used to execute the dual PVS-based scene data scheduling and rendering method in the above-mentioned embodiment.
[0125] The computer-readable storage medium provided herein may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including, but not limited to, wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.
[0126] The computer-readable storage medium may be included in the dual-PVS-based scene data scheduling and rendering device; or may exist independently without being assembled into the dual-PVS-based scene data scheduling and rendering device.
[0127] The computer-readable storage medium carries one or more programs. When executed by a dual-PVS-based scene data scheduling and rendering device, the one or more programs enable the dual-PVS-based scene data scheduling and rendering device to write computer program code for performing the operations of the present application in one or more programming languages, or a combination thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0128] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of code, and the module, program segment or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0129] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0130] The computer-readable storage medium provided in this application stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned dual-PVS-based scene data scheduling and rendering method. This computer-readable storage medium addresses the technical problem of reducing computational resource consumption for model rendering. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are similar to those of the dual-PVS-based scene data scheduling and rendering method provided in the aforementioned embodiments, and are not further elaborated here.
[0131] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned dual PVS-based scene data scheduling and rendering method.
[0132] The computer program product provided in this application can solve the technical problem of reducing computational resource consumption for model rendering. Compared to the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the dual-PVS-based scene data scheduling and rendering method provided in the aforementioned embodiment, and will not be further elaborated here.
[0133] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A scene data scheduling and rendering method based on dual PVS, characterized in that: The dual PVS-based scene data scheduling and rendering method includes: Determine the target scene unit where the camera viewpoint is located, and obtain a rendering scene tree corresponding to the target scene unit from the PVS of the target scene unit, where the nodes of the rendering scene tree are target visible objects corresponding to the target scene unit; Determine the viewing cone corresponding to the camera viewpoint according to the direction vector and the viewing angle of the camera; Traversing the target visible object in the rendering scene tree, and determining vector distances from each vertex of the bounding volume of the target visible object to each plane of the viewing cone; If the vector distance corresponding to any vertex of the bounding volume of the target visible object is greater than zero, determining that the target visible object is a target rendering object; Get the camera's screen resolution and screen pixel error; Determining a model level of the target rendering object according to a product of a bounding volume size of the target rendering object and a screen resolution, and a product of a distance from the target rendering object to the camera viewpoint and a screen pixel error; The level-of-detail model corresponding to the model level is loaded into the rendering pipeline, and the target rendering object is rendered.
2. The scene data scheduling and rendering method based on dual PVS according to claim 1, characterized in that: Before the step of determining the target scene unit where the camera viewpoint is located and obtaining the rendering scene tree corresponding to the target scene unit from the PVS of the target scene unit, the method further includes: Traversing the convex polygons on each scene unit in the three-dimensional scene, and taking the currently traversed convex polygon as the target convex polygon, wherein the convex polygon represents an open area between two adjacent scene units; Determining a projection interval of the target convex polygon according to normal vectors of each edge of the target convex polygon, and after determining adjacent scene units connected to the target convex polygon, determining whether there are other convex polygons connected to the adjacent scene units within the projection interval; If the other convex polygon does not exist in the projection interval, other scene units connected to the traversed target convex polygon are used as visible scene units of the scene unit; A rendering scene tree corresponding to the scene unit is constructed according to the level of detail model of each visible object in the visible scene unit.
3. The scene data scheduling and rendering method based on dual PVS according to claim 2, characterized in that: After determining the adjacent scene unit connected to the target convex polygon, and then determining whether there are other convex polygons connected to the adjacent scene unit in the projection interval, the method further includes: If there are other convex polygons connected to the adjacent scene units in the projection interval, the other convex polygons are used as the target convex polygons; Execute the steps of determining the projection interval of the target convex polygon according to the normal vectors of each edge of the target convex polygon, and after determining the adjacent scene units connected to the target convex polygon, determining whether there are other convex polygons connected to the adjacent scene units in the projection interval, until no other convex polygons exist in the projection interval.
4. The scene data scheduling and rendering method based on dual PVS according to claim 1, characterized in that: After the step of traversing the target visible object in the rendering scene tree and determining the vector distances from each vertex of the bounding volume of the target visible object to each plane of the viewing cone, the method further includes: If the vector distance corresponding to any vertex of the bounding volume of the target visible object is greater than zero, generating a first sampling point in the target scene unit, and generating a second sampling point in the bounding volume of the target visible object; A connecting line is generated between each of the first sampling points and each of the second sampling points. If there is a connecting line that does not intersect with the bounding volume of another object, the target visible object is determined to be the target rendering object, wherein the other object is an object in the rendering scene tree other than the currently traversed target visible object.
5. The scene data scheduling and rendering method based on dual PVS according to claim 1, characterized in that: After the step of loading the level of detail model corresponding to the model level into the rendering pipeline, the method further includes: Acquire a movement trajectory of the camera viewpoint, wherein the movement trajectory includes at least one stop scene unit; Determining at least one candidate route from the historical trajectory map based on a similarity between the movement trajectory of the camera viewpoint and the movement routes in the historical trajectory map; According to the movement trajectory of the camera viewpoint, interesting scene units are determined in the candidate routes, and rendering scene trees corresponding to the respective interesting scene units are loaded.
6. The scene data scheduling and rendering method based on dual PVS according to claim 5, characterized in that: The step of determining the scene of interest unit in the candidate route according to the movement trajectory of the camera viewpoint includes: Determining the dwell time and movement acceleration corresponding to each dwell scene unit in the movement trajectory according to the movement trajectory; Taking a weighted sum of the dwell time and the movement acceleration to obtain an interest score for each dwell scene unit; The scene type of the stop scene unit having an interest score greater than a preset interest threshold is determined, and the interest scene unit is determined from the candidate routes according to the scene type.
Citation Information
Patent Citations
Three-dimensional scene rendering acceleration method and system based on video geometric analysis
CN110738721A
Rendering of 3D scenes on a display using hierarchical z-buffer visibility
US5579455A