Patent EP-4064203-A1 (EP)
Title: Intersection testing in a ray tracing system
Inventor: KING ROSTAM
IPC: G06T15/06
Filed: 2022-03-21
Abstract: A method and intersection testing module are provided in a ray tracing system for determining whether a ray intersects a 3D axis-aligned box. The box represents a volume defined by a front-facing plane and a back-facing plane for each of the dimensions, u, v and w, of the three-dimensional axis-aligned box, wherein b<sub>min,u</sub> is a constant u component value of the front-facing plane for the u dimension, b<sub>max,u</sub> is a constant u component value of the back-facing plane for the u dimension, b<sub>min,v</sub> is a constant v component value of the front-facing plane for the v dimension, b<sub>max,v</sub> is a constant v component value of the back-facing plane for the v dimension, b<sub>min,w</sub> is a constant w component value of the front-facing plane for the w dimension, and b<sub>max,w</sub> is a constant w component value of the back-facing plane for the w dimension. Scaled ray components ρ<sub>u</sub> and ρ<sub>v</sub> are determined, wherein ρu=DuDw and ρv=DvDw, and wherein a third scaled ray component ρw=DwDw=1. D<sub>w</sub> is the major component of the ray direction vector such that |D<sub>w</sub>| ≥ |D<sub>u</sub>| and |D<sub>w</sub>| ≥ |D<sub>v</sub>|. A scaled minimum culling distance, t<sub>min,scaled</sub>, is determined using a result of multiplying an unscaled minimum culling distance for the ray, t<sub>min,unscaled</sub>, by the magnitude of D<sub>w</sub>. A scaled maximum culling distance, t<sub>max,scaled</sub>, is determined using a result of multiplying an unscaled maximum culling distance for the ray, t<sub>max,unscaled</sub>, by the magnitude of D<sub>w</sub>. Cross-multiplication values of Aρ<sub>u</sub>b<sub>min,v</sub>, Aρ<sub>v</sub>b<sub>min,u</sub>, Aρ<sub>u</sub>b<sub>max,v</sub> and Aρ<sub>v</sub>b<sub>max,u</sub> are determined. A cross-multiplication value of one or both of: (i) Aρ<sub>u</sub>b<sub>min,w</sub> and (ii) Aρ<sub>v</sub>b<sub>min,w</sub> is determined. A cross-multiplication value of one or both of: (i) Aρ<sub>u</sub>b<sub>max,w</sub> and (ii) Aρ<sub>v</sub>b<sub>max,w</sub> is determined. The determined cross-multiplication values are used to: identify which of the front-facing planes intersects the ray furthest along the ray; and identify which of the back-facing planes intersects the ray least far along the ray. It is determined whether the ray intersects the identified front-facing plane of the box at a position that is no further along the ray than the position at which the ray intersects the identified back-facing plane. It is determined whether ρ_t<sub>max,scαled</sub> is no less than b_, wherein ρ_ = ρ<sub>u</sub> and b_ = b<sub>min,u</sub> if the front-facing plane for the u dimension is the identified front-facing plane, wherein ρ_ = p<sub>v</sub> and b_ = b<sub>min,v</sub> if the front-facing plane for the v dimension is the identified front-facing plane, and wherein ρ_ = ρ<sub>w</sub> = 1 and b_ = b<sub>min,w</sub> if the front-facing plane for the w dimension is the identified front-facing plane. It is determined whether ρ<sub>+</sub>t<sub>min,scaled</sub> is no greater than b<sub>+</sub>, wherein ρ<sub>+</sub> = ρ<sub>u</sub> and b<sub>+</sub> = b<sub>max,u</sub> if the back-facing plane for the u dimension is the identified back-facing plane, wherein ρ<sub>+</sub> = ρ<sub>v</sub> and b<sub>+</sub> = b<sub>max,v</sub> if the back-facing plane for the v dimension is the identified back-facing plane, and wherein ρ<sub>+</sub> = ρ<sub>w</sub> = 1 and b<sub>+</sub> = b<sub>max,w</sub> if the back-facing plane for the w dimension is the identified back-facing plane. It is determined that the ray intersects the box if all three of: (i) it is determined that the ray intersects the identified front-facing plane of the box at a position that is no further along the ray than the position at which the ray intersects the identified back-facing plane, (ii) it is determined that ρ_t<sub>max,scaled</sub> is no less than b_, and (iii) it is determined that p<sub>+</sub>t<sub>min,scaled</sub> is no greater than b<sub>+</sub>, otherwise it is determined that the ray misses the box.