Pulse laser short-range detection simulation method based on GPU and BVH structure

Through the use of GPU parallel processing and BVH structure to accelerate intersection judgments in pulse laser detection simulation, the problem of too slow calculation speed of traditional methods is solved, and efficient real -time simulation and improved detection accuracy is achieved.

CN119375862AActive Publication Date: 2025-01-28BEIJING INST OF TECH
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411407915.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-01-28
Estimated Expiration
2044-10-10

AI Technical Summary

Technical Problem

The traditional pulse laser detection simulation method uses CPU serial computing, which leads to the slow calculation speed when processing complex three-dimensional models and cannot realize real-time simulation.

Method used

The simulation method based on the GPU and BVH structure is used, and the parallel processing capacity of the GPU is used to track the light, and the unnecessary calculation is reduced through the BVH structure to accelerate the intersection of light and objects.

Benefits of technology

It has significantly improved the simulation efficiency, can maintain the output frame rate of more than 30fps in complex scenarios, meet the real -time simulation requirements, and improve the detection accuracy and the reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119375862A_ABST
    Figure CN119375862A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of laser short-range detection, and discloses a pulse laser short-range detection simulation method based on a GPU and BVH structure, and the method comprises the following steps: S1, light generation; s2, BVH acceleration: reading a BVH structure transmitted by a CPU, respectively adding bounding boxes to objects in the three-dimensional scene, judging whether the light intersects with the bounding boxes or not when judging whether the light intersects with the objects or not, and if not, directly stopping operation, and accelerating intersection judgment of the light and the objects; s3, performing light ray intersection traversal: traversing the generated initial light ray, performing light ray intersection judgment on each node in a BVH structure, namely bounding box traversal, according to a BVH acceleration scheme, if the nodes are not intersected, the light intensity of the point is 0, and otherwise, calculating the light intensity of the point by combining system parameters and model parameters; and S4, scattering and gray calculation. According to the method, after the GPU is adopted to accelerate and superpose the BVH structure, the output frame rate exceeding 30 fps can still be kept in a complex scene, and the real-time simulation requirement is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of laser short-range detection, and in particular to a pulse laser short-range detection simulation method based on a GPU and a BVH structure. Background Art

[0002] Laser detection is a high-precision detection device widely used in civil and military fields. They are often used to accurately measure the distance and speed of targets and provide key target information for the system. Pulse laser detection requires processing a large amount of optical data, including the emission, scattering, and reception of light beams. These calculation processes are often very complex, involving complex mathematical models and algorithms. Simulation technology plays an important role in the research and development and performance evaluation of pulse laser detection. Through simulation, the performance of the system under different conditions can be predicted without actual physical testing, thereby reducing dependence on actual hardware, reducing R&D costs and testing risks. At the same time, it accelerates the design iteration process of the system, quickly evaluates the performance of different design schemes, and improves design efficiency.

[0003] The traditional simulation method uses CPU serial calculation. When the model is relatively fine, that is, the number of triangular face elements is large, the CPU traversal speed is too low to achieve real-time simulation. Summary of the invention

[0004] In order to overcome or alleviate the above technical problems, the purpose of the present invention is to provide a pulse laser short-range detection simulation method based on GPU and BVH structure, to perform pulse laser short-range detection simulation, and to improve the simulation efficiency. The powerful parallel processing capability of GPU is used to realize ray tracing; at the same time, the BVH structure is used to quickly eliminate the intersection test between light and most irrelevant objects, and only the objects that may intersect are calculated in detail, which significantly reduces the amount of unnecessary calculations. During simulation, the CPU is used to receive inputs such as three-dimensional scene model data and system parameters, and then the vertices, face elements and textures of the three-dimensional scene are respectively passed to the GPU buffer. At the same time, in order to further improve the efficiency of intersection judgment, a bounding volume hierarchy BVH structure is added to the three-dimensional scene in the CPU, and it is passed to the GPU together; after receiving the required raw data stream, the GPU calls the scene rendering engine for preprocessing, and performs the ray tracing process according to the set initial conditions. After the end, the result is passed back to the CPU and output.

[0005] The present invention provides the following technical solutions:

[0006] In a first aspect, the present invention provides a pulse laser short-range detection simulation method based on a GPU and a BVH structure, which comprises the following steps:

[0007] S1: Ray generation: Starting from the detector position, the GPU sequentially emits rays to each face element of the 3D model surface read by the CPU to simulate light transmission;

