Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Download Outerra Tech Demo. Unofficial Outerra Discord server, MicroProse Discord server for OWS.

Author Topic: Geometry Instancing  (Read 15596 times)

necro

  • Sr. Member
  • ****
  • Posts: 451
    • google+ Blog
Geometry Instancing
« on: February 21, 2011, 02:10:19 am »

Heya,
Q: How much is your highest resoluted base-patch subdivided when giving it to the geometry shader? I read that there is a limitation of 256 faces? And playing around with glsl confirm this assertion. So i'm curious in understanding your technique. You are gaining patches with > a * pow(10,6) faces.
A small example will explain my confusion.
We assume a computed patch with 2 * pow(10,6) faces
Each face needs a maximum of 3 EmitVertex() commands. Which are limited by a maximum of 256.
Quote
fCount = 2 000 000 // Face Count
vCount = 6 000 000 * 3 = 6 000 000  //Vertex Count
Probably you wont need 6 * pow(10, 6) vertices for computing the faces by using of TriangleStrip Mode (or some other mode).
If you want to create this high resoluted patch with a geometry shader you would use a base patch with ~23400 faces
Quote
6 000 000 / 256 ~= 23437 vertices

Mh i see that this is not as much as i expected. So probably i did something wrong. Please could you shortly explain the technique behind the scenes?
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Geometry Instancing
« Reply #1 on: February 21, 2011, 04:07:55 am »

A: we aren't using geometry shaders for terrain ;)

Geometry shaders aren't very effective; for example a simple dummy one that just copies stuff from vertex shader can halve the performance. We are using them in cases when a geometry shader can do a common work for multiple emitted vertices, that compensates for its shortcomings. For example atmospheric scattering computation when rendering the trees, although even that will be probably done differently in the end.
Logged

necro

  • Sr. Member
  • ****
  • Posts: 451
    • google+ Blog
Geometry Instancing
« Reply #2 on: February 21, 2011, 06:11:15 am »

Oh how interesting. How you produce the highlevel patches then? Are you presubdividing them or is that in realtime? How big could a vertexbuffer be with 2 000000 polys. That would be minimum 3 x 3 x 8bit per face. Which results in a buffer of pow(2, 21) bit -> pow(2, 18) Bytes. That should be a size of 256k Bytes per patch. Oh thats not that much. Maybe i computed something wrong.. (i did everything in my head because i'm in the train - sry for mistakes <_<)
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Geometry Instancing
« Reply #3 on: February 21, 2011, 08:02:54 am »

The patches are precomputed - there's a generator component that produces the patches on demand. With roads modifying the terrain etc it could hardly be produced in real time with reasonable performance.
Our terrain meshes are 35x35 with 32B per vertex. It could be optimized but mesh size isn't the biggest problem in GPU memory consumption, the size of terrain textures is.
Logged