Statistics from WebGLRenderer.info do not give the same numbers when used with autoReset=false.
To reproduce:
create renderer with shadowMap.enabled=true
set renderer.info.autoReset = false;
before the call to renderer.render, call renderer.info.reset();
What I noticed:
Numbers are much higher:
triangles are trippled
calls are quadrupled
In the source code of WebGLRenderer, when autoReset is true, the info.reset() call happens after a call to shadowMap.render().
My assumption is that the shadowMap.render generates values in the info object, which are then reset, and then the real render call happens.
When autoReset is false, the manual reset is obviously not occuring at the same place, hence the difference.
With autoReset = false, If I disable renderer shadowMap, the number of triangles and calls match exactly.
My concern:
I use this info to keep track of the number of calls and triangles mainly for optimisation. Very usefull. After adding a module that uses the EffectComposer, the renderrer.info values were not the same. From the Three.js docs, setting info.autoReset to false and calling info.reset manually is the solution, which I believe is not quite right.
My questions:
Am I doing something wrong ?
Is the info.reset in the WebGLRenderer source code doing the right thing ?
Should the numbers from the shadowMap.render call be considered ?
If I move the line specified just after the frame++, it does fix the issue for me. This seems to be a long time ‘bug’ that went undetected. Unless not many people use shadow maps.