Terrain painting and BUG

So I’ve been painting the terrain and one major problem I’ve had is that by using the altitude and slope modifiers I get “square-ish” appearance in borders between different terrain textures. The only way to solve this issue I’ve noticed is to turn off the slope and altitude modifier and go finely over the edge to soften up that break between terrain textures.

I was really hoping there was some way to soften that break without having to do all this manual work. I’ve tried “refining” the terrain texture but this messes up the entire texture painting. The textures remain in the right spot but where I colored them in is translated to another area of the terrain. I know this is a bug. So this needs fixing in any case. However, I was curious if this refining function would even do what I’m looking for.

Any help would be appreciated. Thanks.

Hey @wcb,

Thanks for letting us know about the bug!

Terrain isn’t an area I’m considered an expert in, but there may be an alternative that you could look at while we’re waiting for someone more familiar to jump in. Splat Maps may be a better option for fine-tuning your terrain textures if you haven’t looked at these already.

Are your Altitude and Slope mins and maxs the same across layers? You may need to add some overlap between them.

If say, you’ve got a mud texture and a grass texture, and the Altitude maximum on the mud is 100 and the Altitude minimum on the grass is 100 there is going to be a hard edge where they meet because they don’t overlap at all.

If you set mud maximum to 105 and grass minimum to 95, you’ve now got 10 meters of terrain where they meet that you can use to fine tune the blending. The same applies to Slope.

@wcb Can you provide repro steps for the bug that you’re describing with terrain texture refinement? Here’s what I tried, but I can’t reproduce it:

  1. Create a new level with the default 1024 x 1024 terrain.
  2. Add a terrain texture layer with a grass material.
  3. Open the terrain tool -> Layer Painter, and use the grass material to paint a blue A in the 0,0 corner, a green B in the 0,1024 corner, and a red C in the 1024,1024 corner.
  4. Choose “refine terrain texture tiles” from the terrain texture layer tool.
  5. Save the level.
    I’m still seeing the correct colors and materials for A, B, and C in the different corners. Is there an additional step that I’m missing?

As to your question about what “refining” does, and whether or not it would help… When you’re painting with the terrain layer painter, the terrain brush is painting two separate channels of information - terrain color, and layer blend weights. These channels are controlled by the “color opacity” and “detail intensity” sliders. If you set color opacity to 0, you will just paint layer blend weights. If you set detail intensity to 0, you will just paint terrain color. The layer blend weights are stored with the heightmap data, with the weights stored per-vertex. The terrain color is stored into the terrain megatexture.

So… depending on what exactly you’re trying to “soften up”, you might need different approaches. Because the blend weights are per-vertex, the frequency of the weight data is controlled by the “meters per pixel” of the heightmap. This could be anywhere from 1 to 64, where 1 meter is the best resolution you’ll get. The texture blending itself is per-pixel, but the weights are extrapolated from the values at those 1-meter increments. The terrain color has a pixel resolution determined by the terrain megatexture tiles.

The terrain megatexture tiles can be seen in Terrain Editor -> Tools -> Export/Import Megaterrain. Each tile and its resolution is listed there. It defaults to a single tile of 512x512, which means that if your terrain is 1024x1024, you’re getting 2 meters per pixel. As you can see here, when painting with a radius of 0.5, the closest I can put my red dots on the grid is in 2 meter intervals:

image

Now, in the Export/Import Megaterrain dialog box, you can select the tile and choose “Change Tile Resolution” to set the tile as high as 2048x2048, which gives 0.5 meters per pixel. If I set my radius to 0.25 to make smaller dots, I can space my dots in 0.5 meter intervals:

image

To get even higher-resolution than this, I can go to Terrain Texture Layers -> File -> Refine Terrain Texture Tiles. This will split every megaterrain tile into 4. Here’s what that looks like before and after:

image
image

Now the terrain texture has 4096x4096 total resolution, or 0.25 meters per pixel. You can keep refining even further if you need even higher color resolution, and you can change the resolution on a per-tile basis to get varied resolution in different parts of the level.

This is all a long-winded way to say that refining the terrain texture should help if your issue is with color blockiness. You should also make sure to increase the resolution on the existing tile(s).

1 Like

I made the terrain as big as possible. Then paint. Then refine. That’s when I get the error. And thanks for the explanation of refining.

Can you provide any screenshots or videos showing the problem you’re describing? I modified my steps to the following and still can’t reproduce it:

  1. Create a new level with the default 1024 x 1024 terrain.
  2. Go to Tools->TerrainEditor->Modify->Resize Terrain and resized to 4096x4096, 16 meters per texel. (The largest terrain possible)
    image
  3. Add a terrain texture layer with a grass material.
  4. Open the terrain tool -> Layer Painter, and use the grass material to paint a blue A in the 0,0 corner, a green B in the 0,65535 corner, and a blue C in the 65535,65535 corner.


  5. Choose “refine terrain texture tiles” from the terrain texture layer tool.
  6. Save the level.
    I’m still seeing the correct colors and materials for A, B, and C in the different corners. I’m not sure how to reproduce the bug you’re describing. All the letters / colors are still in the same place after refining.


As a side note, I wouldn’t recommend creating a terrain larger than 16k x 16k, since you’ll run into floating-point precision issues that get progressively worse at the 16k and 32k coordinate boundaries. Actually, for high-quality terrain, 4k x 4k is the largest I’d suggest so that you can keep it at 1 meter per texel resolution.

I will when I have time. But it doesn’t look like you’ve did any terrain modifications to the terrain. When I experienced the bug I I had a lot of terrain sculpting.

and I used different terrain layers

I generate the texture. Then I refine it. It asks me to save. The asset processor seems to lag a bit so it reports an error. Then it processes. Then it loads up this mess.