* Ensure the statistics properly represent number of objects / triangles / vertices rendered when using instancing

This commit is contained in:
shadowislord 2014-06-05 22:37:00 -04:00
parent 948fdb21eb
commit c925104f5e
2 changed files with 12 additions and 6 deletions

View File

@ -120,15 +120,21 @@ public class Statistics {
/** /**
* Called by the Renderer when a mesh has been drawn. * Called by the Renderer when a mesh has been drawn.
*
*/ */
public void onMeshDrawn(Mesh mesh, int lod){ public void onMeshDrawn(Mesh mesh, int lod, int count){
if( !enabled ) if( !enabled )
return; return;
numObjects ++; numObjects += count;
numTriangles += mesh.getTriangleCount(lod); numTriangles += mesh.getTriangleCount(lod) * count;
numVertices += mesh.getVertexCount(); numVertices += mesh.getVertexCount() * count;
}
/**
* Called by the Renderer when a mesh has been drawn.
*/
public void onMeshDrawn(Mesh mesh, int lod){
onMeshDrawn(mesh, lod, 1);
} }
/** /**

View File

@ -2545,7 +2545,7 @@ public class LwjglRenderer implements Renderer {
context.lineWidth = mesh.getLineWidth(); context.lineWidth = mesh.getLineWidth();
} }
statistics.onMeshDrawn(mesh, lod); statistics.onMeshDrawn(mesh, lod, count);
// if (GLContext.getCapabilities().GL_ARB_vertex_array_object){ // if (GLContext.getCapabilities().GL_ARB_vertex_array_object){
// renderMeshVertexArray(mesh, lod, count); // renderMeshVertexArray(mesh, lod, count);
// }else{ // }else{