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

Anti-Aliasing

Discussion in 'iOS and tvOS' started by mattimus, Jan 24, 2009.

  1. mattimus

    mattimus

    Joined:
    Mar 8, 2008
    Posts:
    576
    I know that unity iphone currently does not support anti-aliasing. Until recently, I have just assumed that this was a limitation of the hardware. However, recently I have seen games that feature anti-aliased 3d. Granted, it is only 2x, but it is certainly better than nothing.

    Has anyone looked into possible workarounds for 3D anti-aliasing in Unity? I'd be curious to see methods as well as performance implications of better edge rendering.
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Is Edge really 3D, or is just 2D isometric (like Marble Madness and other pseudo-3D games that existed long before 3D acceleration)? If it's 2D, then they can do whatever AA they like with the pre-rendered graphics. Personally I haven't seen any 3D iPhone games with AA (not just the Unity games, but all of them).

    --Eric
     
  3. CedarParkDad

    CedarParkDad

    Joined:
    May 28, 2008
    Posts:
    98
    If you have the framerate and memory to give, you can render to a texture twice the size of the to a texture and use a software pixel shader replacement to resize correctly on the display size. That's the "easy" but expensive way to get 2x in a 3D game. But, it is expensive as heck and why nobody I know of has anti-aliasing in true 3D.

    Most work towards removing "jaggies" is done through art which doesn't present high-contrast edges (ie red-on-white...heck, anything except white on white). I'd look more along those lines, as well as movement and cover of edges (plants). Take a screenshot of any 3D game and look for how they hide the edges, as people have gotten pretty good at it.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    With 2D through 3D, "antialias" can be handled pretty simple actually.

    Just make the border or your images an alpha gradient so the border is more than a single pixel. that will help to boost the quality drastically as it will not have the problem of "pixel there - no pixel there" which is causing the rolling edge issues that normally look that worse.
     
  5. bakno

    bakno

    Joined:
    Mar 18, 2007
    Posts:
    604
    How can you do this? Are you referring to the border of the objects (something handled by the shader) or the border of the texture image?
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    border of the texture

    you won't get geometry antialias for realtime 3d usage (20FPS+), independent of what you do on the iphone
     
  7. HaruRuben

    HaruRuben

    Joined:
    Mar 25, 2009
    Posts:
    22
    Just got my iPhone 3G-S, what's cool is i kept my deactivated phone as an iPod and it still has
    all my apps on it so i can run them at the same time and it's a HUGE difference

    i saw on the Khronos forums for Open GL ES2 some talk about AA in ES2, but it's all a bit over my head

    here's a good benchmark, this is about what I was experiencing as well, even on intensive full 3d apps like GameLoft's Hero of Sparta:

    http://topiphonenews.com/iphone-3gs-blows-away-iphone-3g-in-3d/

    so, I guess my question is now that we have new hardware and ES2, do you think some level of AA would be doable?
     
  8. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    if you don't care about graphics memory.
    AA doubles the VRAM usage for the general presentation buffers by x*const where x is the AA level you use.

    I don't think its a feature you really need at sub-mm pixel sizes as most users aren't able to detect single pixels on it at all.
     
  9. HaruRuben

    HaruRuben

    Joined:
    Mar 25, 2009
    Posts:
    22
    maybe on most games, but for a scientific app it's nice to have more clarity. something critical to understand, like if it's a spaceship and it looks slightly gritty that's okay but to demonstrate a mechanism for example clarity is very important

    but that's more of a discussion of a creative balance, all real-time apps are a balance of performance vs. quality. it really should be left to the developer to decide how much vram is too much for that app. for a scientific app, or say an adventure/thoughtful puzzle style game frame rate really isn't nearly as important as if you are making a jumping man game

    games are 99 cents, a serious enterprise app for manufacturing/scientific/etc. client is more lucrative at the moment.(and would legitimize buying a lot more iphone Unity licenses than my one test case)

    for this project I'm debating how to appraoch the design, I did a test 3d version of the mechanism which would be ideal, but of course too gritty to understand visually

    I suppose the risk is if Unity iPhone appears sluggish because people are misusing any theoretical AA then Unity iPhone gets a bad reputation.