Good day! With you help, I made core of game scene. Now I want to make some 3D models instead of sprites.
But my goal is light game for computers with 2-4 Gb RAM and old video cards, so the question is: how many polygons can I use? This calculation is difficult for me, because I am not programmer.
The game scene includes 1600 slots for objects (this number may change slightly in the future). Most of them will be empty, I want to add about 400 object in each scene, ~50% of them will be 3D and ~50% — sprites.
How many polygons per model in this case I can use for create new scene at few seconds? What video cards will work with this scene fast?
The raw numbers of polygons doesn’t matter that much The GPUs are great at rendering shapes with lots of polygons, the polygons are just a few floats in memory. I found that polygon count is seldom the bottleneck in modern 3D applications, unless someone wants to go really “crazy”
The exact memory cost depends on how you define a polygon. The triangle is really
3 * int + 3 * 3 * float = 3 * 4 + 3 * 3 * 4 = 48 bytes (assuming that you use indexed geometry but vertexes are not shared, so the worst case), so not much. You need
1024 * 1024 * 1024 / 48 = 22 369 621 triangles to use 1 GB, so you have about 56k triangles available for each of 400 objects. Divide it as necessary if each vertex will also have a normal vector, and/or a texture coordinate or other data.
However, simple calculations like above often prove ineffective to determine the real memory usage. Because there are often unforeseen factors So I would much rather recommend to do a real “stress test”, throw at CGE the approximate number and kind of objects you plan to have, and see how it performs.
Depending on your objects, you may find you have no problem with performance at all, or you will find it at a different place than polygon count – like in number of objects per scene. The numbers you speak of (400) should not cause any issues, but not everything is as optimal yet as I’d like to.
See Optimization and profiling | Manual | Castle Game Engine and plans to optimize RAM usage by CGE in Optimizing memory usage, part 1: efficient step animation, using component system in X3D nodes (no interfaces), less memory used by sprite sheets – Castle Game Engine . I still haven’t finished it.
Thanks, very informative.
Computer calculation speed always seems to me unbelievable