Creating and Applying Materials
Last updated
Last updated
Since materials can be used on multiple game objects, it is an asset created and it appears in the Project window and stored in the Assets folder.
Right-click in the Project window or click on Assets in the taskbar.
Select Create > Material.
This will create a new asset in the Project window in the current folder:
Name your material and press the Enter/Return key to confirm.
Note: Unlike scripts, renaming a material is safe and will update editor references to it.
When the asset is selected, the Inspector will show its properties.
This can be done before or after updating the properties. Many developers add the material first to see how the game object will look as they mess with the material options.
To apply the material, simply click and drag the material onto the game object in the Scene window, Hierarchy window, or (if selected) into the Inspector.
These properties are listed in the order you'll find yourself using the most often.
Click on the color picker to choose the color or input color values. Click on the link below for more details:
Textures are 2D images that get wrapped around objects with the material they are attached to.
To add a main texture, click on the circle/target icon to the left of "Albedo." A window will appear listing your available textures - those in your Asset folder and a few built-in options.
Double-click or select the asset and close the window. The texture will appear in the square next to Albedo.
Using a texture with a color other than white could affect the look of your material.
With the current texture and color, the preview of the texture at the bottom of the Inspector window looks like this:
What it looks like on a cube in the scene:
Materials appearing to glow use the Emission property.
Click the checkbox to see more options.
This property can glow based on a color or a texture. The Tiling and Offset are for tweaking textures. HDR colors have an intensity setting to contribute to it's "light source" appearance.
Example of a material named "Glow" with a black albedo color and bright green HDR emission color:
What it looks like on a cube in the scene:
This property can make reflective materials.
Example of a material using a white albedo and maximum Metallic setting of 1:
What it looks like on a cube in the scene:
Example of a material using a white albedo and maximum Metallic and Smoothness settings of 1:
What it looks like on a cube in the scene:
Normal and height maps are a type of texture that looks similar to the main albedo texture that is colored in a way to convert the texture into having the appearance of detailed depth. These are used in more advanced texturing and material techniques that allow developers to create super detailed scenes with very basic shapes.
Occlusion tells the program what NOT to show. This property can be a texture to help add another layer of detail, similar to Normal and Height maps.
Many textures are not "seamless" and will appear with a very noticeable seam down the middle of your game object. This Tiling and Offset property lets you stretch/zoom in or compress/zoom out the texture on the X and Y axes using the Tiling setting. To move the texture on either axis, use the Offset setting.
Example of using a tiling of 5 on both axes:
What it looks like on the cube object in the scene:
Similar to enlarging lower quality images, lower-quality textures will look kinda crappy when zooming in (tiling less than 1). If you plan to use parts of a texture, try to find images that are larger.
This mode is where you can make a material render in different ways, including transparent.
As mentioned above, Shaders are powerful code that can tell the computer exactly how a surface or material should appear. In fact, "Standard," is the shader all these properties are part of. Standard is a good place to start, but some tutorials might tell you to choose another.