How to generate the elevation maps for GPU based geometry clipmaps?

Started by
13 comments, last by L. Spiro 11 years, 10 months ago
The lowest (coarsest) elevation map is simply the height map, right? What about the finer levels? How do i create their elevation maps?
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "
Advertisement
Use mipmaping. Create your heightmap as a texture on the gpu, and make sure the gpu generates mipmaps for it. Then, when you are sampling the heightmap, you have mipmaps to give you coarse or fine grained results.
Wisdom is knowing when to shut up, so try it.
--Game Development http://nolimitsdesigns.com: Reliable UDP library, Threading library, Math Library, UI Library. Take a look, its all free.

Use mipmaping. Create your heightmap as a texture on the gpu, and make sure the gpu generates mipmaps for it. Then, when you are sampling the heightmap, you have mipmaps to give you coarse or fine grained results.


But, aren't mipmaps by definition smaller and at a lower resolution than the original texture? How can they represent finer levels?
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "
Do you even need mipmaps for that? Doesnt it automatically interpolate it when youre checking a point on the texture?

o3o

Also, in the paper they keep saying "toroidal access". What does that mean?
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "
Not sure, but i think that means that if you go over a border, it ends up at the opposite border.

o3o

Yeah, that makes sense.

Well i still don't know how to obtain the elevation maps for each level. In the paper they talk about synthesis and decompression.. But then how does the mipmapping fit into this... I'm so confused!!!

Someone please explain all of this to me...
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "

The lowest (coarsest) elevation map is simply the height map, right? What about the finer levels? How do i create their elevation maps?

Your terms are confused. “Coarse” means “rough and without detail” while “fine” means “with detail”. Course is the far set of the terrain and fine is the single mesh that is right beneath you with the highest level of detail.



But, aren't mipmaps by definition smaller and at a lower resolution than the original texture? How can they represent finer levels?

Each mipmap is the next coarser level.



Also, in the paper they keep saying "toroidal access". What does that mean?

It means as the heightmap texture is being modified on the GPU, anything the falls off one edge wraps to the opposite edge, and as such when you are accessing the heightmap texture you need to do the same. Trivial with the repeat wrap mode.



Yeah, that makes sense.

Well i still don't know how to obtain the elevation maps for each level. In the paper they talk about synthesis and decompression.. But then how does the mipmapping fit into this... I'm so confused!!!

Someone please explain all of this to me...

http://research.microsoft.com/en-us/um/people/hoppe/gpugcm.pdf

The 2.4.1 Upsampling section is talking about artificially generating even finer levels of detail and is used by the 2.3.5 The Vertex Shader section for interpolating between levels. For your basic implementation you don’t need to worry about this yet. It is designed to prevent holes between the rings, which is something you should handle after you have a working prototype.

Figure 2-1.
Each level of the pyramid represents a different mipmap level of the heightmap texture. Each ring reads from its own mipmap level. It is possible for you to use only one level (no mipmaps) but using mipmaps allows you better filtering potential (better interpolation between points) and reduces texture reads.

The 2.4.2 Residuals section is just talking about adding extra detail. It is optional and you should ignore it until you have a working prototype.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Thanks for your reply smile.png

1) What does the original heightmap represent? The finest level?

2) I still don't know how to obtain the elevation maps. Maybe you mentioned it and i'm too dumb to follow :|. Let's say i have a 1024x1024 heightmap. If this is the finest level (question 1), how do i obtain the mipmaps that represent the coarser levels?

3) From my understanding, all rings have equal number of vertices, just at different spacing. But the vertex textures holding the height data are of different resolutions, right? What am i missing here?

I'm sorry but i just don't understand the concept itself, even after reading the paper twice.
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "

  1. Yes.
  2. Treat it as a texture and do basic mipmapping. It is a texture with mipmaps. Nothing more. tex2Dlod() allows you read any of the mipmaps you want.
  3. If you have an image that is 512×512 and you read pixels from [0, 0] to [10. 10], and if you assume each pixel represents 1 meter, then you just read 10 meters by 10 meters in world space. Assume you wanted to do the same thing but with the same image shrunken in half. The image is the same image as before but now it is scaled down to 256×256 (this is a mipmap). That means every pixel in the image is now 2 meters instead of 1. We are still going to read from [0, 0] to [10, 10], but if the vertex locations are still the same then we just packed 20 meters by 20 meters into the same space. This is wrong, and to fix it we have to double the distance between vertices. This is why the rings double in size each time while the source texture halves each time.



L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

This topic is closed to new replies.

Advertisement