Game Asset Design and Performance.
Posted on 2016-08-24
I have a question regarding performance and how game engines handle mesh objects. – For the purpose of this question, let’s assume we have a wall asset within a game. If we make our wall 10 feet tall and 100 feet long, we have a rectangle, which can be made up of two large triangles.
So, our first example is a wall that is 10 feet tall X 100 feet long and is made up of 2 triangles.
Let’s now assume we broke up that same wall into smaller 10 foot sections (i.e. 10 feet tall X 10 feet long each).
So, in our second example we have our 100 foot long wall made up of 10 individual sections, which are each 10' x 10' made up or 2 triangles each, so our 100 foot wall now contains 20 triangles.
Example 1 = A wall, 10 feet tall X 100 feet long and is made up of 2 triangles.
Example 2 = A wall made up of 10 sections, each at 10 feet tall x10 feet long and each section is made up or 2 triangles, so our wall has a total of 20 triangles.
My question is which of these designs approaches to our wall is more memory intensive for the game engine to deliver to the scene?
Is it more expensive (in terms of memory resources) to draw 2 very large triangles. Or, is it more expensive to draw 20 much smaller triangles?
Or are they equivalent…after all, we’re producing the same asset which is 10 feet tall and 100 feet long? The only difference is that in one instance we're drawing 2 huge triangles and in the other we're drawing 20 much smaller triangles. Can we assume each triangle is 1 "draw-call"? Or is that something totally different?
Although this may seem somewhat academic in terms of "one wall", it can add up when you're producing "modular" assets for a city scene or for a large office building scene or modular asset.