Skip to main content
gamedev.net
🔒 Locked

GPU Geomtry clipmaps

Started by FeverGames 3 replies 1.2k views
Original Post
FeverGames
FeverGames
Hey guys, i am just wondering about something. I have been reading in both Shader X5 and GPU gems 2 and 3 about geomtry clipmaps. It makes the terrain look like a sort of large mipmap texture. You can instance vertex blocks etc for each level of the terrain. there's just one thing. I don't see why the L shaped stuff is in the terrain blocks etc. I can't figure out why this is so much easier for the movement over the terrain. So i have a couple of questions and maybe someone can direct me in the right way: 02_clipmaps_01.jpg is it true that this represents a mipmapped texture as well? Beeing the smallest a low res and the biggest level a high res? 02_clipmaps_05.jpg what's the use of the different sizes and shapes of the blocks? I hope someone can help me with these questions or maybe that someone has another resource then the books mentioned before explaining the theory. I have been breaking my head on this one for quiet some time now :)
Leafteaner
Leafteaner
Quote:
there's just one thing. I don't see why the L shaped stuff is in the terrain blocks etc. I can't figure out why this is so much easier for the movement over the terrain.

Yeah I also thought it was a bit unclear in those papers, but as soon as you try to implement it without those it makes alot more sense. For the terrain to look smooth as the clipmaps follow the camera around, the vertices in each level need to be aligned based on their resolutions. So the finest level needs to move one unit for every unit the camera moves, and the next level needs to move 2 units every time the camera crosses 2 units. You can keep track of when the camera crosses these "grid" lines by using the camera position mod the grid size for each level, and it has to be done separately for the x and z. Each time this happens, you swap the interior trim for that level to balance out the motion and keep things even. Otherwise you get all kinds of popping and movement artifacts.

Quote:
is it true that this represents a mipmapped texture as well? Beeing the smallest a low res and the biggest level a high res?

Yup essentially its like a mipmap chain.

Quote:
what's the use of the different sizes and shapes of the blocks?

It's setup like that to keep things even during the movements as described above.

Quote:
I have been breaking my head on this one for quiet some time now :)

Ha yeah don't worry, there seems like alot of papers about this but they are all lacking in some of the details when it comes to implementing it. It took me a while to figure everything out. The paper from this thread can be pretty helpful. It's not the standard geometry clipmaps, but there is alot of info that applies to it.

http://www.gamedev.net/community/forums/topic.asp?topic_id=504549

Hope that helps some.
FeverGames
FeverGames
Quote:
Yeah I also thought it was a bit unclear in those papers, but as soon as you try to implement it without those it makes alot more sense. For the terrain to look smooth as the clipmaps follow the camera around, the vertices in each level need to be aligned based on their resolutions. So the finest level needs to move one unit for every unit the camera moves, and the next level needs to move 2 units every time the camera crosses 2 units. You can keep track of when the camera crosses these "grid" lines by using the camera position mod the grid size for each level, and it has to be done separately for the x and z. Each time this happens, you swap the interior trim for that level to balance out the motion and keep things even. Otherwise you get all kinds of popping and movement artifacts.


So the actual interior trims and fixups are actually just gap fillers. The L shape is to update the clipmaps. The clipmaps is essentually a sort of mipmap that everytime contains a larger piece of the whole terrain (according to each 'ring' in the vertex data). The L shape makes it possible to only update a portion of each texture in the clip array, rather then the whole thing itself.

a shader code to wrap the texture coordinates around these updates is then needed to load the appropriate UV coordinate from the height field of the right level clipmap (from the texture array).

i am still not sure 100% how to do that but heck, i think i just got a lot closer! Is the above correct? I always thought the L shaped update had something to do with the interior trims and gap fills. man.

Thank you very much and i will most certainly read the paper inside out tomorrow!
FeverGames
FeverGames
and of course this genious calculation in the shader is using the AddressU/V = Wrap;, where there is an offset added to gridPos, depending on the movement of the camera.

i am still a bit unsure since ive been trying to understand it for a while now, so i have to ask if someone can confirm this :D
FeverGames
FeverGames
As far as I understand it, I need to load buffer data from the harddisk that is around the boundaries of each clipmap level, and keep loading new based on movement etc. Is this correct? The GPU gems article is talking about upsampling the coarser level, but i have to be honest, i don't see a very nice and beautiful terrain beeing regenerated out of a 256x256 resized texture that used to be 16 000x16 000. But thats my 2 cents.

Wouldn't this create a gigantic stream of data and updating? (Imagining for example 8 clipmap levels).

thanks for the help

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.