Sign in to follow this  

Creating Terrain

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

I am having trouble with creating terrain, I have created a huge terrain in 3Ds max, about 1000000 x 1000000 in size I used the attached height map in 3Ds max and right now the terrain doesn't look realistic at all, here are the problems I am having:

1. Even when the terrain is too big, I see it looks like its small and when I move the camera towards a mountains thats FAR away, it's either move TOO slow or TOO fast depending on the camera movement speed.
2. The mountains looks very close EVEN when the terrain is so large.
3. I made a simple tank model, when the camera is close, the tank looks normal, when the camera is alittle far, the tank looks so small (I attached a screenshot, the tank looks like it's a black spot!).
4. I am not sure about the best way to apply texture so it looks realistic.

I applied the following to make the texture repeat itself:
d3ddev->SetTextureStageState(0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT3|D3DTTFF_PROJECTED); Edited by Medo3337

Share this post


Link to post
Share on other sites
[left][size=4]Well how close or far the mountains are depends on how you've drawn your heightmap.You shouldn't use pure white as primary color at the Clouds filter(I assume you made the heightmap in photoshop),as white means maximum height,which will make them look pointy.Try applying some grey here and there with a soft brush.Also it's a good idea to split the terrain into chunks and render only the ones that are actually going to be close to the camera and for the farther ones use a low poly version and some fog/blur to make the transition smoothe[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]r,otherwise you're rendering millions of vertices just for the terrain.For the texture to look realistic in 3DSMAX click the model,open modifiers and select UVW Map,then make it Planar and give it a scale 5-6 times smaller than the actual size of the model,so it would tile 5-6 times along the surface.You would need a seamless texture for that,tho.

Edit:I've attached a heightmap that you might want to try:[/font][/color][/size]

[attachment=9201:heightmap.bmp][/left] Edited by Bogomil

Share this post


Link to post
Share on other sites
If I want to create a very large terrain for first person shot game mission:
What is the appropriate plane size that I should use in 3Ds Max?
What is the appropriate number of length and width segments for the plane?
What is the appropriate height map image size in pixels?

Share this post


Link to post
Share on other sites
I have used the height map you attached but the world is too small, I tried to scale and make it alot larger, now I see the camera movement is very slow, when I increase the camera movement speed, I see the world is STILL small even when the plane size is very large or is scaled to be very large.

Maybe the problem is with the height map?

I want to create a VERY large terrain for a first person shot game.

Share this post


Link to post
Share on other sites
If order to make it appear farther you should probably put very light fog the which will make the closer objects sharper or some blur based on distance. Also if there's a way to make the texture mirror instead or wrap there would be less problems with the seams.

Share this post


Link to post
Share on other sites
I am not sure about how to do what you say, I am using DirectX 9 and C++.

The main problem I am having right now is I cant get the terrain to be very large, no matter how much I scale it, when I scale it the camera movement get slow, when I increase the camera movement, it get faster and the terrain doesn't look like it's large at all.

Share this post


Link to post
Share on other sites
There are a number of factors that affect the perception of distance and size. Texture, detail, shadows, distance of the camera off the ground, field of view. Try putting a simple grass texture on your hills, put the light source at an angle. Also I think your heightmap is very coarse, e.g. no fine details. Try adding some fine noise. Experiment with the other settings.

Share this post


Link to post
Share on other sites
Now I have created a very good terrain!

Still having a little problem though:
1. The texture look like it's repetitive! I think I need a way to make the terrain texture doesn't look like it's repetitive (I have attached a screenshot in the main post)

2. I need to create alot of mountains, I have a huge terrain and I need example of a height for creating ALOT of mountains, though I need some good spaces between the mountains. Edited by Medo3337

Share this post


Link to post
Share on other sites
Even when I apply [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][left][background=rgb(250, 251, 252)]seamless texture, it looks repetitive and not realistic.[/background][/left][/font][/color]

Share this post


Link to post
Share on other sites
It's a common problem with texturing. The human eye can easily spot the same texture repeated many times. There are a number of options. Probably the easiest would be having a selection of different ground textures and paint them onto the landscape, blend them together. That can take a little practice and a little artistic skill to look nice. On the opposite end of the spectrum, ID Software went crazy with megatextures, e.g. you don't see repeated textures because there are huge unique areas hand-drawn by an artist.

Share this post


Link to post
Share on other sites
Try looking up samples of texture splatting for height map terrain.
It would give your areas more detail.

Share this post


Link to post
Share on other sites
Splatting(blending 2 textures together over some of the terrain like grass to rock) will help some but ultimately you'll need to determine what is going to be on the terrain. A building of some sort? trees? These elements help hide the repetition from the eye. Also, try using a texture (material) that has noise in it instead of sever color changes. It’s these sever color changes that lead to the repetition. Smaller pixel color changes and variation on a texture can give you a great looking terrain with low overhead. Experiment with noise.

Depending on the distance the camera will be from the outer mountains you can give the illusion of depth by adjusting their scaling of the texture. This could help with the repetition too.

Cheers!

Share this post


Link to post
Share on other sites
I tried to add noise to the texture using Photoshop, I still see repetition, the repetition is well noticed on the mountains, however it's not noticed on the ground.

Share this post


Link to post
Share on other sites
Hmm, it's a shame that (to my knowledge) hardware rendering requires power of two texture sizes. If arbitrary texture sizes were allowed, you could for example blend a texture of width 97 with one of width 103 (both primes) to get an effective texture of width 9991 (97 * 103) which would reduce the appearance of repetition. I think the best you could do that way is blending rectangular textures aligned in different directions, e.g. blend a 64 x 256 texture with a 256 x 64 texture to effectively get a 256 x 256 texture.

Share this post


Link to post
Share on other sites
[quote name='jefferytitan' timestamp='1339020494' post='4946879']
Hmm, it's a shame that (to my knowledge) hardware rendering requires power of two texture sizes. If arbitrary texture sizes were allowed, you could for example blend a texture of width 97 with one of width 103 (both primes) to get an effective texture of width 9991 (97 * 103) which would reduce the appearance of repetition. I think the best you could do that way is blending rectangular textures aligned in different directions, e.g. blend a 64 x 256 texture with a 256 x 64 texture to effectively get a 256 x 256 texture.
[/quote]
You would still get patterns doing this though, as the blending would change by very tiny steps. Uniformily distributing the blending around the terrain could help (via a hash function?) but you might get seams. I think most recent hardware supports arbitrary textures but it's probably a bit slower than ordinary textures (or maybe they resize it to the nearest power of two anyway).

A good way to do it is to take 2-3 similar textures, and blend them at runtime using some kind of noise inside the shader (or whatever you are using to render the terrain). That way there is very little repetition if you tweak it right (and you can get some cool effects like blending a stone road into grass in a more or less realistic way if you define a blendmap which indicates how much blending there should be at a given position). Does that make sense?

Share this post


Link to post
Share on other sites
Absolutely, you would still get patterns, but larger patterns for your texture-size buck, so less noticeable.

Good suggestion on the shader, I tend to forget that as I'm not a shader guru. You could use Perlin or Simplex noise as your blend function for the different textures, based on position hashing.

Share this post


Link to post
Share on other sites
[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][left][background=rgb(250, 251, 252)]> A good way to do it is to take 2-3 similar textures, and blend them at runtime[/background][/left][/size][/font][/color]

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][left][background=rgb(250, 251, 252)]Any example on blending 2-3 textures?[/background][/left][/size][/font][/color]

Share this post


Link to post
Share on other sites
[quote name='Medo3337' timestamp='1339038554' post='4946933']

[left][background=rgb(250, 251, 252)]> A good way to do it is to take 2-3 similar textures, and blend them at runtime[/background][/left]


[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)]Any example on blending 2-3 textures?[/background][/size][/font][/color][/left]

[/quote]

I'm not sure about runtime but you can in the shader. Add a blend weight in your vertex structure and pull the pixels color from each texture based off the weight.

Share this post


Link to post
Share on other sites
[quote name='Medo3337' timestamp='1339279771' post='4947766']
@DJTN: Any example on creating a Shader file to blend textures on the terrain?
[/quote]

Riemer does exactly this on one of his tutorials. Take a look.

[url="http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series4/Multitexturing.php"]http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series4/Multitexturing.php[/url]

Share this post


Link to post
Share on other sites
Sign in to follow this