An excitation acquisition method, electronic device, and storage medium for verifying boundary intersection points

By generating a ray emission direction sequence in ray tracing, the verification problem of the attachment of rays and polygon boundary intersection points is solved, and the comprehensive coverage of complex scenes and the accuracy of rendering results is achieved.

CN120014142BActive Publication Date: 2025-07-04METAX INTEGRATED CIRCUITS (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510488537.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-07-04
Estimated Expiration
2045-04-18

AI Technical Summary

Technical Problem

In the ray tracing process, it is difficult for the prior art to fully cover complex geometric configurations and extreme boundary conditions, resulting in inconsistent rendering results or errors. The verification method of the Top_Left algorithm is difficult to exhaust all possible boundary conditions.

Method used

By obtaining the light emission points and direction vectors on the polygon plane, the z-axis component is randomly generated and the intersection points are rotated on the polygon plane, the x-axis and y-axis components are generated, forming a light emission direction sequence, and an excitation signal is generated to verify the intersection of the boundary.

Benefits of technology

A comprehensive coverage of complex scenarios is achieved, the verification complexity and calculation complexity are reduced, and the accuracy and consistency of rendering results are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120014142B_ABST
    Figure CN120014142B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of chip design, and particularly to a method for obtaining stimuli for verifying boundary intersection points, an electronic device, and a storage medium. By means of a preset polygonal plane and an emission point, a random range is determined based on the vertices of the polygon and the tangent points corresponding to the inscribed circle, and corresponding z-axis components are randomly generated according to the random range; for each z-axis component, the intersection point is rotated on the polygonal plane and the corresponding x-axis and y-axis components are obtained, so as to obtain a sequence of light emission directions composed of the x-axis component, the y-axis component, and the z-axis component, and further obtain a stimulus signal for verifying the boundary intersection point. It can not only cover the scenarios of collinear points and collinear lines, but also cover the scenarios in different directions, and can also cover the situations from the rotation angle to whether the triangle intersects, and the verification is more sufficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of chip design, and particularly to a method for obtaining stimuli for verifying boundary intersections, an electronic device, and a storage medium. Background Art

[0002] In computer graphics, ray tracing is a core rendering technique aimed at generating highly realistic images by simulating the interaction of light with objects in a scene. One of the core steps of ray tracing is the calculation of the intersection points of rays with geometric bodies, where triangle meshes are the most commonly used geometric representation. In complex three-dimensional scenes, the boundaries of geometric bodies (such as the common edge of two triangles) are often key areas for the interaction of light with the scene. Therefore, how to accurately determine the ownership of the intersection points of rays with these boundaries has become an important issue in ray tracing algorithms.

[0003] During the ray tracing process, when a ray intersects the boundary of two triangles with a common edge, the intersection point may exactly lie on the common boundary. In this case, how to determine which triangle the intersection point belongs to is a problem that needs to be carefully handled. If not handled properly, it may lead to inconsistent or incorrect rendering results, such as duplicate rendering or missed rendering. To solve this problem, the Top_Left algorithm has been proposed as a method for determining ownership based on boundary conditions. This algorithm defines a deterministic rule to ensure that in the case of boundary intersection, the intersection point belongs to a specific triangle, thus avoiding the random ownership problem caused by floating-point operation errors. In the verification of the ray tracing module, the correctness and robustness of the Top_Left algorithm need to be verified through a series of methods. It uses test cases to construct different scenarios (such as extreme geometric configurations, boundary intersection positions, etc.) to examine the actual performance of the algorithm, while numerical stability analysis focuses on the reliability of the algorithm under floating-point operation errors.

[0004] However, in practical applications, complex geometric configurations and ray paths may be encountered, which may result in the inability of theoretical analysis to fully cover all actual scenarios. Secondly, although the design of test cases can cover common situations, it is difficult to exhaust all possible boundary conditions, especially some extreme geometric configurations may not be fully considered. Therefore, there is an urgent need for a verification method that can cover more scenarios. Summary of the Invention

[0005] In view of the above technical problems, the technical solution adopted by the present invention is: a method for obtaining stimuli for verifying boundary intersections, the method comprising the following steps:

[0006] S100. Obtain a preset polygon and a light emission point O. The polygon is divided into N triangles with a common vertex at the center point P. The projection of the light emission point O on the polygon is the center point P.

[0007] S200. When the intersection point of the light emission point O and the polygon plane is a vertex V of the i-th triangle i , obtain the z-axis component dir.z of the current emission direction Vi , where the V i is different from the center point P. When the intersection point of the light emission point O and the polygon plane is the tangent point C of the inscribed circle of the polygon on the i-th triangle i , obtain the z-axis component dir.z of the current emission direction Ci .

[0008] S300. Randomly generate the z-axis component of the direction vector of the light emitted from the light emission point O. Respectively obtain the initial intersection points of each z-axis component and the polygon plane. Among them, the polygon plane is perpendicular to the z-axis in the three-dimensional coordinate system. The polygon plane includes N triangles with a common vertex at the center point P, and the projection of the light emission point O on the polygon is the center point P.

[0009] S400. For each initial intersection point of the z-axis component and the polygon plane, rotate it around the center point P on the polygon plane for one week and sample the corresponding scanning points to obtain the x-axis component and y-axis component of the direction vector of the light emission direction from the light emission point O to each scanning point, and obtain a light emission direction sequence composed of the x-axis component, y-axis component, and z-axis component.

[0010] S500. Generate an excitation signal for verifying the boundary intersection points from the light emission point O and the light emission direction sequence.

[0011] In addition, the present invention also provides a non-transitory computer-readable storage medium, in which at least one instruction or at least one program segment is stored, and the at least one instruction or the at least one program segment is loaded and executed by a processor to implement the above method.

[0012] In addition, the present invention also provides an electronic device, including a processor and the above non-transitory computer-readable storage medium.

[0013] The present invention has at least the following beneficial effects:

[0014] The present invention provides a method for obtaining incentives to verify boundary intersection points. Through a preset polygon plane, it can not only cover the scenarios of collinear points (P) and collinear lines (common edges), but also cover scenarios in different directions by randomly generating the z-axis component and combining with rotating the intersection points on the polygon plane, with more sufficient verification. At the same time, due to the design of the scenarios, it can not only comprehensively cover all scenarios, but also reduce the verification complexity and computational complexity. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0016] Figure 1 It is a flowchart of a method for verifying the attribution of boundary intersection points based on a ray tracing module provided by an embodiment of the present invention;

