OpenGL 4.4 pipeline - perspective division before clipping?

134 views Asked by At

I would like to consult with somebody about opengl 4.4 graphics processing pipeline diagram found in opengl insights, specifically about perspective division and primitive clipping order.

The diagram in opengl 4.4 for example, shows that perspective division comes BEFORE clipping (green part).

It is very strage, since there are very good reasons division should come AFTER clipping. Otherwise there would be problem when w=0 (which could be solved by an if statement though), as well as information about whether the point was in front or behind the camera. For example, point (0.5, 0, 0, -1) in clipping space becomes (-0.5, 0, 0) in NDC, and thus seems to be inside the cube ranging from (-1, 1) in all directions, so it wouldn't be clipped, which would be wrong.

I'm just wondering what am I seeing wrong in that pipeline diagram or is it really happening that way in opengl, and why?

1

There are 1 answers

0
Nicol Bolas On BEST ANSWER

The diagram is wrong; it's that simple. Note that the sections cited in the standard seem to go backwards if you follow the flowchart: 13.4, 13.6, 13.5. The standard doesn't usually put things like that out of order.