# Outerra forum

• January 25, 2020, 10:41:12 pm
• Welcome, Guest

### News:

Outerra Tech Demo download. Help with graphics driver issues

Pages: [1]

### AuthorTopic: Geometry Instancing  (Read 3219 times)

#### necro

• Sr. Member
• Posts: 451
##### 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
• Hero Member
• Posts: 6653
• Pegs is clever, but tae hain’t a touch sentimental
##### 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
##### 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

• Brano Kemen