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

Unity 3.3 MSAA and particles...

Discussion in 'iOS and tvOS' started by sboyette, Mar 26, 2011.

  1. sboyette

    sboyette

    Joined:
    Jan 22, 2009
    Posts:
    62
    When I have particles and turn MSAA on - in Unity 3.3 - my particles polygons are clearly visible - I am assuming its due to the sampling, however is there a way to resolve this?
     
  2. synapsemassage

    synapsemassage

    Joined:
    Jul 27, 2009
    Posts:
    334
    I also use particles and MSAA but can't confirm this. What shader do use? You should use correct mobile shaders: shader/mobile/particles/e.g. additive.
    I experience a major impact on performance though! Especially then particles are erupting and close together in a cluster. If there is a way to improve performance. I would like to know it :)
     
  3. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    particles that are close together are always costly, thats because of the overdraw which hits the fillrate, the major limited thing on iphone4 / itouch4 / ipad1 with hd resolution.

    as for the original problem: aside of what synapsemassage mentioned, also ensure that the texture is well done on the fading end so it does not lend itself to such side effects.
     
  4. sboyette

    sboyette

    Joined:
    Jan 22, 2009
    Posts:
    62
    Guys, thanks for the info.
    I am not having a costly issue (performance seems just fine), Its a rendering issue. I am using the mobile shaders - and only see the issue when I switch MSAA on (2x), its like the AA engine is rendering the extremities of the polygon billboard.. I have attached a picture of the issue...



    This is just an image of where the emitter is - and some of the particles that are shooting out.. If I turn MSAA off - it looks perfect.
     
  5. synapsemassage

    synapsemassage

    Joined:
    Jul 27, 2009
    Posts:
    334
    I had a similar looking problem a while ago, not with particles but gras patches. As far as I remember it was related to texture compression but not MSAA related. Do you use texture compression (PVRTC)? Also compression might cause artifacts as transparent areas will suffer from compression. Check if switching your texture to RGBA 16 or 32 helps.
     
    Last edited: Mar 26, 2011
  6. sboyette

    sboyette

    Joined:
    Jan 22, 2009
    Posts:
    62
    @synapsemassage - Thanks for the input - I just tried a uncompressed texture, and that was not the issue.. but I did find it!

    It is the mobile particle shader when used with MSAA, nearly all of them..
    If you dont use MSAA,it works like a champ, however when turned on, it works poorly.

    I was able to cheat it someone - by simply using the mobile/transparent, vertex shader on my particle. seems to work.. not quite as good looking as a particle shader, but it works..

    Thanks again!

    Sean
     
  7. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    @sboyette: I would like to say that I am experiencing the same issues.
     
  8. sboyette

    sboyette

    Joined:
    Jan 22, 2009
    Posts:
    62
    @Daniel - Its the particle Shader coupled with MSAA - I was able to work around it by changing the texture to use the mobile/transparent shader.. (not as vibrant as the particle shader) and it works just fine!
     
  9. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    I can't find the mobile/transparent shader. Is it built-in to Unity?
     
  10. sboyette

    sboyette

    Joined:
    Jan 22, 2009
    Posts:
    62
    It is, If you import the Standard Assets (Mobile) - its under Shaders - Mobile Transparent Vertex Color.
     
  11. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    oh, okay. thanx
     
  12. synapsemassage

    synapsemassage

    Joined:
    Jul 27, 2009
    Posts:
    334
  13. dissidently

    dissidently

    Joined:
    Dec 8, 2010
    Posts:
    286
    is the shader you're having problems with, and now worked around, the ADDITIVE mobile particle shader?
     
  14. dissidently

    dissidently

    Joined:
    Dec 8, 2010
    Posts:
    286
  15. synapsemassage

    synapsemassage

    Joined:
    Jul 27, 2009
    Posts:
    334
    In my project ADDITIVE seems to have the smallest impact on performance. Maybe: The problem might be using ADDITIVE with (real) transparency creates the artifacts. A workaround seems to be to use the mobile/transparent shader. Maybe: You could also try to fill transparency in your texture with black solid color and use additive shader.
     
  16. dissidently

    dissidently

    Joined:
    Dec 8, 2010
    Posts:
    286
    I agree. I've had a couple tests done for me, that show using Additive shaders WITHOUT alpha channels and using black instead, has massively increased iOS performance.

    However I'm concerned about the issue with the polygon edges showing, as stated in the OP. I've had one instance of this as well. In another engine. Not yet in Unity. But haven't tried this latest release.
     
  17. synapsemassage

    synapsemassage

    Joined:
    Jul 27, 2009
    Posts:
    334