Skip to main content
GameDev.net gamedev.net
🔒 Locked

Terrain simplification suggestions

Started by rollo Jun 5, 2008 at 4:44 AM 7 replies 2.4k views
Original Post
rollo
rollo
Hello, I need to implement a method for simplifying geometry for a "map", and googling isnt very helpful when half the worlds academics have written a paper on the subject... so I thought I'd ask you guys for tips. - My data is generated from bitmaps. One specifies regions, the other is a hightmap. - Edges between regions must be left intact and not moved. Basically, edges are marked in the geometry, so the algorithm must be able to leave those alone. - Simplification should be done for each region in isolation if possible. - This is a preprocessing step, so performance isnt as big deal as it would be otherwise. Ease of implementation and robustness are much more important. Very grateful for any pointers to good papers or example implementations.
cskelton
cskelton
Don't know if this is what you're looking for, but assuming you generate index buffers for your terrain, you can run through the index buffers and remove indices (not at random of course). This would work assuming you had knowledge of when you reached an edge, so you could skip those indices. This will reduce the amount of geometry that gets rendered by "collapsing" triangles, although it won't reduce the actual memory load of the vertices themselves. I've never tried something like this, but that would be my first shot at it.

Good Luck,
C
Lord Crc
Lord Crc
Perhaps you could use some of the ideas from one of Hoppe's papers (that's one, he has others with a similar theme, check them out too).
TerrorFLOP
TerrorFLOP
I've implemented my 3D terrain, using your approach of bitmaps and heightmaps (which seems to be one standard technique anyway), based on a VERY good chapter in the following book:

Introduction to 3D Game Programming with DX9.0 - By Frank D Luna

If you've never checked this book out, give it a glance over in your local book shop. It was quite popular since a new edition is out which is almost twice the size of the old book that I have.

Frank also describes techniques for pre-lighting the geometry using cheap but effective hacks.

I would show you what I've done, but my code is heavily integrated into my graphics DLL. But if you insist I'll try and submit a simplified version.

My advice is check the book out anyway. The second edition has a great intro to HLSL and shaders.
Corman
Corman
What i think rollo is really after is a technique using his in world terrain data to turn it into to a stylized simplification to create a "mini-map" type graphic(s) for a player to use in game.
Developer Journal: The Life of Corman
TerrorFLOP
TerrorFLOP
Mmmm...

If you're talking like say, the minimap in WOW for instance, then off the top of my head, my first hack at this problem would probably be to create a much smaller, but identical terrain. And since this would be just a map, perhaps a "flat" terrain, which is then partially rendered to the screen as the players map.

This map could of course be created during startup (or development) and since it's small, the mesh could be easily optimized since vertices would be close to each other.

Just a rough idea...
Corman
Corman
Well i probably shouldn't of said "mini-map" but i said it more to refocus what i believe he wants. I think he might be going more for that "treasure map" type pull up map or something similar.
Developer Journal: The Life of Corman
Mercy84
Mercy84
(Assuming a minimap / worldmap is what you're after...)

Just off the top of my head, you could take your heightmap and run an automatic threshold adjustment over it, followed by an edge extraction algorithm, and lay that over a copy of your colour/texturemap, then render the whole thing into a texture for your map.

By altering the parameters you use for your thresholding and edge extraction, I think you should end up with something that looks like a topographical map.

Depending on the style you're going for, you could make your edge extraction produce fat cartoony lines, or lighter almost sketchy lines.

Alternatively you could just render your heightmap/terrain in an ortho view with some lighting.

You could then map locations of places or items in your world back onto the map and place a glyph or symbol onto the map and generate some kind of key to be rendered off to one side.

If you're going for a fog of war or unexplored terrain effect, generate a completely opaque alpha mask at the same time and knock holes in it periodically as the player moves around.
rollo
rollo
thanks for the reply guys. I will be making a minimap-like thing also, but what I really was after was a way to cut down on graphics memory use of my map. its a pretty big map, so I need to run some mesh simplification algorithm on it. The important part is that there are certain vertices the algorithm must not touch. I'll have a look at hoppe's stuff as suggested

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.