Search

US-12620161-B2 - Ray tracing using compressed ray data representation for a ray having three direction components and three position components

US12620161B2US 12620161 B2US12620161 B2US 12620161B2US-12620161-B2

Abstract

A computer implemented method converts ray data for a ray into a ray representative, wherein the ray representative is a compressed representation of the ray data, and wherein the ray data comprises three direction components and three position components for the ray. The method comprises identifying which of the three direction components of the ray data has the greatest magnitude, and defining the axis of the identified direction component as the major axis of the ray. The method further comprises determining a translated position on the ray at which the position component along the major axis is zero, and rescaling the three direction components of the ray so that the magnitude of the direction component along the major axis is one. The ray representative comprises: (i) the two position components of the translated position along the axes which are not the major axis, and (ii) the two rescaled direction components along the axes which are not the major axis.

Inventors

  • Peter Smith-Lacey
  • Simon Fenney

Assignees

  • IMAGINATION TECHNOLOGIES LIMITED

Dates

Publication Date
20260505
Application Date
20230926
Priority Date
20220927

Claims (19)

  1. 1 . A computer implemented method for converting ray data for a ray into a ray representative, wherein the ray representative is a compressed representation of the ray data, and wherein the ray data comprises three direction components and three position components for the ray, the method comprising: identifying which of the three direction components of the ray data has the greatest magnitude, and defining the axis of the identified direction component as the major axis of the ray; determining a translated position on the ray at which the position component along the major axis is zero; and rescaling the three direction components of the ray so that the magnitude of the direction component along the major axis is one; wherein the ray representative comprises: (i) the two position components of the translated position along the axes which are not the major axis, and (ii) the two rescaled direction components along the axes which are not the major axis; the method further comprising converting the ray representative into a quantised ray identifier by generating a data packet for the ray representative that includes data that indicates the major axis of the ray, the two position components of the translated position and the two rescaled direction components; and wherein the quantised ray identifier is used to obtain data to perform ray intersection testing for rendering an image of a scene.
  2. 2 . The method of claim 1 , wherein the ray representative comprises exactly two direction components and exactly two position components.
  3. 3 . The method of claim 1 , wherein the ray representative further comprises an indication of the major axis.
  4. 4 . The method of claim 3 , wherein the indication of the major axis comprises two bits.
  5. 5 . The method of claim 1 , wherein the ray data further comprises a minimum distance component and a maximum distance component, and the method further comprises rescaling the minimum and maximum distance components based on the translated position and on the rescaling of the three direction components of the ray.
  6. 6 . The method of claim 1 , wherein the rescaling of the three direction components of the ray is such that the value of the direction component along the major axis is plus one.
  7. 7 . The method of claim 1 , wherein the quantised ray identifier has a fixed bit-width.
  8. 8 . The method of claim 1 , wherein the data in the data packet for the quantised ray identifier comprises no more than three bits to indicate each of said two rescaled direction components along the axes which are not the major axis.
  9. 9 . The method of claim 1 , wherein the data in the data packet for the quantised ray identifier comprises no more than five bits to indicate each of said two position components of the translated position along the axes which are not the major axis.
  10. 10 . The method of claim 1 , wherein the quantised ray identifier identifies a set of rays, each ray of the set of rays comprising similar position and direction components.
  11. 11 . The method of claim 1 , further comprising generating a hash of the quantised ray identifier to represent the ray representative.
  12. 12 . The method of claim 11 , wherein generating the hash comprises performing logical XOR operations on the bits of the quantised ray identifier to reduce the number of bits of the quantised ray identifier.
  13. 13 . The method of claim 11 , wherein the hash comprises eight bits.
  14. 14 . The method of claim 1 , wherein the ray representative is used to store an indication of the ray in a cache, the cache being used to store data for intersection testing that is used by the ray tracing system to render an image of a scene.
  15. 15 . A computer system for converting ray data for a ray into a ray representative, wherein the ray representative is a compressed representation of the ray data, wherein the ray data comprises three direction components and three position components for the ray, the computer system comprising processing logic configured to: identify which of the three direction components of the ray data has the greatest magnitude, and define the axis of the identified direction component as the major axis of the ray; determine a translated position on the ray at which the position component along the major axis is zero; and rescale the three direction components of the ray so that the magnitude of the direction component along the major axis is one; wherein the ray representative comprises: (i) the two position components of the translated position along the axes which are not the major axis, and (ii) the two rescaled direction components along the axes which are not the major axis; and the processing logic being further configured to convert the ray representative into a quantised ray identifier by generating a data packet for the ray representative that includes data that indicates the major axis of the ray, the two position components of the translated position and the two rescaled direction components; wherein the quantised ray identifier is used to obtain data to perform ray intersection testing for rendering an image of a scene.
  16. 16 . The computer system of claim 15 , wherein the ray representative comprises exactly two direction components and exactly two position components.
  17. 17 . The computer system of claim 15 , wherein the ray representative further comprises an indication of the major axis.
  18. 18 . The computer system of claim 15 , wherein the computer system is a ray tracing system.
  19. 19 . A non-transitory computer readable storage medium having stored thereon an integrated circuit definition dataset that, when processed in an integrated circuit manufacturing system, configures the integrated circuit manufacturing system to manufacture a computer system for converting ray data for a ray into a ray representative, wherein the ray representative is a compressed representation of the ray data, wherein the ray data comprises three direction components and three position components for the ray, the computer system comprising processing logic configured to: identify which of the three direction components of the ray data has the greatest magnitude, and define the axis of the identified direction component as the major axis of the ray; determine a translated position on the ray at which the position component along the major axis is zero; and rescale the three direction components of the ray so that the magnitude of the direction component along the major axis is one; wherein the ray representative comprises: (i) the two position components of the translated position along the axes which are not the major axis, and (ii) the two rescaled direction components along the axes which are not the major axis; the processing logic being further configured to convert the ray representative into a quantised ray identifier by generating a data packet for the ray representative that includes data that indicates the major axis of the ray, the two position components of the translated position and the two rescaled direction components; and wherein the quantised ray identifier is used to obtain data to perform ray intersection testing for rendering an image of a scene.

Description

CROSS-REFERENCE TO RELATED APPLICATIONS AND CLAIM OF PRIORITY This application claims foreign priority under 35 U.S.C. 119 from United Kingdom patent application Nos. GB 2214122.0 and GB 2214124.6, both filed on 27 Sep. 2022, which are herein incorporated by reference in their entirety. BACKGROUND Ray tracing is a computational rendering technique for generating an image of a scene by tracing paths of light usually from the viewpoint of a camera through the scene. The paths of light that are traced through the scene are referred to as rays. Each ray to be traced is modelled as originating from a viewpoint of the scene and passes through a pixel into the scene. As a ray traverses the scene it may intersect objects within the scene. The interaction between a ray and an object it intersects can be modelled to create realistic visual effects. For example, in response to determining an intersection of a ray with an object, a shader program may be executed in respect of the intersection. The shader program is a portion of computer code. A programmer can write the shader program to define how the system reacts to the intersection which may, for example cause one or more secondary rays to be emitted into the scene. Alternatively, the shader program could cause one or more rays to be emitted into the scene for the purposes of determining whether the object is in shadow at the intersection point. Rendering an image of a scene using ray tracing may involve a large number of intersection tests. In real-life ray tracing systems, billions of intersection tests may be performed to render a single image of a scene. In order to reduce the number of intersection tests that need to be performed, ray tracing systems can generate acceleration structures. An acceleration structure comprises a number of nodes, with each node representing a region (e.g., volume) within the scene. Acceleration structures are often hierarchical, forming a tree-like structure, such that they include multiple levels of nodes. The nodes near the top of the acceleration structure represent relatively large regions in the scene. For example, the root node of the acceleration structure may represent the whole scene. Nodes near the bottom of the acceleration structure represent relatively small regions in the scene. Leaf nodes of the acceleration structure represent regions that at least partially bound one or more primitives (e.g., triangles) in the scene, and comprise pointers to their bounded primitives. Intersection testing is traditionally performed for a ray using the acceleration structure by first testing the ray for intersection with the root node of the acceleration structure. If the ray is found to intersect a parent node, such as the root node, testing can then proceed to the child nodes of that parent. In contrast, if the ray is found not to intersect a parent node, intersection testing of the child nodes of that parent node can be avoided, minimising computational intensity. If a ray is found to intersect a leaf node, then it can be tested against the objects within the region represented by the leaf node to thereby determine which object(s) the ray intersects with. The objects may be represented using primitives. A primitive denotes a unit of geometry in the system. Ray tracing operations are typically highly computationally intensive. The intensive nature of these operations means that there is a desire to increase the speed of, or decrease latency associated with, these operations. Further improvements that can be made to ray tracing technologies include a decrease in the hardware area required to perform the processing operations. SUMMARY This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. There is provided a computer implemented method for converting ray data for a ray into a ray representative, wherein the ray representative is a compressed representation of the ray data, and wherein the ray data comprises three direction components and three position components for the ray, the method comprising: identifying which of the three direction components of the ray data has the greatest magnitude, and defining the axis of the identified direction component as the major axis of the ray;determining a translated position on the ray at which the position component along the major axis is zero; andrescaling the three direction components of the ray so that the magnitude of the direction component along the major axis is one;wherein the ray representative comprises: (i) the two position components of the translated position along the axes which are not the major axis, and (ii) the two rescaled direction components along the axes which are not the major axis. The ray represe