Excitation obtaining method for verifying boundary intersection point, electronic equipment and storage medium

By using preset polygon planes and ray emission points in the ray tracing algorithm, the z-axis components are randomly generated and the intersection points are rotated to obtain the x-axis and y-axis components, and the excitation signal is generated to verify the intersection of the boundary, which solves the accuracy of the judgment of the belonging point between the boundary intersection of the ray and the complex geometry, and achieves more full verification and reduces the computational complexity.

CN120014142AActive Publication Date: 2025-05-16METAX INTEGRATED CIRCUITS (SHANGHAI) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the ray tracing algorithm, how to accurately determine the association between the intersection point between the ray and the boundary of complex geometric bodies, especially when the intersection point happens to be on the common boundary, there is a risk of inconsistent rendering results or errors.

Method used

Through the preset polygon plane and light emission point, the random range is determined using the tangent points corresponding to the vertices of the polygon and the intangible circle, and the z-axis components are randomly generated, and the intersection points are rotated on the polygon plane to obtain the x-axis and y-axis components, generating the excitation signal to verify the intersection point of the boundary.

Benefits of technology

This method can cover more scenarios, including co-points and collinear scenarios, and the verification is more sufficient, reducing verification complexity and computational complexity, ensuring the consistency and accuracy of rendering results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120014142A_ABST
    Figure CN120014142A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of chip design, in particular to an excitation obtaining method for verifying boundary intersection points, electronic equipment and a storage medium, a random range is determined through preset polygon planes and emission points and through tangent points corresponding to vertexes and inscribed circles of a polygon, and a corresponding z-axis component is randomly generated according to the random range; and for each z-axis component, rotating the intersection point on the polygonal plane and acquiring the corresponding x-axis and y-axis components to obtain a light emission direction sequence consisting of the x-axis component, the y-axis component and the z-axis component, thereby obtaining an excitation signal for verifying the boundary intersection point. According to the method, common-point and collinear scenes can be covered, scenes in different directions can also be covered, the situation that whether triangles intersect or not from the rotation angle can also be covered, and 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 in particular to an excitation acquisition method for verifying boundary intersections, an electronic device and a storage medium. Background Art

[0002] In computer graphics, ray tracing is a core rendering technology that aims to generate highly realistic images by simulating the interaction between light and objects in the scene. One of the core steps of ray tracing is the calculation of the intersection between light and geometric bodies, of which triangle mesh is the most commonly used geometric representation. In complex three-dimensional scenes, the boundaries of geometric bodies (such as the common edges of two triangles) are often the key areas where light interacts with the scene. Therefore, how to accurately determine the intersection of light and these boundaries has become an important issue in ray tracing algorithms.

[0003] In the process of ray tracing, when the ray intersects the boundary of two triangles with common edges, the intersection point may be located exactly on the common boundary. In this case, how to determine which triangle the intersection point belongs to is a problem that needs to be handled with caution. If handled improperly, it may lead to inconsistent or incorrect rendering results, such as repeated rendering or missing rendering. To solve this problem, the Top_Left algorithm is proposed as an attribution judgment method based on boundary conditions. The algorithm defines a deterministic rule to ensure that the intersection point belongs to a specific triangle when the boundary intersects, thereby avoiding the random attribution 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 locations, etc.) to verify 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 actual applications, complex geometric configurations and light paths may be encountered, which may result in theoretical analysis being unable to fully cover all practical 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, a verification method that can cover more scenarios is urgently needed. 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 an incentive for verifying a boundary intersection, the method comprising the following steps: S100, obtaining a preset polygon and a light emitting point O, wherein the polygon is divided into N triangles with a center point P as a common vertex; the projection of the light emitting point O on the polygon is the center point P.

[0006] S200, when the intersection of the light emitting point O and the polygonal plane is a vertex V of the i-th triangle i When , get the z-axis component dir.z of the current launch direction Vi , wherein V i Different from the center point P; when the intersection of the light emitting point O and the polygonal plane is the tangent point C of the inscribed circle of the polygon at the i-th triangle i When , get the z-axis component dir.z of the current launch direction Ci .

[0007] S300, randomly generate the z-axis component of the direction vector of the light emitted by the light emitting point O; obtain the initial intersection point of each z-axis component with the polygonal plane respectively; wherein the polygonal plane is perpendicular to the z-axis in the three-dimensional coordinate system, the polygonal plane includes N triangles with the center point P as a common vertex, and the projection of the light emitting point O on the polygon is the center point P.

[0008] S400, for each initial intersection point of the z-axis component and the polygonal plane, rotate it on the polygonal plane with the center point P as the center point and sample the corresponding scanning points, 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 of the scanning points, and obtain a light emission direction sequence composed of x-axis components, y-axis components and z-axis components.

[0009] S500, generating an excitation signal for verifying a boundary intersection by using the light emitting point O and the light emitting direction sequence.

[0010] 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 is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the above method.

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

[0012] The present invention has at least the following beneficial effects: The present invention provides an incentive acquisition method for verifying boundary intersections, which can not only cover scenes of common points (P) and common lines (common edges) through a preset polygonal plane, but also cover scenes in different directions through randomly generated z-axis components combined with rotating intersections on the polygonal plane, so that the verification is more complete. At the same time, due to the design of the scene, it can not only fully cover all scenes, but also reduce the verification complexity and calculation complexity. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 A flow chart of a boundary intersection attribution verification method based on a ray tracing module provided in an embodiment of the present invention; Figure 2 A schematic diagram of an implementation scenario provided for an embodiment of the present invention. DETAILED DESCRIPTION

[0015] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0016] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present invention have the same meanings as commonly understood by those skilled in the art.

[0017] See also Figure 1 , which shows a flow chart of a method for obtaining an excitation to verify a boundary intersection, the method comprising the following steps: S100, obtaining a preset polygon and a light emitting point O, wherein the polygon is divided into N triangles with a center point P as a common vertex; the projection of the light emitting point O on the polygon is the center point P.

[0018] The light emission point O is the emission starting point of the light in the ray tracing module, which is represented by coordinates in three-dimensional space. It is the reference point for light propagation. All light rays start from the light emission point O and propagate along a specific emission direction. It should be noted that the light emission point O is not within the polygonal plane.

[0019] Among them, the direction vector of the light is used to describe the propagation direction of the light. 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.

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

[0021] In one implementation, the vertex coordinates of the N triangles are stored in a memory.

[0022] S200, when the intersection of the light emitting point O and the polygonal plane is a vertex V of the i-th triangle i When , get the z-axis component dir.z of the current launch direction Vi , wherein V i Different from the center point P; when the intersection of the light emitting point O and the polygonal plane is the tangent point C of the inscribed circle of the polygon at the i-th triangle i When , get the z-axis component dir.z of the current launch direction Ci .

[0023] In one embodiment, the dir.z Vi The steps to obtain include: S210, obtaining the center point P and the V i The length between PVi ; S220, obtaining the length L between the light emitting point O and the center point P PO ; S230, according to △V i The dir.z is obtained by the similarity principle of the triangle composed of PO and the direction vector of the launch direction. Vi , the dir.z Vi Satisfies: dir.z Vi / dir.x Vi =L PO / L PVi , where dir.x Vi =cost, t is PV i The angle with the x-axis.

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

[0025] It should be noted that since the polygon and the light emission point O are preset values, LPO / L PVi The value of is known, so the dir.z is determined Vi .

[0026] In one embodiment, the dir.z Ci The steps to obtain include: S240, obtaining the center point P and the tangent point C i The length between PCi ; S250, obtaining the length L between the light emitting point O and the center point P PO ; S260, according to △C i The dir.z is obtained by the similarity principle of the triangle composed of PO and the direction vector of the launch direction. Ci , the dir.z Ci Satisfies: dir.z Ci / dir.x Ci =L PO / L PCi , where dir.x Ci =cost.

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

[0028] It should be noted that, similarly, since the polygon and the light emission point O are both preset values, L PO / L PCi The value of is known, so the dir.z is determined Ci .

[0029] It should be noted that dir.z Vi and dir.z Ci The acquisition can be performed simultaneously or sequentially. The acquisition steps can also be performed alternately. There is no restriction on the order of the acquisition steps.

[0030] S300, randomly generate the z-axis component of the direction vector of the light emitted by the light emitting point O; obtain the initial intersection point of each z-axis component with the polygonal plane respectively; wherein the polygonal plane is perpendicular to the z-axis in the three-dimensional coordinate system, the polygonal plane includes N triangles with P as a common vertex, and the projection of the light emitting point O on the polygon is the center point P.

