Terrain Blending
William Pheloung
Last month we upgraded the Terrain System to leverage some of the built-in features of the Unity engine with our procedural generation systems. While these changes dramatically improved the look and feel of terrain in the game, it’s clear to say that we still have a lot of ground to cover.
I will detail our changes to improve blending at the edge of terrain patches. Previously terrain patches appeared as squares with sharp transitions at the edge where they met the rest of the terrain. In this changeset, I wanted to make the edges look better, and I wanted the art team to have full control over tweaking these edges to their liking.
Early prototype with high texture terrain
It was critical that early on, we established that these changes would work with high-resolution textures to futureproof things a bit. The image above shows a prototype of an early version of the system I developed working with high-resolution textures. Even though the edges looked unpredictable and blocky at the time, this prototype established that we could use this system with high-resolution textures should we decide to go down that route.
It was clear early on in development that the default terrain texture painting brush would not work for our needs. We needed to use custom brushes to get terrain transitions that flowed naturally. The above image shows texture painting with a custom brush giving the terrain a hazy feeling.
Once we had custom brushes working, the next step was to allow a variety of opacity. This was accomplished by sending an opacity value to the Unity shader we used as a custom terrain brush. The opacity range is exposed to the developers on the project so that the art team can manipulate the range of values to their liking.
Finally, after meeting with the Art Lead, we decided to use a custom brush for the terrain splotch too. Here you can see the finished product in the game. The artists can now manipulate parameters on these transitions to get it exactly where they want it to be.
We still have a lot of work to do with this system, though. Our next step will be to make it easier to place these terrain splotches so that multiple splotches of different types can be placed inside a plaza. We also intend to make individual splotches customizable so that two different ones can use two different brushes for a distinct feel.