Hi guys, I have a question:
how can I speed up render of 1800 polygon regions, containing 6000 vertices? Currently I’m using frustum culling, and polygon regions are stored in quad tree, so I’m querying polygons from quad tree in viewbox.
I’m not fully into OpenGL, I heard something about VBO and caching objects in GPU memory, but don’t know where to start and how to use this for my purposes. Can anyone teach me?
Render loop for Textured Polygons (it’s my wrapper for PolygonRegion with AABB) looks like that:
getTexturedPolygons().execute(qTreeBox, new QuadTree.Executor<TexturedPolygon>() {
@Override
// for each TexturedPolygon in viewbox
public void execute(double x, double y, TexturedPolygon texturedPolygon) {
if (camera.frustum.boundsInFrustum(texturedPolygon.getAABB())) {
polygonSpriteBatch.draw(texturedPolygon.getPolygonRegion(), 0, 0);
}
}
});
The result is textured terrain. Here are bounds of each triangle: