CN109215106B - Method for real-time ray tracing acceleration structure based on dynamic scene - Google Patents

Method for real-time ray tracing acceleration structure based on dynamic scene Download PDF

Info

Publication number
CN109215106B
CN109215106B CN201811002620.3A CN201811002620A CN109215106B CN 109215106 B CN109215106 B CN 109215106B CN 201811002620 A CN201811002620 A CN 201811002620A CN 109215106 B CN109215106 B CN 109215106B
Authority
CN
China
Prior art keywords
scene
ray
bvh
objects
tree
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.)
Active
Application number
CN201811002620.3A
Other languages
Chinese (zh)
Other versions
CN109215106A (en
Inventor
高天寒
李颖
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.)
Northeastern University China
Original Assignee
Northeastern University China
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 Northeastern University China filed Critical Northeastern University China
Priority to CN201811002620.3A priority Critical patent/CN109215106B/en
Publication of CN109215106A publication Critical patent/CN109215106A/en
Application granted granted Critical
Publication of CN109215106B publication Critical patent/CN109215106B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/06Ray-tracing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The invention provides a method for tracking an acceleration structure by real time rays based on a dynamic scene, and relates to the technical field of computer graphics. According to the method, complexity classification is firstly carried out on objects in a scene in the image rendering process, different bounding boxes are respectively established for the objects with different complexity by utilizing an AABB bounding box and an inner bounding box, a BVH tree is established by utilizing a method of combining two establishing modes of top-down and bottom-up, and an image is rendered. The method provided by the invention can reduce the intersection times of rays, improve the efficiency of a ray tracing algorithm, accelerate the rendering speed of the scene, is very suitable for the aspects of real-time rendering of dynamic scenes and the like, and can be applied to the research fields of image rendering optimization and the like.

Description

