A method and system for dynamic object visibility queries of visibility data representations

By performing meshing and encoding on 3D scenes, the problem of excessive mesh visibility data was solved, enabling efficient visibility querying and data compression, and improving the performance and network efficiency of multi-user 3D applications.

CN116737980BActive Publication Date: 2026-01-27ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310750124.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-25
Publication Date
2026-01-27
Estimated Expiration
2043-06-25

AI Technical Summary

Technical Problem

Existing schemes based on pre-computed visibility sets suffer from excessively large amounts of mesh-to-mesh visibility data, resulting in low storage and query efficiency and limiting their application in situations with limited hardware configurations.

Method used

The method employs offline baking and online querying. By uniformly dividing the 3D scene into square grids, occlusion culling technology is applied to calculate grid visibility offline. Different encoding methods are used to compress the visibility set data for different grid types and store it on disk. During online querying, the appropriate decoding algorithm is selected based on the grid type for fast visibility querying.

Benefits of technology

It significantly reduces the amount of visible set data, saves memory and external storage overhead, enables real-time and fast grid visibility queries, improves the performance of multiplayer 3D applications, and reduces network traffic and defends against cheating behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116737980B_ABST
    Figure CN116737980B_ABST
Patent Text Reader

Abstract

The application discloses a dynamic object visibility query method and system of a visibility data representation, and the system comprises two modules of offline baking and online query. The offline baking module divides a 3D scene into uniform square grids, applies occlusion culling technology, and offline calculates the visibility of each grid with all other grids; all the grids are classified, corresponding encoding methods are adopted to compress the visibility set of different types of grids, and the encoded file is stored on a disk. The online query module reads all the visibility set data on the disk into the memory; when the visibility query of a current grid to a specified grid is performed, the visibility set of the current grid is read, and according to the type of the current grid, a corresponding fast decoding algorithm is selected to obtain the visibility with the specified grid. The application greatly reduces the data size of the visibility set, and meanwhile, the improved representation method can still be used to quickly perform the visibility query.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer graphics technology, and particularly relates to a method and system for dynamic object visibility query based on visibility data representation. Background Technology

[0002] Visibility is a fundamental problem in computer graphics research. Today, users have increasingly higher demands for the visual quality of 3D graphics systems, requiring more and more refined rendering and ensuring real-time interactive experiences even with limited hardware configurations. Therefore, in computer graphics rendering, removing objects that will ultimately be invisible due to occlusion before being rendered by the hardware is an effective optimization method.

[0003] One approach to occlusion culling is based on pre-computed visibility sets, widely used by many rendering engines, including Unreal Engine. This approach divides the scene into meshes, and then, for each mesh, pre-computes its visibility to static objects in the scene. This pre-computation process can employ techniques such as ray tracing or physically based ray tracing. The resulting visibility data for all meshes is called the visibility set. By storing the visibility set, the visibility of static objects in the scene can be quickly determined at runtime based on the camera's mesh position.

[0004] Traditional pre-computed visibility sets are used for graphics rendering optimization. First, the scene is divided into meshes, then static objects in the scene are collected, and the visibility of each mesh to all static objects is pre-computed. The resulting set of all visibilitys is called the visibility set. If we change the visibility set of each mesh from a set of mesh-to-static-object visibilitys to a set of mesh-to-mesh visibilitys—that is, pre-compute the visibility between each mesh and every other mesh—then at runtime, we can check which meshes the volume range of a dynamic object falls within, and then check whether the currently located mesh can see these meshes. This visibility set can then be used to determine the visibility of small dynamic objects. We call this the inter-mesh visibility set, distinguishing it from the traditional mesh-to-static-object visibility set. A typical use case for this inter-mesh visibility set used to determine the visibility of dynamic objects is determining the visibility between players in multiplayer games.

