Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

iPhone hardware : interesting facts

Discussion in 'iOS and tvOS' started by n0mad, Nov 24, 2009.

  1. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    Just browsed again the GLBenchmark results for 3GS, and I realized some interesting things :

    - 3GS has a much higher fillrate for Multi-textures than Single-Textures
    - Ambient light is a bit more expensive than Omni
    - the most interesting ... 256x256 texturing is a lot more expensive than 512x512
    - The overall is clearly optimized for 512x512
    - NEAREST_MIPMAP_LINEAR filtering beats Linear
    - GL_MAX_VIEWPORT_WIDTH is set to 2048, as Height.


    So what I can understand is :

    - It appears that every device has a slightly higher fillrate with multi than single texturing, but with the 3GS, there's a 20000 kTexels gap, which is huge.
    Would it mean that we would have better performance with a 2 texures pass, one being a plain color, than with a single texture pass ?
    - As ambient lights are barely used when you have more than one light, would it be possible to completely shut down Ambient in a shader ?
    - Never use 256x256 textures. Never. :D
    - It will always be better perfs to use 2 x 512*512 textures than one 1024*1024
    - Better use NEAREST_MIPMAP_LINEAR filtering.
    - We can use the 3GS as an HD video emitter (like connecting it to a TV).



    Also, other facts :
    - 2G and 3G have same performances between each other
    - 3G just don't care about texture size at all, same perfs for all.
    - same for filtering



    So at last, there is no impact on doing those optimizations for any type of iDevice, and benefits will be greatly visible on 3GS.

    Overall, if we're using 512x512 textures, using Nearest MipMap Linear, shutting down Ambient, and optimize the texturing for Multi Textures, we can gain :
    - +14745 kTexels / second,
    - +3700 kTris / second


    edit : This is not very huge, as 3700 kTris / sec would mean 60k tris / frame at 60 FPS. And I'm really not sure about the single to multi-texture trick.
    But still interesting.
     
  2. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    2,686
    60 tris is really nothing but interesting - but it's good to see in a benchmark how different texture sizes perform. 64x64 is as bad as 1024x1024, that's good to know!
    But as i have learned some days ago using mipmapping will be always faster - so when using mipmaps I've no control about the texture size anyway or am I wrong?

    I am more surprised about the fact that the iPhone is actually very british and a grandson of the Acorn Archimedes 8) - Prozessor and GPU are both from british companies.

    So if your iDevice is slow blame the brits, if the touchscreen is not responding blame the germans, if it crashes blame the americans, if it does not survive when it falls on the floor blame the chinese :D
     
  3. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    Oops sorry, I made a mistake, it's not 60 tris / frame, but 60K (60000).

    Finally, I think the real useful calculation would be :

    +3700 kTris / sec, which means +3700 tris / miliseconds.

    In a recent Profiler, I had :

    So :
    tris #> avg: 10164

    in :
    render: 2.4

    which means 4235 tris / ms.

    In that number, we must count all the shaders differencies and other graphic workouts that exceed a simple textured mesh display.
    So it's not very accurate.

    But that would abstractly mean that instead of doing a 2.4 rendertime, I'd do a 1.3 rendertime.

    Plus the kTexels / second boost that is impossible to measure right now.

    Would be interesting to make some bench using those optimizations, and without.
     
  4. minevr

    minevr

    Joined:
    Mar 4, 2008
    Posts:
    1,018
    What????? 256*256 > 512*512???

    Really :?:
     
  5. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    2,686
    What about the results of the iphone 2G and 3G in this database? It always says 512k triangles/s. I guess it's just not tested ? I mean the 3GS can't be 10 times faster.
     
  6. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    Yes it is ;)
    (GPU wise)

    (video comparison on a demo)

    Although, I think it effectively misses somes tests about 2G/3G. But those numbers seem quite realistic.
     
  7. moctezumagames

    moctezumagames

    Joined:
    Jun 9, 2009
    Posts:
    395
    I am not only worried about the performance crazyness... how can it be even the same?

    This makes me think I can't trust those results.
     
  8. ader

    ader

    Joined:
    Jan 27, 2009
    Posts:
    155
    Did you mean:

    It will always be better perfs to use 4 x 512*512 textures than one 1024*1024

    ?
     
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    No, incorrect math aside ;), multiple textures = multiple draw calls = much slower than any minor differences in texture performance, if they do in fact exist.

    --Eric
     
  10. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    Oh my .... well yes :roll:

    Aw, that's true.

    Anyway, there must be a trick :D
     
  11. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    I've seen such odd facts in other hardwares as well.

    If this benchmark is serious (and since it has been existing for years, I'm sure it's serious), there might be some weird explanation behind the new GPU pipeline.

    Just like the one where AlphaTest is slower than Blending on iDevices, but not in other big GPUs (PC, consoles, etc).
     
  12. giyomu

    giyomu

    Joined:
    Oct 6, 2008
    Posts:
    1,094
    not from my knowledge , but I hear that texture size things is related to how in the hardware the binary data are stocked that will make a "normal" reason for such behaviors, hearing that from some core engineer guys ( didn't really understand all the speech :(..)

    so that shouldn't be weird things but somethings totally normal form "the core enginneer" point of view ,

    I wonder if there is some infos on teh web about that particular things in a more general way ...
     
  13. n0mad

    n0mad

    Joined:
    Jan 27, 2009
    Posts:
    3,732
    Hey, I found a post in Toucharcade developers forums :


    If this is true, this is very important, as every skinning operations were put on VFP in iUnity 1.5.

    Is it confirmed ?

    edit : I have some kind of proof that 3GS is less effective with VFP than older models : If I put a negative X scale (= mirroring) on a 41 bones skinnedMesh, my global frametime is nearly cut by an half.
    On my 3G, it is barely visible.

    I read a post from ReJ some time ago, where he was stating that they'll put native Neon optimization instead of Neon VFP in a future build.
    That would mean replacement of VFP I guess, and if the guy in the quote says truth, that would mean a big skinning/physics/vector perf overall. Until I'm completely wrong.