Method for real-time ray tracing acceleration structure based on dynamic scene
Technical Field
The invention relates to the technical field of computer graphics, in particular to a method for real-time ray tracing acceleration structure based on a dynamic scene.
Background
Rendering is a process of generating an image from information such as a scene model by software, and is a very important technology. The ray tracing technology is an image synthesis technology and an important algorithm in the field of photorealistic graphics, realizes the drawing of an image by simulating the intersection point of a ray and the surface of an object, and is a method for presenting a three-dimensional (3D) image on a two-dimensional (2D) screen. Ray tracing is a process of simulating the actual propagation of light in a scene according to the principle of optical energy propagation: and emitting light from the camera, simulating the propagation conditions of refraction, reflection and the like of the light in a scene, continuously calculating the obtained energy, and continuously iterating until a convergence condition is reached. The image calculated by the method has absolute reality and can synthesize high-quality complex 3D scenes. However, since the ray tracing technique needs to take global factors into consideration during use, each ray emitted by the light source must be intersected with each polygon contained in the scene, which consumes a lot of computing resources. The traditional ray tracing technology is simply used for scene rendering, the effect is not ideal, the efficiency is low, and the real-time scene rendering cannot be realized. However, the real-time online game and the film and television industry are developed rapidly today, and the rendering based on the static scene only can not meet the requirements of people. However, the existing rendering data structure based on the static scene is difficult to satisfy the real-time rendering of the scene. Therefore, it is an important research direction to realize real-time ray tracing rendering of dynamic scenes.
The bounding box acceleration technology is one of the earliest acceleration technologies in a ray tracing algorithm, and is to utilize bounding boxes with simple geometric characteristics to surround objects in a rendered scene, and use the idea that the intersection speed of the bounding boxes and rays is high to judge whether the rays are intersected with the objects in the scene in advance, so that objects which are not intersected with the rays are removed at low cost, and the purpose of improving the efficiency of the algorithm is achieved, and the bounding box acceleration technology is one of the key steps of the acceleration ray tracing algorithm. In the method for dividing the space of the scene, KD-tree (short for k-dimensional tree) and BVH-tree (short for Bounding Volume hierarchy) are most commonly used, but for the dynamic scene, the performance of the BVH-tree is superior to that of the KD-tree, but the traditional BVH algorithm needs large time overhead, which hinders the quick reconstruction of the BVH-tree when the scene changes dynamically, and the traditional BVH-tree algorithm needs to be improved.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method for accelerating a structure by real-time ray tracing based on a dynamic scene, aiming at the defects of the prior art, which can reduce the number of times of ray intersection, improve the efficiency of a ray tracing algorithm, accelerate the rendering speed of the scene, is very suitable for the aspects of real-time rendering of the dynamic scene and the like, and can be applied to the research fields of image rendering optimization and the like.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
a real-time ray tracing acceleration structure method based on a dynamic scene comprises the following steps:
step 1: reading 3D models in a scene, storing read data in a GPU video memory, and storing the number information of surface patches and vertexes of the 3D models;
step 2: and (2) carrying out complexity classification on the 3D model in the scene by using the number information of the surface patches and the vertexes of the scene 3D model objects stored in the step (1), wherein the specific method comprises the following steps:
firstly, setting system threshold values of scenes aiming at different scenes, then carrying out complexity classification on all 3D objects in the scenes, and classifying the objects into complex object classes if the vertex values of the patches of the 3D objects are greater than the threshold values; if the number of the top points of the surface patches of the 3D object is less than or equal to the threshold value, classifying the object into a simple object class;
and step 3: according to the classification result in the step 2, the complex object establishes respective bounding boxes for all 3D objects in the scene respectively by using a construction method of an inner bounding box and the simple object establishes respective bounding boxes for all 3D objects in the scene by using a construction method of an axis alignment bounding box;
and 4, step 4: respectively solving the spans of an X axis, a Y axis and a Z axis of the model according to the model distribution in the scene, and dividing the space by using a coordinate axis SAH mechanism;
and 5: the BVH-tree is constructed by a method combining a top-down mode and a bottom-up mode, firstly, a leaf node is created for a single object by the top-down method, and iteration is carried out layer by layer until a complete BVH tree structure is created;
step 6: outputting a BVHlist array after the construction of the BVH-tree is finished;
and 7: starting from a viewpoint, judging whether the light rays emitted from the viewpoint are intersected with objects in a scene or not, and carrying out intersection test on the current light rays and bounding boxes in nodes of the BVH tree, wherein each light ray is a ray and is expressed as: r = E + T x D, where E is the viewpoint (0,), D is the ray's line of defense, and T is the parameter when the ray intersects a certain spatial structure;
if the current ray is not intersected with the BVH node, indicating that the current ray is not intersected with the scene, and ending the ray tracing of the current ray; if the current ray intersects with the BVH node, judging whether a primitive exists in the BVH node, if so, indicating that the current ray intersects with an object in the scene, and continuing to track the ray; if no primitive exists in the BVH node, the current ray is not intersected with an object in the scene, and the ray tracing of the current ray is finished; recursively judging each ray starting from the viewpoint until the judgment is completed, and outputting a rendered picture;
and step 8: when a scene changes dynamically, the original bounding box logic structure of a single object at the bottom layer does not change, the bottom layer data structure is updated rapidly by using a top-down tree construction method, then the bounding box of each object in the scene is used as a node, the BVH-tree is updated rapidly by adopting a bottom-up mode, and a new BVHlist array is generated;
and step 9: and after updating the BVH-tree structure, repeating the intersection test in the step 7 until the rendering is successful.
Adopt the produced beneficial effect of above-mentioned technical scheme to lie in: according to the method for the real-time ray tracing acceleration structure based on the dynamic scene, complexity classification is firstly carried out on objects in the scene in the image rendering process, and different bounding boxes are respectively established for the objects with different complexities by utilizing the AABB bounding box and the inner bounding box, so that the purposes of reducing the ray intersection frequency and improving the efficiency of a ray tracing algorithm are achieved; meanwhile, the method of combining the top-down construction mode and the bottom-up construction mode of the BVH tree is utilized, so that the construction and updating modes of the BVH tree in the dynamic scene are simplified. In the process of rendering the dynamic scene, the algorithm efficiency can be improved, the rendering speed of the scene is increased, the method is very suitable for the aspects of real-time rendering of the dynamic scene and the like, and the method can be applied to the research fields of image rendering optimization and the like.
Drawings
FIG. 1 is a flowchart of a method for real-time ray tracing acceleration structure based on dynamic scenes according to an embodiment of the present invention;
FIG. 2 is a flow chart of a bounding box construction method provided by an embodiment of the present invention;
fig. 3 is a flowchart of a BVH tree construction method according to an embodiment of the present invention.
Detailed Description
The following detailed description of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
As shown in fig. 1, the method of the present embodiment is as follows.
Step 1: reading the 3D models in the scene, storing the data in a GPU video memory, and storing the number information of the patches and the vertexes of the 3D models.
And 2, step: and (3) carrying out complexity classification on the 3D model in the scene by using the patch and vertex quantity information of the scene 3D model object stored in the step (1). As shown in fig. 2, firstly, setting system thresholds of a scene for different scenes, then performing complexity classification on all 3D objects in the scene, and if a patch vertex value of the 3D object is greater than the threshold, classifying the object into a complex object class; and if the number of patch vertices of the 3D object is less than or equal to the threshold, classifying the object into a simple object class.
And step 3: according to the classification result in the step 2, the complex object utilizes a construction method of an inner bounding box, and the simple object utilizes a construction method of an AABB bounding box (short for axial-aligned bounding box Axially-aligned), so as to respectively establish respective bounding boxes for all 3D objects in the scene.
The principle of the inner bounding box technology is that a new bounding box is built inside a conventional bounding box, and there is a certain relationship between the two bounding boxes, and the conventional bounding box is usually called an outer bounding box, and the newly built bounding box is called an inner bounding box. Two intersection points are formed after the ray intersects with the outer bounding box, the two intersection points are set as P1 (X1, Y1, Z1) and P2 (X2, Y2, Z2), the inner bounding box is established by taking the line segment P1P2 as a diagonal line, and the surfaces of the inner bounding box are parallel to a coordinate plane respectively.
The AABB bounding box is also called an axis-aligned bounding box, each edge of the bounding box is parallel to a coordinate plane, and the AABB bounding box constructed in the rendering scene is a simple hexahedron.
And 4, step 4: according to model distribution in a scene, the spans of an X axis, a Y axis and a Z axis of the model are respectively solved, and a coordinate axis SAH mechanism is used for dividing the space. Since SAH assumes that light is randomly emitted, a BVH-tree with a higher balance can be obtained using this method.
And 5: a BVH-tree is constructed by combining a top-down mode and a bottom-up mode, as shown in FIG. 3, leaf nodes are created for a single object by a top-down method, and iteration is performed layer by layer until a complete BVH tree structure is created.
And 6: and outputting the BVHlist array after the BVH-tree is constructed.
And 7: starting from a viewpoint, judging whether the light rays emitted from the viewpoint are intersected with objects in a scene or not, and carrying out intersection test on the current light rays and bounding boxes in nodes of the BVH tree, wherein each light ray is a ray and is expressed as: r = E + T × D, where E is the viewpoint (0,), D is the ray's line of defense, and T is the parameter when the ray intersects a certain spatial structure. If the current ray is not intersected with the BVH node, indicating that the current ray is not intersected with the scene, and ending the ray tracing of the current ray; if the current ray intersects with the BVH node, judging whether a primitive exists in the BVH node, if so, indicating that the current ray intersects with an object in the scene, and continuing to track the ray; if no primitive exists in the BVH node, the current ray is not intersected with an object in the scene, and the ray tracing of the current ray is finished; and recursively judging each ray starting from the viewpoint until the judgment is finished, and outputting a rendering picture.
And step 8: when the scene changes dynamically, the original bounding box logic structure of a single bottom object does not change, the bottom data structure is updated rapidly by using a top-down tree construction method, then the bounding box of each object in the scene is used as a node, the BVH-tree is updated rapidly by using a bottom-up mode, and a new BVHlist array is generated.
And step 9: and after updating the BVH-tree structure, repeating the intersection test in the step 7 until the rendering is successful.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, and not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions and scope of the present invention as defined in the appended claims.

Claims (2)

1. A real-time ray tracing acceleration structure method based on dynamic scenes is characterized by comprising the following steps: the method comprises the following steps:
step 1: reading 3D models in a scene, storing read data in a GPU (graphics processing Unit) video memory, and storing the number information of surface patches and vertexes of the 3D models;
step 2: performing complexity classification on the 3D model in the scene by using the number information of the surface patches and the vertexes of the objects of the 3D model of the scene stored in the step 1;
and step 3: according to the classification result in the step 2, the complex object establishes respective bounding boxes for all 3D objects in the scene respectively by using a construction method of an inner bounding box and the simple object establishes respective bounding boxes for all 3D objects in the scene by using a construction method of an axis alignment bounding box;
and 4, step 4: respectively solving the spans of an X axis, a Y axis and a Z axis of the model according to the model distribution in the scene, and dividing the space by using a coordinate axis SAH mechanism;
and 5: the BVH-tree is constructed by a method combining a top-down mode and a bottom-up mode, firstly, a leaf node is created for a single object by the top-down method, and iteration is carried out layer by layer until a complete BVH tree structure is created;
step 6: outputting a BVHlist array after the construction of the BVH-tree is finished;
and 7: starting from a viewpoint, judging whether the light rays emitted from the viewpoint are intersected with objects in a scene or not, and carrying out intersection test on the current light rays and bounding boxes in nodes of the BVH tree, wherein each light ray is a ray and is expressed as: r = E + T x D, where E is the viewpoint (0, 0), D is the line of defense of the ray, and T is a parameter when the ray intersects a certain spatial structure;
if the current ray is not intersected with the BVH node, indicating that the current ray is not intersected with the scene, and ending the ray tracing of the current ray; if the current ray intersects with the BVH node, judging whether a primitive exists in the BVH node, if so, indicating that the current ray intersects with an object in the scene, and continuing to track the ray; if no primitive exists in the BVH node, the current ray is not intersected with an object in the scene, and the ray tracing of the current ray is finished; recursively judging each ray starting from the viewpoint until the judgment is completed, and outputting a rendered picture;
and 8: when a scene changes dynamically, the original bounding box logic structure of a single object at the bottom layer does not change, the bottom layer data structure is updated rapidly by using a top-down tree construction method, then the bounding box of each object in the scene is used as a node, the BVH-tree is updated rapidly by adopting a bottom-up mode, and a new BVHlist array is generated;
and step 9: and after updating the BVH-tree structure, repeating the intersection test in the step 7 until rendering is successful.
2. The method of claim 1, wherein the real-time ray tracing acceleration structure based on the dynamic scene comprises: the specific method for the complexity classification in the step 2 comprises the following steps:
firstly, setting system threshold values of scenes aiming at different scenes, then carrying out complexity classification on all 3D objects in the scenes, and classifying the objects into complex object classes if the vertex values of the patches of the 3D objects are greater than the threshold values; and if the number of patch vertices of the 3D object is less than or equal to the threshold, classifying the object into a simple object class.
CN201811002620.3A 2018-08-30 2018-08-30 Method for real-time ray tracing acceleration structure based on dynamic scene Active CN109215106B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811002620.3A CN109215106B (en) 2018-08-30 2018-08-30 Method for real-time ray tracing acceleration structure based on dynamic scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811002620.3A CN109215106B (en) 2018-08-30 2018-08-30 Method for real-time ray tracing acceleration structure based on dynamic scene