[0005] However, a major problem with schemes based on pre-computed visibility sets is the sheer volume of pre-computed data. In particular, the visibility data between each grid cell and every other grid cell can result in a raw data volume that is the square of the number of grid cells in the scene. Existing schemes for storing grid-to-grid visibility, such as those using bit arrays or run-length encoding, have not yielded ideal results. The enormous data volume limits the practical application of this scheme.

[0006] Therefore, in order to make the mesh-to-mesh visibility pre-computation scheme more widely used, an efficient data representation method is needed. This data representation method can not only compress the size of the visibility set data to a smaller range, but also ensure that visibility queries can be performed quickly using the compressed visibility set data. Summary of the Invention

[0007] To address the shortcomings of existing technologies, this invention provides a method and system for dynamic object visibility querying based on visibility data representation. The system includes two modules: offline baking and online querying. The technical solution of this invention is achieved through the following:

[0008] A first aspect of the present invention: a method for dynamic object visibility query based on visibility data representation, the method comprising the following steps:

[0009] (1) Model building: Build a dynamic object visibility query model, which includes two parts: offline baking and online query;

[0010] (2) Offline baking: Divide the 3D scene into uniform square grids, apply occlusion culling technology to calculate the visibility of each grid to all other grids offline; classify all grids, use corresponding encoding methods to compress the visible set for different types of grids, and store the encoded file on disk;

[0011] (3) Online query: The disk reads all visible set data into memory; when performing a visibility query on a specified grid for the current grid, the visible set of the current grid is read, and the corresponding fast decoding algorithm is selected according to the type of the current grid to obtain the visibility with the specified grid.

[0012] Specifically, in step (2), the encoding method is to assign numbers to the grids in a certain order for the visibility between every two grids: in space, the grids are numbered sequentially from left to right, then from top to bottom, and then from front to back, for each column, each row, and each plane.

[0013] Furthermore, in step (2) of the offline baking module, different representation methods are used to encode the original visibility data for different types of grids, and the encoded data is recorded, specifically as follows:

[0014] (2.1) For the first type of mesh, the visibility between it and other meshes is initially calculated.

[0015] After the data is processed, all visible grids are traversed sequentially. During the traversal, multiple consecutively numbered visible grids are recorded as the starting and ending grid numbers. The interval of these consecutively numbered grids is represented by a pair of numbers. The encoded data is an ordered set containing several pairs of grid numbers.

[0016] (2.2) For the second type of mesh, the visibility between it and other meshes is initially calculated.

[0017] After the data is collected, a specific grid around it is designated as its reference grid. The differences between the visible set of the current grid and the reference grid are compared. All the differences are recorded as a new grid set. The grids in the new set are traversed using the same method as in step (2.1). The starting and ending grid numbers of consecutively numbered grids are recorded. The encoded data is an ordered set containing several grid number pairs.

[0018] (2.3) For the third type of mesh, the visibility between it and other meshes is initially calculated.

[0019] After the data is collected, two specific grids on the left and right sides of different columns are designated as reference grids. Based on the positional relationship between the current grid and these two reference grids, the original visibility data of these two reference grids are interpolated to obtain an estimate of the visibility data of the current grid. The difference between the actual visibility data of the current grid and the estimated data is calculated, and all differences are recorded to obtain a new grid set. The same method as in step (2.1) is used to traverse the grids in the new set and record the starting and ending grid numbers of consecutively numbered grids. The encoded data is an ordered set containing several grid number pairs.

[0020] Further, in step (2.3), the interpolation of the original visibility data of the two reference grids is specifically performed as follows:

[0021] (2.3.1) Mark the current mesh as C;

[0022] (2.3.2) Calculate the distance of the current grid to the two reference grids A and B on the left and right sides respectively, and find the proportion t of the position of interval AC in interval AB;

[0023] (2.3.3) Take out the original visibility datasets of the two reference grids A and B, divide all the consecutively numbered grid intervals contained in their original data into rows; for each row, take all the intervals in this row of the "reference grid", perform interval matching according to the specified strategy, and then use t to interpolate the beginning and end of each matched interval to obtain the interpolated interval, and round it to the integer interval.

