How is clipping performed in hardware?

51mon

Newcomer
Hi
I recently had to perform clipping in software, when I realized that this task which I usually take for granted is not so trivial. So this made me curious, how is it done in hardware? What algorithm is used?

What puzzled me the most is how to clip against the near plane in proj-coord space?

Thanks
 
What puzzled me the most is how to clip against the near plane in proj-coord space?
Thanks
Apply your 4x4 projection matrix but keep your points in homogeneous coordinates i.e. keep [X, Y, Z, W]. You can then clip against a near plane of, say, W=1. Only after that is done do you perform the division by W to compute the screen coordinates.

As for how it is done in hardware, well, there are several solutions including actually clipping the geometry or rendering in homogeneous coordinates and rejecting pixels.
 
Apply your 4x4 projection matrix but keep your points in homogeneous coordinates i.e. keep [X, Y, Z, W]. You can then clip against a near plane of, say, W=1. Only after that is done do you perform the division by W to compute the screen coordinates.

Thanks that worked just fine :)
 
Back
Top