Jump to content
  • Advertisement
Sign in to follow this  
taytay

Coloring generated terrain?

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

Hi, I am working on a random terrain generating tool but I don't have much idea how to color them.

I tried using perlin noise to add some green it does not look realistic

25150351.jpg

any tutorial or idea how to do it?

Share this post


Link to post
Share on other sites
Advertisement
Are you familiar with custom brushes or stamps as used in photoshop? I've seen a similar method used to place forests. Also, an airbrush tool that applies a tiling texture with varying amounts of transparency could be good for dirt, mountains, and water surface.

Share this post


Link to post
Share on other sites

Are you familiar with custom brushes or stamps as used in photoshop? I've seen a similar method used to place forests. Also, an airbrush tool that applies a tiling texture with varying amounts of transparency could be good for dirt, mountains, and water surface.


nah, my problem is more like "where to color" not "how to color". I could use a brush on random parts of terrain instead of a perlin noise but I don't think it would be better.

I tried using normal of terrain too. If a surface is steep, it is less green now. also added some gray. I guess it looks better but still needs tuning.
70725698.jpg

Share this post


Link to post
Share on other sites
I have not tried to do anything like this before, but these are my first thoughts:

You could look at the slope and height of each vertex in the terrain. The higher the vertex is, the more likely it is to be snow or rock for a mountain. The flatter and lower, more likely grass. If the slope is steep, rock is more likely. If underwater, mud, rock, or something. As for trees, I would just randomly distribute it upon grass.

Share this post


Link to post
Share on other sites
From what I can see, the main thing you're missing is texture. Texture can make or break a landscape. You could use exactly the same placement scheme as you already have in place, and couple it with better texturing, and the results would look a hundred times better. Other than that, you need a consistent model for things such as moisture/precipitation, erosion and water flow, underlying structure of the ground, etc... even if it is a simple one.

Many people base terrain texturing on simplistic factors such as elevation (low-lying areas in green that graduate to brown then white at the caps of mountains) or, as you tried, the normal (steep areas go to rock, not-steep areas go to grass/dirt/whatever). While this can provide a good start, the artificiality of such a terrain can be quite painfully obvious.

Vegetation density and composition are direct results of various factors: Rainfall/moisture quantity, elevation, temperature, wind exposure, depth of soil, etc... Some of these can be simulated through non-physical means, others can be simulated as a byproduct of other systems, still others can be merely approximated. For example, soil depth can be modeled as a function of ground steepness coupled with erosion-deposition patterns computed by an erosion simulation. Moisture levels can be calculated as a function of elevation, proximity to water bodies, and a simple model of rainfall "shadowing" that calculates the aridity of the land as a gradient with shadowed areas cast in the lee of mountains. Mountains tend to filter off rainfall from storms, leaving the areas in their rain shadows much drier than the areas facing the prevailing storms. Steepness of terrain, too, can affect the water content of a location, leading to swampy flats where water is allowed to pool on ground that has a relatively deep soil bed.

Coloration of the rock is a function of the underlying rock strata in real life. I typically say bollox to simulating that deeply, and just choose a set of rock/stone textures that suit the theme and color scheme of the level. Exposure of rock would be a function of soil depth, in the case of bedrock, and allocation of rock outcroppings, in the case of prop/scenery object placement.

Share this post


Link to post
Share on other sites

From what I can see, the main thing you're missing is texture. Texture can make or break a landscape. You could use exactly the same placement scheme as you already have in place, and couple it with better texturing, and the results would look a hundred times better. Other than that, you need a consistent model for things such as moisture/precipitation, erosion and water flow, underlying structure of the ground, etc... even if it is a simple one.

Many people base terrain texturing on simplistic factors such as elevation (low-lying areas in green that graduate to brown then white at the caps of mountains) or, as you tried, the normal (steep areas go to rock, not-steep areas go to grass/dirt/whatever). While this can provide a good start, the artificiality of such a terrain can be quite painfully obvious.

Vegetation density and composition are direct results of various factors: Rainfall/moisture quantity, elevation, temperature, wind exposure, depth of soil, etc... Some of these can be simulated through non-physical means, others can be simulated as a byproduct of other systems, still others can be merely approximated. For example, soil depth can be modeled as a function of ground steepness coupled with erosion-deposition patterns computed by an erosion simulation. Moisture levels can be calculated as a function of elevation, proximity to water bodies, and a simple model of rainfall "shadowing" that calculates the aridity of the land as a gradient with shadowed areas cast in the lee of mountains. Mountains tend to filter off rainfall from storms, leaving the areas in their rain shadows much drier than the areas facing the prevailing storms. Steepness of terrain, too, can affect the water content of a location, leading to swampy flats where water is allowed to pool on ground that has a relatively deep soil bed.

