x


About MipMaps problem.

Dear Unity Users,

We are desinging a user interface for our game, Recently we have come across a problem with our GUITexture element. We imported a png file with alpha and unticked Generate Mip Maps option but the texture in game is not sharp and seem like a low quality import. we have attached the original image , an ingame screentshot of the mentionent texture and out import settings. We have tried using various formats but failed to impruve the quality of the texture.

Any help is greatly appreciated.

alt text

Thank you in advance Grcan SERBEST

more ▼

asked Jan 07 '11 at 09:02 PM

Grcan SERBEST gravatar image

Grcan SERBEST
71 1 1 7

(comments are locked)
10|3000 characters needed characters left

4 answers: sort oldest

Thank you for all answering. The problem has been solved, it was indeed a resizing problem, choosing " ToLarger" has worked like a charm. Krobill's answer as that and this was the correct answer. I want share the solution with you.

If image doesn't have dimensions that are a power of 2, by default Unity will resize it for you. On our screenshot it's the combo box non power of 2 with the 'to nearest' option selected. This means your texture may have been resized to a lower resolution and is stretched on screen to fit the desired size.

Your options are : - Prevent this resizing, but it's always a good thing to use power of 2 dimensions since it's more hardware friendly - Choose 'To Larger' to allow the resizing but one without loss of data - Resize yourself your texture to a power of 2 dimension which is in fact recommended most of the time.

Thanks again for the quick reply.

alt text

Regards.

more ▼

answered Jan 07 '11 at 09:47 PM

Grcan SERBEST gravatar image

Grcan SERBEST
71 1 1 7

(comments are locked)
10|3000 characters needed characters left

Looks like compression artifacting. Change the texture format to RGBA32 or something like that instead of automatic compressed or dxt5 or whatever you have it set to.

Also, is your texture actually a power of two? Maybe turn off the NPOT stretching?

more ▼

answered Jan 07 '11 at 09:04 PM

Tetrad gravatar image

Tetrad
7.3k 27 37 89

Hello Tetrad,

The image format is currently ARGB 32 bit no luck so far...I do not know how to turn on or off the NPOT stretching, please if you could elaborate on that. The texture we are using is at its original size ingame so there should be no stretching if I understand it correctly. Our code is; GUI.DrawTexture (Rect(altbar1520yan,altbar1520dik,1520,363),altbar1520);

Jan 07 '11 at 09:34 PM Grcan SERBEST
(comments are locked)
10|3000 characters needed characters left

How are you drawing the texture?

If you happen to be using a GUI.Label() to draw the texture it adds padding and it distorts images and generally makes them look fuzzy (in my experience).

Try using GUI.DrawTexture() instead and see if that helps.

more ▼

answered Jan 07 '11 at 09:15 PM

Moxon gravatar image

Moxon
21 1 1 5

Hello Moxon ,

We already use GUI.DrawTexture when drawing texture...

Thank you

Jan 07 '11 at 09:27 PM Grcan SERBEST
(comments are locked)
10|3000 characters needed characters left

Have you toyed around with the filter mode of the texture? Bilinear filtering will, by default, tend to slightly smudge the pixels around to attain some slight softness in textures. It's ideal to not filter your UI textures at all though if you want them to be in the exact way you originally drew them.

more ▼

answered Jan 07 '11 at 09:40 PM

Jason B gravatar image

Jason B
1.7k 29 32 44

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x22

asked: Jan 07 '11 at 09:02 PM

Seen: 1388 times

Last Updated: Jan 07 '11 at 09:02 PM