[0024] Furthermore, the specific process of the interval matching strategy in step (2.3.3) is as follows:

[0025] For reference grids A and B, suppose that the x-coordinate of grid A is less than the x-coordinate of grid B, that is, grid A is to the left of B. Traverse each visible interval of grid A and find the last interval in the visible interval of grid B that is to the left of the current visible interval of A. Interval S1 is to the left of interval S2 if and only if the starting grid of interval S1 is to the left of the starting grid of S2, and the ending grid of S1 is to the left of the ending grid of S2.

[0026] Furthermore, in step (3), during online querying, each query requires determining the visibility between the current grid and another specified grid. Different methods are used for different types of grids, specifically including:

[0027] (6.1) For the first type of grid, perform a binary search in the encoded data according to the grid number to find whether there is an interval of a certain consecutively numbered grid that contains the grid number. The result is the visibility. If it exists, output yes; if it does not exist, output no.

[0028] (6.2) For the second type of grid, firstly, based on the grid number, perform a binary search in the encoded data to find whether there exists an interval of a certain consecutively numbered grid that contains the grid number. The result is a Boolean value indicating whether the grid exists. Then, obtain the type of the reference grid of the current grid. Based on its type, calculate the visibility of the reference grid and the grid number, i.e., the Boolean value indicating whether the grid is visible, using the appropriate method. Finally, XOR the two Boolean values ​​and output the visibility, i.e., the Boolean value indicating whether the grid is visible.

[0029] (6.3) For the third type of grid, firstly, based on the specified grid number, perform a binary search in the encoded data to find whether there is an interval of a certain consecutively numbered grid containing the specified grid number, and the result is a Boolean value indicating whether it exists; then, obtain the types of the two reference grids of the current grid, obtain their original visibility data, and perform interpolation to obtain an estimate of the visibility data of the current grid, and perform a binary search in this estimated visibility data to find whether the specified grid number exists in the estimated visibility data set, and the result is a Boolean value indicating whether it exists; finally, XOR the above two Boolean values ​​and output the visibility, i.e., whether it is visible Boolean value.

[0030] Specifically, the online query in step (2) will query the visibility between multiple specified grids and other specified grids in real time during runtime; all locations are dynamic and will change in real time, and there is no special preset distribution pattern for the locations.

[0031] A second aspect of the present invention: a dynamic object visibility query system for visibility data representation, the system comprising the following modules:

[0032] Model building module: Constructs a dynamic object visibility query model, which includes two parts: offline baking and online query;

[0033] Offline baking module: Divides the 3D scene into uniform square grids, applies occlusion culling technology to calculate the visibility of each grid to all other grids offline; classifies all grids, applies corresponding encoding methods to compress the visible set for different types of grids, and stores the encoded file on disk;

[0034] Online query module: Reads all visible set data from disk into memory; when performing a visibility query for a specific grid in the current grid, it reads the visible set of the current grid and selects the appropriate fast decoding algorithm to obtain the visibility with the specified grid based on the type of the current grid.

[0035] The beneficial effects of this invention are as follows:

[0036] This system and the way visibility data is represented are used to enable real-time and fast querying of visibility between grids in static scenarios, while significantly reducing the amount of visibility set data, saving memory and external storage overhead, and enabling the visibility pre-computation scheme based on the visibility set between grids to be more widely used.

[0037] This system and data representation method can be used in multiplayer 3D applications, such as city tour applications and game clients. Because each frame requires the execution of physical and animation calculations for complex models such as characters, as well as related special effects and business logic, there is a significant overhead. Therefore, by querying visibility in real time, other characters that are not visible to the user can be quickly removed, eliminating this unnecessary overhead and improving performance. In addition to the client, it can also be used on the server side of 3D applications that require network synchronization, such as city tour application servers and online game servers. The server queries the visibility between each character and other dynamic units in real time each frame, and then sends data to each client only to other dynamic units within the current character's field of view, which can significantly reduce network traffic. When used on game servers, it can also serve to defend against wallhacks and X-ray vision cheats. Attached Figure Description

