Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Shaw Mishrak

Landscape in D3D

This topic is 6603 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

What is a good way to create landscape in Direct3D? Right now, I am thinking that I''ll just store triangle vertices in my 3D-Object files. Is there a better way of doing this? I am not looking for randomly generated landscape, just a fast way to save/load/render landscape. Shaw Mishrak

Share this post


Link to post
Share on other sites
Advertisement
What about heightmaps?
You can see a heightmap your landscape watched from above but instead of graphics that show how high each point is you have a number that says how high every point is.

Share this post


Link to post
Share on other sites
I use a bitmap, similar to those topo maps found in an atlas. Each pixel represents a vertrx in a grid, and the color indicates an altitude. Various algorithms are used to smooth the surface into a realistic scene. The advantage is that the map may be easily drawn in MSPaint or other bitmap tools, or may be imported (with editing) from a scanner.

Share this post


Link to post
Share on other sites
yeah both are right in my opinion, at the moment just having a grey-scale bitmap is the easiest way to go about it... of course that means you can''t have overhangs, but it''s not such a problem really.

the main problem is convincing texturing... because if you apply one texture across the whole landscape it looks rubbish because it''s so low resolution, and if you apply one texture per square, it also looks rubbish because it repeats itself too often
i have found that the best way to go about it is to place a single fairly large seamless texture (e.g. 1024x1024) across several tiles (such as 32x32)... this looks quite good as it is not visible that the texture repeats itself, but at the same time it is quite high res

Share this post


Link to post
Share on other sites
The way I''m going to do it for one of my games is to create several heightmaps for different chunks of land, and texture those with large textures. But instead of using the heightmaps directly in the game, I''m using the 3DS MAX displacement tool to pre-calculate a mesh, and then optimizing it so it has fewer triangles.

lntakitopi@aol.com - http://www.geocities.com/guanajam

Share this post


Link to post
Share on other sites
A little bit about my terrain...

I''m using a height-map, with 256x256 bitmaps tiled over about 12x12 coords, kinda like remo mentioned. I specify the type (grass, snow, rock, etc.) for each coord, then I blend between types at borders. I also pre-calc the light value at each coordinate, so I don''t use a light-map. I''ve also got an LOD algo that combines triangles at game-initialization.

Here''s a coupla'' screenshots:

basic terrain | showing LOD

I made an editor app to make my height-maps, btw.

Share this post


Link to post
Share on other sites
How would you go about making direct3d adept to a 2d map creation utility? Like having lets say a 256x256 map and each map has a height variable that controls how high the map is and has a texture for that tile. How would you make direct3d take that into effect? So if you had one tile with a height of 30 and the rest at 0 (floor) then it would connect points from the edges of the tile and make it look like a spike kinda? Know what I mean?

Share this post


Link to post
Share on other sites
In response to a coupla'' emails, lemme'' point to two previous threads in which my terrain algo and others'' were discussed:

Blending Multiple Textures onto a Terrain (AG, read this)

Landscape LOD

Also, a little bit about my height-map editor app:

- I did not want to simply edit a bitmap in an existing paint program. Mine happens to be a racing game, so I needed very fine control over the terrain.
- I wrote my terrain render algo and tested it with a simple hard-coded height-map before writing the editor.
- The editor app is basically a duplicate of the game app, except I added a cursor that lets me modify the height-map. So the editor uses the same rendering functions as the game app, and I can even race my vehicles over the terrain as I edit it.
- Basically I move the cursor around, hit a key, and *presto* a hill appears. At that point I can adjust the height and width of the hill, "flatten" it to get a plateau, etc..
- My editor doesn''t let me pick the texture for each coord. I found it easier to just load in a bitmap for that. However the editor does adjust the textures sometimes, for example it changes grass to dirt/rock if the slope at a coord becomes very steep.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!