Join Adam Crespi for an in-depth discussion in this video Adding surface texture with a bumped diffuse material, part of Unity: Materials and Lighting.
In making games, we put a lot of detail into our texture, and that's how we get surfaces that are actually quite plain, to really look realistic. For example, most of the walls in this market look like a plaster, and it's dirty on the bottom. All of them have a material called Plaster Wall C. Which is what they were named in Maya. Or their diffuse map was called. We want to change these over from a Diffuse to a Bump Diffuse, as there's actually quite a bit of texture for that plaster. I'll roll up the Mesh Render, by clicking on the arrows here, and also the Collider, to bring that material a little bit higher up.
I'll roll up the Animator and now I'm going to change the name on the Shader. First, under Shader I'll drop down and right now it's set to Diffuse, and I'm going to change it over to a Bump Diffuse and I get an extra texture slot. This allows me to put a normal map in. And again, adjust a main color by tinting if I need, as well as a base RGB. In the textures folder in this project, I'll open it up by doubleclicking, and select the Plaster Wall Normal. We need to make sure that when we bring in Normals that they're tagged correctly.
Right now, this shows up as a Texture, and it's not going to be regarded as a Normal properly. I'll select this Texture and drop down under where it says Texture and choose Normal Map and un-check, Create from Gray Scale. I created this as a Normal, in its red, green and blue colors. I'm going to let it max out at 1024 for now. Although, we can reduce it if we need by using the Mac size here. Let's say, if we are going for Mobo or simply want to author bigger and let Unity handle the compression.
I'll click Apply, and now this is a normal that I'll pull into my material. I'll re-select the object, and drag that Plaster Wall Normal right across in to the Normal Texture. We can see already the wall has a lot more detail in it. As the Normal is meant to compliment that diffused texture. So the plaster looks rough and uneven. Finally, I'm going to rename this as Plaster Wall C may not be quite what I want in a name. When we import materials in Objects from Maya, we see in the Meshes folder where I've placed the FBXs, there are materials in a separate materials folder that Unity generates.
I'll double click on it and there's that Plaster Wall material separate. This is the other way we can get to Materials, by going in and selecting them directly. And any object with this Material assigned will be affected by whatever changes we make. Now I'll rename it by either pressing F2 or clicking down on the name. I'll rename this to Rough Plaster and press enter. And, now that Material is renamed on every object. On the Keyhole Arch and the Other Walls. The Bump Diffuse Shader is great for things that need additional surface detail.
But that detail shouldn't generate too much of a shine, so we can think of a Bump Diffuse as a really good Shader for, for example, plaster, brick, pavement, especially if it's not wet, rough or aged wood. It'll work really nicely for maybe a very nubbly or textured cloth. Anything that doesn't really need to shine, but definitely needs a Normal Map in it.
- Creating and editing a diffuse material
- Bringing out shine with specular materials
- Building reflective materials
- Creating a custom shader
- Lighting you scene
- Fine-tuning hard and soft shadows
- Color tinting a baked light