4

In the following two graphs,

  • the red lines are borders of the perspective-projection frustum,
  • the blue lines are to be rasterized,
  • the green lines are perspective-projection lines, which are wrong.

How do modern GPU pipelines do such clipping given only a perspective-projection matrix?

enter image description here

enter image description here

chaosink
  • 561
  • 1
  • 3
  • 13

1 Answers1

2

3D clipping is usually done in clipspace coordinates, that means the perspective matrix is used for sending the primitives to clipspace before doing the actual perspective projection. You can visualize the clipspace as a view frustum but with the shape of a box. So it is very fast to clip primitives against a AABB. The math is a little involved, but is all explained in this blog post:

Calculating the gluPerspective matrix and other OpenGL matrix maths | Unspecified Behaviour Blog