Render.info of EffectComposer, show no real values

Hi people!

I’m using an EffectComposer and loading an kinda complex GLTF model and I’m trying to get the renderer.info.render of my scene but aren’t showing me real values after model load.

Rendering through the Composer, console.log(renderer.info.render) prints always:
{frame: XX, calls: 1, triangles: 2, points: 0, lines: 0}
I’ve also tried console.log(composer.renderer.info.render) but gets the same result

but when render through the Renderer the same command prints:
before load {frame: 45, calls: 2, triangles: 2, points: 0, lines: 24}
after {frame: 46, calls: 193, triangles: 46850, points: 0, lines: 24}

I’m printing it in my animate function. Any solution guys?

That not may be the case here, but just fyi - if you console log an object, you actually log that objects reference. When you view / expand the logs, you may sometimes see the latest available state of that object - not the state at which it was logged (esp. this may happen if you log something 60 times per second, devtools will keep the value occluded until you decide to expand it.)

Try logging particular values that aren’t objects (renderer.info.frame etc.), or create a deep clone before logging (if possible):

console.info(JSON.parse(JSON.stringify(renderer.info)));

From the documentation: three.js docs

By default these data are reset at each render call but when having multiple render passes per frame (e.g. when using post processing) it can be preferred to reset with a custom pattern. First, set autoReset to false .

renderer.info.autoReset = false;

Call reset() whenever you have finished to render a single frame.

renderer.info.reset();
2 Likes