VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/sprites-and-textures-in-unity/

⇱ Sprites and Textures In Unity - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Sprites and Textures In Unity

Last Updated : 4 May, 2026

Textures are images applied to 3D objects to give them color and detail. Sprites are 2D images used for characters, objects, and UI in 2D games.

TextureSprite
Used on 3D objects (cubes, spheres, models)Used for 2D objects (characters, items, UI)
Wraps around 3D surfacesRendered flat on screen
Needs a Material to applyCan be directly used in Sprite Renderer

Importing Images as Textures

Step 1: Drag any .png or .jpg into Unity's Project window.

Step 2: Click the imported image.

Step 3: In Inspector, set Texture Type:

  • Default: For 3D objects
  • Sprite (2D and UI): For 2D games and U
👁 Importing-Images-as-Textures
Importing Image as Texture

Texture Import Settings

Select any texture in Project window. These settings matter most:

Texture Type

  • Defines how Unity interprets the image
  • Options: Default (for 3D), Sprite (for 2D)

Wrap Mode

  • Controls behavior at texture edges
  • Options: Repeat (tiling), Clamp (no repeat)

Filter Mode

  • Determines how texture looks when scaled
  • Options: Point (pixel art), Bilinear (smooth)

Compression

  • Reduces file size of the texture
  • Options: High Quality (no compression), Normal

Max Size

  • Sets the maximum resolution of the texture
  • Example: 2048 for HD, 512 for mobile

Filter Modes Explained

  • Point (No Filter): Pixels stay sharp. Best for pixel art games.
  • Bilinear: Smooth blur. Best for realistic textures.
  • Trilinear: Like Bilinear but smoother at distance.
👁 Filter-Mode-In-Unity
Filter Mode In Unity

Creating Sprites for 2D Games

Method 1: Single Sprite

  1. Import image.
  2. Set Texture Type to "Sprite (2D and UI)".
  3. Drag image from Project into Scene.

Method 2: Sprite Sheets (Multiple Sprites from one image)

  1. Import image with Texture Type = Sprite
  2. Set Sprite Mode = Multiple
  3. Click Sprite Editor button
  4. Click Slice - Automatic - Slice
  5. Apply – Each sprite becomes separate

Now you can drag individual sprites from the Project window.

Applying Textures to 3D Objects

Textures cannot be applied directly to 3D objects. They need a Material.

Step 1: Create Material

  • Right-click in Project - Create - Material
  • Name it (example: "WoodMaterial")

Step 2: Assign Texture

  • Select Material
  • Drag your texture into Albedo or Base Map slot

Step 3: Apply to Object

  • Drag Material onto your 3D object in Scene

Optimizing Textures for Performance

  • Set Max Size to lowest acceptable value (512 for mobile)
  • Enable Compression to reduce file size
  • Use Sprite Atlas to combine multiple sprites (reduces draw calls)
Comment
Article Tags:
Article Tags:

Explore