[0008] S2: BVH acceleration: read the BVH structure passed in by the CPU, add bounding boxes to the objects in the 3D scene, and then determine whether the light intersects with the object by first determining whether it intersects with the bounding box. If not, the calculation can be stopped directly, thus accelerating the intersection determination between the light and the object;

[0009] S3: Ray intersection traversal: Traverse the generated initial rays, and according to the BVH acceleration scheme, perform ray intersection judgment on each node in the BVH structure, that is, the bounding box traversal. If there is no intersection, the light intensity of the point is 0. If there is intersection, the light intensity of the point is calculated by combining the system parameters and model parameters.

[0010] S4: Scattering and grayscale calculation: When it is determined that the light intersects with the object, the scattering intensity is iteratively calculated according to the BRDF model, otherwise a new light is generated and the scattered light is recursively traced until the maximum iteration weight is reached. Based on the results of ray tracing, the grayscale value of each pixel is calculated and passed back to the CPU to produce a complete simulated image.

[0011] According to some embodiments, step S1 comprises the following steps:

[0012] S11: receiving the 3D scene model data, missile body parameters and transceiver system parameter inputs on the CPU side, and then transferring the vertices, facets and textures of the 3D scene to the GPU buffer respectively; at the same time, in order to further improve the intersection judgment efficiency, adding a bounding volume hierarchy BVH structure to the 3D scene in the CPU, and transferring it to the GPU;

[0013] S12: After receiving the required raw data stream, the GPU calls the scene rendering engine for preprocessing and generates initial light according to the set camera position and posture.

[0014] According to some embodiments, step S2 comprises the following steps:

[0015] S21: When dividing the triangular face set, first divide the total space where all face elements are located into eight AABB boxes according to the octree structure. Taking the x coordinate sorting as an example, assuming that there are seven face elements AG in the space, and the minimum x coordinate of each face element is xA-xG, then xD is the median of the minimum x coordinate of the face element, which is set as the Px face and the overall space is divided into two. By analogy, eight AABB bounding boxes can be obtained, and the number of face elements in each bounding box is roughly equal;

[0016] S22: Divide the face element set into sub-bounding boxes, and the judgment criterion is: for a face element, if all vertices of the sub-bounding boxes are on the same side of the face element, the face element is considered not to be in the bounding box;

[0017] S23: Transfer the BVH linked list structure to the GPU in the form of an array and assign an ID to each node, and transfer the BVH structure to the GPU global memory area at one time.

[0018] According to some embodiments, step S3 comprises the following steps:

[0019] S31: Generate initial emission light;

[0020] S32: traverse the BVH; perform intersection judgment on each bounding box corresponding to the constructed octree node, start traversing from the root node, and continue traversing until the leaf node if the node intersects, otherwise abandon the subtree;

[0021] S33: Determine whether there is a hit node in the scene, that is, the object intersects with the light. According to the BVH acceleration scheme, when performing pulse laser detection simulation by ray tracing method, first traverse each node in the BVH structure to make a ray intersection judgment. If there is no intersection, it means that the laser has not detected the object, and jump to S38 to end the tracing; if there is an intersection, jump to S34;

[0022] S34: perform a ray intersection judgment traversal on the face elements under the node. If there is an intersecting face element, calculate the direction and light intensity weight of the scattered light according to the BRDF model and iterate, then jump to S4;

[0023] Step S4 performs scattering and grayscale calculation, which specifically includes the following steps:

[0024] S41: scattering update; if the current plane is the plane with the shortest distance, calculate the scattering intensity according to the BRDF; record the scattering intensity and weight value;

[0025] S42: Determine whether the tracking iteration reaches the maximum iteration weight, if not, jump to S32; if yes, jump to S43;

[0026] S43: grayscale calculation according to scattering intensity and weight;

[0027] S44: End tracking.

[0028] According to some implementations, when the traced light intersects with the facet in step S34, the traversal is determined by updating the light direction and light intensity weight according to the scattering of the light on the surface. The specific steps are as follows:

[0029] S341: Use BRDF to sample scattered light. When the traced light intersects with the surface element, the direction and light intensity weight of the scattered light are calculated according to the BRDF model and iterated.

[0030] S342: Calculate the light intensity weight of each pixel based on the result of ray tracing. When the number of ray iterations reaches the threshold, the ray is considered to be extinguished and the light intensity weight is 0. If it can return to the original light before extinguishing, it proves that the ray can go through the complete emission-scattering-reception process. Record the final light intensity weight of the ray for grayscale calculation output in S43.