[0038] The accompanying drawings are incorporated into and form part of this specification, illustrating how the various modules involved in the invention are implemented in accordance with the principles of the invention. The focus of the drawings is not limitation, but rather to explain the principles of the invention. In the drawings,

[0039] Figure 1This is an execution flowchart of each module of the visibility query system of the present invention;

[0040] Figure 2 This is a diagram illustrating a possible mesh type partitioning method according to the present invention;

[0041] Figure 3 This is a process diagram of the present invention for interpolating the visible interval using a "reference grid";

[0042] Figure 4 This is the matching diagram of the visible interval for the interpolation process of the present invention;

[0043] Figure 5 This is a schematic diagram of the system flow of the present invention. Detailed Implementation

[0044] The following detailed description, relating to the accompanying drawings, will set forth specific details of one embodiment to provide a full understanding of the various aspects of the claimed invention. It will be apparent to those skilled in the art that other embodiments, different from the specific details described below, may be employed to implement certain modules and systems of the invention. The following description is intended for explanation rather than limitation. Any modifications, equivalent substitutions, etc., made within the spirit and principles of the invention should be included within the scope of protection of the invention.

[0045] According to the scheme of the present invention, the modules and processes of the designed visibility query system are as follows: Figure 1 As shown. We will apply this solution to an online game. The specific solution is as follows:

[0046] For a 3D scene, the user first specifies a region and the dimensions (length, width, and height) of each grid. The system then divides the specified region evenly into several grids and numbers all the grids sequentially according to their column (x-direction), row (z-direction), and plane (y-direction). The grid numbers can be directly derived from their spatial location and therefore do not need to be saved. For example, by default, the space is divided into 1x1x1 grids. A point with spatial coordinates (x0, y0, z0) is mapped to grid coordinates (i, j, k) by rounding. The system calculates the grid number for the grid with coordinates (i, j, k) using the formula id = i + x × k + x × z × j, and calculates the coordinates of the grid with the number id using the formulas i = id % x, k = (id / x) % z, j = id / (x × z). The grid with coordinates (i, j, k) is called the grid located on the j-th plane (or y-plane), in the i-th column and k-th row.

[0047] First, the system allows users to choose whether to perform initial mesh filtering, removing some inaccessible meshes to initially reduce visibility calculation time and the final data volume. This step includes automatic and manual filtering. The automatic filtering process involves the system randomly placing a cube object on the scene's ground and controlling its movement within the scene to avoid collisions, thus determining walkable locations. Manual filtering is provided when automatic filtering fails to identify locations, such as in scenarios where users are prohibited from entering invisible walls or certain buildings. In these cases, users can manually filter these business-related inaccessible locations. After initial filtering, meshes in these inaccessible locations are recorded as an invalid mesh set and skipped in subsequent occlusion baking calculations. During the visibility query step, all queries involving invalid meshes will return "invisible".

[0048] Next, using traditional occlusion culling techniques, we pre-calculate the visibility set of all valid meshes to all other meshes. Various traditional visibility query methods can be applied. We can select 27 points from each mesh: 8 vertices, the midpoints of 12 edges, the midpoints of 6 faces, and the mesh center. We then connect these points to the 27 points of the mesh to be queried and perform reachability checks. If at least one connection exists without obstruction, the two meshes are considered mutually visible. This step can be accelerated using GPU-based ray tracing.

[0049] This scheme differs from traditional methods that rely on the visibility set of a grid to a static object. In this scheme, the visibility between grids is symmetrical; if grid A is visible to grid B, then grid B is also visible to grid A. Therefore, in the baking module, for each grid, only its visibility with other grids whose numbers are lower than its own is required, and only this data needs to be stored. In the query module, when calculating the visibility of grid X to Y, if X is greater than Y, the visibility of X to Y is calculated normally; if X is less than Y, the visibility of Y to X is calculated in reverse. Thus, the original data size is compressed to half its original size.

