4
\$\begingroup\$

Screenshot.

After setting a texture to GameObject, it looks bad. Some pixels can be seen and colors are distorted. The image itself is in good quality but after importing it to Unity, it looks ugly.

Screenshot explanations:

  • left, image attached to the GUITexture GameObject
  • middle, image before importing to Unity
  • right, after importing (shown in inspector)
\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

The shape distortion you're seeing (especially in the right picture) is probably related to how you're drawing the texture. Ensure that you're using dimensions that maintain the aspect ratio of the image.

The blurriness is probably from the import settings of the image. By default the image is put through a bi-linear filter, the maximum resolution is 1024, the image is stored as a power of 2, and compression is enabled. All of these settings can cause what you're seeing with image quality.

In your case I'd say go to the texture importer and change the import settings for "Texture Type" to GUI (Editor/Legacy), change the "Filter Mode" to Point, the "Max Size" to what ever is closest to your native resolution, and change "Format" to Truecolor. Experiment with the last step of changing the format, since Truecolor is no compression whatsoever, and the image will take a large amount of memory.

Also look at tutorials for ways you can "coerce" the image into working well with compression by codifying the colors you use a little.

\$\endgroup\$
0
\$\begingroup\$

Did you insert on the Pixel Inset the right coordinates?

Somethimes i have the same problem, the problem with Unity is that you cant have pixel perfect its very hard, because 1 unit in Unity is not necessarily 1 pixel in the image. But indeed is 1 unit in Unity its about 1 meter, so may have to do some math on it.

If you are using an orthographic camera maybe this can help.

http://indiehoodgames.wordpress.com/2013/07/27/pixel-perfect-calculator-for-orthographic-camera-unity3d/

My suggestion is that you use a Plane, and try to put the texture on it, and scale it where is the best look by trial and error.

Best of luck

\$\endgroup\$
1
  • \$\begingroup\$ 1 Pixel can be 1 Unit in Unity pretty easily. All it takes is configuring another camera to render the GUI, and setting that camera's aspect ratio and size according to the screen size \$\endgroup\$ Aug 13, 2014 at 21:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .