I’ve got an object (a robot with ~ 5000 polys made up of 3 meshes - body, wheels, and laser) that seemed to be causing a huge drop in FPS (from 30 to 20) when it was visible. So I started playing trying to figure out what part was causing the issue by turning off the mesh renderers for the various components. I ended up turning of ALL of the mesh renderers on the object and I still get the FPS drop.
What could be causing this? I was under the impression that if the mesh renderer is disabled then it should not affect render performance, period. Is this not the case?
Possibly it’s the animation playback. Or even better, you have mesh colliders on the skinned mesh thus gets recomputed every frame which obviously is a really bad idea.
If you deactivate the whole game object, you can turn off any component. This way you can drill down if the issue is maybe with some other component type.
I would guess that you have scripts running on this object that are giving you the performance hit, or does the speed pick up again after it leaves the cameras viewport?
The speed drop is only when it is within view of the camera. Also there are no mesh colliders on it, nor animations. If I deactivate the object completely the FPS goes back up. I’ll keep playing, however since the drop is only when the object is being rendered, I would assume it has something to do with the rendering subsystem, not physics or my own scripts.
I think you can be pretty sure that this is not the cause. If the renderer is disabled, rendering will not be involved. The render is not even in the scenes spatial data structure used for culling when disabled.
Well I don’t know what’s going on, I can’t reproduce it now to continue debugging, it did seem a bit ridiculous to me so I guess I’ll forget about it. At this point I only get a negligible 2 fps drop when it’s in view, which is way better than 10 fps drop. If this crops up again I’ll continue to investigate.
are u talking in editor? you’ll get inaccurate results looking at fps in editor and having other apps like a modeling proggy open can really whack fps around. so the change could have been stuff you had running in the background that you don’t now. try it in a standalone if you haven’t…
I was trying in both stand alone and editor, now after playing more I think it was something else (like a group of trees) that was barely popping into view as I was moving the camera around the robot, not the robot.
Were you trying it in standalone with other apps - including the Unity editor - closed? Apologies for the obvious suggestion, but even having Unity open in the background will yield inaccurate performance figures.