[0031] In a second aspect, the present invention provides a program having a program code for executing the above-mentioned simulation method when the program code is run on a computer, a processor, a control module or a programmable hardware component.

[0032] In a third aspect, the present invention provides a memory storing a computer program, which, when executed by a processor, implements the steps of the above-mentioned pulse laser short-range detection simulation method based on GPU and BVH structure.

[0033] Compared with the prior art, the present invention has the following beneficial effects:

[0034] 1. Accelerate the calculation process: GPU has a high degree of parallel processing capability, which can significantly increase the speed of simulation calculations. Compared with traditional CPUs, GPU is more efficient in processing large-scale data and complex calculations, especially in large-scale ray tracing and data parallel processing, which can significantly reduce simulation time.

[0035] 2. Improve detection accuracy: The BVH structure is a hierarchical bounding volume structure that optimizes the detection process of ray-object intersection by grouping objects in the scene and approximating them with bounding volumes. This method can reduce unnecessary calculations and improve detection accuracy and efficiency.

[0036] 3. Improve system reliability and stability: The high computing power of GPU and the efficient data management of BVH structure can improve the reliability and stability of the system in complex environments, especially in multi-target detection and dynamic environments.

[0037] 4. The speed of pulse laser short-range detection simulation in the CPU is not enough to support real-time requirements; the simulation method using only GPU acceleration greatly reduces the simulation time compared to the non-acceleration method, but when the input model is a complex scene, this method is not enough to meet the real-time simulation requirements. The pulse laser short-range detection simulation method based on GPU and BVH structure provided by the present invention can still maintain an output frame rate of more than 30fps in complex scenes after superimposing the BVH structure, which meets the real-time simulation requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A three-dimensional scene model diagram provided by an embodiment of the present invention.

[0039] Figure 2 A diagram of the GPU accelerated simulation architecture provided by an embodiment of the present invention.

[0040] Figure 3 A BVH-AABB bounding box partition diagram provided by an embodiment of the present invention.

[0041] Figure 4 A multi-level BVH bounding box partition diagram provided by an embodiment of the present invention.

[0042] Figure 5 An octree space data structure storage sequence diagram provided by an embodiment of the present invention.

[0043] Figure 6 A flowchart of a pulse laser short-range detection simulation method based on a GPU and a BVH structure is provided in an embodiment of the present invention.

[0044] Figure 7 A ray tracing flowchart of steps S3 and S4 provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0045] The present invention is described in detail below in conjunction with the embodiments and drawings, but it should be understood that the embodiments and drawings are only used to exemplify the present invention and do not constitute any limitation on the protection scope of the present invention. All reasonable changes and combinations within the scope of the inventive concept of the present invention fall within the protection scope of the present invention.

[0046] The present invention will be further described below in conjunction with the accompanying drawings.

[0047] Example 1

[0048] This embodiment uses Figure 1 The established three-dimensional scene model is used as input, and the total number of scene faces is 16384.

[0049] like Figure 6 This embodiment provides a pulse laser short-range detection simulation method based on GPU and BVH structure, including the following steps:

[0050] Step S1: Light generation. Generate rays on the GPU starting from the detector (camera) position and emitting to each pixel of the imaging plane to simulate light transmission. Define a pulse laser detection simulation method based on GPU acceleration and BVH optimization, and adopt the method of simulating light transmission by the reverse light path proposed by Turner Whitted based on the reversibility of the light path. The main light is emitted from a pixel of the camera (detection device). If it does not intersect with any object, it means that the point is empty and the calculation can be stopped; when the light hits the object, the next level of reflection, refraction and shadow light is generated according to the material properties of the model, and it is used as a new light to continue iterating and recursively until it dies or hits the light source. The transceiver system in the pulse laser is coaxial, so it can be considered that the light source and the detector are at the same position, so the reverse light path is actually the same as the forward light path. The design converts the simulation body to the GPU for parallel computing. According to the basic principles of ray tracing and the GPU structure, the GPU acceleration architecture for pulse laser detection simulation is designed. Figure 2 shown.

[0051] The CPU receives inputs such as 3D scene model data, projectile parameters, and transceiver system parameters, and then passes the vertices, faces, and textures of the 3D scene into the GPU buffer respectively; at the same time, in order to further improve the efficiency of intersection judgment, a bounding volume hierarchy (BVH) structure is added to the 3D scene in the CPU and passed to the GPU together; after receiving the required raw data stream, the GPU calls the scene rendering engine for preprocessing, generates initial light according to the set camera position and posture, and then starts the ray tracing process. After completion, the result is passed back to the CPU and output.

