Search Unity

"Mobile Bloom" Shader from Angry Bots results in splash screen freeze in Xcode

Discussion in 'iOS and tvOS' started by an, Aug 18, 2011.

  1. an

    an

    Joined:
    Oct 6, 2009
    Posts:
    146
    Dear CommUnity,

    The title nearly says it all: In my current project, I tried to use the mobile bloom shader, shipped with the angry bots demo. I've applied the mobilebloom.js file to my main camera, and assigned the shader. Everything works perfectly in the Editor! However, if I build&run the app, the application freezes while displaying the SplashScreen.

    I really don't have any clue why this happens, and I'd be very lucky to hear some advice!

    thx in advance!
     
  2. Ntero

    Ntero

    Joined:
    Apr 29, 2010
    Posts:
    1,436
    What generation of iDevice is it?
     
  3. an

    an

    Joined:
    Oct 6, 2009
    Posts:
    146
    It's a 3GS, so it supports openglES 2.0
    I've tried to build it arm6+arm7 and arm7 only. both didn't work
     
  4. Ntero

    Ntero

    Joined:
    Apr 29, 2010
    Posts:
    1,436
    Ah k, sorry, OpenGL ES version was my only real lead.
     
  5. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    Does the game freeze at the splash screen if you take the script and shader out? i.e. is it definitely what's causing the crash?
     
  6. an

    an

    Joined:
    Oct 6, 2009
    Posts:
    146
    @Ntero: unfortunately that's not the problem. thanks for your help, though!

    @gepetto I've tried that already. Disabling the script and shader results in a running game, so it's definitely because of the mobile bloom.

    It seems like there's a general problem with mobile bloom, though:
    For testing purposes, I've opened the angry bots project, turned the bloom very high (to see if bloom works or not) and then built angry bots for my iPhone - The game runs, but it has no bloom (except the fake sprite-based glow here and there).

    I'm a bit confused as one of the angry bots devs said to me, that mobile bloom runs on mobile devices. however, if it would, I'd have seen that in my angry bots built (which is completely unaltered, except the bundle id and the bloom value. seems I like overlook sth here.
     
    Last edited: Aug 18, 2011
  7. marjan

    marjan

    Joined:
    Jun 6, 2009
    Posts:
    563
    hi, though i don´t know were your problem might be i can confirm that everything runs just fine. I just opened the demo project, set it to ios and build and run
    (maybe i made some adjustments in playersettings and changed some texture qualitys, don´t remember). Runs as expected under iPad2. Didn´t test any other devices though.

    I think i read somewhere, that angry bots is also available as a downloadable app in the appstore now, so you might want to try that one first.
     
  8. an

    an

    Joined:
    Oct 6, 2009
    Posts:
    146
    The application runs appropriately! It's just that the mobile bloom shader is inactive! Try setting the bloom very high in Unity (to see the difference between bloom on/off) and then build it for your OGL2.0 iDevice. It won't show the bloom.. (At least for me)
     
  9. an

    an

    Joined:
    Oct 6, 2009
    Posts:
    146
    Aah I've got a hint for y'all: The quality manager in AngryBots disables the bloom dynamically for 3GS-Devices. The iPhone 4 is the only iPhone with bloom. I tried to enable bloom for 3GS, too, it's building right now in Xcode.
    That doesn't explain why my application crashes, but it's better than nothing.
     
  10. an

    an

    Joined:
    Oct 6, 2009
    Posts:
    146
    Mobile Bloom works! At least in Angry Bots. It _was_ the Qualitymanager script disabling the Effect for 3GS-Devices.
    I edited the script and enabled Mobile Bloom for my 3GS, too, however this results in a noticeable performance loss.

    Now I've to try out how to get this beast into my own project!
     
  11. ole

    ole

    Unity programmer

    Joined:
    Sep 30, 2010
    Posts:
    56
    this should work fine:
     

    Attached Files:

  12. an

    an

    Joined:
    Oct 6, 2009
    Posts:
    146
    Hey ole, this, indeed, works fine!

    The performance is surprisingly great, and the quality is outstanding for mobile devices!

    Thank you for your awesomeness :)
     
  13. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Ole, could we tempt you into making a set of mobile shaders? you could even sell them on asset store to promote the store. I would happily pay a lot. That platform is crying out for fast shaders :)
     
  14. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Also please if its no trouble, is it possible to turn bloom shader into blur shader? just curious. Trying to look at blurring the 4 corners of the screen (a bit like how vignetting works without the chroma).
     
  15. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
  16. ole

    ole

    Unity programmer

    Joined:
    Sep 30, 2010
    Posts:
    56
    hehe :)

    a blurred vignette would be fasted to realize with texture masked quads you draw over the screen corners only where the texture mask defines the blurriness. you can use a similar separable blur as in the mobile bloom package (or try your luck with just downsampling upsampling).
    sadly, changing render targets on iOS can cause a GPU hit, so i am not sure if blurring once or for all 4 corners individually would be faster ...
     
  17. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah!! I got as far as doing the darkened corners myself (this is a lot of fun faking it btw).

    But I think blurring for all is a better idea, because its more useful. you could blur, bloom and tint the screen, its better for games to combine shaders. You guys taught me this with your pdf :)
     
  18. pepworks

    pepworks

    Joined:
    Jan 18, 2010
    Posts:
    19
    Hi folks,

    the mobile_bloom_unitypackage flips the camera in the editor in the vertical axis? :)
    Where do I have to place some "-" to have it have it run normal?
    (Does this only happens for me?)

    thanks,

    pep
     
  19. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Doesn't happen for me. But that might be because erm, an old version of unity required a workaround for mobile rendertextures. What version are you using?
     
  20. nopecio

    nopecio

    Joined:
    Nov 16, 2011
    Posts:
    23
    Hi, this happened to me in 3.4 too (now in 3.5 the screen is totally black)
    I hope this gives you a clue.
    Regards
     
  21. claudiohcs

    claudiohcs

    Joined:
    Feb 17, 2012
    Posts:
    8
    Hi, I'm with the same problem. When the mobile bloom is active, the camera flips in horizontal and vertical axis. I use 3.4 unity version.
    I've tryed use the mobile bloom from angry bots and everything works fine, but, when I build the apk for android and ran in it, the screen freezes in my loading scene, but I can still hear the music and interact with the menu scene (press buttons, for example).
    Regards.
     
  22. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    I have tried MOBILE_BLOOM_community.unitypackage on kindle fire 1 but is crashes on launch. any idea why its not workign !
     
  23. WermHat

    WermHat

    Joined:
    Jul 13, 2012
    Posts:
    88
    Just tested on an iPad Mini and the screen turns black when the shader is activated. iOS 6.0, Unity Pro 3.5.6. Works fine on all other iOS devices. Thoughts, anyone?
     
  24. SpiriTx

    SpiriTx

    Graphics QA

    Joined:
    Apr 12, 2012
    Posts:
    252
    I've just tested and it worked fine. If you are able to reproduce the crash, please file a bug with project attached.
     
  25. WermHat

    WermHat

    Joined:
    Jul 13, 2012
    Posts:
    88
  26. WarrenB

    WarrenB

    Joined:
    May 24, 2012
    Posts:
    21
    I tried mobile bloom on the Kindle Fire1 and Droid X2. Both crashed at startup with debug references to OpenGL. I tried the 32 bit buffer, in case that helped, but it still crashed.
     
  27. cherub

    cherub

    Joined:
    Apr 26, 2006
    Posts:
    493
    im getting this warning:

    Tiled GPU perf. warning: RenderTexture color surface (188x251) was not cleared/discarded, doing <run with profiler for info>
    UnityEngine.Graphics:Blit(Texture, RenderTexture, Material, Int32)
    MobileBloom:OnRenderImage(RenderTexture, RenderTexture) (at Assets/Scripts/Fx/MobileBloom.js:89)
     
  28. cherub

    cherub

    Joined:
    Apr 26, 2006
    Posts:
    493
    ok, so putting the following into the script made the warning go away. Whomever owns the package might want to update it.

    Code (csharp):
    1.     tempRtB.DiscardContents();
    2.     Graphics.Blit (source, tempRtB, bloomMaterial, 1);
     
  29. pez

    pez

    Joined:
    Jul 6, 2013
    Posts:
    52
    Hi, hoping someone can help me.
    We're getting some really bad performance issues with using any image effects on iOS. It can be mobile bloom, contrast stretch, vignette - anything we add, just on their own, makes our FPS drop from 60+ to 6.. (It starts high but then falls over about 10 seconds time)
    We did have the black screen issue, which turning the 32bit display buffer on fixed, but then obviously we got this big performance hit. Without any image effects and with the 32bit display buffer still turned on - we're still getting above 60fps. Anyone know why we're taking such a massive hit on performance from even the mobile optimized effects?
    Testing on an iPad 2, Latest iOS version.
    Thanks
     
  30. cherub

    cherub

    Joined:
    Apr 26, 2006
    Posts:
    493
    same here but ipad4.