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

Built-In Image Effects and Android

Discussion in 'Shaders' started by GoricLeonor, Jul 21, 2015.

  1. GoricLeonor

    GoricLeonor

    Joined:
    May 23, 2014
    Posts:
    3
    Straight to the point: despite promising claims stated in this article I am unable to use the Optimized Blur and Bloom effects on Android. The only feedback I get states that: "The shader Hidden/FastBlur (UnityEngine.Shader) on effect BlurCamera (UnityStandardAssets.ImageEffects.BlurOptimized) is not supported on this platform!". I suppose (or maybe I'm wrong) that hardware is not the issue, it's been tested on Sony Xperia C5303 with Adreno 320 GPU on board supporting OpenGL ES 3.0. I looked throughout the entire web looking for a solution and skyrocketed everything in the quality panel in my desperate attempts to make my game look pretty again.

    Was it all in vain?
     
    Zinov likes this.
  2. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    You should probably forget about full screen effects for mobile platforms for now. The overdraw of it alone is usually too much for mobile devices.
     
  3. GoricLeonor

    GoricLeonor

    Joined:
    May 23, 2014
    Posts:
    3
    Solved it, apparently using constant arrays in shaders crashes the compiler on Adreno 3xx devices.
     
    Last edited: Jul 24, 2015
    Zinov likes this.
  4. Theformand

    Theformand

    Joined:
    Jan 2, 2010
    Posts:
    271
    How did you solve it? I'm messing around with Bloom on my LG Nexus 5, just for funsies and the BloomOptimized script is being disabled.

    I see the static const arrays of blur weights in there. But I'm not sure how to untangle them from the rest of the shader. Any tips?
     
  5. GoricLeonor

    GoricLeonor

    Joined:
    May 23, 2014
    Posts:
    3
    Simply remove the const keyword and it should work correctly. I'm not sure what the performance implications are from the array not being constant, although it works like a charm on my Xperia SP.
     
    Last edited: Sep 9, 2015
    dariy, sirbrialliance and Zinov like this.
  6. Theformand

    Theformand

    Joined:
    Jan 2, 2010
    Posts:
    271
    Thank you, I misread your solution as the arrays themselves being an issue :) Not their const keyword. Seems to work for me as well.
     
  7. sanmn19

    sanmn19

    Joined:
    Jun 30, 2013
    Posts:
    56
    Thanks a lot! You just saved me lot of time. Removed the const keyword for the array and made them fixed and it's working as expected. I thought it was an optimized shader, why would they declare those arrays as half s?
     
  8. Zinov

    Zinov

    Joined:
    Jul 20, 2015
    Posts:
    38
    I just want to say thank you. You saved my day.
     
  9. amarinello

    amarinello

    Joined:
    Feb 25, 2014
    Posts:
    2
    Thanks a bunch for this. Exactly what I needed.
     
  10. dariy

    dariy

    Joined:
    Jun 23, 2014
    Posts:
    2
    Thank you, Goric!
     
  11. incytel

    incytel

    Joined:
    Mar 2, 2016
    Posts:
    3
    Thanx Goric! The blur was working on my Xperia M2, but it had an awful performance. (I think the issue was because I was interpolating the blur size to give it some ease effect), however, removing the const keywords fixed the problem entirely.
     
  12. R3tr0BoiDX

    R3tr0BoiDX

    Joined:
    Feb 22, 2014
    Posts:
    2
    Sorry, I don't get it. What exactly did you changed?
     
  13. macrod

    macrod

    Joined:
    Dec 9, 2012
    Posts:
    31
    Unfortunately, removing the 2 "const" qualifiers from MobileBloom.shader does not solve my problem here on Nexus 5.

    The Bloom Optimized effect itself is good, but it conflicts with the Unity UI if the canvas uses Screen Space - Camera. <---- Due to UI camera Clear Flag > Don't Clear.
     
    Last edited: Dec 1, 2016