Jump to content
  • Advertisement
Sign in to follow this  
RaPhiuS

"Infinite Terrain"

This topic is 5043 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

Hello ! I recently started to implement a geo mip mapped terrain renderer based on the whitepaper "Fast Terrain Rendering using Geometrical MipMapping" by Willem H. de Boer. Since with geometrical mipmapping the terrain is subdivided in patches i'm wondering if with that method it would be possible to simulate "infinite" terrain. What i mean by "infinite" terrain is not the mathematical concept but more precisely the illusion that the observer is travelling on a height map which never ends. Of course, parts of this heigt map are regularly repeated. What kind of methods exists or how would you do to simulate an "infinite" terrain ?

Share this post


Link to post
Share on other sites
Advertisement
do a search on the forums... this has been discussed countless time by countless number of people before.

Share this post


Link to post
Share on other sites
not sure what you're looking for exactly, but i think georgia tech published a paper on out-of-core rendering (google for it). if you don't want to get that fancy, you could just randomly generate your heightmaps or loop them (as in, once you reach the edge of one you "teleport" to back to the other side)

Share this post


Link to post
Share on other sites
Tiling your heightmap is probably the way to go, unless you're happy to procedurally generate it. Given that your terrain is split up into pieces from the GMM, you just repeat those pieces.

Of course, you can't just keep rendering for ever - got to stop at some distance - so you might want to look into things like fog so that you can fade out the terrain after a while.

Share this post


Link to post
Share on other sites
ngill, i just can't find the thread(s) that were treating this subject :/

Silex, yes but when i'm reaching an edge i'll see that the end of the terrain, is there no nice way to add/remove patches while the camera is moving and how you would do that ?

superpig, is there no "dynamic" way to add/remove patches while moving upon the terrain ?

Share this post


Link to post
Share on other sites
Ok, say you have your terrain tiles stored in a nice 2d array called Tiles[SixeX][SizeY];

And you know that you are in the tile at X, Y.

to draw all the N tiles (with repeating) around yourself:


for (i = X - N; i < X + N; i++)
{
for (j = Z - N; j < Z + N; j++)
{
Draw(Tile[i % SizeX][j % SizeY]);
}
}



The important thing to notice is the Mod Operator (%). If you want a tiling, repeating terrain, its an easy way to go about it.

Share this post


Link to post
Share on other sites
You have a bunch of patches, let's say 8 accross.

You are stood on the 7th looking towards the 8th, so you draw the 7th, then 8th, then 1st, then 2nd . . .

If you are having trouble understanding how to draw them in the right place, then think either of translating the patch so that it is in the right place, or of translating the camera inbetween drawing each patch. The code will be the same either way.

Share this post


Link to post
Share on other sites
Quote:
Original post by RaPhiuS
superpig, is there no "dynamic" way to add/remove patches while moving upon the terrain ?
Like WarAmp and Squirm say, you're not actually adding/removing patches - you're reusing patches that are already there, you're just translating them before drawing them the second time.

Share this post


Link to post
Share on other sites
Finally did it !

Thank you for all the infos you gave me ! ;)

btw, i'm using triangle fans actually, how would you do to turn geomipmapping rendering using vertex arrays and triangle strips ?

Actually, what i am trying to do is to add to each patch a vertex array, texture array and detail texture array. hmmm, that eats up a lot lot memory though...

In fact, for each patch i allocate a space that consider the worst scenario ! Say i have a 513x513 heightmap which patch size is 17x17... well i'm finishing allocating 17*17=289 3d vectors for each patch... and i'm not taking into account the texture and detail texture coordinates....

As i end up with 30 patch per side i have : (30*30)*(289) = 260100 3D vectors (ouch !)

any nice way around ? :D

Share this post


Link to post
Share on other sites
Don't think so. 260100 3D vectors = 260100 * 3 * 4 bytes

which is what? 4 Mb? Yeah, it wouldn't fit on a floppy disk, and transferring it to the graphics card every frame wouldn't come cheap, but let's face it, a 512x512x32bit texture isn't all that uncommon, and three of those would take up as much memory as your entire terrain geometry. Get it in perspective :o)

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!