Search Unity

Questions about maximum texture size can be used in iOS

Discussion in 'iOS and tvOS' started by liudibo, Mar 25, 2011.

  1. liudibo

    liudibo

    Joined:
    Dec 9, 2010
    Posts:
    75
    I want to show a panorama on a "SkySphere" in my project. The original size of the image(panorama used as the texture) is 4096 * 1583.

    I use a very simple shader to set this texture to a sphere object:

    Code (csharp):
    1. Shader "SkySphere" {
    2.     Properties {
    3.         _MainTex ("Base (RGB)", 2D) = "white" {}
    4.     }
    5.    
    6.     SubShader {
    7.         Pass {
    8.             Cull Front
    9.             SetTexture [_MainTex]
    10.         }
    11.     }
    12. }
    13.  
    Every works fine in the editor using Unity Remote on iPad. But after I port it to the real iPad, I only see a black screen. Then I try to reduce texture size to 2048, this works fine on the iPad device. Here are 2 screen-shot to show the setting of the imported texture:

    $屏幕快照 2011-03-25 下午10.17.14.png $屏幕快照 2011-03-25 下午10.19.27.png

    The only difference of the settings is "Max Size".

    So my questions are:
    1. Does 2048 is the max size that iOS (OpenGL ES 2.0) support?
    2. If not what's the limit?
    3. Are there some other ways to implement a high res "SkySphere" in Unity, even bigger than 4096?

    Thanks for help.
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The max size depends on the hardware. Pre-3GS is 1024, after that is 2048. Also, you need square power-of-two sized textures to be able to use compression.

    --Eric
     
    7a likes this.
  3. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
  4. liudibo

    liudibo

    Joined:
    Dec 9, 2010
    Posts:
    75
    Thanks, my friends.
     
  5. synapsemassage

    synapsemassage

    Joined:
    Jul 27, 2009
    Posts:
    334
    Considering your given example i would recalculate (change proportions) your panorama pic to 2546 x 2546 (this equals your 4096 x 1583 resolution size) and then resize it to 2048x2048 to take advantage of compression.
     
  6. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,085
    why are you scaling up then down instead of just scaling down?
     
  7. celaeno

    celaeno

    Joined:
    Jan 31, 2013
    Posts:
    64
    Hello, I've materials with tiled textures. Now it bakes from the tiled textures one big texture atlas. So a wall material with 10x10 brick textures becomes one big 10x10 brick in the texture atlas, is there also a way to get only one brick texture in the atlas and keep the end result tiled? I tried fix out of bound uv's but I'm not really getting if it is possible to keep tiled material without getting a big texture atlas.

    Thanks