If i use a single mesh to represent all chunks, how do i pass the height data to the shader? Do i create a float array parameter, update it with heights for every chunk and send it to the shader?
Wouldn't using different meshes and switching vertex buffers be faster?
Chunked LOD vertex data?
I don't know if it's relevant but i'm implementing the Rendering Very Large, Very Detailed Terrains version.
Ok how about this, I can use a single vertex and index buffer if i use VTF. The vertex buffer would only contain x and y coordinates. For every chunk i set two uniform parameters, translation and scaling of chunk. I would then calculate the texture coordinates by applying the translation and scaling the {x,y} vector. The texture coordinates can then be used to sample the heightmap! (Also sample diffuse textures)
Three questions:
1) Would that work?
2) The size of my world is approx 250Km squared. A PNG texture of size 16384 x 16384 is 16.7 MB. Would uploading and sampling this in a vertex shader be a problem? What's a better format to use?
3) How can i edit my terrain if i use VTF? Is it possible to edit such large textures in realtime?
Three questions:
1) Would that work?
2) The size of my world is approx 250Km squared. A PNG texture of size 16384 x 16384 is 16.7 MB. Would uploading and sampling this in a vertex shader be a problem? What's a better format to use?
3) How can i edit my terrain if i use VTF? Is it possible to edit such large textures in realtime?
Just so you're aware, a 16384x16384 heightmap is going to be a heck of a lot bigger then 16.7mb.
Just so you're aware, a 16384x16384 heightmap is going to be a heck of a lot bigger then 16.7mb.
But, i already have one that's 16.7MB...
That is highly compressed, which won't be suitable for a gpu: 16384*16384*1 = 268,435,456 bytes, or 256mb. For a 16bit heightmap that's 512mb.
However, that isn't really a problem as long as you use a suitable LOD - i.e. only use the high res data close to the player, and a low res heightmap further away. This basically what I'm doing.
As to your question about editing, don't forget you only need the small subset you're working on in memory at any one time. You can just stream data from the HDD when needed.
EDIT - when I say 512mb isn't suitable for the gpu, it may actually be OK, it just depends on what lower limits you want to set in terms of target hardware. I'm actually in a very similar situation, but I haven't yet made a choice - but i'm kinda thinking that nowadays (on a PC) 1gb vram is pretty much entry level...
However, that isn't really a problem as long as you use a suitable LOD - i.e. only use the high res data close to the player, and a low res heightmap further away. This basically what I'm doing.
As to your question about editing, don't forget you only need the small subset you're working on in memory at any one time. You can just stream data from the HDD when needed.
EDIT - when I say 512mb isn't suitable for the gpu, it may actually be OK, it just depends on what lower limits you want to set in terms of target hardware. I'm actually in a very similar situation, but I haven't yet made a choice - but i'm kinda thinking that nowadays (on a PC) 1gb vram is pretty much entry level...
Pfft i hate terrains. So basically i have 2 choices:
1) Store a huge chunked quad tree in memory, load different chunks when i need them and use a couple dozen vertex buffers.
2) Store a huge heightmap in memory, load all of it to the gpu (because honestly i can't see how i can divide it...) and use one vertex buffer.
1) Store a huge chunked quad tree in memory, load different chunks when i need them and use a couple dozen vertex buffers.
2) Store a huge heightmap in memory, load all of it to the gpu (because honestly i can't see how i can divide it...) and use one vertex buffer.
I suggest another two choices
- Actually look at something modern such as geometrical clipmaps. Becouse seriously, you're looking at something targeting Geforce4? No way. Vertex textures are pretty much the best thing since sliced bread for those kind of applications.
This page describes our midway project (spring semester 2003) at the Technical University of Denmark, supervised by Niels Jørgen Christensen.[/quote]I do not know those guys. Perhaps I'm just ignorant but why their mid-semester project would have to add something better than industry standard worth reading 100 pages? I apologize for not reading them. It just does not seem worth it.
- Actually review all your code and figure out the number of vertex buffers is really minor detail (albeit I admit using static resources instead of dynamic has some charm).
- Actually review all your code and figure out the number of vertex buffers is really minor detail (albeit I admit using static resources instead of dynamic has some charm).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement