Gamebryo Engine - Performance

Cc90d4948d3392105897314f6e3338c8
0
Faturek 101 Oct 08, 2010 at 21:55

Hi all

This is my first post. Hope, it’s the right forum.

I’ve got a question about the performance of the gamebryo-engine (Elder Scrolls IV: Oblivion) regarding “amount of polygons” vs “texture size”.

Which way to go for a good performance:

  1. Have a lot of (> 1’000) (grass-)meshes with 4 triangles (12 triangle points => that is 4’000 triangles (12’000 triangle points) for 1’000 grass-meshes) with a 512*1024 px texture (every grass mesh has the same texture).

  2. Have a lot of (> 1000) (grass-)meshes with 2 triangles (6 triangle points => that is 2’000 triangles (6’000 triangle points) for 1’000 grass-meshes) but with a 1024*2048 px texture (every grass mesh has the same texture).

Hope, someone can answer this question.

Thanks in advance.

Regards
Faturek

8 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Oct 08, 2010 at 23:00

Sorry, there is no simple answer to that question. It depends on the hardware, the view, the geometry of the grass, and probably other things. With too many vertices you’ll be vertex bound, and with fewer you’ll be pixel bound. Texture sizes will affect rendering performance less than you think because with a full mip chain, you’ll be sampling the mip levels best specialized for the pixel-to-texel ratio on each triangle, so adding another high-res mip will only affect the parts close enough to the camera for it to be visible. The only sure-fire way to answer questions like this is to try it out and measure the performance for the situations you’re interested in.

Cc90d4948d3392105897314f6e3338c8
0
Faturek 101 Oct 09, 2010 at 11:40

Hi Reedbeta

Thx for your answer. I’ll test the framerates with both versions.

About the grass-geometry:

In v1, each grass-mesh consists of two rectangles = 4 faces (in 3ds Max-terms) = 4 triangles (in gamebryo-mesh-format-terms (*.nif)). This means that each rectangle is “splitted” into 2 faces (= 2 triangles). This makes 4 faces and 8 vertices (in 3ds Max-terms) and 4 triangles and 12 triangle points (in gamebryo-mesh-format-terms (*.nif)) for each grass-mesh.

in v2, each grass-mesh consists of two triangles = 2 faces (in 3ds Max-terms) = 2 triangles (in gamebryo-mesh-format-terms (*.nif)). This makes 2 faces and 6 vertices (in 3ds Max-terms) and 2 triangles and 6 triangle points (in gamebryo-mesh-format-terms (*.nif)) for each grass-mesh.

In my opinion, the v2-version gives a better performance because of the huge poly reduction in comparison to v1 (e.g. 2’000 grass meshes in v1 have 8’000 faces (or 8’000 triangles); in v2, the 2’000 grass meshes only have half the amount of the faces / triangles (4’000)). Since every grass mesh has the same texture, I don’t think, that for every grass mesh the texture will be loaded separately…?

Regards
Faturek

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Oct 09, 2010 at 12:46

why would you want a full 1024x2048 texture just for a blade of grass? are you megatexturing or what?

Cc90d4948d3392105897314f6e3338c8
0
Faturek 101 Oct 09, 2010 at 14:34

It’s not just one blade of grass… Most of the games (I know) have for the grass meshes just some rectangles with an alpha layered texture applied. The texture-file “represents” a whole bunch of “grass blades”.

This means that a single grass-mesh (either consisting of 4 or only 2 faces) with the “alpha-layered-grass-texture” applied represents a whole bunch of grass blades (sry, I can’t describe it better, English isn’t my native language).

46407cc1bdfbd2db4f6e8876d74f990a
0
Kenneth_Gorking 101 Oct 09, 2010 at 18:33

I belive you are referring to ‘billboards’. Just don’t render each mesh one-at-the-time, or you will have bigger performance issues to worry about :)

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Oct 10, 2010 at 06:57

I dont understand man, sorry cant help you

6837d514b487de395be51432d9cdd078
0
TheNut 179 Oct 10, 2010 at 16:56

Your 2nd option is the semi-correct way as far as geometry structuring goes. With one quad, or 2 triangles, you should have only 4 vertices, not 6. With just 4 vertices, 2 of them get reused twice, so you benefit from vertex caching. You should have 6 indices defined per quad. You should also batch all the grass up into a single buffer and render them in one toss. With just 4000 vertices, that should fly even on old hardware.

Textures should be at a resolution optimal for a single quad at close proximity. 1024x2048 seems a bit excessive to me. Most games use resolutions of 512 or less. You’re wasting a lot of memory just for grass.

3660f98ccd9e7079e44572e870c24113
0
AticAtac 101 Oct 23, 2010 at 18:30

If your grass is too slow then smoke it :w00t: