Skip to content

New clipping algorithm

Luke Benstead requested to merge new-clipping into master

This PR introduces a new clipping algorithm that has the following properties:

  • It minimises copying. The input buffer is manipulated directly in a loop, triangles requiring clipping are removed and then newly generated clipped triangles are appended
  • It has minimal cost for vertices that don't require clipping. If none of your polys need clipping they are just skipped over.

There are still some outstanding issues with vertex winding. I'll fix those in another PR.

Merge request reports