[0052] Step S2: Select the AABB bounding box and octree structure to construct BVH acceleration.

[0053] S21: When dividing the triangular face set, first divide the total space where all face elements are located into eight AABB boxes according to the octree structure. The division standard is to sort all face element vertices according to x, y, and z coordinates respectively, and take the sorted medians Px, Py, and Pz as the three division faces.

[0054] Taking the x-coordinate sorting as an example, assuming that there are seven facets AG in the space, and the minimum x-coordinate of each facet is xA-xG, then xD is the median of the minimum x-coordinate of the facet, let it be the Px face and divide the overall space into two. By analogy, eight AABB bounding boxes can be obtained, such as Figure 3 shown.

[0055] S22: Divide the face element set into sub-bounding boxes, and the judgment criterion is: for a face element, if all vertices of the sub-bounding boxes are on the same side of the face element, the face element is deemed not to be in the bounding box.

[0056] S23: Continue to add bounding boxes in layers based on the eight basic bounding boxes mentioned above until the number of face elements in each bounding box reaches the threshold, and finally obtain a set of recursive nested cube structures. The AABB bounding box uses binary encoding as the index, and the encoding method is as follows Figure 4 As shown on the right, each time eight sub-bounding boxes are segmented, they are encoded so that each bounding box has a unique index. Each bounding box index is represented as a node, and the nested AABB bounding boxes constructed above are represented as an octree in the spatial data structure, with each node connecting eight child nodes. Nodes can be divided into leaf nodes that actually contain face elements and branch nodes that contain AABB boxes according to the bounding content. Each leaf node contains the maximum and minimum three-dimensional coordinates (xmax, ymax, zmax) and (xmin, ymin, zmin) of the bounding box. The BVH structure is highly recursively constructed in the form of a linked list in the CPU. When calling the function, a null pointer is first passed in as the parent node pointer, and then the new node pointer is defined as a BVH Node type pointer. After completing the BVH child node division, the BVH constructor is recursively called and the child node pointer is passed in as the next level parent pointer. Finally, the recursion ends when the leaf node is reached, completing the overall construction of the BVH.

[0057] S24: Transfer the BVH structure to the GPU global memory area at one time. In the simulation, the BVH linked list structure is transferred to the GPU in the form of an array and an ID is assigned to each node according to the above encoding. Figure 5 Taking the octree structure shown as an example, after the GPU array traverses from the root node and stores the leaf nodes N10-N17 connected to N2, it returns to the second layer to store N3-N9, and finally stores the leaf nodes N18-N25 connected to N9.

[0058] like Figure 7 The process including step S3 and step S4 is also the process of the entire ray tracing. S3 mainly describes the process of determining whether the ray and the face element intersect; S4 describes the calculation after tracing the intersection, specifically:

[0059] S3: GPU parallel computing synchronously processes multiple rays Figure 7 The process shown performs a recursive tracing operation. Step S3 includes the following steps:

[0060] S31: Generate initial emission light;

[0061] S32: traverse the BVH; perform intersection judgment on the bounding boxes corresponding to the octree nodes constructed above, start traversing from the root node, and continue traversing until the leaf node if the nodes intersect, otherwise abandon the subtree;

[0062] S33: Determine whether there is a hit node in the scene, that is, the object intersects with the light. According to the BVH acceleration scheme, when performing pulse laser detection simulation by ray tracing method, first traverse each node (bounding box) in the BVH structure to make a ray intersection judgment. If there is no intersection, it means that the laser has not detected the object, and jump to S44 to end the tracing; if there is an intersection, jump to S34;

[0063] S34: perform ray intersection judgment traversal on the facets under the node, and if there are intersecting facets, jump to S4;

[0064] S4: Scattering and grayscale calculation, specifically including the following steps:

[0065] S41: scattering update; if the current plane is the plane with the shortest distance, calculate the scattering intensity according to the BRDF; record the scattering intensity and weight value;

[0066] S42: Determine whether the tracking iteration reaches the maximum iteration weight, if not, jump to S32; if yes, jump to S43;

[0067] S43: grayscale calculation according to scattering intensity and weight;

[0068] S44: End tracking.

[0069] In S34, when the traced light intersects with the surface element, the light direction and light intensity weight are updated according to the scattering of the light on the surface to determine the traversal. The specific steps are as follows:

[0070] S341: Use BRDF to sample scattered light. When the traced light intersects with the surface element, the direction and light intensity weight of the scattered light are calculated according to the BRDF model and iterated.

[0071] S342: Calculate the light intensity weight of each pixel based on the result of ray tracing. When the number of ray iterations reaches the threshold, the ray is considered to be extinguished and the light intensity weight is 0. If it can return to the original light before extinguishing, it proves that the ray can go through the complete emission-scattering-reception process. Record the final light intensity weight of the ray for grayscale calculation output in S43.

[0072] Example 2

[0073] This embodiment adopts three pulse laser detection simulation methods to compare the implementation effects of different simulation methods. The output power image pixels are taken as 32×32, 64×64, and 128×128. The overall simulation method without acceleration, the acceleration method of only calling the GPU, and the acceleration method of superimposing the BVH acceleration structure are used to repeat the simulation. The average time consumption of the three methods is shown in Table 1.

[0074] Table 1 shows the comparison of simulation performance under different pixel conditions.

[0075]

[0076] It can be seen from Table 1 that the simulation method without acceleration increases in direct proportion with the increase of pixels; for the acceleration methods of GPU acceleration and superimposed BVH, both methods call the GPU for parallel computing, and the pixel value required for simulation is far lower than the upper limit of GPU parallel computing. Therefore, these two acceleration methods are not sensitive to changes in pixel values, and the simulation speed is relatively stable.

[0077] When the pixel value requirements are the same, the performance of the GPU acceleration method is much better than that of the non-accelerated simulation method, and the larger the pixel value, the more obvious the advantage; when the output image pixel is 128×128, the GPU acceleration method increases the simulation speed by nearly 1000 times, and the GPU acceleration method with superimposed BVH further increases the simulation speed to about 0.02s on this basis, that is, the frame rate exceeds 40fps (frame per second, fps), making real-time simulation of pulsed laser detection possible.

[0078] When the output image pixels are set to a fixed value of 64×64 and the total number of facets in the 3D scene model are 12, 2842, 12014, 16384 and 25661 respectively, the average time consumption of the three simulation methods is shown in Table 2.

[0079] Table 2 shows the comparison of simulation performance under different numbers of facets.

[0080]

[0081] The GPU acceleration method solves the problem that the time consumption of pulse laser detection simulation method increases with the complexity of the scene when there is no acceleration. 4 At the same time, the non-accelerated simulation method takes hundreds of seconds, while the GPU acceleration method only takes a few seconds. The GPU acceleration method with superimposed BVH takes the least time, indicating that the acceleration structure is effective.

[0082] When only GPU is used for acceleration, the simulation time also shows a slight growth trend with the increase of the number of facets. After superimposing BVH, the growth rate of simulation time is significantly reduced, indicating that the BVH structure can greatly reduce unnecessary light intersection judgments and further improve simulation efficiency. In addition, when the number of facets is small, that is, the scene is relatively simple, the BVH scene management advantage is not prominent, so the performance difference before and after superimposing BVH is not significant; when the number of facets increases to 25661, the GPU acceleration method without BVH takes 3.0491s, while the GPU acceleration method with BVH superimposed takes 0.0255s, and the output frame rate is still greater than 30fps, proving that the designed BVH+GPU accelerated simulation method is sufficient to realize the real-time simulation function of pulse laser detection in complex scenes.

[0083] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0084] The above embodiments are only preferred implementations of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A pulse laser short-range detection simulation method based on GPU and BVH structure, characterized by: The following steps are involved: S1: Ray generation: Starting from the detector position, the GPU sequentially emits rays to each face element of the 3D model surface read by the CPU to simulate light transmission; S2: BVH acceleration: read the BVH structure passed in by the CPU, add bounding boxes to the objects in the 3D scene, and then determine whether the light intersects with the object by first determining whether it intersects with the bounding box. If not, the calculation can be stopped directly, thus accelerating the intersection determination between the light and the object; S3: Ray intersection traversal: Traverse the generated initial rays, and according to the BVH acceleration scheme, perform ray intersection judgment on each node in the BVH structure, that is, the bounding box traversal. If there is no intersection, the light intensity of the point is 0. If there is intersection, the light intensity of the point is calculated by combining the system parameters and model parameters. S4: Scattering and grayscale calculation: When it is determined that the light intersects with the object, the scattering intensity is iteratively calculated according to the BRDF model, otherwise a new light is generated and the scattered light is recursively traced until the maximum iteration weight is reached. Based on the results of ray tracing, the grayscale value of each pixel is calculated and passed back to the CPU to produce a complete simulated image.

