GPU Geometry Clipmaps

Started by
13 comments, last by Matt Aufderheide 15 years, 10 months ago
Hey, I've always been interested in real-time terrain rendering. I started using brute force rendering and continued by implementing geomipmapping. Recently I've done some research on geometry clipmaps. I've read the paper by H. Hoppe but despite the great explanations I still have some questions. 1. I will be implementing the terrain engine using Direct3D 10. Am I correct in making the assumption that there will be no serious performance difference between texture lookups in the vertex shader versus the pixel shader? 2. In Direct3D 9 there were limitations on texture formats that were suitable for vertex texture fetches. Are these limitations removed in Direct3D 10? 3. The paper by H. Hoppe briefly discusses the use of degenerated triangles (figure 2-5). Why are they needed? As far as I understood, the elevation data is smoothed around the edges by interpolating between the current level and the coarser level, so there shouldn't be any cracks anyway? 4. Unortunately the paper by H. Hoppe doesn't discuss any texture splatting. I will probably be using an array of alpha textures and coresponding detail textures. There will be one alpha texture and one detail texture for every ground type that occurs on the terrain block. The problem with this is that blocks in the far distance will cover a larger surface then the closer blocks, and thus are likely to have more different ground types. To reduce the amount of texture lookups I would first read the alpha value and if it is below a certain treshold omit the detail texture lookup. Will this kind of flow control be efficient on DirectX 10 hardware? Explanation or advice on any of these questions is very much appreciated. Thanks in advance, Quinnie p.s. Because some of these questions are DirectX specific but others are not I was unsure in which forum I should post. If this topic belongs in the 'DirectX and XNA' forum, then maybe a moderator could move it.
Advertisement
Quote:Original post by Quinnie
1.
I will be implementing the terrain engine using Direct3D 10. Am I correct in making the assumption that there will be no serious performance difference between texture lookups in the vertex shader versus the pixel shader?


I believe that since the pipeline is much more generic in DX10, this should be correct. In fact the cost of a texture lookup should be exactly the same in the vertex, geometry and pixel shader.

Quote:Original post by Quinnie
2.
In Direct3D 9 there were limitations on texture formats that were suitable for vertex texture fetches. Are these limitations removed in Direct3D 10?


Yes, for the same reasons as above - if you can read from a texture in the pixel stage then you can read from it at the vertex stage too.


I'm not sure about the other questions but I'm very interested in hearing the answer to 3., I'm not sure how a zero-area triangle will help prevent gaps!
Quote:Original post by Quinnie
3.
The paper by H. Hoppe briefly discusses the use of degenerated triangles (figure 2-5). Why are they needed? As far as I understood, the elevation data is smoothed around the edges by interpolating between the current level and the coarser level, so there shouldn't be any cracks anyway?


The cracks are not from difference in actual height. These kind of cracks appear due to rounding errors that occur at 'T-junctions' (when a vertex is places on the edge of another triangle.)
See 'Connecting Patches' second sentence. That is where my understanding of this is from, and is probably a better explanation.
Hey,

Thanks a lot for your responses. Googling t-vertices returned the following wikipedia definition.

Quote:'T-vertices' is a term used in computer graphics to describe a problem that can occur during mesh refinement or mesh simplification. The most common case occurs in naive implementations of continuous level of detail, where a finer-level mesh is 'sewed' together with a courser-level mesh by simply aligning the finer-vertices on the edges of the course polygons. The result is a continuous mesh, however due to the nature of the z-buffer and certain lighting algorithms such as gouraud shading, visual artifacts are often visible.


I understand how this can be a problem with geometry clipmapping. Am I correct in assuming that a degenerated triangle list, although it doesn't have an area, will result in a 1 pixel line being rendered?
Quote:Original post by Quinnie
Hey,

Thanks a lot for your responses. Googling t-vertices returned the following wikipedia definition.

Quote:'T-vertices' is a term used in computer graphics to describe a problem that can occur during mesh refinement or mesh simplification. The most common case occurs in naive implementations of continuous level of detail, where a finer-level mesh is 'sewed' together with a courser-level mesh by simply aligning the finer-vertices on the edges of the course polygons. The result is a continuous mesh, however due to the nature of the z-buffer and certain lighting algorithms such as gouraud shading, visual artifacts are often visible.


I understand how this can be a problem with geometry clipmapping. Am I correct in assuming that a degenerated triangle list, although it doesn't have an area, will result in a 1 pixel line being rendered?


there wont be anything rendering... its just to avoid artifacts from rounding errors... if u have 2 seperate vertices there is no guarantee they will be at the EXACT same position which can in SOME cases result in a single pixel "hole"... by using generates u avoid this...
Hey,

Thanks for your reply. However I still don't understand how these degenerated triangles avoid the rounding errors. I must be misunderstanding some part of the idea. Below are some of my (confusing) thoughts.

If without the degenerated triangles there could be artificats, and the degenerated triangles will not render anything. How can they remove the artifacts? Or do the degenerated triangles have an effect on how the blocks are rendered, causing the artifacts to never even occur? If so, how can they effect the rendering of an entirely different piece of geometry?

Is the resolution of these degenerated triangles equal to that of the finer level or that of the coarser level?

And why doesn't H. Hoppe include the degenerated triangles into the calculation of the amount of DrawPrimitive calls needed per level? Surely they will need a DrawPrimitive call just like all other geometry?

Any clarification is very much appreciated,

Quinnie
Quote:Original post by Quinnie
... and the degenerated triangles will not render anything.


They do. An alternative to degenerate triangles is to leave a gap between patches and use a triangle strip to stitch them together. More about that here. That's just an alternative. Degenerate triangles will fill the gaps that would exist in any rendering of 'T-junctions', simply because it will render a line where the gap from rounding occurs (if there is one.)
Thanks for your response,

I have succesfully implemented stitching in my previous terrain engine that used geomipmapping. It worked great although it required precomputing a lot of different index buffers.

I'm even more confused about the degenerated triangles now though. There are some conflicting statements in this topic.

Quote:Original post by Dragon_Strike
Quote:Original post by Quinnie
Am I correct in assuming that a degenerated triangle list, although it doesn't have an area, will result in a 1 pixel line being rendered?

there wont be anything rendering...


Quote:Original post by Moomin
Quote:Original post by Quinnie
... and the degenerated triangles will not render anything.


They do ... simply because it will render a line where the gap from rounding occurs (if there is one.)


Am I still misunderstanding something? I've always been under the impression that degenerated triangles were optimized away in an early stage and won't cause anything to be rendered?

It would make more sense to me if instead of the degenerated triangles some sort of skirt would be rendered.

Thanks in advance,

Quinnie
lets try this again...

in most cases the degenerate will not be rendered...

however...

imagine two vertices (which are not connected by a triangle) that u want to be at the exact same point... as in the case where different meshes meet... lets say their height should be 123.0000004.... but due do rounding errors: one of the vertices will be at 123.0000000 and the other will be at 123.0000010... which causes a small gap between the 2 vertices... by using a degenerate u avoid this
I can't confirm theory on this, but when I did my (partial) geometry clipmap program last year the degenerates removed alot of the 'holes' in the terrain that were present.

Formski

This topic is closed to new replies.

Advertisement