Hello! I’m getting into optimizing my game, but I’m not very skilled at it yet. I’ve been trying to learn more and have concluded that my issues are likely GPU-bound, stemming from a combination of problems. For instance, I don’t currently bake lights, and I might not be using LODs correctly.
As I’m debugging these issues, I’ve noticed something puzzling: when I monitor my primitives while the game is running, I see counts between 3 to 5 million, whereas the entire level model has around 600k primitives, according to Blender’s statistics. The editor also confirms this number when I enable statistics, showing below 600k primitives. This is accurate since not all are drawn simultaneously.
So, why does the primitive count appear to be almost 10 times higher when I run the scene? I’ve tried viewing the scene in wireframe mode both in the editor and during gameplay, and they look the same. Am I missing something?
Are you sure you don’t have other things in the tree that are constructed but not visible? Alternately, it’s possible that all your LODs at each level are all existing at the same time.
Any good way to check? Because I am using the generated LODs, and I think you are talking about the method to have handmade LODs and just give them a different range from where you can see them, right? Well, I don’t have that; I have just the generated LODs. But I actually made a mistake; I read the number wrong. It’s not 5 million, but 50 million, so I think that is the main reason my game is slow. If you want, the project is Open Source: GitHub - XFajk/GMTK2025Game. It’s a failed attempt at the GMTK game jam; the game is practically unplayable for many reasons.
I browsed through your project, but I don’t have time to download it and run through it. I see that you basically have one model which seems to be a very complex ship model. When you say primitives does that mean triangles? Or are there more triangles?
By primitives, I mean polygons, so I guess yes, triangles. But I may have found the problem: I discovered that for a light to be able to cast a shadow, it has to create a camera where the light is. For a point light, it has to create six of those for each axis: x, y, z, and also the negatives. Each of those cameras also has to render the scene from its point of view. If I have 30 point lights in my scene, I don’t know if these light cameras have occlusion culling, so 30 * 6 * 600k is 108,000,000. The light cameras are probably culled at least somehow, so the 50 million should be pretty accurate. My idea now is to try to bake the lights and see if that helps me