[0050] After obtaining the raw visibility data through baking, all meshes in the 3D scene are classified according to a specific mesh type partitioning scheme. The types are divided into three categories, referred to as "Category 1", "Category 2", and "Category 3".

[0051] One possible way to divide it is as follows: Figure 2As shown, this diagram illustrates the grid classification of a certain y-plane. For ease of explanation, the numbers "1", "2", and "3" represent "Category 1", "Category 2", and "Category 3". The first row is filled with one "1" and three "3"s in every four columns. If the last group has fewer than four columns, then the last column is also filled with "1". After filling, the reference grid for each "3" is set to the two adjacent "1"s. The second row is filled entirely with "2", and the reference grid is set to the corresponding grid in the previous row. Then, we repeat the above filling steps in groups of two rows; that is, the third row repeats the method of the first row, the fourth row repeats the method of the third row, and so on, filling each subsequent row. After completing the classification of one y-plane, we continue to the next y-plane and repeat the above classification scheme. The above division method is just one possibility; other classification methods can be tried. For example, the first row can be filled with "1" and "3" in groups of six columns, or the second row can be filled with one "2" and three "3"s in groups of four columns, or the classification can be repeated in groups of three rows, etc. Flexible adjustments can be made to obtain different encoding results for comparison, thereby obtaining a smaller amount of data.

[0052] Based on the raw data of grid-to-grid visibility, the system performs the following processing on the three different types of grids:

[0053] (1) For the "first type" grid, after the visibility data between it and other grids is initially calculated, all visible grids are traversed sequentially. During the traversal, multiple consecutively numbered visible grids are recorded as the starting grid and ending grid numbers. The interval of this consecutively numbered grid is represented by a pair of numbers. The encoded data is an ordered set containing several pairs of grid numbers.

[0054] (2) For the "second type" grid, after the visibility data between it and other grids is initially calculated, a specific grid around it is designated as its "reference grid". The difference between the visibility set of the current grid and the "reference grid" is compared. All the differences are recorded as a new grid set. The grids in the new set are traversed using the same method as in step (1). The starting and ending grid numbers of consecutively numbered grids are recorded. The encoded data is an ordered set containing several grid number pairs.

[0055] (3) For the "third type" grid, after the visibility data between it and other grids is initially calculated, two specific grids on the left and right sides of its different columns are designated as its "reference grids". Based on the positional relationship between the current grid and these two "reference grids", the original visibility data of these two "reference grids" are interpolated to obtain an estimate of the visibility data of the current grid. The difference between the actual visibility data of the current grid and the estimated data is calculated. All the differences are recorded to obtain a new grid set. The grids in the new set are traversed using the same method as in step (1), and the starting and ending grid numbers of consecutively numbered grids are recorded. The encoded data is an ordered set containing several grid number pairs.

[0056] After data processing, visibility data is stored on disk. In practice, we automate this entire process as a continuous deployment step, uploading the pre-calculated data via version control tools like Git or Subversion. During automated builds on the game's server, all map visibility data is retrieved and packaged into the game. At runtime, the server first reads the visibility data into memory, then checks the visibility between up to 60 players in real-time each frame. For each check, based on each player's current position, we retrieve the grid containing that player and perform visibility queries on the grids between each pair of players. Different methods are applied to the visibility queries depending on the grid type, as detailed below:

[0057] (1) For the "first type" grid, perform a binary search in the encoded data according to the grid number to find whether there is an interval of a certain consecutively numbered grid that contains the specified grid number. If so, output the visibility (yes or no).

[0058] (2) For the "second type" grid, firstly, according to the grid number, perform a binary search in the encoded data to find whether there is an interval of a certain consecutively numbered grid that contains the grid number (yes or no); then obtain the type of the "reference grid" of the current grid, and according to its type, calculate the visibility (yes or no) between the "reference grid" and the grid number using the appropriate method; finally, XOR the two results and output the visibility (yes or no).

