Textures in Unity are one of the key elements that make game graphics look alive and realistic. They can be used to add detail to 3D models without overloading the scene with geometry. Textures are responsible for the appearance of the surface of objects: color, gloss, roughness, unevenness, and even transparency. In this article, we will look at what textures are in Unity, what tools are used to apply them, how to load and apply textures to 3D objects, and what types of maps are best to use to achieve the desired effect.
In Unity, textures are images applied to materials, which are then assigned to objects. Image formats supported by Unity include PNG, JPG, TGA, PSD, TIFF, and even EXR for HDR maps. Once imported, the image becomes a Texture Asset, which can be used as a texture in a material or in scripts. In order for a texture to appear on a 3D object, it must be assigned to a material, and the material to an object.
First, you need to import the texture into the project. This is done simply by dragging the image into the Project window. In the texture settings in the inspector, you can set the type:
– Default — a regular texture for visual display;
– Normal map — a texture that imitates surface irregularities, affecting lighting without changing the geometry;
– Sprite (2D and UI) — if the texture is used in 2D or interface;
– Cursor — for the mouse cursor;
– Lightmap — for pre-calculated lighting.
After importing, a Material is created (right click → Create → Material). In the Inspector, you can customize its appearance. If URP or HDRP is used, the material is created with a shader that matches the render pipeline (for example, Lit Shader). The standard render uses the Standard Shader.
In the material window, select the Albedo slot — this is the main texture that determines the surface color. The desired texture is dragged here. Below you can set Metallic and Smoothness, or assign a separate Metallic map if the surface should shine like metal. You can also assign a Normal Map (it creates a sense of relief), Height Map (for the parallax effect), Occlusion Map (shading), Emission Map (glow) and Detail Mask (additional detail mask).
After setting up the material, you can simply drag it onto the 3D object in the scene. The object immediately takes on the appearance specified by the material. If the object consists of several parts, you can assign different materials to different Mesh Renderer → Materials → Element X.
If you use ProBuilder, Unity allows you to paint on the surface directly in the editor. But if you need complete flexibility in applying textures, then UV mapping is a must. This is the decomposition of the surface of a 3D object in 2D to accurately specify how the texture is laid down. Unity can't generate UVs, so they are defined in a 3D editor (such as Blender or Maya) and imported along with the model. In Mesh Renderer, it is important that the UV channel matches the texture placement.
You can use scripts to dynamically apply textures to objects during the game. For example, here is a simple example of replacing a texture:
public class TextureChanger : MonoBehaviour
{
public Texture newTexture;
void Start()
{
GetComponent().material.mainTexture = newTexture;
}
}
You can change not only the main texture, but also normal maps, metallicity and other parameters. Unity also supports shader graph — a visual tool for creating custom materials. In URP or HDRP, you can manually specify how the texture will be interpreted, what effects affect it (for example, wave animation, scrolling, smooth burnout, etc.).
If you need texture animation (for example, running water), you can change the UV coordinates via a script or use Tiling and Offset directly in the material. For example, to make the texture move, just change the offset in Update:
public class ScrollTexture : MonoBehaviour
{
public float scrollSpeed = 0.5f;
private Renderer rend;
void Start()
{
rend = GetComponent();
}
void Update()
{
float offset = Time.time * scrollSpeed;
rend.material.SetTextureOffset("_MainTex", new Vector2(offset, 0));
}
}
It is also worth remembering about Texture Atlases - combining multiple textures into one to reduce the number of draw calls, especially important for mobile games. In Unity, you can use Sprite Atlas, and for 3D - prepare manually in the editor or through third-party plugins.
As a result, working with textures in Unity is a whole world where artistic solutions and technical precision are combined. The correct setting of materials and shaders determines how your game will look: flat and plastic or rich and realistic.
Game: Perform tasks and rest cool. 2145 people play!
Play gameGame: Perform tasks and rest cool. 2551 people play!
Play gameShaders are an essential part of any graphics-intensive application. Traditionally, shaders in Unity were created using...
Read moreShaders in Unity are a vital part of the visual design of games and applications, and understanding their principles ope...
Read moreTexture atlases and Texture Array in Unity are powerful tools for optimization and flexibility when working with texture...
Read more