For people just getting to know CRYENGINE, one of the first things that you will try and do is sculpt and paint some terrain.
This article will give an overview of the most common mistakes and best practices when it comes to painting terrain in Sandbox.
Many of you will probably have seen this at one stage or another. If you're just starting with CRYENGINE this may come as a bit of a shock as to why this is happening:
To better understand why this is happening, let's disable detail textures to see more clearly:
As you can see, the "underneath" terrain texture is a low resolution texture (in this case a 4x4 pixel grey texture). But the important part to note here is the massive difference in color and brightness of the brown area and the white area.
When the level was created, the white area was already there, covering the entire map as the default terrain layer. We've simply painted over the top of it with the brown "mud1" layer.
A lot of people see this and simply panic as though something is wrong when in fact there's not, you just need to keep going and consider the end result won't have that white texture there anymore, it will be painted over with something else.
The trick to blending two terrain layers together is to, of course, make them match as closely as possible. If that isn't possible, there are simple transitioning steps you can paint to help make it more gradual.
Take for example, green grass meets white sand. This can seem difficult to achieve at first:
Such a short blending area looks totally unnatural, and that's because it is. You'd never see such thick, green grass meet thick sand so abruptly, and if you did, that's what it would look like.
What we normally see is a much larger transition and this can be very easy to achieve with a simple "detail pass", manually painted, to give a more gradual transition. Think of it like painting a gradient in photoshop:
All you're doing here is coloring the grass layer to be closer to the sand layer, closer to white, rather than green.
How much detail you want to go into is purely up to you. Here's two steps:
This issue only comes up sometimes as it depends on some initial settings you make when creating your level. In short, the larger your level is, the more blocky your terrain painting will appear.
On a standard 1024m @ 2 pixels per meter level, your default terrain texture resolution will look something like this:
And your terrain painting efforts will look something like this:
The problem with this current setup is you're stretching a very low resolution texture over a very large terrain area.
Not to worry, as this can be easily corrected. As instructed on the main Terrain Painting article, you can change your terrain texture tile resolution to suit your needs.
To utilize higher resolutions, the terrain needs to be repainted as you cannot make a high resolution result from a low resolution original. So you should set this up in the very early stages to suit your level.
By increasing each tile to 1024 pixels, we get twice the resolution to paint with:
But it's still not great and we probably don't want to go to maximum resolution unless we have to.
There is another option available to use if we know where our play area is and where the player will see the terrain.
As instructed in the main Terrain Painting article, you can refine the number of tiles available in your level. In this case, we'll just refine it once which takes us from 4 tiles to 16 tiles:
Notice we're also back to 512 pixels for each tile.
Knowing which tile I'm currently working at, I'll increase it to 1024 pixels which gives me an entire 1024 pixels for just that small area (well, relatively speaking for such a large level).
Repainting again with the 1024 pixels for that tile gives much better results:
And you can keep refining and altering the resolution of your tiles as needed.
Keep in mind that of course nothing comes for free and the trade off here is memory consumption for your terrain textures and also the time taken to generate terrain textures.