[0059] (3) For the “third type” grid, firstly, according to the number of the specified grid, perform a binary search in the encoded data to find whether there is an interval of a certain consecutively numbered grid that contains the specified grid number (yes or no); then obtain the types of the two “reference grids” of the current grid, obtain their original visibility data, and perform interpolation to obtain an estimate of the visibility data of the current grid, and perform a binary search in this estimated visibility data to find whether the specified grid number is in the estimated visibility dataset (yes or no); finally, XOR the above two results and output the visibility (yes or no).

[0060] The specific process of using the "reference grid" for visibility interpolation in the above steps is as follows: Figure 4 As shown, the steps are as follows:

[0061] (1) Mark the current grid as C.

[0062] (2) Calculate the distance of the x coordinate between the current grid and the two “reference grids” A and B on the left and right sides respectively, and find the proportion t of the position of the interval AC in the interval AB.

[0063] (3) Take out the original visibility datasets of the two “baseline grids” A and B, match all consecutively numbered grid intervals contained in their original data according to the specified strategy, and then perform linear interpolation on the beginning and end of each matched interval with t as the parameter to obtain the interpolation interval, and round it to the integer interval.

[0064] The specific process of interval matching in the above interpolation process is as follows: For "reference grids" A and B, where the x-coordinate of grid A is less than the x-coordinate of grid B (i.e., grid A is to the left of B), traverse each visible interval of grid A and find the last visible interval of grid B that is to the left of the current visible interval of A. Interval S1 is to the left of interval S2 if and only if the starting grid of interval S1 is to the left of the starting grid of S2, and the ending grid of S1 is to the left of the ending grid of S2. Figure 4 For the intuitive process of interpolation, for two grids A and B in the row z=0, the corresponding visible intervals of A and B are L1 and L2 respectively. After interpolation, the visible interval of C is L3.

[0065] When two grids, A and B, have more than one visible interval in a certain row, their matching intervals need to be calculated and then interpolated separately. The specific process of interval matching is as follows: For the "reference grids" A and B, let's assume that the x-coordinate of grid A is less than the x-coordinate of grid B, that is, grid A is to the left of B. Traverse each visible interval of grid A, and find the last interval in the visible intervals of grid B that is to the left of the current visible interval of A. Interval S1 is to the left of interval S2 if and only if the starting grid of interval S1 is to the left of the starting grid of S2, and the ending grid of S1 is to the left of the ending grid of S2. Figure 4 Here's an intuitive process for finding matching intervals. A and B each have two visible intervals L1 and L4, and L2 and L3, in the row z = 0. A is to the left of B. Therefore, for A's two visible intervals L2 and L4, find the intervals to the left of B's ​​entire visible interval, namely L1 and L3.

[0066] In addition, such as Figure 5 As shown, the present invention also provides a dynamic object visibility query system for visibility data representation, the system comprising the following modules:

[0067] Model building module: Constructs a dynamic object visibility query model, which includes two parts: offline baking and online query;

[0068] Offline baking module: Divides the 3D scene into uniform square grids, applies occlusion culling technology to calculate the visibility of each grid to all other grids offline; classifies all grids, applies corresponding encoding methods to compress the visible set for different types of grids, and stores the encoded file on disk;

[0069] Online query module: Reads all visible set data from disk into memory; when performing a visibility query for a specific grid in the current grid, it reads the visible set of the current grid and selects the appropriate fast decoding algorithm to obtain the visibility with the specified grid based on the type of the current grid.

[0070] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that, based on the technical solutions disclosed in the present invention, various modifications or variations that can be made by those skilled in the art without creative effort should be included within the scope of protection of the present invention.

Claims

