- Home /
The question is answered, right answer was accepted
My sprite from sprite.create looks pixelated.
When I use sprite.create with a www.texture from a png and view it at runtime it looks pixelated. This is how it looks like in the inspector when created:
This is how it's supposed to look:
Strangely it looks normal on a project testing animations, but when I moved the code to the project for the actual game, it results in how the first image looks like. But I don't see anything that might be the cause for this difference. Here's the code for creating the sprite:
WWW www = new WWW(s);
Texture2D texture = www.texture;
texture.filterMode = FilterMode.Point;
Sprite sprite = Sprite.Create(texture, new Rect(0.0F, 0.0F, texture.width, texture.height), new
Vector2(0.5F, 0.5F), 32F);
So how do I make it not look pixelated?
Answer by ghostmode · Oct 31, 2017 at 07:29 AM
Correct Answer: Go to your project's Quality Settings (Edit/Project Settings/Quality) and change the 'Texture Quality' to 'Full Res'.
Original Answer: One thing that might be causing this, you're not setting a pixelsPerUnit
in the Sprite.Create
call, so it's defaulting to 100 pixels per unit, is that what you want?
@ghostmode Well, it's already set in the call, the forth argument in sprite.create is set to 32F, which is the pixelsPerUnit argument. So it can't be it. Also pixelsPerUnit is just for how many pixels the game should draw per 1 unit of length in world space. So it shouldn't affect the sprite when viewed in the inspector.
Whoops you're right, I missed that in your post. Next idea: Go to your project's Quality Settings (Edit/Project Settings/Quality) and change the 'Texture Quality' to 'Full Res'.
@ghostmode Yes! That worked. Thank you so much. Also, if you can, just edit the answer so it makes sense as the correct answer.