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

experimental
shadowislord 11 years ago
parent 948fdb21eb
commit c925104f5e
  1. 16
      jme3-core/src/main/java/com/jme3/renderer/Statistics.java
  2. 2
      jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglRenderer.java

@ -120,15 +120,21 @@ public class Statistics {
/**
* 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 )
return;
numObjects ++;
numTriangles += mesh.getTriangleCount(lod);
numVertices += mesh.getVertexCount();
numObjects += count;
numTriangles += mesh.getTriangleCount(lod) * count;
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);
}
/**

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

Loading…
Cancel
Save