[0031] It should be noted that the z-axis components of the initial intersection of each z-axis component and the polygonal plane are obtained separately, including dir.z Vi 、dir.z Ci and a randomly generated z-axis component.

[0032] It should be noted that in S200, only the z-axis components of special boundary points are obtained. In order to cover more scenes, it is also necessary to verify the scenes between these special boundary points. The random generation method can not only verify the corresponding scenes, but also make them closer to the real scenes.

[0033] In one implementation, S300 further includes a step of randomly generating a z-axis component: S310, according to the dir.z Vi and dir.z Ci Determine the random range of the z-axis component, the random range of the z-axis component includes: (0, dir.z Vi ), (dir.z Vi ,dir.z Ci ) and (dir.z Ci ,+∞).

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

[0035] In one implementation, K(j) z-axis components are randomly generated within the random range of each z-axis component, and 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 the corresponding type of scene can be verified through at least one z-axis component within each random range, making the verification more sufficient. This prevents random results from being concentrated in one or several scenes, resulting in uneven verification or failure to verify.

[0036] In one embodiment, 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 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.

[0037] S340, setting the initial angle of t to 0°, and obtaining L PQ .

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

[0039] 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. Figure 2 , a cube is used to help understand the relationship between coordinate points in a three-dimensional coordinate system. Inside the cube, there is a cube with four vertices V 0 、V 1 、V 2 and V 3 The rhombus is divided into triangles T0, T1, T2 and T3 with the center point P as the common vertex through two diagonal lines, where T0 is △V 0 PV 1 , T1 is △V 1 PV 2 , T2 is △V 2 PV 3 , T3 is △V 3 PV 0 , the projection of the light emitting point O in the polygonal plane is exactly P, that is, the light emitting point O is perpendicular to the polygonal plane, and the intersection of the light emitted by the light emitting point O and the plane where the rhombus is located is Q, so △OPQ is a right triangle. △OPQ is similar to the triangle formed by the direction vector of the radiation direction of the light emitting point O. Therefore, when the intersection of the light emitted by the light emitting point O and the polygonal plane is vertex V 3 When △OPV 3 is a right triangle. According to the triangle similarity principle, 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 All are known, get dir.z V3 When the initial intersection point is V 3 When the coordinates of the initial intersection point are V 3 When the initial intersection point is not a vertex or a tangent point, it is obtained by the formula satisfied by the initial intersection point.

[0040] S400, for each initial intersection point of the z-axis component and the polygonal plane, rotate it on the polygonal plane with the center point P as the center point and sample the corresponding scanning points, 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 of the scanning points, and obtain a light emission direction sequence composed of the x-axis component, the z-axis component and the y-axis component.

[0041] In one embodiment, in S400, the sampling method is equal-angle sampling. In one embodiment, in order to achieve the purpose of sufficient verification, the sampling frequency is once per rotation of 1 / 100 degree.

[0042] In one embodiment, 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 in the polygonal plane and the positive direction of the x-axis.

[0043] It should be noted that each z-axis component corresponds to multiple groups of x-axis components and y-axis components corresponding to corresponding scanning points sampled during one rotation, that is, each z-axis component corresponds to a sequence of light emission directions.

[0044] S500, generating an excitation signal for verifying a boundary intersection by using the light emitting point O and the light emitting direction sequence.

[0045] The excitation signal is an input signal that drives or triggers the ray tracing module to generate an intersection result.

[0046] In one embodiment, the excitation signal includes multiple groups of sub-excitations, wherein each group of sub-excitations includes multiple sub-excitations and each sub-excitation includes the coordinates of the light emission point O and an 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.

[0047] In one embodiment, the excitation signal is used to input a ray tracing module, and the ray tracing module verifies the boundary intersection in combination with the vertex coordinates of the N triangles stored in the memory. It should be noted that the intersection result of the ray tracing module is compared with the corresponding expected result. If the two are the same, the verification passes; if the two are different, the verification fails. In one embodiment, the expected result is the intersection result of Cmodel.

[0048] The verification of boundary intersections is done through a deterministic boundary attribution rule (Top-Left) to avoid repeated calculation of the same pixel by multiple adjacent primitives.