Publications (2)

Publication Number Publication Date
CN109215106A CN109215106A (en) 2019-01-15
CN109215106B true CN109215106B (en) 2023-01-03

Family

ID=64986804

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811002620.3A Active CN109215106B (en) 2018-08-30 2018-08-30 Method for real-time ray tracing acceleration structure based on dynamic scene

Country Status (1)

Country Link
CN (1) CN109215106B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11120611B2 (en) 2019-08-22 2021-09-14 Microsoft Technology Licensing, Llc Using bounding volume representations for raytracing dynamic units within a virtual space
US11295508B2 (en) * 2020-06-10 2022-04-05 Nvidia Corporation Hardware-based techniques applicable for ray tracing for efficiently representing and processing an arbitrary bounding volume
CN113298925B (en) * 2021-04-14 2023-07-11 江苏理工学院 Dynamic scene rendering acceleration method based on ray path multiplexing
CN113255251B (en) * 2021-07-14 2021-09-17 中国空气动力研究与发展中心低速空气动力研究所 Realistic ice type rendering method
US11783528B2 (en) * 2021-12-21 2023-10-10 Huawei Technologies Co., Ltd. Method and apparatus for supporting an image rendering using ray tracing
CN117011487A (en) * 2022-05-20 2023-11-07 腾讯科技(深圳)有限公司 Image rendering method, device, equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2649745A1 (en) * 2006-04-19 2007-11-01 Mental Images Inc. Instant ray tracing
WO2009063319A2 (en) * 2007-11-15 2009-05-22 Mental Images Gmbh Shallow bounding volume hierarchies for accelerated ray tracing
CN108090947A (en) * 2018-01-03 2018-05-29 沈阳品尚科技有限公司 A kind of ray tracing optimization method towards 3D scenes

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2649745A1 (en) * 2006-04-19 2007-11-01 Mental Images Inc. Instant ray tracing
WO2009063319A2 (en) * 2007-11-15 2009-05-22 Mental Images Gmbh Shallow bounding volume hierarchies for accelerated ray tracing
CN108090947A (en) * 2018-01-03 2018-05-29 沈阳品尚科技有限公司 A kind of ray tracing optimization method towards 3D scenes

