In this and the previous cases, the rasterization problem starts after the projection stage, so there can be cases where triangles overlap each other.
How do we handle the overlaps? do we do the containment checks for all triangles or are the occluded triangles ignored during projection itself?
tarangs
I guess the transparency could be one of the factors that decide this, assuming the triangles are opaque, could we save the computation if we eliminate occluded parts before rasterization?
keenan
@tarangs We'll talk about how to handle occlusion in a later lecture; the de facto solution in modern rasterization pipelines is to use a so-called "depth buffer", but there are other solutions that work in special situations (such as drawing primitives in sorted order, which as you point out is important when primitives are partially transparent).
CMUScottie
How to check whether a rectangle intersects with the triangle? I guess one way is to check whether the four points of the rectangle are all inside/outside the triangle. If yes -> no intersection, if not -> there is intersection.
shengx
I think to be precise about rectangle-triangle collision we have to check if any of these 3 conditions hold:
1. At least one vertex of the triangle is contained in the rectangle.
2. At least one vertex of the rectangle is contained in the triangle.
3. Any triangle edge intersects any rectangle edge.
Step 1 is trivial, step 2 is line side test like discussed in earlier slides, step 3 is also easy since the rectangle edges are axis-aligned. I guess we can also add optimizations that can trim out rectangle-triangle pairs that cannot possibly intersect prior to doing these checks.
eryn
I think Sutherland–Hodgman algorithm could work for detecting collision between any two convex polygons.
clam
On the topic of modern hardware: I'm interested in finding out where a lot of the graphics perf breakthroughs come from. i.e. Since all this stuff is embarassingly parallel (that's a real term apparently), what proportion of effort in / result out are manufacturers getting out of trying new methods vs 'moar core'.
In this and the previous cases, the rasterization problem starts after the projection stage, so there can be cases where triangles overlap each other. How do we handle the overlaps? do we do the containment checks for all triangles or are the occluded triangles ignored during projection itself?
I guess the transparency could be one of the factors that decide this, assuming the triangles are opaque, could we save the computation if we eliminate occluded parts before rasterization?
@tarangs We'll talk about how to handle occlusion in a later lecture; the de facto solution in modern rasterization pipelines is to use a so-called "depth buffer", but there are other solutions that work in special situations (such as drawing primitives in sorted order, which as you point out is important when primitives are partially transparent).
How to check whether a rectangle intersects with the triangle? I guess one way is to check whether the four points of the rectangle are all inside/outside the triangle. If yes -> no intersection, if not -> there is intersection.
I think to be precise about rectangle-triangle collision we have to check if any of these 3 conditions hold: 1. At least one vertex of the triangle is contained in the rectangle. 2. At least one vertex of the rectangle is contained in the triangle. 3. Any triangle edge intersects any rectangle edge.
Step 1 is trivial, step 2 is line side test like discussed in earlier slides, step 3 is also easy since the rectangle edges are axis-aligned. I guess we can also add optimizations that can trim out rectangle-triangle pairs that cannot possibly intersect prior to doing these checks.
I think Sutherland–Hodgman algorithm could work for detecting collision between any two convex polygons.
On the topic of modern hardware: I'm interested in finding out where a lot of the graphics perf breakthroughs come from. i.e. Since all this stuff is embarassingly parallel (that's a real term apparently), what proportion of effort in / result out are manufacturers getting out of trying new methods vs 'moar core'.