1. A method for dynamic object visibility query based on visibility data representation, characterized in that, The method includes the following steps: (1) Model building: Build a dynamic object visibility query model, which includes two parts: offline baking and online query; (2) Offline Baking: The 3D scene is divided into uniform square grids. Occlusion culling technology is applied to calculate the visibility of each grid to all other grids offline. All grids are classified, and the visibility set is compressed using corresponding encoding methods for different types of grids. The encoded files are stored on disk. In offline baking, different representation methods are used to encode the original visibility data for different types of grids, and the encoded data is recorded. Specifically: (2.1) For the first type of mesh, the visibility between it and other meshes is initially calculated. After the data is processed, all visible grids are traversed sequentially. During the traversal, multiple consecutively numbered visible grids are recorded as the starting and ending grid numbers. The interval of these consecutively numbered grids is represented by a pair of numbers. The encoded data is an ordered set containing several pairs of grid numbers. (2.2) For the second type of grid, after the visibility data between it and other grids is initially calculated, a specific grid around it is designated as its reference grid. The difference between the visibility set of the current grid and the reference grid is compared. All the differences are recorded as a new grid set. The grids in the new set are traversed using the same method as in step (2.1). The starting and ending grid numbers of consecutively numbered grids are recorded. The encoded data is an ordered set containing several grid number pairs. (2.3) For the third type of grid, after the visibility data between it and other grids is initially calculated, two specific grids on the left and right sides of its different columns are designated as its reference grids. Based on the positional relationship between the current grid and these two reference grids, the original visibility data of these two reference grids are interpolated to obtain an estimate of the visibility data of the current grid. The difference between the actual visibility data of the current grid and the estimated data is calculated. All the differences are recorded to obtain a new grid set. The same method as in step (2.1) is used to traverse the grids in the new set and record the starting and ending grid numbers of the consecutively numbered grids. The encoded data is an ordered set containing several grid number pairs. (3) Online query: The disk reads all visible set data into memory; when performing a visibility query on a specified grid for the current grid, the visible set of the current grid is read, and the corresponding fast decoding algorithm is selected according to the type of the current grid to obtain the visibility with the specified grid.

2. The method for dynamic object visibility query based on visibility data representation according to claim 1, characterized in that, The encoding method in step (2) is to assign numbers to the grids in a certain order for the visibility between every two grids: in space, the grids are numbered sequentially from left to right, then from top to bottom, and then from front to back, for each column, each row, and each plane.

3. The method for dynamic object visibility query based on visibility data representation according to claim 1, characterized in that, In step (2.3), the interpolation of the original visibility data of the two reference grids is specifically performed as follows: (2.3.1) Mark the current mesh as C; (2.3.2) Calculate the x-coordinates between the current grid and the two reference grids A and B on the left and right sides respectively. Given the target distance, find the proportion t that interval AC occupies within interval AB; (2.3.3) Extract the original visibility datasets of the two reference grids A and B, and extract their original... The data contains all consecutively numbered grid intervals, which are divided into rows. For each row, all intervals in that row of the "baseline grid" are obtained, and interval matching is performed according to the specified strategy. Then, for the beginning and end of each matched interval, interpolation is performed using t to obtain the interpolated interval, which is then rounded to an integer interval.

4. The method for dynamic object visibility query based on visibility data representation according to claim 3, characterized in that, The specific process of the interval matching strategy in step (2.3.3) is as follows: For reference grids A and B, assume that the x-coordinate of grid A is less than the x-coordinate of grid B, that is, grid A is to the left of B. Traverse each visible interval of grid A and find the last interval in the visible interval of grid B that is to the left of the current visible interval of A. Interval S1 is to the left of interval S2 if and only if the starting grid of interval S1 is to the left of the starting grid of S2, and the ending grid of S1 is to the left of the ending grid of S2.

