Hello,
I am working on a game in my company, We will launch our game for iphone 3g and iphone 4g, Now difference between resolution of iphone 3g and iphone 4g, dpi of iphone 3g is 480x320 and iphone 4g has 960x640.
now at which resolution i need to make textures for my game,
do i need to make textures according to 960x640 resolution or make them according to 480x320
because if i make a texture of size 480x320 and use it as a guiTexture its view is full on iphone 3 and one iphone 4 it is half from both sides, if i set pixelInset to 960x640 then it is not so smooth that can be on iphone 4
Please suggest something,
Thanks in Advance
I don’t have any experience developing for iPhone in particular, but typically this kind of problem is solved one of two ways.
- Create your texture to suit one device and then scale (stretch or reduce) it for the other device. If you want maximum detail, create it for the 960x640 resolution and scale it down for 480x320 devices. If you want a smaller/higher performance texture, create it for the 480x320 devices and scale it up for the 960x640 resolution.
or
- Create two textures (or texture sets) and select the correct one for the device at run time.
The second option obviously doubles up the artwork required, and also means having twice as many textures assets in your game, but its probably the highest performance option (being programmatically simpler). The first option, if done properly, is more portable - you can scale your texture(s) up/down to suit resolutions other than the two you mentioned (e.g. if the next iPhone model has an even higher resolution screen).
as the retina resolution happens to be 2x the older iphone resolution, you can do following:
- design textures for 960x640
- tell em to have mipmaps
- configure i.e. the “Simple” quality settings (Edit->Project Settings->Quality) to have half-resolution textures
- when the game detects that it is running on 480x320 resolution, make it use the “Simple” quality settings (QualitySettings.currentLevel=QualityLevel.Simple)
where, in game do I use this to switch? is it dynamic?
Thanks wennid,nsiomos for your suggestion,
It would be great if we could know best approach, from Quality, Performance and Build size perspective.
You’re welcome 
Just to clarify, nsiomos’s way is an easier (better) version of my “option 2” (ie. getting Unity to do it for you instead of manually making both a hi- and lo-res texture).
nsiomos’s way will be the best for run-time performance, but will produce a slighty bigger build size (as will any variant of option 2) because you have both a hi-res and a lo-res texture in your final build. You can get a smaller build by scaling on the fly when necessary (ie. option 1), but at the cost of performance.
If you use a lo-res texture, then you get the smallest build size and you only need to scale on the better hardware (where the performance hit is presumably less of an issue), but the quality will suffer since the lo-res texture obviously isn’t going to have the level of detail a hi-res version would.
the two methods are a tradeoff between memory and build size basically:
-
if you only include hi-res textures, you save the build size for the low-res ones, but the older devices need to load the big textures into their limited RAM. So, if your game suddenly crashes (I had this…), then this solution is not for you.
-
if you include low- and-hi-res textures, memory usage is optimized on low-res devices, but you pay for it with build size (all textures sizes = 1.25 * largest textures sizes).
Note also that when using the trick with mipmaps I described above in order to have Unity do all the work for you, the build size cost is slighty larger, as unity generates textures of 1/2, 1/4, 187 etc size too (all textures sizes = 1.33 * largest textures sizes)
Is it possible to build a iPhone 3G version and an iPhone 4 version and submit them separately to the app store (is this allowed)? What about the iPad?
Mip maps can look terrible sometimes (such as textures that require an alpha channel), and waste memory for sizes you’re not actually using - I recommend the solution I posted in this thread a while back:
http://forum.unity3d.com/threads/78154-Supporting-Multiple-iOS-Resolutions-(iPad-iPhone4-3GS)?highlight=DynamicTextures
no its not possible to have multiple versions like that. iPads can usually have own version because the dimensions of the device, screen size with usable area, controls and so on are a bit different from the smaller devices. Apple can reject iPad versions too if theres no reasonable difference from mobile versions