Skip to content

Textures Setup

In order to get the effects looking as they should, it’s important to know how to import and set up the textures we’ll be using for our sprites and UI images.

Here you have a link to a video that explains how to setup your textures in case you prefer a visual explanation:

The most important part is having enough room within the sprite shape to show the effects. In the top of the Scene window you can choose how the scene view is rendered. If we change from Shaded to ShadedWireframe we’ll be able to see the sprite rect size:

The Scene window's Shading Mode dropdown, currently on Shaded, with Shaded Wireframe highlighted
The soldier sprite in Shaded and in Shaded Wireframe view, where black mesh lines hug the sprite's shape with no room around it

In the Shaded Wireframe view we can see black lines, that’s the shape of the mesh where your sprite and effects will be rendered. To get all the effects to display properly we’ll need more space. Otherwise the effects will get cropped where the black line ends:

The same growing outline on the soldier imported as a Tight mesh and as a Full Rect, with each mesh drawn in black. On the Tight mesh the outline is cut off along the mesh's edge; on the Full Rect it draws all the way around

The easiest way of doing so is changing the Mesh Type to Full Rect in the import settings of the sprite:

The spaceSoldier Import Settings in the Inspector, with Sprite Mode Single and Mesh Type set to Full Rect

We should always have plenty of space around the sprite so that all the effects can get rendered properly like in this picture (red lines show all the available space where effects can get rendered):

The soldier inside its square Full Rect mesh, with red lines filling the empty space around it where effects can render

Moreover, if you need even more space you could use the Rect Size effect. This effect will make the available space for the sprite even bigger. Note that this effect will only properly work on single image sprites, it won’t work on spritesheets. And doesn’t work well for UI Images either, please use this effect as a last resort. It also needs the texture’s Wrap Mode set to Clamp, otherwise the sprite repeats into the extra room. It needs some transparent border to start from: on art that touches the edge of its image, Clamp stretches those edge pixels across the new room. And it grows the mesh from the sprite’s pivot but the texture from its centre, so keep the pivot in the centre or the sprite drifts.

An outline that comes out cut off is the most common case of this; How to Add an Outline to a Sprite in Unity goes through each cause.

2. Leave spacing when slicing a spritesheet

Section titled “2. Leave spacing when slicing a spritesheet”

In a similar fashion if we are using a spritesheet you must import the sprites in Multiple Sprite Mode (as you always do) and then make sure that when you Slice your sprites they have some spacing:

A sliced spritesheet of pixel art monsters and a sword, the selected slice leaving wide transparent spacing around its sprite

Notice how sprites have a generous spacing between them. Be aware that some effects won’t display correctly unless you set up your atlas sprites properly, see next section to know how (Sprite Atlases).

3. Add Post Processing and Bloom for the Glow properties

Section titled “3. Add Post Processing and Bloom for the Glow properties”

You’ll see that some effects have a Glow property. In order for these properties to have the desired effect you need to add Post Processing and Bloom to the Main Camera of your scene.

If you don’t know how this is done you can follow these videos:
URP: https://youtu.be/ZJBw7sGG63g
Built-in: https://youtu.be/pq5dTygcFVU

Glow showing in the Scene view but not the Game view? How to Make a Sprite Glow in Unity goes through every cause.

Most of the time it will be a good idea to set the Wrap Mode of the Import Settings of the textures you use to Repeat. This will assure a proper result when using effects that use scrolling textures:

Texture Scroll on the soldier with the texture set to Clamp and to Repeat. With Clamp the soldier scrolls out of its sprite and pops back; with Repeat it wraps around without a break
The Advanced section of a texture's import settings, with an arrow pointing at Wrap Mode set to Repeat

The same exact process applies to UI images