Jump to content
  • Advertisement
Sign in to follow this  
Waaayoff

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

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
Do you even need mipmaps for that? Doesnt it automatically interpolate it when youre checking a point on the texture?

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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. Edited by Waaayoff

Share this post


Link to post
Share on other sites

  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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!