This is an algorithm to decrease the amount of triangles being rendered for voxel engines, this is a 2D version
Triangle Filler by The Log Father All other code by me Learned about greedy mesh from this video: https://youtu.be/qnGoGq7DWMc?si=6FSdch-e61zqOrfJ