Jump to content
  • Advertisement
Sign in to follow this  
RaPhiuS

"Infinite" Terrain

This topic is 4957 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 (;-) like a saw in a thread at www.gamedev.net) 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. So i'm wondering how, using the geometrical mipmapping method, it would be possible to exploit the terrain patches to implement a such terrain renderer which "infinitely" repeat and creating the illusion that the terrain is infinite. If you have ideas about how this would be possible, please tell me ;-) Thx

Share this post


Link to post
Share on other sites
Advertisement
method 1.
Well let's say that you cave a grid that disapears beyond th z-far distance.
Each grid cordinate has a position and a uv value(for referencing the heightmap or whatever)

Lets say we are traveling in the u+ direction, and we have traveld the distance of 10 grid units, then we could move the camera back 10 grid(in the u- direction) units and at the same time displace the uv cordinates the same amount.

method 2.
basicly you add and subtract rows/columns of the grid as you move along it by rendering it trough a function.

method 3.
If your using vbo's and stuff and don't want to rebuild them constantly, you could divide the grid into smaller parches and then render them end to end.
And when you pass from one grid to another, just repeat the patches.

Share this post


Link to post
Share on other sites
Thank you for your answer ;-)

Well i'm a bit frustrated because i don't really see how i could implement that :/ I'm sure it is not that hard (maybe even very easy to do) !

In fact, i don't really see when and where i need to start drawing the patches (at which position :/)

Share this post


Link to post
Share on other sites
Maybe another solution is just rendering the map multiple times

O = original map
X = original map rendered on the outskirts of the original

XXX
XOX
XXX

When you get near a border, you just render the map "twice" or "triple" in some cases.

When you cross the border, you just teleport the player to the other side of the map, on exactly the same spot, so it'll appear that you have an infinite terrain, or more like a globe.

If this is not clear, I'll try to repost it, still bit sleepy *yawns*

Share this post


Link to post
Share on other sites
I don't really see what you are meaning... (:/) Some more infos would be welcome ;-)

Would that not be very costly to render twice or triple ?

Share this post


Link to post
Share on other sites
yes, well that is if you render the full monty.
Instead, split the heightfield in a few pieces(something that represents 64x64 or 32x32 pixels of the heightmap).
That means that you can choose to render only what is visible and not the parts that is behind you and beyond the z-far distance.
IT allso means that you have some optimations when repeating the heightmap.

the heightmap renderer i use only renders an area of 64x64 of 512x512 at one time(allthough this is done proceduraly and will be changed when i get my heightmap vertexprogram + vbo up and running)

Share this post


Link to post
Share on other sites
I'm currently working on a 2D top-down view space shooter game, so I also did an infinite universe type map deal. For me it was 2D patches and you're looking at them from a top down view so it's a bit easier, however, I quickly discovered a problem that was unnoticed thus far: The upper and lower limits of floats and doubles. I don't know about you but I keep my players positions in X/Y float couples. What happened is that if I keep my game running for around half an hour straight and just keep moving with my players in the exact same direction in full speed their position increases to the billions neighbourhood. At that point weird, fun and unexpected things started happening :)

Anyway, not a bug that'll surface during actual gameplay (since in my game for example, combat rounds typically last anywhere between 20 seconds and 3 minutes). Just something to nibble upon.

Share this post


Link to post
Share on other sites
Finally did it ! :D

Thank you for all your infos ;)

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
no, nothing easy anyway (perhaps trough a vertex program and a GF6800), you could speed it up with some VBO stuff though.

Actuarly those numbers are pretty normal.

I once calcylated how many if statements the conectivety precalc function i use for stencil volumes would have to go though in order to do the connectivety for an object of 1000 polygons.
It ended up to be over one billion if statements.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!