Coloration of the rock is a function of the underlying rock strata in real life. I typically say bollox to simulating that deeply, and just choose a set of rock/stone textures that suit the theme and color scheme of the level. Exposure of rock would be a function of soil depth, in the case of bedrock, and allocation of rock outcroppings, in the case of prop/scenery object placement.


thanks, I guess I will work on shaping terrain a bit more. It should have bigger plains instead of all cavities. I have many ideas but too little time with all my work and graduate program :(

I am planning the area will be huge, that is why I am not using textures on this model. It will dynamically increase level detail once you are close enough to surface and there will be textures.

Share this post


Link to post
Share on other sites

Are you familiar with custom brushes or stamps as used in photoshop? I've seen a similar method used to place forests. Also, an airbrush tool that applies a tiling texture with varying amounts of transparency could be good for dirt, mountains, and water surface.




"Splatting" is the term to google (multiple textures applied by the graphic engine with varying degreee of blendings between them)
Coefficients in the terrain data controlled the precalculated blends.

---

Long ago I did some terrain creation tools that analyzed terrain and autoplaced detail features depending of various factors like :

altitude
nearness to water (small and large like ocean)
slope
clue tags placed by user

different plants grew in different ecological situations
details like snow exist in certain places

I even had some adjustments to the basic scenery to exagerate erosion patterns.

Manmade feature\s like roads also would reshape contours

Share this post


Link to post
Share on other sites
use textures with triplanar shader, works for simple heightmap terrain and for volumetric terrain
http://www.thermite3d.org/dokuwiki/doku.php?id=hlsl_code_for_triplanar_texturing

also used in the nvidia cascades demo

Share this post


Link to post
Share on other sites
oggs91: wow, looks great. I will check triplanar shading.

currently I am working on rivers, it is much harder than I thought. Here is a picture of possible rivers generated by algorithm.

61525140.jpg

it kinda works but still needs lots of work.

any good tutorials on this subject?

Share this post


Link to post
Share on other sites
In my experience, a river simulation is only as good as the erosion performed on the base terrain beforehand. Erosion is what transforms a heap of dirt into a watershed. Water runoff naturally flows downhill, picking up sediment, carrying it a ways, and depositing it. Just as importantly, thermal erosion can cause entire hillsides to slump. A combination of these two erosive factors is vital to constructing a realistic and believable watershed. Consider the paper, Fast Hydraulic and Thermal Erosion on the GPU. Particularly, in Figure 7 you can see the separate effects of hydraulic erosion, thermal erosion, and their combined effect on the terrain.

In the past, I have used a simple approximation of erosion using a rain-drop simulation. I simulate scattering some number of raindrops across a scene, then iterating the raindrops in randomized order. Each raindrop is moved in the direction of its lowest neighbor, if such a neighbor exists, and the originating cell and destination cell are "smoothed" by lowering the one and raising the other by some factor determined by a strength of erosion parameter. Performed iteratively many times in small steps, this has an approximating effect. The results really aren't that close to actual simulated erosion using a Navier Stokes or other flow model, but for some applications they are good enough.

After the terrain is eroded, I would perform a similar pass to chart the flow of water, and find out which cells received a flow rate above some certain threshold. These would be marked as rivers. (see http://www.gamedev.net/blog/33/entry-1895315-rivers/ and http://www.gamedev.net/blog/33/entry-1897117-relief-rivers/ ) Given that the underlying erosion model was so-so at best, the results were merely okay. A terrain really, really needs the effects of thermal erosion. Hydraulic erosion tends to cut narrow, deep channels rather than wide, gradual valleys.

Water flows can also be accumulated to form higher-elevation lakes. And if you don't really want to perform a whole watershed simulation, you can go the route of eroding the terrain then seeding a number of rivers by determining the mouth of the river, where it exits into the ocean, and recursing upward into higher terrain by following the highest neighbor of a cell being evaluated. At random points you can fork, by spawning a second river trace following the second-highest neighbor to start with, and following highest neighbors thereafter, attenuating each recursing river by some amount each step and terminating the river when it has attenuated to zero or when it has reached a local maximum. This ensures that all of your rivers eventually meet the sea, which can be aesthetically superior, even if it's not physically accurate.

Share this post


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

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!