CN112686992A - Geometric figure view frustum realization method and device for OCC tree in smart city and storage medium - Google Patents
Geometric figure view frustum realization method and device for OCC tree in smart city and storage medium Download PDFInfo
- Publication number
- CN112686992A CN112686992A CN202110037005.1A CN202110037005A CN112686992A CN 112686992 A CN112686992 A CN 112686992A CN 202110037005 A CN202110037005 A CN 202110037005A CN 112686992 A CN112686992 A CN 112686992A
- Authority
- CN
- China
- Prior art keywords
- occlusion
- screen
- occ
- tree
- shielded
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/05—Geographic models
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/10—Geometric effects
- G06T15/40—Hidden part removal
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Geometry (AREA)
- Computer Graphics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Remote Sensing (AREA)
- Image Processing (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention discloses a method and a device for realizing a geometrical view cone of an OCC tree applied to a smart city and a computer readable storage medium, wherein the method comprises the following steps: collecting a shielding body and a shielded body; sorting the occlusion bodies according to weight; calculating the visibility of the occlusion body and the occluded body; and traversing the ordered occlusion body and the occluded occlusion body, and storing the visibility information by using a 64-bit unsigned long data structure. According to the invention, the shielding body and the shielded body are mapped to the screen space to generate a set of screen triangles, and the screen triangles are sequenced according to the screen depth, so that the scanning range is enlarged, the detection efficiency is improved, and the detection time is saved.
Description
Technical Field
The invention relates to the technical field of 3D rendering, in particular to a method and a device for realizing a geometrical view frustum of an OCC tree applied to a smart city and a computer-readable storage medium.
Background
Occlusion Culling (OCC) refers to not rendering an object when it is occluded by other objects and not within the visual range of the camera. When the shielding elimination is used, before the rendering object is sent to the rendering pipeline, the hidden surface or the hidden object which cannot be seen due to the shielding is eliminated, so that the rendering data volume of each frame is reduced, the rendering performance is improved, and the performance improvement is more obvious in the shielding dense scene.
However, OCC is not an automatic process in 3D graphics computation, since in most cases the object furthest away from the camera is rendered first, the object closer to the camera is rendered and overlays the previously rendered object (this repeated rendering is also called "overlaw"). It is different from the view frustum clipping, which only does not render objects outside the range of the camera view angle, but does not reject objects that are occluded by other objects but still within the lens range. However, when occlusion culling is used, viewing frustum clipping still works.
Pre-calculated raw PVS technique: firstly, dividing grids, and then calculating the visibility states of all objects in each grid off line, wherein the grids are described by cells, the grids are generally 10M by 10M, OCIDs are generated for each object in the grids, and the visibility is recorded by storing one BitAlray, so that the memory can be occupied as small as possible.
The existing visibility calculation algorithm is generally conservative and cannot process the elimination of a dynamic model, and the existing visibility calculation algorithm consumes long time due to pixel-by-pixel baking, needs additional occupied memory and needs self development of a debugging tool.
Disclosure of Invention
Aiming at the defects in the prior art, the scanning range is expanded, a screen triangle set is generated by mapping the shielding body and the shielded body to the screen space, and the screen triangles are sequenced according to the screen depth, so that the objects to be removed can be rapidly calculated, and the calculation efficiency is improved.
The invention provides a method and a device for realizing a geometrical view cone of an OCC tree applied to a smart city and a computer readable storage medium, wherein the specific scheme is as follows:
a geometric view cone implementation method of an OCC tree applied to a smart city is characterized by comprising the following steps:
step S1: collecting a shielding body and a shielded body;
step S2: sorting the occlusion bodies according to weight;
step S3: calculating the visibility of the occlusion body and the occluded body;
step S4: and traversing the ordered occlusion body and the occluded occlusion body, and storing the visibility information by using a 64-bit signaled long data structure.
The method further comprises: the collecting of the shielding body and the shielded body in the step S1 includes: and collecting the occlusion body and the occluded body, performing distance correlation calculation, and calculating the Weight of the occlusion body.
The method further comprises: the sorting the occlusion bodies according to the weights in step S2 includes: and sequencing the occlusion bodies according to the Weight, and screening the true occlusion bodies needing occlusion.
The method further comprises: the ordering of the occlusion volumes by Weight includes: and sorting the occlusion bodies according to the order of the weights of the occlusion bodies from high to low, namely preferentially drawing the occlusion body with the high weight, wherein the occlusion body with the low weight can be occluded by the occlusion body with the high weight.
The method further comprises: the step S3 includes: and respectively mapping the shielding body and the shielded body to a screen space to generate a set of screen triangles, wherein the shielding body maps the triangles of the bounding box, and for each shielded body, only the triangle formed by the maximum value and the minimum value on the screen is taken, and the shielding detection in the later period can be extended to be a rectangle.
The method further comprises: the step S4 includes: sorting screen triangles generated by the shielding body and the shielded body according to the screen depth, wherein the screen triangles are near the front of the screen and far from the back of the screen, the triangular depth of the shielding body is the farthest depth of three points, and the triangular depth of the shielded body is the nearest depth of the three points; the sorted triangles are then traversed.
The method further comprises: the traversing the sorted triangles comprises the following steps:
step S41, for the occlusion body, scanning each rectangle in a row, binding 64-bit unscented long integer with the number being the height number in each rectangle, carrying out boundary detection, screening out all triangle pixels in the rectangle, traversing the ordered triangle pixels in the range of the rectangle, if the triangle pixels of the occlusion body exist, setting the corresponding position of the pixel corresponding to the height unscented long integer to be 1, and setting the default positions of other positions to be 0;
step S42, traversing each triangle for the shielded object, then expanding the triangle into a quadrangle, respectively scanning in the rectangle, if the corresponding bit of the unused long integer in the rectangle corresponding to the occupied pixel is 1, then the object is shielded, otherwise, the object is visible;
and step S43, finally, placing the detection result into an octree, and rendering according to the detection result.
The invention also discloses: the utility model provides a be applied to geometric figure view cone realization device of OCC tree in wisdom city which characterized in that includes:
the collection module is used for collecting the shielding body and the shielded body;
the sorting module is used for sorting the occlusion bodies according to the weight;
a calculation module for calculating the visibility of the occlusion body and the occluded body;
and the storage module is used for traversing the ordered occlusion body and the occluded occlusion body and storing the visibility information by utilizing a 64-bit signaled long data structure.
The invention also discloses: a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the geometrical pyramid implementation method applied to OCC trees of a smart city.
The invention has the beneficial effects that:
the key of the method is that a 64-bit signaled long data structure is used for storing visibility information, line scanning is carried out during detection, efficiency is greatly saved, and meanwhile, one screen triangle is arranged on each object to be detected, so that detection time is greatly saved at last although some depth information is sacrificed. Meanwhile, the method enlarges the scanning range, and improves the triangular depth value of the scanning occlusion body by many times compared with the pixel-by-pixel scanning efficiency.
Drawings
FIG. 1 is a schematic diagram of a geometrical view cone implementation method of an OCC tree applied to a smart city in an embodiment of the present invention.
FIG. 2 is a schematic diagram of a geometrical view cone implementation apparatus of OCC tree applied to a smart city according to an embodiment of the present invention.
Detailed Description
The present invention is further described below in conjunction with the following figures and specific examples so that those skilled in the art may better understand the present invention and practice it. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a method and a system for realizing a geometrical view cone of an OCC tree applied to a smart city and a computer readable storage medium, wherein the specific scheme is as follows:
as shown in fig. 1, the present invention provides a method for implementing geometric cones of an OCC tree applied to a smart city, which is characterized in that the method includes the following steps:
step S1: the collection shelter and the sheltered body.
And collecting the occlusion body and the occluded body, performing distance correlation calculation, and calculating the Weight of the occlusion body.
The formula for calculating the Weight is Weight n Distance (originPos, world pos), where n represents the Weight of the object, originPos is the origin coordinate, and world pos is the world coordinate where the object is located.
Step S2: the occlusion bodies are sorted by weight.
Sorting the occlusion bodies according to the Weight, and screening real occlusion bodies needing occlusion, for example, performing transparency processing; the sorting is performed according to the order of the weights of the occlusion bodies from high to low, that is, the occlusion body with high weight is drawn preferentially, and the occlusion body with low weight is occluded by the occlusion body with high weight.
Step S3: calculating the visibility of the occlusion body and the occluded body.
And respectively mapping the shielding body and the shielded body to a screen space to generate a set of screen triangles, wherein the shielding body maps the triangles of the bounding box, and for each shielded body, only the triangle formed by the maximum value and the minimum value on the screen is taken, and the shielding detection in the later period can be extended to be a rectangle. Thus, although some precision is sacrificed, the improvement of the exchange efficiency is very large; one of the key points for improving the efficiency is that when a screen triangle is written, the screen triangle is divided into rectangles with the width of 64.
Step S4: and traversing the ordered occlusion body and the occluded occlusion body, and storing the visibility information by using a 64-bit signaled long data structure.
And sorting the screen triangles generated by the shielding body and the shielded body according to the screen depth, wherein the screen triangles are near the screen and far from the screen, the triangle depth of the shielding body is the farthest depth of three points, and the triangle depth of the shielded body is the nearest depth of the three points, so that the accuracy of shielding and rejecting can be ensured to the maximum extent. And traversing the sorted triangles, wherein the traversing process comprises the following steps:
step S41, for the occlusion body, line-scan each rectangle, bind 64-bit unscented long integer with height number in each rectangle, perform boundary detection, screen out all triangle pixels in the rectangle, traverse the sorted triangle pixels in the range of the rectangle, if there is a triangle pixel of the occlusion body, the corresponding position of the pixel corresponding to the height unscented long integer is 1, and the default of other positions is 0.
Step S42, for the occluded object, go through each triangle, then expand the triangle into a quadrangle, scan in the rectangle to which it belongs, if the corresponding bits of the unsigned long integer in the rectangle corresponding to the occupied pixels are all 1, the object is occluded, otherwise, the object is visible.
And step S43, finally, placing the detection result into an octree, and rendering according to the detection result.
As shown in fig. 2, according to an embodiment of the present invention, the present invention further discloses an apparatus for implementing geometric frustum of OCC tree applied to a smart city, the apparatus including:
the collection module is used for collecting the shielding body and the shielded body;
the sorting module is used for sorting the occlusion bodies according to the weight;
a calculation module for calculating the visibility of the occlusion body and the occluded body;
and the storage module is used for traversing the ordered occlusion body and the occluded occlusion body and storing the visibility information by utilizing a 64-bit signaled long data structure.
According to an embodiment of the present invention, the present invention further discloses a computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the geometrical view frustum implementation method for an OCC tree applied to a smart city.
The method, the device and the computer-readable storage medium for realizing the geometrical view cones of the OCC tree applied to the smart city can enlarge the scanning range, generate a screen triangle set by mapping the shielding body and the shielded body to a screen space, and rapidly calculate the objects to be eliminated by sequencing the screen triangles according to the screen depth, thereby improving the calculation efficiency.
Each functional unit in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a ReRAM, an MRAM, a PCM, a NAND Flash, a NOR Flash, a Memory, a magnetic disk, an optical disk, or other various media that can store program codes.
The above embodiments are merely preferred embodiments for fully illustrating the present invention, and the scope of the present invention is not limited thereto. The equivalent substitution or change made by the technical personnel in the technical field on the basis of the invention is all within the protection scope of the invention. The protection scope of the invention is subject to the claims.
Claims (9)
1. A geometric view cone implementation method of an OCC tree applied to a smart city is characterized by comprising the following steps:
step S1: collecting a shielding body and a shielded body;
step S2: sorting the occlusion bodies according to weight;
step S3: calculating the visibility of the occlusion body and the occluded body;
step S4: and traversing the ordered occlusion body and the occluded occlusion body, and storing the visibility information by using a 64-bit signaled long data structure.
2. The method for realizing geometric view frustum of OCC tree in smart city as claimed in claim 1, wherein said step S1 of collecting the occlusion bodies and the occluded bodies comprises: and collecting the occlusion body and the occluded body, performing distance correlation calculation, and calculating the Weight of the occlusion body.
3. The method for implementing geometric view cones of OCC tree for smart cities as claimed in claim 1, wherein said step S2 of sorting said occlusion bodies according to weight comprises: and sequencing the occlusion bodies according to the Weight, and screening the true occlusion bodies needing occlusion.
4. The method for implementing a geometrical view frustum of an OCC tree for a smart city according to claim 3, wherein said sorting the occlusion bodies according to Weight comprises: and sorting the occlusion bodies according to the order of the weights of the occlusion bodies from high to low, namely preferentially drawing the occlusion body with the high weight, wherein the occlusion body with the low weight can be occluded by the occlusion body with the high weight.
5. The method for implementing a geometrical view frustum of an OCC tree for a smart city as claimed in claim 1, wherein said step S3 comprises: and respectively mapping the shielding body and the shielded body to a screen space to generate a set of screen triangles, wherein the shielding body maps the triangles of the bounding box, and for each shielded body, only the triangle formed by the maximum value and the minimum value on the screen is taken, and the shielding detection in the later period can be extended to be a rectangle.
6. The method for implementing a geometrical view frustum of an OCC tree for a smart city as claimed in claim 1, wherein said step S4 comprises: sorting screen triangles generated by the shielding body and the shielded body according to the screen depth, wherein the screen triangles are near the front of the screen and far from the back of the screen, the triangular depth of the shielding body is the farthest depth of three points, and the triangular depth of the shielded body is the nearest depth of the three points; the sorted triangles are then traversed.
7. The method of claim 6, wherein the step of traversing the sorted triangles comprises the steps of:
step S41, for the occlusion body, scanning each rectangle in a row, binding 64-bit unscented long integer with the number being the height number in each rectangle, carrying out boundary detection, screening out all triangle pixels in the rectangle, traversing the ordered triangle pixels in the range of the rectangle, if the triangle pixels of the occlusion body exist, setting the corresponding position of the pixel corresponding to the height unscented long integer to be 1, and setting the default positions of other positions to be 0;
step S42, traversing each triangle for the shielded object, then expanding the triangle into a quadrangle, respectively scanning in the rectangle, if the corresponding bit of the unused long integer in the rectangle corresponding to the occupied pixel is 1, then the object is shielded, otherwise, the object is visible;
and step S43, finally, placing the detection result into an octree, and rendering according to the detection result.
8. The utility model provides a be applied to geometric figure view cone realization device of OCC tree in wisdom city which characterized in that includes:
the collection module is used for collecting the shielding body and the shielded body;
the sorting module is used for sorting the occlusion bodies according to the weight;
a calculation module for calculating the visibility of the occlusion body and the occluded body;
and the storage module is used for traversing the ordered occlusion body and the occluded occlusion body and storing the visibility information by utilizing a 64-bit signaled long data structure.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the geometrical frustum implementation method of an OCC tree for a smart city according to any one of claims 1 to 7.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110037005.1A CN112686992A (en) | 2021-01-12 | 2021-01-12 | Geometric figure view frustum realization method and device for OCC tree in smart city and storage medium |
GB2103526.6A GB2605360A (en) | 2021-01-12 | 2021-03-15 | Method, Apparatus and Storage Medium for Realizing Geometric Viewing Frustum of OCC Tree in Smart City |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110037005.1A CN112686992A (en) | 2021-01-12 | 2021-01-12 | Geometric figure view frustum realization method and device for OCC tree in smart city and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112686992A true CN112686992A (en) | 2021-04-20 |
Family
ID=75439115
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110037005.1A Pending CN112686992A (en) | 2021-01-12 | 2021-01-12 | Geometric figure view frustum realization method and device for OCC tree in smart city and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112686992A (en) |
GB (1) | GB2605360A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113797531A (en) * | 2021-08-30 | 2021-12-17 | 网易(杭州)网络有限公司 | Method and device for realizing occlusion rejection, computer equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104331918A (en) * | 2014-10-21 | 2015-02-04 | 无锡梵天信息技术股份有限公司 | Occlusion culling and acceleration method for drawing outdoor ground surface in real time based on depth map |
CN110136082A (en) * | 2019-05-10 | 2019-08-16 | 腾讯科技(深圳)有限公司 | Occlusion culling method, apparatus and computer equipment |
CN111784612A (en) * | 2020-07-08 | 2020-10-16 | 网易(杭州)网络有限公司 | Method and device for eliminating scene object model in game |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6603474B1 (en) * | 1999-05-27 | 2003-08-05 | International Business Machines Corporation | Method and apparatus for occlusion culling of objects in a data processing system |
US20030117398A1 (en) * | 2001-12-21 | 2003-06-26 | Hubrecht Alain Yves Nestor | Systems and methods for rendering frames of complex virtual environments |
-
2021
- 2021-01-12 CN CN202110037005.1A patent/CN112686992A/en active Pending
- 2021-03-15 GB GB2103526.6A patent/GB2605360A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104331918A (en) * | 2014-10-21 | 2015-02-04 | 无锡梵天信息技术股份有限公司 | Occlusion culling and acceleration method for drawing outdoor ground surface in real time based on depth map |
CN110136082A (en) * | 2019-05-10 | 2019-08-16 | 腾讯科技(深圳)有限公司 | Occlusion culling method, apparatus and computer equipment |
CN111784612A (en) * | 2020-07-08 | 2020-10-16 | 网易(杭州)网络有限公司 | Method and device for eliminating scene object model in game |
Non-Patent Citations (1)
Title |
---|
WILL YAN: "浅谈软遮挡剔除", 《HTTPS://ZHUANLAN.ZHIHU.COM/P/48163037》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113797531A (en) * | 2021-08-30 | 2021-12-17 | 网易(杭州)网络有限公司 | Method and device for realizing occlusion rejection, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
GB2605360A8 (en) | 2022-10-26 |
GB2605360A (en) | 2022-10-05 |
GB202103526D0 (en) | 2021-04-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110738721B (en) | Three-dimensional scene rendering acceleration method and system based on video geometric analysis | |
US8760450B2 (en) | Real-time mesh simplification using the graphics processing unit | |
CN111921202B (en) | Data processing method, device and equipment for virtual scene and readable storage medium | |
US8743114B2 (en) | Methods and systems to determine conservative view cell occlusion | |
US7561156B2 (en) | Adaptive quadtree-based scalable surface rendering | |
CN104331918A (en) | Occlusion culling and acceleration method for drawing outdoor ground surface in real time based on depth map | |
TW201312499A (en) | Depth of field rasterization | |
Livnat et al. | Interactive point-based isosurface extraction | |
CN114529658A (en) | Graph rendering method and related equipment thereof | |
CN110807787B (en) | Skyline extraction method and system | |
TWI417808B (en) | Reconstructable geometry shadow mapping method | |
CN112686992A (en) | Geometric figure view frustum realization method and device for OCC tree in smart city and storage medium | |
CN100578542C (en) | Graphic processing system and method for storing texture data in graphic processing system | |
CN116468838B (en) | Regional resource rendering method, system, computer and readable storage medium | |
KR20100068603A (en) | Apparatus and method for generating mipmap | |
CN115063485B (en) | Three-dimensional reconstruction method, device and computer-readable storage medium | |
KR20160068204A (en) | Data processing method for mesh geometry and computer readable storage medium of recording the same | |
CN111028349A (en) | Hierarchical construction method suitable for rapid visualization of massive three-dimensional live-action data | |
CN110782516A (en) | Texture merging method and related device for three-dimensional model data | |
CN106780693B (en) | Method and system for selecting object in three-dimensional scene through drawing mode | |
CN114926590A (en) | Mass point cloud data visualization method | |
CN112802175B (en) | Large-scale scene shielding and eliminating method, device, equipment and storage medium | |
CN110738719A (en) | Web3D model rendering method based on visual range hierarchical optimization | |
CN117557740B (en) | Three-dimensional model segmentation level switching method and device, electronic equipment and storage medium | |
JP2019046080A (en) | Information processing apparatus, method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210420 |
|
RJ01 | Rejection of invention patent application after publication |