Tuesday, September 9, 2014

Unity Tip: More Natural Unity Terrain Texture

______________________________________________________________

Here's a little Unity tidbit I didn't find out about until fairly late in my development process. Fortunately, it's quick and easy to implement.

One of the things you may have noticed is that Unity terrains, though incredibly mold-able, are not very realistic up close. Whatever texture you use, even if you tile it to look right, is still obviously just a picture of grass or rocky dirt. This is because it is completely flat.

What's more, there's a slot for normalmaps in your terrain textures, but they don't do anything! After a bit of googling, I found a trick that isn't mentioned in the Documentation. It turns out that there's a second Shader available for terrains other than plain flat diffuse.
  • Make a new material and assign it the Nature/Terrain/Bumped Specular in the drop-down in the Inspector.
  • Select your Terrain and click the Gear button in your Terrain script in the Inspector
    • Under Base Terrain is a slot for Material. Assign your new Bumped Specular material
Now any textures you add with normal maps will look all bumpy. Downside: now they're really shiny too. 

This looks a lot better texture-wise but you're probably not used to your grass and dirt being this shiny. That's okay. You can turn down the shininess, or if you like, change the shine-color (specular color) in the material's Inspector view.
Here's my new texture with the shininess turned all the way down and the specular color set to black (more like shadow, less like shine). Now your texture doesn't look like a matte painting on a clay ground. Throw some grass on in and a horsey and you've got a lovely field.

There are a lot of less-mentioned and/or completely undocumented tricks already built into Unity. Keep an eye out for more!

______________________________________________________________



All blog posts by UnityGirl are inspired by my work with Brunelleschi: Age of Architects on the Aesop Games team. Check out our Crowd Funding page(s)!

No comments:

Post a Comment