[0017] Figure 2 It is a schematic diagram of an implementation scenario provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0019] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present invention have the same meaning as commonly understood by those of ordinary skill in the art.

[0020] Please refer to Figure 1 , which shows a flowchart of a method for obtaining incentives to verify boundary intersection points. The method includes the following steps:

[0021] S100, obtain a preset polygon and a ray emission point O. The polygon is divided into N triangles with a central point P as a common vertex; the projection of the ray emission point O on the polygon is the central point P.

[0022] Among them, the ray emission point O is the emission starting point of the ray in the ray tracing module, represented by coordinates in three-dimensional space. It is the reference point for the propagation of the ray, and all rays start from this ray emission point O and propagate along a specific emission direction. It should be noted that the ray emission point O is not in the polygon plane.

[0023] Among them, the direction vector of the light ray is used to describe the propagation direction of the light ray. It is a three-dimensional vector, expressed as (dir.x, dir.y, dir.z), where dir.x is the x-axis component, dir.y is the y-axis component, and dir.z is the z-axis component.

[0024] In one embodiment, the polygon is a rhombus and N = 4. The polygon is divided into 4 triangles by connecting the diagonals, and the diagonals are parallel to the coordinate axes. This structure is the smallest unit for verifying the attribution of boundary points, which can cover all types of boundary points and reduce the calculation amount.

[0025] In one embodiment, the vertex coordinates of the N triangles are stored in the memory.

[0026] S200, when the intersection point of the light ray emission point O and the polygon plane is a vertex V of the i-th triangle i , obtain the z-axis component dir.z of the current emission direction Vi , where the V i is different from the center point P; when the intersection point of the light ray emission point O and the polygon plane is the tangent point C of the inscribed circle of the polygon in the i-th triangle i , obtain the z-axis component dir.z of the current emission direction Ci .

[0027] In one embodiment, the obtaining step of the dir.z Vi includes:

[0028] S210, obtain the length L between the center point P and the V i ; PVi ;

[0029] S220, obtain the length L between the light ray emission point O and the center point P PO ;

[0030] S230, obtain the dir.z according to the similarity principle of the triangle formed by △V i PO and the direction vector of the emission direction. The dir.z Vi satisfies: dir.z Vi / dir.x Vi =L Vi / L PO , where dir.x PVi =cost, and t is the angle between PV Vi and the x-axis. i

[0031] In one embodiment, when PV i is parallel to the x-axis, t = 0.

