# How can I fade in 3D foliage smoothly?

Take a look at this picture:

This is a picture of me diving down from a high height. As you can see, the world is a simple world with grass, snow, trees, etc.

The problem here is the 3D foliage. If is obviously just "jumping" into the scene. It also changes the scene dramatically - Instead of simply adding detail to the "current" scene, it's effectively overwriting the terrain underneath it and setting it's own colours/details.

Let's take a look at a popular game, such as war thunder:

Yes, you can see the 3D foliage appearing as the player gets closer to it. However, it is very hard to actually focus on how or where it is appearing. Also, the grass adds detail to the terrain, rather than completely overwriting it and providing a completely different picture.

The TL;DR on this is - My game has grass that "pops" into existence and creates an obvious change in the terrain, whereas professional games have unobtrusive hard-to-notice geometry gradually fading into view.

How do other games do this, and how can I implement it?

• It looks like the foliage in your second example matches the colour of the terrain underneath. So they may be selecting/tinting the foliage to spawn based on the terrain colour, or conversely they may have painted a terrain colour map based on the foliage that has been designated to spawn there. – DMGregory Jan 17 '16 at 19:46
• @DMGregory Are you suggesting that I get the terrain colour underneath, and set the grass colour to be that colour (or a variant of it)? – joehot200 Jan 17 '16 at 21:31
• That's one approach. The Witcher 3 uses a variation on this idea (using the terrain colour at the base and fading vertically) – DMGregory Jan 17 '16 at 21:34

Why don't you lerp foliage opacity between transparent and opaque across some distance range? Could be the simplest most noticeable improvement.