WebXR: Triangle count info seems doubled

Hi,

I use WebGLRenderer’s info object to check the triangle count in my application.

In the normal browser mode, the triangle count seems as expected and everything is fine.

Although, when I switch to the VR mode everything seems doubled. Triangle count, draw calls, geometries, etc.

Is this the right behaviour? Is this happening because the GPU has to render the same scene into every lens (i.e Left lens and right lens at the same time)?

Or is this an issue in my code/bug in the library?

Any information regarding this will be appreciated.

Thanks
Srinivas

Yes, the scene has to be rendered twice for each sub camera representing the left and right eye.

However, only renderer.info.render should be affected by this. Not renderer.info.memory.

1 Like

@Mugen87,

So do you mean to say that the geometries/textures count should remain constant in both Browser/WebXR mode ? :slight_smile:

Regards,
Srinivas

It would be confusing if this is not the case.

Well it does seem to double the geometries/textures in my case. Just tested a minute back :confused:

I can’t image how this can happen. E.g. memory.geometries is only increased when the renderer encounters a geometry for the first time. That is not true when rendering in XR with multiple sub cameras.

1 Like

When I use this example (On Rift S), the behaviour is similar to what you mentioned above. The geometry and texture count remains the same. (three.js v r112)
https://pacific-globeflower.glitch.me/fixed.html

Although, when I am testing my application on a latest version of three.js (r127) where the geometry/texture count does not remain the same. Likely a bug in the library or something in my code?

Like I said before, I can’t image how this could happen in three.js.

If the official WebXR examples have wrong stats, I suggest you file a bug at GitHub.

1 Like

Ok if its the case, I shall do that :slight_smile: Can you point me to an official three.js VR example which has inbuilt stats ? :slight_smile: I could not find one at the moment.

Not sure what you mean by “inbuilt”. You can debug renderer.info in all three.js applications. It’s best to set a break point in the animation loop.

The three.js dev tools also output the stats from renderer.info.

1 Like