Materials in Unity are how you add color and texture to your space. There are many other elements than can enhance your space as well such as emission and normal maps to add light or bump effects to your assets.
- RIght mouse click in the Project hierarchy, in the '_AddYourArtHere/Materials' folder for example, and select Material. Name as you see fit.
Creating a material
- You can apply materials by either dragging the material onto the asset in the Scene viewport or Hierarchy window, or applying it to the materials on the asset directly in the Materials tab.
Applying a material to the asset directly.
Once your material is created you can select it and modify different elements to get the effect you want.
Note that is it highly recommended to keep textures to the power of two such as 64x64, 128x128 up to 2048x2048. It is also possible to use other variations such as 128x256 or 512x1024. Make sure that you reduce the size of your textures as much as possible. this can be done in Unity on the texture itself.
The Material details in the Inspector
Also known as diffuse, is the base color of the material. You can click on the color to affect that directly, or drag an image into the square at the left.
Metallic is a certain type of reflective property on the material. Usually, you will keep this at 0 or 1, but this is up to you. The Standard shader uses Smoothness rather than Roughness in comparison to many other applications. So 0 or black is rough and not polished through to 1 or white is very shiny or polished.
If you want to create a texture for this you use the Red channel for the Metallic, and the Alpha channel for smoothness. This is done to reduce filesize. Programs like Substance painter can export this out correctly for you, otherwise you can use photoshop to create the texture manually.
The Normal map is a special texture that allows the light to display a bumpy surface. You may get a warning when you first apply a normal map that says 'Fix now' as Normal map textures require a 'Normal map' setting in their Texture Type. This can also be done on the Texture itself.
Adjust the Texture type to Normal Map as needed
These are usually not recommended in WebGL spaces due to the filesize of textures in comparison to the benefit that these textures bring or functionality in WebGL spaces.
Turning on Emission offers a color and texture slot that allows the texture to emit light. This light will be affected by the Bloom settings in a space, but also apply light to lightmaps. If you click on the color you can adjust elements such as what the emissive color is, and it's intensity.
Intensity settings between 0.5 - 2 are recommended. More than that and the bloom effect gets a bit much.
Adjust Emission settings.
Tiling allows you to tile the texture more or less in two axes. If the mapping is not as you would like, it is possible to improve the scale of the texture as you want. This allows you to use smaller textures to create detailed materials.
Offset allows you to slide the texture along axes as needed. This is great for when you want to animate a texture along a direction (if the UVMaps allow it).
Secondary maps allow you to add more detail to your texture as Albedo and normal, with the ability to adjust it's tiling and offset as well. This is very useful to break up tiling a bit at the cost of added filesize. If using smaller images to do so this can improve the texture at detail depending on the situation.
Specular Highlights and reflections can be turned off for faster processing if needed.
Render Queue - This defines the order that the material is rendered in. Only used in specific cases.
Enable GPU Instancing - This is used for optimising material use in a space. If you have a lot of assets that use the same material this could help.
Double Sided Global Illumination - This will set the material to double sided when rendering Global Illumination, as most materials are single sided. Occasionally you may get a lightmap that looks incorrect or 'scattered', this may fix that issue.