- Home /
high quality image appears low quality when displayed through a GUI window
Hello everyOne, I am using GUI window to display a popup menu before and after level start. my problem is the quality of the image! its displaying very blury and low-quality although the image is too high res for this(2100x720) but I am displaying it in 350x120. I also tried different formats, different resolutions.. still the same result
I am dragging it to a Texture variable also tried Texture2D .. I can't figur out what might what might be the problem! help please
Well, when using GUI.DrawTexture , I am having this problem. I tried to attach to a GUITexture, its perfect! so what's the problem with GUI.DrawTexture? although using 750x240 dimensions for a 2100x720 image.(same aspect ratio)
I had the same problem, but for the solution was this: http://gamedev.stackexchange.com/questions/98678/what-causes-this-graphics-quality-difference-between-webgl-build-and-unity-5-edi
Answer by hathol · Jun 26, 2012 at 12:54 AM
Check your import settings for the image and make sure it's set to GUI. Unity imports as Texture by default and auto scales the image to a 2^n resolution so it gets blurry when rescaled to its original aspect ratio again.
but why great result with Guitexture and not with GUI.DrawTexture?
Sure :) If you click on your imported image in the project view (your asset library basically), the import settings will show up in the inspector view. The property you are looking for is called "Texture Type" (Unity 3.5.1). Its just a dropdown menu. Select GUI there (and maybe change the format from compressed to 16 bits while you're at it) and you should be fine :)
To your other question: it doesn't matter. The important point is the import setting. When set to texture, the image gets rescaled to a different aspect ratio and then rescaled again to fit the chosen ratio specified by your guitexture or GUI.DrawTexture. Since scaling is not a lossless operation, the result gets blurry. When set to GUI ins$$anonymous$$d, the image gets padded to the next largest power of two size, therefore preserving the aspect ratio of your original image. This results in a slightly higher memory consumption, but keeps the image nice and sharp. For more info, read http://unity3d.com/support/documentation/$$anonymous$$anual/Textures.html :)
Your answer
Follow this Question
Related Questions
Rendering GUI.Buttons in the middle of the screen 5 Answers
My OnGUI() Won't show the Button elements :( 0 Answers
Draw crosshair INSTEAD of cursor. 1 Answer
Capture screenshot to texture, memory issue 1 Answer
Non-uniform scale textures in GUI 1 Answer