"Infinite Terrain"
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 ?
do a search on the forums... this has been discussed countless time by countless number of people before.
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)
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.
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.
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 ?
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 ?
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:
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[j % SizeY]);<br>}<br>}<br><br></pre></div><!–ENDSCRIPT–><br><br>The important thing to notice is the Mod Operator (%). If you want a tiling, repeating terrain, its an easy way to go about it.
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.
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.
Quote:Original post by RaPhiuSLike 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.
superpig, is there no "dynamic" way to add/remove patches while moving upon the terrain ?
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
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
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)
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)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement