Terrain streaming

Started by
15 comments, last by VladR 15 years, 3 months ago
I think you're still missing the point about the fundamental tradeoff of size vs. resolution. But ignoring that... most streaming systems are VERY simple. You make a big uniform grid of all your stuff (in this case, one heightmap texture per cell in the grid). Then you try to ensure that you always have some local region around the camera loaded. Either the closest four cells, or the current cell and the 7 neighbors, whatever. As the camera moves around, you use spare cycles (or another thread) to load new cells on the horizon and throw out old ones.

Clipmapping and megatexure are just elaborate extensions of that idea, so that you have more resolution in the local neighborhood of the camera, and less resolution as you get farther away. But again, understanding that requires that you realize that texture size does not limit terrain size! My 256x256 heightmap could represent all of North America ... except that each polygon would cover something like 15 miles.
Advertisement
Quote:Original post by Hiyar
They are using multiple vertex textures and a single vertex buffer for terrain rendering.(if I understand that correctly). I wanted to how is the streaming performed, if using several vertex textures.


What exactly do you want to know here? How the load new vertex textures in the background? The look for papers/tutorials that describe things like texture streaming/mega texturing as it has already been said. Google should know quite a few.
Or do you want to know how to use more than one heightmap texture when finally rendering your terrain? That has nothing to do with "streaming".
Just seems like we're always talking about different things here.
Quote:Original post by osmanb
I think you're still missing the point about the fundamental tradeoff of size vs. resolution. [...] Clipmapping and megatexure are just elaborate extensions of that idea, so that you have more resolution in the local neighborhood of the camera, and less resolution as you get farther away. But again, understanding that requires that you realize that texture size does not limit terrain size!

Great, I don't know much about mega texturing and I need to ask: How is this done without streaming?
I said:
Quote:Original post by Hiyar
If using vertex texture without any kind of streaming, max texture resolution supported by the hardware limits the terrain size.

I might be wrong. As far as I understand, mega texturing uses different resolutions for the LOD levels, how is data managed in this case?

PS: For my terrain I'm using 4096x4096 texture and the distance between the vertices is 2 meters. So the total terrain size is ca. 8 km². The point is I can't load the whole texture at creation time, if I want much larger terrain, hence hardware limitation. (And of course it wouldn't make sense, because of the high memory cost.)

Quote:Original post by Hiyar
Quote:Original post by Hiyar
If using vertex texture without any kind of streaming, max texture resolution supported by the hardware limits the terrain size.

I might be wrong. As far as I understand, mega texturing uses different resolutions for the LOD levels, how is data managed in this case?

Basically megatexturing is a few layers with the same size, each one stretched further and further until the last one which is stretched across the whole terrain, then they are blended together to provide the best resolution possible.

Quote:Original post by Hiyar
PS: For my terrain I'm using 4096x4096 texture and the distance between the vertices is 2 meters. So the total terrain size is ca. 8 km². The point is I can't load the whole texture at creation time, if I want much larger terrain, hence hardware limitation. (And of course it wouldn't make sense, because of the high memory cost.)


If you use bilinear sampling(something you have to implement yourself) you don't have to limit yourself to one vertex per textel.

Mega texturing is a streaming technique. You have one large texture such as 32kx32k on harddrive and required parts of the texture are streamed at run time.



Bilinear sampling performs bilinear interpolation between four texels, so bilinear sampling can not refine my terrain. It is not possible to define or modify the values between texels.



I will use multiple smaller vertex textures and a simple distance based criterion for streaming and just look how it works.
Quote:Original post by Hiyar
Bilinear sampling performs bilinear interpolation between four texels, so bilinear sampling can not refine my terrain. It is not possible to define or modify the values between texels.

True, but at least you don't get the step pyramid / terrased look on your terrain if your vertics does not line up exactly to the textels.
Quote:Original post by Hiyar
For my terrain I'm using 4096x4096 texture and the distance between the vertices is 2 meters. So the total terrain size is ca. 8 km². The point is I can't load the whole texture at creation time, if I want much larger terrain, hence hardware limitation. (And of course it wouldn't make sense, because of the high memory cost.)

If you want bigger terrain, you have to stream it (slowly over the course of multiple frames with sufficient periods of no CPU/GPU load in between them to allow for smooth user interaction).
Chunk after chunk, once it reaches the given threshold distance.
You really have to think of LOD right away or suffer the consequences of rewriting it several times. There are just too many chunks to load them all in full detail - see My Screenshot of Streaming Terrain
So you have to cheat.

You need to load the data asynchronously and make sure the renderer works just fine even if the desired data isn`t still loaded, so you need to have some backup plan for this case.
Obviously, there are lots of other issues that you discover only after the basic implementation works, but there`s no point in discussing them until you see them. Only you can decide if the issues are worth fixing or not.

VladR My 3rd person action RPG on GreenLight: http://steamcommunity.com/sharedfiles/filedetails/?id=92951596

This topic is closed to new replies.

Advertisement