Are there no other way to paint Unity terrain than with textures?
Before starting to create textures containing just plain colors, I wanted to make sure I wasn't missing on a feature that would allow me to use a material per terrain layer.
I want to achieve a look similar to this game:
Simple, plain colors for the ground.
What are my options?
using textures containing plain colors?
using meshes instead of the Unity terrain?
using probuilder maybe? Just heard of this tool, it seems like it's pretty good at designing simple landscapes like this one.
Thanks.
Answer by streeetwalker · Mar 01, 2020 at 03:40 PM
You don't have to use textures with shaders, and terrain doesn't have to be complex - you can create your own from simple grayscale images using Unity's tool.
Using a terrain generator is a convenient way of creating large scale meshes. You certainly could use pro tools. It's really a matter of convenience and how large the terrain is.
View Sebastian Lague's YouTube series on Procedural Landmass Generation. Episode 16 is where he gets into writing a color shader based on terrain height. It might give you some ideas:
He's also got a a video or two, or a series on populating terrain - placing objects - procedurally - I don't remember the title, but if you are not familiar with his videos his work is definitely worth learning from.
Thx for your answer. I love Sebastian's videos, I actually became a patreon supporter of his recently.
Ok, so let's say I didnt want to write a shader just yet, using only the terrain tool built into unity, I can't just draw plain colors on my mesh, without textures, correct?
Absolutely - you just create a new material and the standard shader and don't drag a texture to the albedo field. You chose the color there. There are a number of other built in shaders that will work too.
The only issue you're facing beyond that is how to assign colors to different parts of your model - so they have to be separate models - e.g. hills vs roads, vs water - or else then your back into working with texture mapping again.
The beauty of Sebastian's shader ( and he provides it for you) is that it colors meshes based height. The example you show doesn't show a lot of variation in height. If that kind of flat terrain is what you are looking for you could create 1 large terrain mesh from a grayscale image that only has has a few gray values in it, and do the coloring all automatically ( well, of course you have to set up the shader values, but once you do that).