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


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

| improve this answer | |
  • $\begingroup$ Thanks, but the blog post doesn't explain perspective clipping. $\endgroup$ – chaosink Dec 29 '17 at 18:26
  • $\begingroup$ I think it does. What is perspective clipping for you? $\endgroup$ – Mauricio Cele Lopez Belon Dec 29 '17 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.