I’m building a city environment and would like to make as many LODs for everything as possible.
I’m assuming this will create hundreds of draw calls. If the city was one mesh it would only make one draw call.
Would too many LODs be counterproductive?
I’ll need to find an LOD script and haven’t tried it yet. I’m making a low poly and high poly mesh for every asset but I’m wondering if it’s necessary.
No. I presume you have lights in your scene? Your mesh would draw once plus one time per light that hits it. If you have one giant mesh, the ENTIRE thing will have to be redrawn many times per scene (I presume for a city, you will need quite a lot of lights). Your framerate will end up at 0. You will be sending millions of vertices to the card every frame.
Compare versus breaking up the mesh into smaller meshes. Each mesh will have to be drawn once plus one time per light that hits it. But the good thing is, since it is only a small mesh, you won’t have so many lights hitting it. So it will only be drawn a few times per frame. Plus, with this method, you can not draw large parts of the city that are out of view (occlusion culling) or outside the view frustum (frustum culling). If you have just one mesh for your city, the entire city has to be drawn, even the parts you cannot see. And it has to be redrawn for each and every light that hits it, even those way across the map. You don’t want to do that.
While it is true, you want to reduce your draw calls as much as possible, and one way to do that is to combine meshes, you don’t want to go overboard with that idea. Only combine meshes that are close enough that it is likely the player will always be seeing them together. If you combine meshes where the player can see one part of it but not another, those whole thing still has to be drawn.
A better way to reduce draw calls is to use a texture atlas and use the same material on as many things as you can. This will allow Unity to batch those items together into a single draw call. Batching is your friend.
In my opinion, no. When I was part way into my level, I started hitting framerates around 20 or so (and that’s without dressing the level at all, that was only environmental models). I started putting LODs on everything (three or four of them, in some cases), set up a texture atlas for better batching, and put a script on my lights to reduce their range based on distance from camera. With those improvements, I jumped my framerate into the 100’s. Each of those improvements had about an equal effect (roughly). So yeah, using LOD has quite a lot of performance impact. At least in my case.
Unless memory is some sort of concern (developing for mobile?), I don’t see a downside for using LODs.