# Geo-clipmaps and geometry blending

This topic is 3834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I am trying to implement the algorithm for "Terrain Rendering Using GPU-Based Geometry Clipmaps" by hugues Hoppe (http://research.microsoft.com/~hoppe/gpugcm.pdf). I have already used the search function but didn't find what I was looking for. I have implemented a chunk of it and it seems to work nicely except for one thing. There are huge problems with popping/visual artifacts at the border between the clipmap detail levels. Now I am trying to implement the geometry blending so that that no longer happens but the problem is that I don't really understand that part of the algorithm. I can calculate the alpha value for the borders that determines the factor for how much the given vertices should blend but I don't get any further. A few facts about what I programmed so far: -It's completely in c++ (mfc) -No 3d API used (transformation/rendering/shading/etc. done by myself for learning purposes) -Perlin-Noise generated 8-bit heightmap for the level 0 (finest) of the terrain -All subsequent levels are generated from level 0 -Each plane/level splitted into blocks for view frustum culling -Degenerate Triangles to fill gaps The following images (red square) show pretty much what I mean with the popping/visual artifacts. When the borders of the level shift and another part of the terrain gets rendered at a different detail level the new details just pop in which looks really bad. I need to understand how the geometry blending works to make it fade in smoothly and on how to implement it but I don't really understand how to do that and would really appreciate if anyone could help me.

##### Share on other sites
Have you checked the "GPU based Geometry Clip-maps" from GPU Gems 2? This should probably be the prefered implementation for clipmaps on a plane (as opposed to a sphere). Basically you apply the 'alpha' blending value (alpha is the wrong term, in this context it is a [vertex] weighting value, alpha generally means colour blending) in the vertex shader to blend between the clipmap level you are drawing and its parent level (or a plane if you are drawing level 0). If you are not using vertex shaders then you would need to apply the blending yourself each frame, which I would guess would be pretty costly in CPU time and bus bandwidth. From those images it appears you are not applying the blending at all, so I guess this is the part of the implentation you are having problems with?

##### Share on other sites
Hi,

that is the algorithm I'm trying to implement and what you mentioned is the part I am having problems with.

I know that the height is represented by the integer part of a float in the heightmap but I don't know exactly what the fractional part which is being used for the blending is.

I am trying to wrap my head around it but I don't quite understand it...

##### Share on other sites
Hi Zaph-0,

There are two components of the height being passed in to the shader by the height map texture - the height of the vertex at the level being drawn at (level x say) and the next coarser level (level x-1 green in your picture) Level x will be a smaller size in the 3D world than level x-1, but it will show more detail (blue in your picture). The integer part being passed in is the height (say z coordinate here) of level x. The fractional part is the height of level x-1.

So the end result is that once the shader breaks the values out seperately it will have access to both the current level's height, and the next coarser level's height.

From here the shader calculates what is called the alpha value of the current position in the clipmap. As it says in section 2.3.5 of the GPU Gems 2 article alpha evaluates to 0, except near the edges of the clipmap where it linearly ramps up to 1. Then you simple multiply the z coordinate of level x by (1-alpha), the z coordinate of level x-1 by alpha and add the results together.

What you will find is that you will need to linearly interpolate (average them IIRC) the values in the coarser map to get the heights between the coarser map vertices.

End result is that it 'morphs' the two values together smoothly. In theory there may appear to be a visible moving morph, but in practice this is not noticeable.

Also (kinda OT) when I naievely did my first implementation I simply generated the coarser levels by picking out every second value from the finer detail levels. The end result was *ALOT* of popping and other nasty visual attributes. I strongly suggest that you pre-generate your coarser level maps from the finer ones using some sort of filtering - a PPT on Geoclipmaps suggested a box filter of size 11.

I hope this makes some sense to you.

Formski

##### Share on other sites
Thanks alot I got the thing running and it works now. I was trying to find my own algorithm to make this thing work and when I finished it and reread the paper I noticed that it's pretty close to what's written in there.

And for the coarse maps, yes I use every 2nd coordinate right now. I know that there will be huge problems with specific kinds of detail (i.e. 2 peaks next to each other) but when it gets too bad I will use a bilinear scaling to make more representative coarse maps.

So far it works nice...

^_^

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633728
• Total Posts
3013576
×