Sign in to follow this  
sipickles

Deconstruct my world....

Recommended Posts

sipickles    240
Hi, I am experimenting with different terrain rendering methods. What do you think of this idea? Create a game map in 3d studio. Carve the map into small 'sectors'. Export each sector as a mesh. Build a class to contain each sector as a progressive mesh, as well as other info relevant to the sector (eg texture ids to help batch rendering order etc). Use frustrum culling to cull out-of-site sectors (does d3d do this anyway?). Use polygon reduction of progressive mesh to lower detail of visible sectors depending on distance. Surely this will be simple and effective, and won't be restricted to the grid patterns of heightmaps etc Any thoughts? Thanks Simon

Share this post


Link to post
Share on other sites
JWalsh    498
sipickles,

Sounds like a great idea. Often times people prefer heightmaps over meshes for terrain because they're easier to create.

If you're attempting to create your terrain in a "world editor" then heightmaps are easier to implement and the user manipulation is more straight forward. Its essentially a height value editor rather than a mesh editor. On the other hand, a lot of people prefer to create their terrain via grayscale or colored images where color = height. Obviously without special interpolation a single pixel on the image/texture can only represent the height of a single vertex. So it makes loading, etc...much easier. Additionally, there's not a good way to represent non-aligned terrain via a texture, for things such as outcrops.

With that said, if you've got the time and skill to create the terrain via a modeling package and you're not too concerned about slighty longer load times (need to load all 3 coordinates from disk, not just 1 ) then I'd say go for it. You're likely to encounter some very interesting and unique terrain features, ie. ourcrops, tunnels, caves, etc...all from a single mesh.

Good luck mate, let me know how it turns out!

Share this post


Link to post
Share on other sites
jollyjeffers    1570
Quote:
Original post by sipickles
I am experimenting with different terrain rendering methods.

I love terrain rendering, and I'm trying to spend time covering various aspects of how/what I'd do if I had the time to make one. If you're interested in what someone like me has to say (I won't be offended if you aren't! [oh]) keep an eye on my journal...

Quote:
Original post by sipickles
Build a class to contain each sector as a progressive mesh, as well as other info relevant to the sector (eg texture ids to help batch rendering order etc).

Good idea.

Quote:
Original post by sipickles
Use frustrum culling to cull out-of-site sectors (does d3d do this anyway?).

Nope, D3D won't do this for you. Technically speaking it culls invisible triangles - but that's done at the last stages of the pipeline such that any performance advantage is going to be minimal. You'll be wanting to implement your own code for this.

Quote:
Original post by sipickles
Use polygon reduction of progressive mesh to lower detail of visible sectors depending on distance.

Yes, this is also a very good idea.

I do see one severe problem that you'll hit thought [sad]

Basically, if you have an arbitrary grid of meshes making up your terrain, and these independently vary their LOD's using VDPM you'll get seams/cracks appearing.

If you take a simple case where two segments are rendered next to each other, but they are on a boundary for distance-based LOD. One is rendered at high detail, one at medium... the edges of the two might match when they're at identical details, but currently on that edge one will have more vertices than the other. Thus you'll get gaps that aren't filled with any rendered data.

You can solve this by drawing a triangle strip (or list) between them to "join" the low<->high details together, but it is extra work and unless you're careful might not be that efficient.

I know I'm blowing my own trumpet here, but in my Journal I discussed a "double heightmap" technique that I'm excited about. Bottom line is, easy to implement makes good use of available algorithms, and goes a long way to solve the classic defficiencies in heightmap rendering (e.g. overhangs/caves).. Maybe you'd be interested in that?

Also, Greg Snook's tile-based algorithm is worth looking at - works really well with GPU's from my experience.

Quote:
Original post by jwalsh
Sounds like a great idea. Often times people prefer heightmaps over meshes for terrain because they're easier to create.

As mentioned, I like heightmapping because it fits a lot of computer algorithms perfectly; and not just those for graphics/rendering.

hth
Jack

Share this post


Link to post
Share on other sites
Jiia    592
Quote:
Original post by jollyjeffers
Basically, if you have an arbitrary grid of meshes making up your terrain, and these independently vary their LOD's using VDPM you'll get seams/cracks appearing.

This could be countered by just making the LOD routine ignore the edge vertices. It might be worth the ability to switch between levels quickly. It might not.

Share this post


Link to post
Share on other sites
sipickles    240
Jiia, you beat me to it!

I'm am not sure how I change the weighting of mesh vertices to prevent edges from being changed. Remember reading about it tho in frank lunas book i think.....

Alternatively, would it be inefficient to simply make the sectors overlap slightly? hmm maybe i havent thought that thru! :P

That would be a good 3ds plugin - one to take a texture and heightmaps it into a 3ds model.........................

I like the idea of using 3ds to model the world, since you can get an overall impression as you go rather than shades of grey!

Maybe I'm just coming from a more arty background, and the hardkore maths melts my mind (and isnt compatible with kronenbourg!)........ and driving round GTA san andreas, its obvious thats no heightmap!

Could you use an animated mesh for terrain effects too? wind? water?

Thanks for your help guys!

Simon

Share this post


Link to post
Share on other sites
jollyjeffers    1570
Quote:
Original post by Jiia
This could be countered by just making the LOD routine ignore the edge vertices.

Didn't know you could do that without rolling your own VDPM algorithm [smile]

Quote:
Original post by sipickles
That would be a good 3ds plugin - one to take a texture and heightmaps it into a 3ds model.

I think it already does that for you. I'm not the most skilled when it comes to using 3DSMax, but the artist I get help from does. He knocked up a heightmap mesh in about 30 seconds flat...

I think he created a highly tesselated plane object, and then applied the heightmap as a bump/displacement material.

Quote:
Original post by sipickles
I like the idea of using 3ds to model the world, since you can get an overall impression as you go rather than shades of grey!

Depends how good your editor is [smile]

I've seen at least one editor that have a dual-view system - one showed you (and allowed you to manipulate) the heightmap, the other showed a 3D wireframe mesh (allowing you to move the camera around).

Quote:
Original post by sipickles
Maybe I'm just coming from a more arty background, and the hardkore maths melts my mind (and isnt compatible with kronenbourg!)

I've come up with some very creative "hardcore" maths after a few kronies [grin]

Quote:
Original post by sipickles
Could you use an animated mesh for terrain effects too? wind? water?

Definitely for water, not quite sure how/why you'd use a mesh for wind tho!


One other thing to bare in mind, a classic greyscale bitmap as a heightmap is limited to 8-bit resolution. There are plenty of ways around it, but if you knock up a dead simple map using a paint program you're likely to only get 256 discrete heights. Which, to be honest, is a bit rubbish in this day-and-age [wink]

Cheers,
Jack

Share this post


Link to post
Share on other sites
Jiia    592
Quote:
Original post by jollyjeffers
Quote:
Original post by sipickles
That would be a good 3ds plugin - one to take a texture and heightmaps it into a 3ds model.

I think it already does that for you. I'm not the most skilled when it comes to using 3DSMax, but the artist I get help from does. He knocked up a heightmap mesh in about 30 seconds flat...

I think he created a highly tesselated plane object, and then applied the heightmap as a bump/displacement material.

There's also a vertex noise modifier. You can set which axes change and the scale of randomness. I like turning the randomness up really high, then applying relax. Then multires of course.

Check out my old 2D game that used a pixel height map [grin]
Only screenshots, though. I have no space for the demo, which is around 300 megs! Everything you see in those maps are made with the height map. Including cliffs, buildings, and roofing.

Share this post


Link to post
Share on other sites
sipickles    240
Quote:
Original post by jollyjeffers

One other thing to bare in mind, a classic greyscale bitmap as a heightmap is limited to 8-bit resolution. There are plenty of ways around it, but if you knock up a dead simple map using a paint program you're likely to only get 256 discrete heights. Which, to be honest, is a bit rubbish in this day-and-age [wink]

Cheers,
Jack


Yeah, I am trying to think outa the box a little - maybe using meshes as terrain for non-square sectors (eg sphere sectors), and not just a 'flat' grid of meshes but using vertical mapping as well (eg vertical tunnels, or improbable geological features only possible in non earth gravity, etc etc!)


Share this post


Link to post
Share on other sites
jollyjeffers    1570
Quote:
Original post by sipickles
Yeah, I am trying to think outa the box a little - maybe using meshes as terrain for non-square sectors (eg sphere sectors), and not just a 'flat' grid of meshes but using vertical mapping as well (eg vertical tunnels, or improbable geological features only possible in non earth gravity, etc etc!)

Definitely all sounds like an interesting direction to take... Might well be of interest to people on these forums if anything you come up with seems to work well (or, for future reference, why it didn't work!)

Good luck [smile]
Jack

Share this post


Link to post
Share on other sites
sipickles    240
Well, not great results so far.

I produced a greyscale heightmap, as usual first of all.

Then I used photoshop's slice tool to divide the heightmap into sections. The save for web function in photoshop is useful for saving all the slices as individually numbered files.

Next, I made a plane object in 3dsmax, added a displace modifier for the sector, then a meshsmooth modifier, then exported with panda Xporter.

I then built a couple of classes, a Csector for each mesh, and a Cworld to contain them in (as a vector).

First impressions were good, but I think there are too many polys being rendered - motion of other objects has begun to judder! Using a plane object in 3ds has meant I've created a grid of polys, much the same as a heightmap does. I didn;t intend to do this, since I thought making it in 3ds could mean flat areas are single polys. Refinement needed here.

Also, I have bad joins, as JJ predicted. However, its nothing to do with the prog meshes downgrading, but instead due to the way the slice tool has divided my initial heightmap.

I think each map needs to share the height data along its edge.....not sure how to implement this yet, since i dont wanna have to manually copy stuff over!

A lot of work to do i think!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this