Jump to content

  • Log In with Google      Sign In   
  • Create Account

Creating Terrain


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
20 replies to this topic

#1 Medo3337   Members   -  Reputation: 681

Like
0Likes
Like

Posted 01 June 2012 - 08:44 PM

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);

Attached Thumbnails

  • terrain problem.png
  • racetrack1heightmap.jpg
  • terrain_1.png

Edited by Medo3337, 03 June 2012 - 06:21 AM.


Sponsor:

#2 Veil   Members   -  Reputation: 143

Like
0Likes
Like

Posted 02 June 2012 - 07:55 AM

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 smoother,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:


Attached File  heightmap.bmp   1MB   67 downloads


Edited by Bogomil, 02 June 2012 - 08:00 AM.


#3 Medo3337   Members   -  Reputation: 681

Like
0Likes
Like

Posted 02 June 2012 - 06:24 PM

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?

#4 Medo3337   Members   -  Reputation: 681

Like
0Likes
Like

Posted 02 June 2012 - 07:10 PM

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.

#5 NateMc4   Members   -  Reputation: 158

Like
0Likes
Like

Posted 02 June 2012 - 07:11 PM

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.

#6 Medo3337   Members   -  Reputation: 681

Like
0Likes
Like

Posted 02 June 2012 - 07:58 PM

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.

#7 jefferytitan   Crossbones+   -  Reputation: 2263

Like
0Likes
Like

Posted 02 June 2012 - 11:46 PM

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.

#8 Medo3337   Members   -  Reputation: 681

Like
0Likes
Like

Posted 03 June 2012 - 06:10 AM

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, 03 June 2012 - 06:18 AM.


#9 Medo3337   Members   -  Reputation: 681

Like
0Likes
Like

Posted 04 June 2012 - 12:58 AM

Even when I apply

seamless texture, it looks repetitive and not realistic.



#10 jefferytitan   Crossbones+   -  Reputation: 2263

Like
0Likes
Like

Posted 04 June 2012 - 01:21 AM

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.

#11 Medo3337   Members   -  Reputation: 681

Like
0Likes
Like

Posted 04 June 2012 - 01:41 AM

Is it possible to do that in 3Ds Max and use the mesh as .x file in DirectX 9?

#12 Amnesty2   Members   -  Reputation: 203

Like
0Likes
Like

Posted 05 June 2012 - 07:34 PM

Try looking up samples of texture splatting for height map terrain.
It would give your areas more detail.

#13 DJTN   Members   -  Reputation: 207

Like
0Likes
Like

Posted 06 June 2012 - 05:58 AM

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!

#14 Medo3337   Members   -  Reputation: 681

Like
0Likes
Like

Posted 06 June 2012 - 01:07 PM

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.

#15 jefferytitan   Crossbones+   -  Reputation: 2263

Like
0Likes
Like

Posted 06 June 2012 - 04:08 PM

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.

#16 Bacterius   Crossbones+   -  Reputation: 9604

Like
0Likes
Like

Posted 06 June 2012 - 04:23 PM

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.

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?

The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#17 jefferytitan   Crossbones+   -  Reputation: 2263

Like
0Likes
Like

Posted 06 June 2012 - 05:55 PM

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.

#18 Medo3337   Members   -  Reputation: 681

Like
0Likes
Like

Posted 06 June 2012 - 09:09 PM

> A good way to do it is to take 2-3 similar textures, and blend them at runtime



Any example on blending 2-3 textures?



#19 DJTN   Members   -  Reputation: 207

Like
0Likes
Like

Posted 07 June 2012 - 08:28 AM

> A good way to do it is to take 2-3 similar textures, and blend them at runtime



Any example on blending 2-3 textures?



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.

#20 Medo3337   Members   -  Reputation: 681

Like
0Likes
Like

Posted 09 June 2012 - 04:09 PM

@DJTN: Any example on creating a Shader file to blend textures on the terrain?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS