Jump to content


Gamebryo Engine - Performance


8 replies to this topic

#1 Faturek

    New Member

  • Members
  • Pip
  • 3 posts

Posted 08 October 2010 - 09:55 PM

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

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 5309 posts
  • LocationSanta Clara, CA

Posted 08 October 2010 - 11:00 PM

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.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 Faturek

    New Member

  • Members
  • Pip
  • 3 posts

Posted 09 October 2010 - 11:40 AM

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

#4 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2725 posts

Posted 09 October 2010 - 12:46 PM

why would you want a full 1024x2048 texture just for a blade of grass? are you megatexturing or what?
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#5 Faturek

    New Member

  • Members
  • Pip
  • 3 posts

Posted 09 October 2010 - 02:34 PM

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).

#6 Kenneth Gorking

    Senior Member

  • Members
  • PipPipPipPip
  • 939 posts

Posted 09 October 2010 - 06:33 PM

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 :)
"Stupid bug! You go squish now!!" - Homer Simpson

#7 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2725 posts

Posted 10 October 2010 - 06:57 AM

I dont understand man, sorry cant help you
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#8 TheNut

    Senior Member

  • Moderators
  • 1701 posts
  • LocationCyberspace

Posted 10 October 2010 - 04:56 PM

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.
http://www.nutty.ca - Being a nut has its advantages.

#9 AticAtac

    Member

  • Members
  • PipPip
  • 87 posts

Posted 23 October 2010 - 06:30 PM

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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users