Also Published As

Publication number Publication date
CN109215106A (en) 2019-01-15

Similar Documents

Publication Publication Date Title
CN109215106B (en) Method for real-time ray tracing acceleration structure based on dynamic scene
US9928643B2 (en) Hierarchical continuous level of detail for three-dimensional meshes
US8115767B2 (en) Computer graphics shadow volumes using hierarchical occlusion culling
CN106469463B (en) A kind of rendering method mixed based on CPU with GPU
WO2017206325A1 (en) Calculation method and apparatus for global illumination
US9508191B2 (en) Optimal point density using camera proximity for point-based global illumination
KR102604737B1 (en) METHOD AND APPARATUS for generating acceleration structure
CN111340928A (en) Ray tracing-combined real-time hybrid rendering method and device for Web end and computer equipment
US20140002458A1 (en) Efficient rendering of volumetric elements
KR20080018404A (en) Computer readable recording medium having background making program for making game
WO2023061364A1 (en) Model establishment method and related apparatus
CN116612223B (en) Digital twin simulation space generation method, device, computer equipment and medium
KR100693134B1 (en) Three dimensional image processing
US11436797B2 (en) Image generation system and method
US11423618B2 (en) Image generation system and method
KR101228118B1 (en) Method for constructing a Kd-tree based on polygon importance
Alj et al. Space carving mvd sequences for modeling natural 3d scenes
Liu et al. Lightweight Web3D crowd rendering for online massive conferencing
US11861785B2 (en) Generation of tight world space bounding regions
Tavares et al. Efficient approximate visibility of point sets on the GPU
US11893677B1 (en) Bounding volume hierarchy (BVH) widening based on node compressibility
US20240203030A1 (en) 3d model rendering method and apparatus, electronic device, and storage medium
WO2023184139A1 (en) Methods and systems for rendering three-dimensional scenes
US20240104824A1 (en) Accelerated bounding volume hierarchy (bvh) traversal for ray tracing
JP3711273B2 (en) 3D graphics drawing device for occlusion culling

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
GR01 Patent grant
GR01 Patent grant