2. The pulse laser short-range detection simulation method based on GPU and BVH structure according to claim 1 is characterized in that: Step S1 includes the following steps: S11: receiving the 3D scene model data, missile body parameters and transceiver system parameter inputs on the CPU side, and then transferring the vertices, facets and textures of the 3D scene to the GPU buffer respectively; at the same time, in order to further improve the intersection judgment efficiency, adding a bounding volume hierarchy BVH structure to the 3D scene in the CPU, and transferring it to the GPU; S12: After receiving the required raw data stream, the GPU calls the scene rendering engine for preprocessing and generates initial light according to the set camera position and posture.

3. The pulse laser short-range detection simulation method based on GPU and BVH structure according to claim 2 is characterized in that: Step S2 comprises the following steps: S21: When dividing the triangular face set, first divide the total space where all face elements are located into eight AABB boxes according to the octree structure. Taking the x coordinate sorting as an example, assuming that there are seven face elements AG in the space, and the minimum x coordinate of each face element is xA-xG, then xD is the median of the minimum x coordinate of the face element, which is set as the Px face and the overall space is divided into two. By analogy, eight AABB bounding boxes can be obtained, and the number of face elements in each bounding box is roughly equal; S22: Divide the face element set into sub-bounding boxes, and the judgment criterion is: for a face element, if all vertices of the sub-bounding boxes are on the same side of the face element, the face element is considered not to be in the bounding box; S23: Transfer the BVH linked list structure to the GPU in the form of an array and assign an ID to each node, and transfer the BVH structure to the GPU global memory area at one time.

4. The pulse laser short-range detection simulation method based on GPU and BVH structure according to claim 3 is characterized by: Step S3 comprises the following steps: S31: Generate initial emission light; S32: traverse the BVH; perform intersection judgment on each bounding box corresponding to the constructed octree node, start traversing from the root node, and continue traversing until the leaf node if the node intersects, otherwise abandon the subtree; S33: Determine whether there is a hit node in the scene, that is, the object intersects with the light. According to the BVH acceleration scheme, when performing pulse laser detection simulation by ray tracing method, first traverse each node in the BVH structure to make a ray intersection judgment. If there is no intersection, it means that the laser has not detected the object, and jump to S38 to end the tracing; if there is an intersection, jump to S34; S34: perform a ray intersection judgment traversal on the face elements under the node. If there is an intersecting face element, calculate the direction and light intensity weight of the scattered light according to the BRDF model and iterate, then jump to S4; Step S4 performs scattering and grayscale calculation, which specifically includes the following steps: S41: scattering update; if the current plane is the plane with the shortest distance, calculate the scattering intensity according to the BRDF; record the scattering intensity and weight value; S42: Determine whether the tracking iteration reaches the maximum iteration weight, if not, jump to S32; if yes, jump to S43; S43: grayscale calculation according to scattering intensity and weight; S44: End tracking.

5. The pulse laser short-range detection simulation method based on GPU and BVH structure according to claim 4 is characterized in that: In step S34, when the traced light intersects with the face element, the light direction and light intensity weight are updated according to the scattering of the light on the surface to determine the traversal. The specific steps are as follows: S341: Use BRDF to sample scattered light. When the traced light intersects with the surface element, the direction and light intensity weight of the scattered light are calculated according to the BRDF model and iterated. S342: Calculate the light intensity weight of each pixel based on the result of ray tracing. When the number of ray iterations reaches the threshold, the ray is considered to be extinguished and the light intensity weight is 0. If it can return to the original light before extinguishing, it proves that the ray can go through the complete emission-scattering-reception process. Record the final light intensity weight of the ray for grayscale calculation output in S43.

6. A program having a program code, characterized in that When the program code runs on a computer, a processor, a control module or a programmable hardware component, the simulation method according to any one of claims 1 to 5 is executed.

7. A memory storing a computer program, characterized in that: When the program is executed by a processor, the steps of the pulse laser short-range detection simulation method based on GPU and BVH structure described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Light tracking optimization method facing 3D scenes

    CN108090947A

  • Computer vision system

    CN113228114A

  • Target radiation brightness calculation method and device and terminal equipment

    CN115082613A

  • Improvement method of photon mapping

    CN115512032A

  • Underwater complex target laser scanning point cloud simulation method based on ray tracing

    CN115964837A