5. The method for dynamic object visibility query based on visibility data representation according to claim 1, characterized in that, In step (3), during online querying, each query requires determining the visibility between the current grid and another specified grid. Different methods are used for different types of grids, specifically including: (3.1) For the first type of grid, perform binary search on the encoded data according to the specified grid number. The search function checks if there exists an interval of consecutively numbered grids that contains a specified grid number. The result is the visibility. If it exists, the output is "yes"; otherwise, the output is "no". (3.2) For the second type of grid, firstly, according to the grid number, perform a binary search in the encoded data to find whether there is an interval of a certain consecutively numbered grid that contains the grid number. The result is a Boolean value indicating whether it exists. Then, obtain the type of the reference grid of the current grid. According to its type, calculate the visibility of the reference grid and the grid number, i.e., the Boolean value indicating whether it is visible. Finally, XOR the two Boolean values ​​and output the visibility, i.e., the Boolean value indicating whether it is visible. (3.3) For the third type of grid, firstly, based on the grid number, perform a binary search in the encoded data to find whether there is an interval of a certain consecutively numbered grid containing the grid number, and the result is a Boolean value indicating whether it exists; then, obtain the types of the two reference grids of the current grid, obtain their original visibility data, and perform interpolation to obtain an estimate of the visibility data of the current grid, and perform a binary search in this estimated visibility data to find whether the grid number exists in the estimated visibility dataset, and the result is a Boolean value indicating whether it exists; finally, XOR the above two Boolean values ​​and output the visibility, i.e., whether it is visible Boolean value.

6. The method for dynamic object visibility query based on visibility data representation according to claim 1, characterized in that, The online query in step (2) will query the visibility between multiple specified grids and other specified grids in real time during runtime; all locations are dynamic and will change in real time, and there is no special preset distribution pattern for the locations.

7. A dynamic object visibility query system based on visibility data representation, characterized in that, The system includes the following modules: Model building module: Constructs a dynamic object visibility query model, which includes two parts: offline baking and online query; Offline baking module: Divides the 3D scene into a uniform square grid, and applies occlusion culling technology to calculate the visibility of each grid to all other grids offline; For all grid types, the visible set is compressed using corresponding encoding methods for different grid types, and the encoded files are stored on disk. In the offline baking module, the original visibility data is encoded using different representation methods for different grid types, and the encoded data is recorded, specifically as follows: For the first type of grid, after initially calculating its visibility data with other grids, all visible grids are traversed sequentially. During the traversal, multiple consecutively numbered visible grids are recorded as the starting and ending grid numbers. The interval of this consecutively numbered grid is represented by a pair of numbers, and the encoded data is an ordered set containing several pairs of grid numbers. For the second type of grid, after initially calculating its visibility data with other grids, a specific grid around it is designated as its reference grid. The difference between the visibility set of the current grid and the reference grid is compared, and all the differences are recorded as a new grid set. The same method as for the first type of grid is used to traverse the grids in the new set and record the starting and ending grid numbers of consecutively numbered grids. The encoded data is an ordered set containing several grid number pairs. For the third type of grid, after initially calculating its visibility data with other grids, two specific grids on the left and right sides of its different columns are designated as its reference grids. Based on the positional relationship between the current grid and these two reference grids, the interpolation of the original visibility data of these two reference grids is calculated to obtain an estimate of the visibility data of the current grid. The difference between the actual visibility data and the estimated data of the current grid is calculated, and all differences are recorded to obtain a new grid set. The same method as for the first type of grid is used to traverse the grids in the new set, and the starting and ending grid numbers of consecutively numbered grids are recorded. The encoded data is an ordered set containing several grid number pairs. Online query module: Reads all visible set data from disk into memory; when performing a visibility query for a specific grid in the current grid, it reads the visible set of the current grid and selects the appropriate fast decoding algorithm to obtain the visibility with the specified grid based on the type of the current grid.

Citation Information

Patent Citations

  • Shield removal method and device for game scene, processor and terminal

    CN108257103A

  • Method and system for automatically generating qualitative map in earthquake disaster risk assessment based on SVC

    CN111611422A