* Ensure the statistics properly represent number of objects / triangles / vertices rendered when using instancing
This commit is contained in:
parent
948fdb21eb
commit
c925104f5e
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user