Ray tracing using compressed ray data representation for a ray having three direction components and three position components
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.
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 . 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 , wherein the ray representative further comprises an indication of the major axis.
4 . The method of claim 3 , wherein the indication of the major axis comprises two bits.
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 . 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 . The method of claim 1 , wherein the quantised ray identifier has a fixed bit-width.
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 . 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 . 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 . The method of claim 1 , further comprising generating a hash of the quantised ray identifier to represent the ray representative.
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 . The method of claim 11 , wherein the hash comprises eight bits.
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 . 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 . The computer system of claim 15 , wherein the ray representative comprises exactly two direction components and exactly two position components.
17 . The computer system of claim 15 , wherein the ray representative further comprises an indication of the major axis.
18 . The computer system of claim 15 , wherein the computer system is a ray tracing system.
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.