Sketchfab Forum

Performance Bug?

(Blackhart) #1

I ran into a slightly strange performance bug today, not so sure if it's a bug or a consequence of my scene... basically I'm uploading a scene for myself that I wanted to view in VR, just a little bit of forest. Modelled all in Blender, and quickly added some leaves to the trees with the hair particles. Really basic low poly ones, only made of 7 polys each. To make sure they showed up in Sketchfab, I converted them into individual meshes. When I uploaded that scene, there were probably close to 1000 of these individual leaf objects, and it caused a ton of lag. It was running at what felt like 5-10 fps. I found it a little strange, since the scene is only 67.2k faces, and I have high poly hardsurface models on Sketchfab with 300k+ faces which run perfectly smoothly. So I went back into Blender, selected all those individual objects, and joined them into a single "leaves" object. So, same number of mesh islands, but all joined into one object. I just uploaded that scene, and it runs buttery smoothly.

No change in the number of polygons. Only a change from individual objects to single objects. Perhaps that's something to consider for Sketchfab performance? The render engine doesn't seem to handle large numbers of objects nicely, even with the exact same polygon density.

(Shaderbytes) #2

No render engine or should I rather say GPU likes to handle 1000's of separated objects.. Bigger mesh objects will always process faster than many small separate objects even though the poly count is the same for both. This is not unique to Sketchfab. Some engines might trick you into thinking it is handling them well but normally it because of some clever batching optimizations they are doing in the background. Similar to what you achieved by joining all the objects manually. These optimizations reduce both CPU and GPU cycles in regards to draw calls , matrix calculations etc..

Generally speaking the same effect can even be seen when copying files on a PC. A single file of say 1GB will copy magnitudes faster than a folder with 15000 files that add up to 1GB. With both examples the bits move at the same speed.. but to move the bits requires a read operation and a write operation. So with a single large file only two operations are required but with the individual files in this example 30000 operations need to be performed.

I hope that makes sense

(Mauricesvay) #3

Yes, fewer objects perform better. Here's an excerpt from the faq:

Meshes: Another very large impact on viewer performance and load times comes from the number of meshes. The more separate meshes/objects/geometries in your scene, the worse the model will perform. Ideally, there would be only one mesh for each material.


Did you change it? Performance seems good now and you only have 14 geometries.

You can fix the draw-order / z-fighting of your leaves by switching the transparency from Alpha Blending to Alpha Mask.

(Blackhart) #5

Yes, for the scene I eventually published I went ahead and combined all the free objects into a single object. I suppose I've been spoiled by the fact that a lot of render engines do batching which mitigates the effect of having lots of smaller geometry on screen with minimal performance impacts.