Fix TiledPolygonRenderer and polygon on terrain algorithm