Search

EP-4345758-B1 - RAY TRACING

EP4345758B1EP 4345758 B1EP4345758 B1EP 4345758B1EP-4345758-B1

Inventors

  • SMITH-LACEY, Peter
  • FENNEY, SIMON

Dates

Publication Date
20260506
Application Date
20230926

Claims (14)

  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, 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.
  2. The method of claim 1, wherein the ray representative comprises exactly two direction components and exactly two position components.
  3. The method of claim 1 or claim 2, wherein the ray representative further comprises an indication of the major axis.
  4. The method of any preceding claim, 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.
  5. The method of any preceding claim, 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.
  6. The method of any preceding claim, 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.
  7. The method of any preceding claim, wherein the quantised ray identifier has a fixed bit-width.
  8. The method of claim 6 or claim 7, 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, and 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.
  9. The method of any of claims 6 to 8, wherein the quantised ray identifier identifies a set of rays, each ray of the set of rays comprising similar position and direction components.
  10. The method of any of claims 6 to 9, further comprising generating a hash of the quantised ray identifier to represent the ray representative by performing logical XOR operations on the bits of the quantised ray identifier to reduce the number of bits of the quantised ray identifier.
  11. 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, 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.
  12. The computer system of claim 11, wherein the computer system is a ray tracing system.
  13. Computer readable code configured to cause the method of any of claims 1 to 10 to be performed when the code is run.
  14. A 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 as claimed in claim 11 or claim 12.

Description

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. US 2019/236832 A1 relates to compressing ray direction data for a ray, e.g. into an octahedral vector format. The compressed ray direction data for a ray may be represented by two parameters (u,v) which indicate a point on the surface of an octahedron. In order to perform intersection testing on the ray, the ray direction data for the ray is unpacked to determine x, y and z components of a vector to a point on the surface of the octahedron. The unpacked ray direction vector is an unnormalised ray direction vector. Rather than normalising the ray direction vector, the intersection testing is performed on the unnormalised ray direction vector. US 2022/230380 A1 relates to a hardware-based traversal coprocessor which provides acceleration of tree traversal operations searching for intersections between primitives represented in a tree data structure and a ray. The primitives may include triangles used in generating a virtual scene. The hardware-based traversal coprocessor is configured to properly handle numerically challenging computations at or near edges and/or vertices of primitives and/or ensure that a single intersection is reported when a ray intersects a surface formed by primitives at or near edges and/or vertices of the primitives. SUMMARY 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 directi