Hello Guest

Author Topic: How to get sharp text and sprites under iOS on iPad?  (Read 10901 times)

rhart

  • Newbie
  • *
  • Posts: 5
    • View Profile
How to get sharp text and sprites under iOS on iPad?
« on: April 30, 2012, 07:33:01 pm »
I am essentially taking text that a user has typed in on their iPad keyboard and display it in a word balloon, so I need the balloon to look really crisp as well as the text. I set the word balloon up as a sprite and I did a text mesh for the text.

On the desktop things look pretty nice, however when I build onto my first gen iPad, the sprites and text are looking fairly pixelated. I tried running some of the demo scenes that come with the toolkit on the device, and I'm seem to be getting similar results.

It it possible to achieve really sharp text and sprite graphics under iOS on an iPad with 2DToolkit. If it is, can anything think of anything I could be doing wrong that I may be able to check. Achieving crisp text seems to be be quite a challenge in Unity, and I'd like to avoid using gui text and Unity GUI if possible.
« Last Edit: April 30, 2012, 07:35:30 pm by rhart »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to get sharp text and sprites under iOS on iPad?
« Reply #1 on: April 30, 2012, 09:07:45 pm »
You should be able to get pixel perfect sharp text on any platform. If you're not, then its either not set up correctly, or you might have uncovered a bug.

I can't guess what is wrong with your set-up, but I'm guessing one of the settings is incorrect. For example, if you ran sample 1 - demoscene on an iPad, it would look blurry as the text will be upsampled from 960x640 -> 1024x768. This is intentional, and you need to adjust your camera to compensate for the change in resolution.

If you run example 11 - camera and alignment however, this should look pin sharp on any target device, as the tk2dCamera automatically adjusts itself to be pixel perfect on any camera.  Another thing to be careful of is positioning the textmesh; it should be on a pixel boundary to be pixel perfect. If your word balloon is in 2D, then using tk2dCamera is probably the easiest way to handle this. 1 world unit in tk2dCamera = 1 pixel.

A number of questions to help me diagnose the problem more specifically -

1. What version of 2D toolkit are you using?
2. Does it look correct in the viewport, at the correct resolution (it really does need to be exactly the same number of pixels)? Eg. 1024x768 vs iPad
3. Is there anything going on with the quality settings in Edit > Project Settings > Quality? Is one of the texture sizes being halved?
4. Are you using tk2dCamera?
5. Are you trying to use the text on a 3d mesh?

Another thing which can help me diagnose this a lot quicker is if you could create a test project demonstrating this issue. If this is possible, then send it to support at unikronsoftware dot com, and I will be able to take a look at this for you.




rhart

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: How to get sharp text and sprites under iOS on iPad?
« Reply #2 on: April 30, 2012, 10:37:43 pm »
Steps I am taking

Experiment 1 --> Just Testing Example 11 on iOS (iPad Gen 1) (2DToolkit version 1.60 patch 1)

1. Create a new unity Project
2. Once the new project opens, I go to build settings
3. Switch form Mac/PC to iOS --> Switch Platform button pressed
4. Go to the asset store for 2D Toolkit and choose import (I have already bought it, which is why it says import for me)
5. Import All into my new project
6. Go to samples 11 - camera and alignment
7. At this point the text looks blurry and pixelated in the view port vs when before conversion from Mac/PC to iOS it looked wonderful.
This leads me to think that something is happening in the conversion process from Mac/PC to iOS that is affecting/diminishing quality.
8. Compile and test on iPad (the real device) --> Pixelated output
9. Went in and checked DemoCameraFont and it said it appeared to have been compressed --> so I set it to truecolor and the text go a heck of a lot better immediately.
10. Compiled and tested on iPad --> Text and images looked nice and crisp!

Experiment 2

I'm going to see if I can do an example of a nice crisp 2DTextMesh from scratch with version 1.60 patch 1 using a 2DToolkit camera, for a 1024 x 769 iPad that will display in Landscape and see what happens. What I'm eventually shooting for is placing the nice crisp text on/infront of a 2D word balloon, so it looks like a comic book dialogue. Will post back results.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to get sharp text and sprites under iOS on iPad?
« Reply #3 on: May 01, 2012, 12:09:00 am »
That makes sense. The DXT compression used on PC/MAC produces significantly better quality output than PVRTC on iOS. In any case, the main idea is what you see in the output window should be what you see in on the device, and thankfully it looks like it is doing what is expected now.

Another thing to check if this happens again is the quality settings - I have had more than one case where the texture size was halved through this.

cataclyst78

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: How to get sharp text and sprites under iOS on iPad?
« Reply #4 on: May 02, 2012, 06:57:06 am »
Thanks for this tip. Had same problem on Android because it was defaulting the quality to "fastest". I am forcing the quality to be "good" and it looks great.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to get sharp text and sprites under iOS on iPad?
« Reply #5 on: May 02, 2012, 06:09:32 pm »
Awesome. Glad its sorted :)