[0032] It should be noted that since the polygon and the light emission point O are both preset values, L PO / L PVi is known, so a definite dir.z Vi is obtained.

[0033] In one embodiment, the obtaining step of the dir.z Ci includes:

[0034] S240, obtaining the length L i between the center point P and the tangent point C PCi ;

[0035] S250, obtaining the length L PO between the light emission point O and the center point P

[0036] S260, obtaining the dir.z i according to the similarity principle of the triangle formed by △C Ci PO and the direction vector of the emission direction, and the dir.z Ci satisfies: dir.z Ci / dir.x Ci =L PO / L PCi where dir.x Ci =cost.

[0037] In one embodiment, when PV i is parallel to the x-axis, t = 45°.

[0038] It should be noted that similarly, since the polygon and the light emission point O are both preset values, L PO / L PCi is known, so a definite dir.z Ci is obtained.

[0039] It should be noted that dir.z Vi and dir.z Ci can be obtained simultaneously or successively, and the obtaining steps can also be carried out crosswise, and the obtaining sequence is not limited.

[0040] S300, randomly generating the z-axis component of the direction vector of the light emitted from the light emission point O; respectively obtaining the initial intersection points of each z-axis component with the polygon plane; wherein, the polygon plane is perpendicular to the z-axis in the three-dimensional coordinate system, the polygon plane includes N triangles with P as the common vertex, and the projection of the light emission point O on the polygon is the center point P.

[0041] It should be noted that obtaining the z-axis component of the initial intersection point of each z-axis component with the polygon plane respectively includes dir.z Vi , dir.z Ci and a randomly generated z-axis component.

[0042] It should be noted that only the z-axis component of the special boundary point is obtained in S200. To cover more scenarios, it is also necessary to verify the scenarios between these special boundary points. By randomly generating, not only can the corresponding scenarios be verified, but also it can be made closer to the real scenario.

[0043] In one embodiment, in S300, it further includes a step of randomly generating the z-axis component:

[0044] S310, determine the random range of the z-axis component according to the dir.z Vi and dir.z Ci . The random range of the z-axis component includes: (0, dir.z Vi ), (dir.z Vi , dir.z Ci ), and (dir.z Ci , +∞).

[0045] S320, randomly generate the z-axis component within each random range of the z-axis component respectively.

[0046] In one embodiment, randomly generate K(j) z-axis components within each random range of the z-axis component. The value range of K(j) is an integer greater than or equal to 1. That is, at least one z-axis component is randomly generated within each random range, so that each corresponding type of scenario can be verified by at least one z-axis component within each random range, making the verification more sufficient. Prevent the random results from concentrating in one or several scenarios, resulting in uneven verification or inability to verify.

[0047] In one embodiment, when the initial intersection point is not a vertex and a tangent point, the step of obtaining the coordinates of the initial intersection point includes:

[0048] S330, according to the similarity principle of the triangle QPO composed of the initial intersection point Q, the center point P, and the light emission point O and the triangle composed of the direction vector of the emission direction, the initial intersection point Q satisfies: dir.z Q / dir.x Q = L PO / L PQ , where L PQ is the length from the center point P to the initial intersection point Q, and dir.x Q = cost, and t is the angle between PQ and the x-axis.

[0049] S340, configure the initial included angle of the said t as 0°, obtaining L PQ .

[0050] S350, according to the said L PQ obtain the said initial intersection point (x p + L PQ , y p , z p ), where (x p , y p , z p ) are the coordinates of the said center point P.

[0051] As an example, the polygon is a rhombus, and the polygon is perpendicular to the z-axis in the three-dimensional coordinate system. One diagonal of the rhombus is parallel to the x-axis, and the other diagonal is parallel to the y-axis. This can not only fully verify all scenarios but also reduce the computational complexity. Please refer to Figure 2 , use a cube to assist in understanding the relationship between each coordinate point in the three-dimensional coordinate system. Among them, there is a rhombus formed by four vertices V0, V1, V2, and V3 inside the cube; the rhombus is divided into triangles T0, T1, T2, and T3 with the center point P as the common vertex by two diagonals, where T0 is △V0PV1, T1 is △V1PV2, T2 is △V2PV3, and T3 is △V3PV0. The projection of the light emission point O on the polygon plane is exactly P, that is, the light emission point O is perpendicular to the polygon plane. The intersection point of the light emitted by the light emission point O and the plane where the rhombus is located is Q. Therefore, △OPQ is a right triangle. △OPQ is similar to the triangle formed by the direction vector of the emission direction of the light emission point O. Therefore, when the intersection point of the light emitted by the light emission point O and the polygon plane is the vertex V3, △OPV3 is a right triangle. According to the principle of triangle similarity, there is dir.z V3 / dir.x V3 = L PO / L PV3 , where dir.x V3 = cost, t = 0°, dir.z V3 = L PO / L PV3 , L PO and L PV3 are both known, obtaining dir.z V3 . When the initial intersection point is V3, the coordinates of the initial intersection point are the coordinates of V3. When the initial intersection point is not a vertex or a tangent point, it is obtained through the formula satisfied by the initial intersection point.