[0049] In summary, the present invention provides an excitation acquisition method for verifying boundary intersections, which uses a preset polygonal plane and an emission point, determines a random range through the tangent points corresponding to the vertices of the polygon and the inscribed circle, and randomly generates a corresponding z-axis component according to the random range; for each z-axis component, the intersection is rotated on the polygonal plane and the corresponding x-axis and y-axis components are obtained to obtain a sequence of light emission directions composed of x-axis components, y-axis components, and z-axis components, thereby obtaining an excitation signal for verifying boundary intersections. The preset polygonal plane can not only cover scenes of common points (P) and common lines (common edges), but also scenes in different directions, and can also cover situations from rotation angles to whether triangles intersect. The verification is more complete, and due to the design of the scene, it can not only fully cover all scenes, but also reduce the verification complexity and calculation complexity.

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

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

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

[0053] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0054] Although some specific embodiments of the present invention have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It should also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. A method for obtaining an incentive for verifying a boundary intersection, characterized in that: The method comprises the following steps: S100, obtaining a preset polygon and a light emitting point O, wherein the polygon is divided into N triangles with a center point P as a common vertex; The projection of the light emitting point O on the polygon is the center point P; S200, when the intersection of the light emitting point O and the polygonal plane is a vertex V of the i-th triangle i When , get the z-axis component dir.z of the current launch direction Vi , wherein V i Different from the central point P; When the intersection of the light emitting point O and the polygonal plane is the tangent point C of the inscribed circle of the polygon at the i-th triangle i When , get the z-axis component dir.z of the current launch direction Ci ; S300, randomly generating a z-axis component of a direction vector of a light ray emitted by a light emitting point O; respectively obtaining an initial intersection point of each z-axis component with a polygonal plane; wherein the polygonal plane is perpendicular to the z-axis in a three-dimensional coordinate system, the polygonal plane includes N triangles with a center point P as a common vertex, and the projection of the light emitting point O on the polygon is the center point P; S400, for each initial intersection point of the z-axis component and the polygonal plane, rotate it on the polygonal plane with the center point P as the center point and sample the corresponding scanning points, obtain the x-axis component and the y-axis component of the direction vector of the light emitting direction from the light emitting point O to each scanning point, and obtain a light emitting direction sequence composed of the x-axis component, the y-axis component and the z-axis component; S500, generating an excitation signal for verifying a boundary intersection by using the light emitting point O and the light emitting direction sequence.

2. The method according to claim 1, characterized in that: In S200, the dir.z Vi The steps to obtain include: S210, obtaining the center point P and the V i The length between PVi ; S220, obtaining the length L between the light emitting point O and the center point P PO ; S230, according to △V i The dir.z is obtained by the similarity principle of the triangle composed of PO and the direction vector of the launch direction. Vi , the dir.z Vi Satisfies: dir.z Vi / dir.x Vi =L PO / L PVi , where dir.x Vi =cost, t is PV i The angle with the x-axis.

3. The method according to claim 1, characterized in that: In S200, the dir.z Ci The steps to obtain include: S240, obtaining the center point P and the tangent point C i The length between PCi ; S250, obtaining the length L between the light emitting point O and the center point P PO ; S260, according to △C i The dir.z is obtained by the similarity principle of the triangle composed of PO and the direction vector of the launch direction. Ci , the dir.z Ci Satisfies: dir.z Ci / dir.x Ci =L PO / L PCi , where dir.x Ci =cost.

4. The method according to claim 1, characterized in that S300 also includes a random generation step of the z-axis component: S310, according to the dir.z Vi and dir.z Ci 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 z-axis components within the random range of each z-axis component.

5. The method according to claim 4, characterized in that K(j) z-axis components are randomly generated within a random range of each z-axis component, and the value range of K(j) is an integer greater than or equal to 1.

6. The method according to claim 1, characterized in that 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 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 x-axis; S340, setting the initial angle of t to 0°, and obtaining L PQ ; S350, according to the L PQ Get the initial intersection point (x p +L PQ ,y p ,z p ), where (x p ,y p ,z p ) are the coordinates of the center point P.

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

8. The method according to claim 1, characterized in that 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 in the polygonal plane and the x-axis.

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

10. An electronic device, characterized in that: The invention comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 9.

Citation Information

Patent Citations

  • Ray tracing acceleration algorithm applied to tunnel environment

    CN104112293A

  • Static scene ray tracing chessboard rendering method and system based on CPU and storage medium

    CN114049421A

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

    CN116912392A

  • Intersection testing in a ray tracing system

    EP4064200A2

  • Intersection testing in a ray tracing system

    GB202209880D0