CPC G06T 15/06 (2013.01) [G06T 15/005 (2013.01); G06T 2210/21 (2013.01)] | 20 Claims |
1. A method of performing intersection testing in a ray tracing system for a ray with respect to a plurality of convex polygons, wherein each of the convex polygons is defined by an ordered set of vertices, and wherein at least one of the vertices is a shared vertex which is used to define two or more of the convex polygons, the method comprising:
projecting the vertices of the convex polygons onto a pair of axes orthogonal to the ray direction, wherein the origin of the pair of axes corresponds with the ray origin; and
for each of the convex polygons:
for each edge of the convex polygon defined by two of the projected vertices, determining a signed parameter, wherein the sign of the signed parameter is indicative of which side of the edge the ray passes on, wherein the position of a first of the projected vertices vi defining the edge is defined with coordinates pi and qi along the respective axes of the pair of axes, and wherein a position of a second of the projected vertices vj defining the edge is defined with coordinates pj and qj along the respective axes of the pair of axes, wherein if the ray is determined to intersect a point on the edge then the sign of the signed parameter is determined using a module which is configured to:
take as inputs, indications which classify each of the pi, qi, pj and qj coordinates as negative, zero or positive, and
output, for valid combinations of classifications of the pi, qi, pj and qj coordinates, an indication of the sign of the signed parameter; and
determining whether the ray intersects the convex polygon based on the signs of the signed parameters determined for the edges of the convex polygon;
wherein for each of two or more of the convex polygons the ray is determined to intersect a point on an edge of that convex polygon.
|