- Home /
Sprites grey when camera zoomed out
Sprites turn grey when camera zooms out. How do i turn this feature off ?
It only happens when i load a png, split it and convert it into multiple new sprites. When i load a png and convert that into a sprite directly it doesn't turn grey.
The 'cinder block' in the images was loaded directly, the greyed out sprites were split.![alt text][1]
Messed around with materials and shaders but couldn't find anything that turned it off.
Answer by Nobozarb · Feb 10, 2018 at 02:13 PM
It is possible this could be caused by anti aliasing, though it does appear pretty extreme. Anyway, try going to Edit > Project Settings > Quality and change Anti Aliasing to Disabled, and then see if it still happens. If it does still happen, make sure there is only one Sprite Renderer on your sprites. I can't really think of anything else right now that would cause this, but I would definitely send a report using Unity Bug Reporter.
Answer by trevk84 · May 13, 2019 at 03:49 PM
I had this problem too. It's a texture mipmap problem. When the sprite turns grey, the grey is actually a mipmap of the texture. Mipmaps are like low definition versions of the original texture, and are used when the object is far away, when high detail isn't needed. Unity automatically does this to increase performance...but the texture on your sprite that you are using has no mipmap to draw, so it draws it as just grey when the object gets far enough awa. Just guessing, but the mipmap probably got deleted when you split/converted/edited the png.
Answer by FuturePilot1701 · Jun 21, 2020 at 06:31 AM
This annoyed me for literally an entire week. I finally found out how to fix it. Set the texture mipMapBias to a large NEGATIVE number. I was using a 10,000 x 5000 pixel texture for my game map, and when the camera was pulled far away from the sprite to show the whole map, the texture on the sprite would blur to white as if there was fog over it. to Do this you use "texture.mipMapBias = -x"
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
public class miniMapControl : MonoBehaviour
{
public GameObject map;
public Texture2D mapTexture;
void Start()
{
mapTexture = map.GetComponent<mapGeneration>().mapTexture;
mapTexture.mipMapBias = -5;
Rect rec = new Rect(0, 0, mapTexture.width, mapTexture.height);
Debug.Log(mapTexture.width);
Debug.Log(mapTexture.height);
//last number changes pixels per unit, which would allow the resolution of the texture to be increased
GetComponent<Image>().sprite = Sprite.Create(mapTexture, rec, new Vector2(0.5f, 0.5f), 1);
}
}
Your answer
Follow this Question
Related Questions
Best Performance for Background Movement 1 Answer
SVG vs other formats for GUI 0 Answers
Image vs Sprites performance 1 Answer
SpriteRenderer doesn't show the sprite 0 Answers
Canvas image sprite change from script 0 Answers