[0052] For each initial intersection point of the z-axis component and the polygon plane, rotate it around the center point P on the polygon plane for one full circle and sample the corresponding scan points, obtaining the x-axis component and y-axis component of the direction vector of the light emission direction from the light emission point O to each scan point, and obtaining a light emission direction sequence composed of the x-axis component, z-axis component, and y-axis component.

[0053] In one implementation, in S400, the sampling method is equal-angle sampling. In one implementation, for the purpose of achieving full verification, the sampling frequency is once every 1 / 100 degree of rotation.

[0054] In one implementation, the x-axis component dir.x satisfies: dir.x = cost; the y-axis component dir.y satisfies: dir.y = sint, where t is the angle between the intersection point and the positive x-axis direction in the polygon plane.

[0055] It should be noted that each z-axis component corresponds to multiple sets of x-axis components and y-axis components corresponding to the scanned points sampled during one full rotation, that is, each z-axis component corresponds to a light emission direction sequence.

[0056] S500, generate an excitation signal for the verification boundary intersection from the light emission point O and the light emission direction sequence.

[0057] Among them, the excitation signal is an input signal that drives or triggers the ray tracing module to generate an intersection result.

[0058] In one implementation, the excitation signal includes multiple groups of sub-excitations, where each group of sub-excitations includes multiple sub-excitations and each sub-excitation includes the coordinates of the light emission point O and the excitation of a light emission direction. The number of sub-excitation groups is equal to the number of randomly obtained z-axis components, and the number of sub-excitations in each group is equal to the number of emission directions.

[0059] In one implementation, this excitation signal is used to input into the ray tracing module, and the ray tracing module combines the vertex coordinates of the N triangles saved in the read memory to verify the boundary intersection. It should be noted that the intersection result of the ray tracing module is compared with the corresponding expected result respectively. If the two are the same, the verification passes; if there are differences between the two, the verification fails. In one implementation, the expected result is the intersection result of Cmodel.

[0060] Among them, the verification of the boundary intersection is through a deterministic boundary attribution rule (Top-Left) to avoid the same pixel being repeatedly calculated by multiple adjacent primitives.

[0061] In summary, the present invention provides a method for obtaining an excitation for verifying a boundary intersection point. By means of a preset polygon plane and an emission point, a random range is determined through the vertices of the polygon and the tangent points corresponding to the inscribed circle, and a corresponding z-axis component is randomly generated according to the random range; for each z-axis component, the intersection point is rotated on the polygon plane and the corresponding x-axis and y-axis components are obtained, resulting in a sequence of light emission directions composed of the x-axis component, the y-axis component, and the z-axis component, and further obtaining an excitation signal for verifying the boundary intersection point. The preset polygon plane can not only cover the scenarios of collinear points (P) and collinear lines (common edges), but also cover scenarios in different directions, and can also cover the cases from the rotation angle to whether the triangles intersect. The verification is more sufficient. At the same time, due to the design of the scenario, it can not only comprehensively cover all scenarios, but also reduce the verification complexity and the calculation complexity.

[0062] An embodiment of the present invention further provides a non-transitory computer-readable storage medium, which can be disposed in an electronic device to store at least one instruction or at least one program segment related to a method for implementing a method in the method embodiment. The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the method provided in the above embodiment.

[0063] An embodiment of the present invention further provides an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0064] An embodiment of the present invention further provides a computer program product, which includes program code. When the program product runs on an electronic device, the program code is used to cause the electronic device to execute the steps in the methods according to various exemplary embodiments of the present invention described above in this specification.

[0065] Those skilled in the art can clearly understand that, for the sake of convenience and conciseness of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.

[0066] Although some specific embodiments of the present invention have been described in detail by way of examples, those skilled in the art should understand that the above examples are only for illustration and not for limiting the scope of the present invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the present invention. The scope disclosed by the present invention is defined by the appended claims.

Claims

