Landscape in D3D

Started by
6 comments, last by Shaw Mishrak 23 years, 9 months ago
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
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.
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.
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
[email=ehremo@hotmail.com][/email]
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
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.
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?
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.

This topic is closed to new replies.

Advertisement