Geomipmapping
Monday, 21. April 2008, 11:40:37
The basic idea is that you split your terrain into smaller patches and render each patch in lower detail as it gets further away from the camera. Pretty much the same as texture mipmapping, hence the name- geo mipmapping. More info.
The annoying thing is solving the gaps between patches of different LOD (T-junctions). I've already done this a couple of years ago, back then, I used a static index buffer for the center of the patch, and a dynamic one for the edges.
That worked quite ok, the best part was, that one patch could have been in highest detail, its neighbor- in lowest detail and both of them would connect perfectly.
Instead of choosing witch LOD to use based on distance, I used to test how big of a "pop" a lower detail patch would cause, if it was acceptable (just a couple of pixel)- use the lower LOD.
Determining which LOD to use this way had two great effects:
Patches that were further away used lower LOD (just like determining based on distance).
Patches that were flat or very smooth, used lower LOD even if they were close to the camera. For example, if a camera is in the middle of a patch that is just a flat plane, it would be rendered in lowest detail because a plane never causes any popping. On the other hand, if you use distance based LOD, the same patch would be rendered in highest detail because it is very close to the camera.
Ok, back to the present.
Currently I'm using simple distance based LOD, limiting to only one LOD difference between neighboring patches and precomputing every possible variation of LOD/edge. So every LOD has 9 permutation of different edges (I guess 16 if you're not doing any culling, 12 if you're not doing a certain hack).
I'm going to use geomorphing to solve the popping problem.
Terrain with the height map as the texture:
Wireframe (LOD+ culling)
Size: 513x513; Patch size: 33;
720fps
(click)
Wireframe (no LOD, no culling)
300fps
(click)
(click)
(click)
The annoying thing is solving the gaps between patches of different LOD (T-junctions). I've already done this a couple of years ago, back then, I used a static index buffer for the center of the patch, and a dynamic one for the edges.
That worked quite ok, the best part was, that one patch could have been in highest detail, its neighbor- in lowest detail and both of them would connect perfectly.
Instead of choosing witch LOD to use based on distance, I used to test how big of a "pop" a lower detail patch would cause, if it was acceptable (just a couple of pixel)- use the lower LOD.
Determining which LOD to use this way had two great effects:
Patches that were further away used lower LOD (just like determining based on distance).
Patches that were flat or very smooth, used lower LOD even if they were close to the camera. For example, if a camera is in the middle of a patch that is just a flat plane, it would be rendered in lowest detail because a plane never causes any popping. On the other hand, if you use distance based LOD, the same patch would be rendered in highest detail because it is very close to the camera.
Ok, back to the present.
Currently I'm using simple distance based LOD, limiting to only one LOD difference between neighboring patches and precomputing every possible variation of LOD/edge. So every LOD has 9 permutation of different edges (I guess 16 if you're not doing any culling, 12 if you're not doing a certain hack).
I'm going to use geomorphing to solve the popping problem.
Terrain with the height map as the texture:
Wireframe (LOD+ culling)
Size: 513x513; Patch size: 33;
720fps
(click)Wireframe (no LOD, no culling)
300fps
(click)
(click)
(click)

Anonymous # 26. April 2008, 16:06
Will you post any demo for this technique with geomorphing to solve popping artifacts?
Nerius Vaskevicius # 26. April 2008, 18:15