• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Waaayoff

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

14 posts in this topic

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

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.
0

Share this post


Link to post
Share on other sites
[quote name='smasherprog' timestamp='1339271179' post='4947728']
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.
[/quote]

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

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?
0

Share this post


Link to post
Share on other sites
Not sure, but i think that means that if you go over a border, it ends up at the opposite border.
0

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...
0

Share this post


Link to post
Share on other sites
[quote name='Waaayoff' timestamp='1339264761' post='4947708']
The lowest (coarsest) elevation map is simply the height map, right? What about the finer levels? How do i create their elevation maps?
[/quote]
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.


[quote name='Waaayoff' timestamp='1339272992' post='4947736']
But, aren't mipmaps by definition smaller and at a lower resolution than the original texture? How can they represent finer levels?
[/quote]
Each mipmap is the next coarser level.


[quote name='Waaayoff' timestamp='1339349098' post='4947962']
Also, in the paper they keep saying "toroidal access". What does that mean?
[/quote]
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.


[quote name='Waaayoff' timestamp='1339349657' post='4947967']
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...
[/quote]
[url="http://research.microsoft.com/en-us/um/people/hoppe/gpugcm.pdf"]http://research.microsoft.com/en-us/um/people/hoppe/gpugcm.pdf[/url]

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
2

Share this post


Link to post
Share on other sites
Thanks for your reply [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

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
0

Share this post


Link to post
Share on other sites
[list=1]
[*]Yes.
[*]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.
[*]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.
[/list]


L. Spiro
1

Share this post


Link to post
Share on other sites
Thanks!

I re-read the article after your answers and now it all makes sense [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

Edit: If anyone's interested, i also found this [url="http://geoinformatics.fsv.cvut.cz/gwiki/Modern_Algorithms_for_Real-Time_Terrain_Visualization_on_Commodity_Hardware#Geometrical_Clipmaps"]article[/url] to be helpful: Edited by Waaayoff
1

Share this post


Link to post
Share on other sites
Ok i have another question.

To update the clipmap, i need a residual texture containing the heights which i obtain from the original compressed heightmap. Right? So does that mean that i have to update a dozen textures (one for each level) by decompressing the heightmap and its mipmaps, and then send the textures to the gpu to be sampled by the clipmap?

If so, how big should those textures be? Same size as clipmap?
0

Share this post


Link to post
Share on other sites
That may be one way to go about it. You may want to test if it is faster to update each level independently or to generate mipmaps after updating only the highest level (I suspect it may be faster to just update everything manually).

They should be the same size as their respective source textures.


L. Spiro
0

Share this post


Link to post
Share on other sites
About the residuals, what is the point of using a filter to predict the finer levels and then using a residual texture to correct the prediction? Why not just read the true data? You're already sampling a texture, might just as well be the heightmap itself.
0

Share this post


Link to post
Share on other sites
They were trying to avoid extra texture reads in vertex shaders which were expensive at the time of that document’s writing (2004). These days that is no longer the case and you may decide to just add more fetches.


L. Spiro Edited by L. Spiro
1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0