GB2605360A - Method, Apparatus and Storage Medium for Realizing Geometric Viewing Frustum of OCC Tree in Smart City - Google Patents

Method, Apparatus and Storage Medium for Realizing Geometric Viewing Frustum of OCC Tree in Smart City Download PDF

Info

Publication number
GB2605360A
GB2605360A GB2103526.6A GB202103526A GB2605360A GB 2605360 A GB2605360 A GB 2605360A GB 202103526 A GB202103526 A GB 202103526A GB 2605360 A GB2605360 A GB 2605360A
Authority
GB
United Kingdom
Prior art keywords
occluders
occludees
weight
occ
realizing
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
Application number
GB2103526.6A
Other versions
GB202103526D0 (en
GB2605360A8 (en
Inventor
Sun Shang
Liu Jingjie
Zhu Rui
Yin Kai
Zhong Chen
Shen Xu
Tang Xintong
Yan Jiayi
Bai Lin
Yu Hao
Qian Chenchuan
Peng Linjian
Wu Tong
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhigu Tech Co Ltd
Original Assignee
Beijing Zhigu Tech Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Zhigu Tech Co Ltd filed Critical Beijing Zhigu Tech Co Ltd
Publication of GB202103526D0 publication Critical patent/GB202103526D0/en
Publication of GB2605360A publication Critical patent/GB2605360A/en
Publication of GB2605360A8 publication Critical patent/GB2605360A8/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/05Geographic models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/40Hidden 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, an apparatus, and a computer-readable storage medium for realizing a geometric viewing frustum of an OCC tree applied to a smart city. The method comprises the steps of: Step S1: collecting occluders and occludees, Step S2: sorting the occluders according to weight, Step S3: calculating visibility of the occluders and the occludees and Step S4: traversing the sorted occluders and occludees and using a data structure of 64-bit unsigned long long to store visibility. By mapping the occluders and the occludees to a screen space, a set of screen triangles is generated, and the screen triangles are sorted according to the screen depth, so that the scanning range is enlarged, the detection efficiency is improved, and the detection time is saved.

Description

Method, Apparatus and Storage Medium for Realizing Geometric Viewing Frustum of OCC Tree in Smart City The invention relates to the technical field of 3D rendering, in particular to a method, an apparatus and a computer-readable storage medium for realizing a geometric viewing frustum of an OCC tree applied to a smart city.
Occlusion Culling (OCC) means disabling rendering of an object when it is not seen by the camera because it is occluded by other objects. When occlusion culling is used, hidden surfaces or hidden objects that cannot be seen due to occlusion are culled before the rendered objects are sent to the rendering pipeline, 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 scene with dense occlusion.
However, OCC is not an automated process in 3D graphics computing because in most cases the object furthest from the camera is rendered first, and the object dose to the camera is rendered later and overlays the previously rendered object (this repeated rendering is also referred to as "OverDraw"). It is different from viewing frustum clipping, which only does not render objects outside the camera's viewing angle, but not culling those objects that are occluded by other objects but still within the lens range.
However, viewing frustum clipping is still effective when occlusion culling is used.
Pre-computed raw PVS technology: first, the grid is divided, and then the visibility state of all objects in each grid is calculated off-line, the grid is described by Cell, the grid is generally 10M*10M, OCID is generated for each object in the grid, and visibility is recorded by storing one fiitArray, so that the memory occupation can be as small as Possible.
The existing visibility calculation algorithm is generally conservative and cannot deal with the culling of the dynamic model, and due to the fact that it is baked pixel-by-pixel, the time consumption is long, extra memory needs to be occupied, and debugging tools need to be developed by themselves.
In view of the defects in the prior art, the scanning range is enlarged, by mapping the occluders and the occludees to a screen space, a set of screen triangles is generated, the screen triangles are sorted according to the screen depth, objects needing to be occluded can be quickly calculated, and the calculation efficiency is improved.
The invention provides a method, an apparatus and a computer-readable storage medium for realizing a geometric viewing frustum of an OCC tree applied to a smart city, and the specific solution is as follows: a method for realizing a geometric viewing frustum of an OCC tree applied to a smart city, is characterized by comprising the steps of: step Si: collecting occluders and occludees; step 52: sorting the occluders according to weight; step 53: calculating visibility of the occluders and occludees; and step 54: traversing the sorted occluders and occludees, and using a data structure of 64-bit unsigned long long to store the visibility information.
In one of the embodiments, collecting occluders and occludees in the step Si comprises the steps of: collecting the occluders and occludees, performing distance correlation calculation, and calculating the weight (Weight) of the occluders In one of the embodiments, sorting the occluders according to weight in the step S2 comprises the steps of: sorting the occluders according to the weight (Weight), and screening actual occluders that need to be occluded.
In one of the embodiments, sorting the occluders according to weight (Weight) comprises the steps of: sorting according to a sequence of weight of the occluders from high to low, that is, preferentially drawing occluders with high weight, and occluders with low weight may be occluded by occluders with high weight.
In one of the embodiments, the step 53 comprises the steps of: mapping the occluders and occludees to a screen space respectively, generating a set of screen triangles, wherein the occluders map all triangles of a bounding box, For each occludees, only a triangle formed by the maximum value and the minimum value on a screen is taken, and later occlusion detection may be extended into a rectangle.
In one of the embodiments, the step S4 comprises the steps of: sorting screen triangles generated by the occluders and the occludees according to a screen depth, the ones close to the screen being in front, the ones far from the screen being behind, wherein, the triangular depth of the occluders takes the furthest depth of the three points, and the triangular depth of the occludees takes the closest depth of the three points; and then traversing the sorted triangles.
In one of the embodiments, traversing the sorted triangles comprises the steps of: step S41, for the occluders, row scanning each rectangle, binding 64-bit unsigned long long integer with the height number in each rectangle, performing boundary detection, screening out all triangular pixels in the rectangle, traversing the sorted triangular pixels in the range of the rectangle, if the triangular pixel of the occluders exists, the corresponding position of the unsigned long long integer corresponding to the height of the pixel is 1, and the other bits are set to be 0 by default; step S42, for the occludees, traversing each triangle, expanding the triangles into quadrilaterals, scanning respectively in the rectangles to which the triangles belong, if the corresponding bits of the unsigned long long integer in the rectangles corresponding to the occupied pixels are all 1, the object is occluded, othenvise, the object is visible; and step S43, finally putting detection results into an octree, and performing rendering accordingly.
The invention also discloses: an apparatus for realizing a geometric viewing frustum of an OCC tree applied to a smart city, characterized by comprising: a collecting module, used for collecting occluders and occludees; a sorting module, used for sorting the occluders according to weight; a calculating module, used for calculating visibility of the occluders and the occludees; a storage module, used for traversing the sorted occluders and occludees, and using a data structure of 64-bit unsigned long long to store visibility information.
The invention also discloses: a computer-readable storage medium, characterized in that, the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, realizes the steps of the method for realizing a geometric viewing frustum of an OCC tree applied to a smart city.
The beneficial effects of the invention are as follows: The key to the method in the invention is that the visibility information is stored by using a data structure of 64-bit unsigned long long; efficiency is greatly saved since row scanning is performed during detection; meanwhile one screen triangle per object to be detected, although some depth information is sacrificed, detection time is greatly saved finally.
Meanwhile, the scanning range is enlarged by the above method, and the scanning efficiency of triangular depth value of the occluders is improved by many times compared with the pixel-by-pixel scanning.
FIG. 1 is a schematic diagram of a method for realizing a geometric viewing frustum of an OCC tree applied to a smart city in an embodiment of the invention.
11G. 2 is a schematic diagram of an apparatus for realizing a geometric viewing frustum of an OCC tree applied to a smart city in an embodiment of the invention.
The invention will be further described below with reference to the accompanying drawings and specific embodiments to enable those skilled in the art to better understand and practice the invention. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to be limiting thereof The invention provides a method, a system and a computer-readable storage medium for realizing a geometric viewing frustum of an OCC tree applied to a smart city, and the specific solution is as follows: as shown in FIG. I, the invention provides a method for realizing a geometric viewing frustum of an OCC tree applied to a smart city, characterized by comprising the steps of: step Si: collecting occluders and occludes; collecting the occluders and occludees, performing distance correlation calculation, and calculating the weight (Weight) of the occluders; the formula for calculating the weight is Weight = n Distance (originPos, worldPos), where n represents the weight of the object, ofiginPos is the origin coordinate, and worldPos is the world coordinate where the object is located; step 52: sorting the occluders according to weight; sorting the occluders according to the weight (Weight), and screening actual occluders that need to be occluded, for example, transparency processing can be performed; wherein, the sorting is sorted according to a sequence of weight of the occluders from high to low, that is, preferentially drawing occluders with high weight, and occluders with low weight may be occluded by occluders with high weight.
step 53: calculating visibility of the occluders and the occludes; mapping the oceluders and the oecludees to a screen space respectively, generating a set of screen triangles, wherein the occluders map all triangles of a bounding box, for each occludees, only a triangle formed by the maximum value and the minimum value on a screen is taken, and later occlusion detection may be extended into a rectangle. In this way, although some precision is sacrificed, the efficiency is greatly improved; a key point here to improve efficiency is to divide the screen triangles into a rectangle with a width of 64 when writing screen triangles.
step S4: traversing the sorted occluders and occludees, and using a data structure of 64-hit unsigned long long to store visibility information; sorting screen triangles generated by the occluders and occludees according to a screen depth, the ones close to the screen being in front, the ones far from the screen being behind, wherein, the triangular depth of the occluders takes the furthest depth of the three points, and the triangular depth of the occludees takes the closest depth of the three points, so that the correctness of occlusion culling can be ensured to the greatest extent.
then traversing the sorted triangles, the traversing process comprises the steps of: step 541, for the occluders, row scanning each rectangle, binding 64-bit unsigned long long integer with the height number in each rectangle, performing boundary detection, screening out all triangular pixels in the rectangle, traversing the sorted triangular pixels in the range of the rectangle, if the triangular pixel of the occluders exists, the corresponding position of the unsigned long long integer corresponding to the height of the pixel is 1, and the other bits are set to be 0 by default.
step S42, for the occludees, traversing each triangle, expanding the triangles into quadrilaterals, scanning respectively in the rectangles to which the triangles belong, if the corresponding bits of the unsigned long long integer in the rectangles corresponding to the occupied pixels are all 1, the object is occluded, otherwise, the object is visible.
step S43, finally putting detection results into an octree and performing rendering accordingly.
As shown in FTG. 2, according to an embodiment of the invention, the invention also discloses an apparatus for realizing a geometric viewing frustum of an OCC tree applied to a smart city, comprising: a collecting module, used for collecting occluders and occludees; a sorting module, used for sorting the occluders according to weight; a calculating module, used for calculating visibility of the occluders and the occludees; a storage module, used for traversing the sorted occluders and occludees, and using a data structure of 64-bit unsigned long long to store visibility infoimation.
According to an embodiment of the invention, the invention also discloses a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, realizes the steps of the method for realizing a geometric viewing frustum of an OCC tree applied to a smart city.
According to a method, an apparatus and a computer-readable storage medium for realizing a geometric viewing frustum of an OCC tree applied to a smart city, the scanning range can be enlarged, by mapping the occluders and the occludees to a screen space, a set of screen triangles is generated, the screen triangles are sorted according to the screen
S
depth, objects needing to be occluded can be quickly calculated, and the calculation efficiency is improved.
The functional uni-in the various embodiments of the invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. the above integrated units can be realized in the form of hardware or software functional units.
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 this understanding, the technical solution of the invention may be embodied in nature or in part as contributing to the prior art or in whole or in part of the technical solution in the form of a software product, and the computer software product is stored in a storage medium including instructions for making a computer device (which may be a personal computer, a server, or a network device, etc.) perform all or part of the steps of the methods of the various embodiments of the invention. The aforementioned storage medium includes: various media on which program code may be stored, such as a U-disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a ReRAM, an MRAM, a ECM, a NAND Hash, a NOR Flash, a Memristor, a magnetic disk, or an optical disk.
The above embodiments are only preferred embodiments for hilly illustrating the invention, and the scope of the invention is not limited thereto. Equivalent substitutions and alterations will occur to those skilled in the art without departing from the scope of the invention. It is intended that the scope of the invention be defined by the claims appended hereto.

Claims (9)

  1. Claims 1. A method for realizing a geometric viewing frustum of an OCC tree applied to a smart city, characterized by comprising the steps of: step Si: collecting occluders and occludees; step S2: sorting the occluders according to weight; step S3: calculating visibility of the occluders and the occludees; and step 54: traversing the sorted occluders and occludees, and using a data structure of 64-bit unsigned long long to store visibility information.
  2. 2. The method for realizing a geometric viewing frustum of an OCC tree applied to a smart city according to claim 1, characterized in that, collecting occluders and occludees in the step SI comprises the steps of: collecting the occluders and occludees, performing distance correlation calculation, and calculating weight (Weight) of the occluders
  3. 3. The method for realizing a geometric viewing frustum of an OCC tree applied to a smart city according to claim 1, characterized in that, sorting the occluders according to weight in the step 52 comprises the steps of: sorting the occluders according to the weight (Weight), and screening actual occluders that need to be occluded.
  4. 4. The method for realizing a geometric viewing frustum of an OCC tree applied to a smart city according to claim 3, characterized in that, sorting the occluders according to weight (Weight) comprises the steps of: sorting according to a sequence of weight of the occluders from high to low, that is, preferentially drawing occluders with high weight, and occluders with low weight may be occluded by occluders with high weight.
  5. 5. The method for realizing a geometric viewing frustum of an OCC tree applied to a smart city according to claim 1, characterized in that, the step 53 comprises the steps of: mapping the occluders and occludees to a screen space respectively, generating a set of screen triangles, wherein the occluders map all triangles of a bounding box, for each occludees, only a triangle formed by the maximum value and the minimum value on a screen is taken, and later occlusion detection may be extended into a rectangle.
  6. 6. The method for realizing a geometric viewing frustum of an OCC tree applied to a smart city according to claim 1, characterized in that, the step S4 comprises the steps of: sorting screen triangles generated by the occluders and occludces according to a screen depth, the ones close to screen being in front, the ones far from screen being behind, wherein, a triangular depth of the occluders takes the furthest depth of three points, and a triangular depth of the occludees takes the closest depth of three points; and then traversing the sorted triangles.
  7. 7. The method for realizing a geometric viewing frustum of an OCC tree applied to a smart city according to claim 6, characterized in that, traversing the sorted triangles comprises the steps of: step S41, for the occluders, row scanning each rectangle, binding 64-hit unsigned long long integer with the height number in each rectangle, performing boundary detection, screening out all triangular pixels in the rectangle, traversing the sorted triangular pixels in the range of the rectangle, if the triangular pixel of the occluders exists, the corresponding position of the unsigned long long integer corresponding to the height of the pixel is 1, and the other bits are set to be 0 by default; step S42, for the occludees, traversing each triangle, expanding the triangles into quadrilaterals, scanning respectively in the rectangles to which the triangles belong, if the corresponding bits of the unsigned long long integer in the rectangles corresponding to the occupied pixels are all 1, the object is occluded, othenvise, the object is visible; and step S43, finally putting detection results into an octree, and performing rendering accordingly.
  8. 8. An apparatus for realizing a geometric viewing frustum of an OCC tree applied to a smart city, characterized by comprising: a collecting module, used for collecting occluders and occludecs; a sorting module, used for sorting the occluders according to weight; a calculating module, used for calculating visibility of the occluders and the occludecs; and a storage module, used for traversing the sorted occluders and occludees, and using a data structure of 64-bit unsigned long long to store visibility information.
  9. 9. A computer-readable storage medium, characterized in that, the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, realizes the steps of the method for realizing a geometric viewing frustum of an OCC tree applied to a smart city according to any one of claims 1 to 7.
GB2103526.6A 2021-01-12 2021-03-15 Method, Apparatus and Storage Medium for Realizing Geometric Viewing Frustum of OCC Tree in Smart City Pending GB2605360A (en)

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 (3)

Publication Number Publication Date
GB202103526D0 GB202103526D0 (en) 2021-04-28
GB2605360A true GB2605360A (en) 2022-10-05
GB2605360A8 GB2605360A8 (en) 2022-10-26

Family

ID=75439115

Family Applications (1)

Application Number Title Priority Date Filing Date
GB2103526.6A Pending GB2605360A (en) 2021-01-12 2021-03-15 Method, Apparatus and Storage Medium for Realizing Geometric Viewing Frustum of OCC Tree in Smart City

Country Status (2)

Country Link
CN (1) CN112686992A (en)
GB (1) GB2605360A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
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 (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030117398A1 (en) * 2001-12-21 2003-06-26 Hubrecht Alain Yves Nestor Systems and methods for rendering frames of complex virtual environments
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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104331918B (en) * 2014-10-21 2017-09-29 无锡梵天信息技术股份有限公司 Based on earth's surface occlusion culling and accelerated method outside depth map real-time rendering room
CN110136082B (en) * 2019-05-10 2021-06-01 腾讯科技(深圳)有限公司 Occlusion rejection method and device and computer equipment
CN111784612A (en) * 2020-07-08 2020-10-16 网易(杭州)网络有限公司 Method and device for eliminating scene object model in game

Patent Citations (2)

* Cited by examiner, † Cited by third party
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

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YAN WILL: "???????", 31 October 2018 (2018-10-31), pages 1 - 3, XP055846249, Retrieved from the Internet <URL:https://zhuanlan.zhihu.com/p/48163037> [retrieved on 20210930] *
YAN WILL: "Talking about soft occlusion culling", 31 October 2018 (2018-10-31), pages 1 - 5, XP055846256, Retrieved from the Internet <URL:https://zhuanlan-zhihu-com.translate.goog/p/48163037?_x_tr_sl=zh-CN&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=nui,sc> [retrieved on 20210930] *

Also Published As

Publication number Publication date
GB202103526D0 (en) 2021-04-28
GB2605360A8 (en) 2022-10-26
CN112686992A (en) 2021-04-20

Similar Documents

Publication Publication Date Title
US8743114B2 (en) Methods and systems to determine conservative view cell occlusion
US8970580B2 (en) Method, apparatus and computer-readable medium rendering three-dimensional (3D) graphics
US8970583B1 (en) Image space stylization of level of detail artifacts in a real-time rendering engine
US10748332B2 (en) Hybrid frustum traced shadows systems and methods
US9508191B2 (en) Optimal point density using camera proximity for point-based global illumination
CN104331918A (en) Occlusion culling and acceleration method for drawing outdoor ground surface in real time based on depth map
JP2004537129A (en) 3D graphic system
TWI480834B (en) Method and apparatus for stochastic rasterization, and non-transitory computer readable medium
EP2347385A1 (en) Method and system for image resizing based on interpolation enhanced seam operations
US6359629B1 (en) Backface primitives culling
US6515658B1 (en) 3D shape generation apparatus
CN113012274B (en) Shadow rendering method and device and electronic equipment
US11769291B2 (en) Method and device for rendering point cloud-based data
US7825928B2 (en) Image processing device and image processing method for rendering three-dimensional objects
CN111494944A (en) Terrain texture loading method and related device
GB2605360A (en) Method, Apparatus and Storage Medium for Realizing Geometric Viewing Frustum of OCC Tree in Smart City
KR101508388B1 (en) Apparatus and method for generating mipmap
US9858709B2 (en) Apparatus and method for processing primitive in three-dimensional (3D) graphics rendering system
CN116630523A (en) Improved real-time shadow rendering method based on shadow mapping algorithm
WO2016178825A1 (en) Rendering via ray-depth field intersection
CN114626978A (en) Image processing method and device, computer equipment and storage medium
CN114596195A (en) Topographic data processing method, system, device and computer storage medium
CN110874858B (en) System and method for rendering reflections
CN114627221B (en) Scene rendering method and device, operator and readable storage medium
CN111932566A (en) Method, device and system for generating model contour map