Hi all,
On one computer InstancedMesh improves performance, on another it actually drags performance down.
I’m trying to figure out if this is because I draw more faces with InstancedMesh, because the bounding sphere is larger (to include more meshes) so culling is less accurate / I draw some stuff outside screen, or is it because on the weaker computer I test on, which is a laptop, instancing is not properly supported and I suffer the consequences of a slower fallback being used internally?
There is a thread here but i can’t find it now that catches this on some browsers on some devices. It really shouldn’t be dragging the performance down, but you might be running into this specific issue.
ANGLE_instanced_arrays is the required WebGL extension, but I think it’s pretty universally supported at this point. I would expect a hard failure if it’s not supported, rather than just degraded performance.
I don’t think InstancedMesh supports front-to-back sorting, like separate objects would have? Without that, it would be pretty easy to stumble into situations with bad overdraw using instancing, so be careful of that.