1. An excitation acquisition method for verifying boundary intersection points, characterized in that, The method includes the following steps: S100. Obtain a preset polygon and a light emission point O. The polygon is divided into N triangles with a central point P as a common vertex. The projection of the light emission point O on the polygon is the central point P. S200, when the intersection point of the light emission point O and the polygon plane is a vertex V of the i-th triangle i obtain the z-axis component dir.z of the current emission direction Vi , where the V i is different from the center point P; When the intersection point of the light emission point O and the polygon plane is the tangent point C of the inscribed circle of the polygon on the i-th triangle i obtain the z-axis component dir.z of the current emission direction Ci ; S300. Randomly generate the z-axis component of the direction vector of the light emitted from the light emission point O; respectively obtain the initial intersection points of each z-axis component with the polygon plane. Wherein, the polygon plane is perpendicular to the z-axis in the three-dimensional coordinate system, the polygon plane includes N triangles with a central point P as a common vertex, and the projection of the light emission point O on the polygon is the central point P. S400. For each initial intersection point of the z-axis component with the polygon plane, rotate it around the central point P by one week on the polygon plane and sample corresponding scan points to obtain the x-axis component and y-axis component of the direction vector of the light emission direction from the light emission point O to each scan point, and obtain a light emission direction sequence composed of the x-axis component, y-axis component and z-axis component. S500. Generate an excitation signal for verifying the boundary intersection points from the light emission point O and the light emission direction sequence.

2. The method according to claim 1, characterized in that, In S200, the obtaining step of the dir.z Vi includes: S210, obtain the length L between the center point P and the V i PVi ;​ S220, obtain the length L between the light emission point O and the center point P PO ; S230, according to △V i Obtain the dir.z according to the similarity principle of the triangle formed by PO and the direction vector of the emission direction Vi , the dir.z Vi satisfies: dir.z Vi / dir.x Vi =L PO / L PVi , where dir.x Vi =cost, and t is the angle between PV i and the x-axis.

3. The method according to claim 1, wherein In S200, the obtaining step of the dir.z Ci includes: S240, obtain the length L between the center point P and the tangent point C i PCi ;​ S250, obtain the length L between the light emission point O and the center point P PO ; S260, obtain the dir.z according to the similarity principle of the triangle formed by △C i PO and the direction vector of the emission direction Ci , the dir.z Ci satisfies: dir.z Ci / dir.x Ci =L PO / L PCi , where dir.x Ci =cost, and t is the angle between PC i and the x-axis.

4. The method according to claim 1, characterized in that In S300, it further includes a step of randomly generating the z-axis component: S310, determine the random range of the z-axis component according to the said dir.z Vi and dir.z Ci to determine the random range of the z-axis component, the random range of the z-axis component including: (0, dir.z Vi ), (dir.z Vi , dir.z Ci ), and (dir.z Ci , +∞); S320. Randomly generate the z-axis component within the random range of each z-axis component.

5. The method according to claim 4, wherein Randomly generate at least one z-axis component within the random range of each z-axis component.

6. The method according to claim 1, wherein In S300, when the initial intersection point is not a vertex or a tangent point, the step of obtaining the coordinates of the initial intersection point includes: S330. According to the similarity principle of the triangle QPO formed by the initial intersection point Q, the center point P, and the light emission point O and the triangle formed by the direction vector of the emission direction, the initial intersection point Q satisfies: dir.z Q / dir.x Q =L PO / L PQ , where L PQ is the length from the center point P to the initial intersection point Q, dir.x Q =cost, t is the angle between PQ and the x-axis; L PO is the length between the light emission point O and P; S340, configure the initial included angle of the said t as 0°, obtaining L PQ ; S350, according to the said L PQ obtain the said initial intersection point (x p +L PQ , y p , z p )), where (x p , y p , z p ) are the coordinates of the said center point P.

7. The method according to claim 1, characterized in that, In S400, the sampling method is equal-angle sampling.

8. The method according to claim 1, wherein In S400, the x-axis component dir.x satisfies: dir.x = cost; the y-axis component dir.y satisfies: dir.y = sint, where t is the angle between the intersection point and the x-axis in the polygon plane.

9. A non-transitory computer-readable storage medium storing at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by a processor to implement the method according to any one of claims 1-8.

10. An electronic device, characterized in that, It includes a processor and the non-transitory computer-readable storage medium described in claim 9.

Citation Information

Patent Citations

  • Ray tracing acceleration algorithm applied to tunnel environment

    CN104112293A

  • Light ray tracing method, light ray tracing device, electronic equipment and storage medium

    CN116912392A