# unity emission map bleeds (bug?)

I have a material with a spritesheet texture (albedo) and an emission map. The spritesheet has 32x32 squares. The emission has a 32x32 square that is an emission for the magma-looking square.

It works well on the magma, however, the glow also spreads to the sand, grass, planks, and snow_grass textures. You can clearly see it spread on the sand (bottom-rightmost opaque texture) in the right because it isn't directly touching the magma. Here is another picture where it is attached

You can still see the spreading of glow if you look closely. Now, you can definitely see it glow here

How do you stop that from happening? That artifact is really weird and i really need it to go away. I've tried decreasing the size of the square in the emission map but it still was there. Please help.

Thanks.

EDIT 1 Here is how I apply uv

 public static Dictionary textureMap = new Dictionary();

public static void Initialize(string texturePath, Texture texture)
{

foreach (Sprite s in sprites)
{
Vector2[] uvs = new Vector2[4];
uvs[0] = new Vector2(s.rect.xMin / texture.width, s.rect.yMin / texture.height);
uvs[1] = new Vector2(s.rect.xMax / texture.width, s.rect.yMin / texture.height);
uvs[2] = new Vector2(s.rect.xMin / texture.width, s.rect.yMax / texture.height);
uvs[3] = new Vector2(s.rect.xMax / texture.width, s.rect.yMax / texture.height);
//Debug.Log(s.name);

if (!textureMap.ContainsKey(s.name))
{
}
}

}

public static bool AddTextures (Block block, Direction direction, int index, Vector2[] uvs)
{
string key = FastGetKey(block, direction);

Vector2[] text;
if (textureMap.TryGetValue(key, out text))
{
//Debug.Log(key);
uvs[index] = text[0];
uvs[index + 1] = text[1];
uvs[index + 2] = text[2];
uvs[index + 3] = text[3];
return true;

}

text = textureMap["Default"];

uvs[index] = text[0];
uvs[index + 1] = text[1];
uvs[index + 2] = text[2];
uvs[index + 3] = text[3];

return false;
}


Where Direction is a direction (example north) and Block is a short. Index is the vertex index of the mesh. Texture is the sprite texture (.png)

• How big is your spritesheet, and how have you set the UVs on your meshes? Do you have mipmapping enabled? – DMGregory Dec 30 '18 at 16:50
• Mipmaps are not enabled, sprite sheet is 160x128 – Kino Bacaltos Dec 30 '18 at 16:56
• That could be a factor. Have you tried making your sprite sheet a power of two in both dimensions? – DMGregory Dec 30 '18 at 16:57
• I suspect its due to the bilinear filtering done on the emission map. Try changing it to point filtering. – DarkDestry Dec 30 '18 at 16:58
• @DMGregory no, but I presume that it will still spread – Kino Bacaltos Dec 30 '18 at 17:02