Search Unity

Glow Effect (Mobile Friendly)

Discussion in 'Assets and Asset Store' started by opsive, Apr 20, 2013.

  1. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    We're currently working on a mobile game which requires objects to glow. We searched through the asset store and noticed that there aren't any mobile friendly glow assets, so we decided to create one.

    $screenshot1.png

    Add glow to your game objects in as little as one extra draw call!

    Glow Effect is an efficient, mobile friendly full screen glow solution. It can easily be added to existing projects and is written in c#/Cg.

    Glow Effect requires Unity Pro.

    Web Demo
    Documentation

    You can download the Glow Effect from https://www.assetstore.unity3d.com/#/content/8238.
     
    Last edited: Aug 16, 2013
  2. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Very nice job. Since it's not free, you must replace "download" by "buy". ;)
    20$ is a very good price. Don't change it.
     
  3. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Thanks. I'm hoping people like the effect so much they don't even think about the buy process and just continue clicking to download :)
     
  4. spartan

    spartan

    Joined:
    Mar 10, 2010
    Posts:
    174
    Can I put glow to only one character in the scene? In that case, is it possible to set the glow amount?
    I'm targeting for mobile. Does the glow effect with 1 drawcall will look like the screenshot of this thread?
     
  5. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    How is it any better then the regular glow post filter effect?
     
  6. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
    Hi,

    Nice tool, but can you tell me. it's part of post process or per objects glow.

    play_edu
     
  7. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Yes, you can apply the glow to only one character in the scene. You set the intensity and the color of the glow through the texture, then through the glow effect script you can adjust the number of glow iterations, spread, and multiplier. Glow with 1 draw call does not look like what is attached to this thread. Since it is rendering everything in only one pass you can only do so much. To get an idea for the number of draw calls on mobile, I'd recommend that you use the alpha channel for glow, and the number of draw calls is equal to 1 plus the number of glow iterations.

    If you bring up the web demo you can see what 1 draw looks like (enable alpha and simple glow) as well as play with the different parameters.

    You're talking about this one? The one that I listed on the asset store is per object and optimized to be able to run on mobile (though it also works great on non-mobile platforms). The Unity one applies glow to every object and is not optimized to run on mobile.

    Thank you. It is a post-process effect. You won't be able to add any real type of glow without a full screen shader.
     
    Last edited: May 1, 2013
  8. spartan

    spartan

    Joined:
    Mar 10, 2010
    Posts:
    174
    Thanks for your response. I hope you can add your plugin to some Unity Asset Store Madness to get it for a reduced price.
     
  9. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    We've temporarily reduced the price to $20, still trying to figure out what the best price is. $20 is the lowest that we'll go with this asset.
     
    Last edited: May 2, 2013
  10. spartan

    spartan

    Joined:
    Mar 10, 2010
    Posts:
    174
    How is the performance on mobile like iPhone 4 or iPad 1 with something like the screenshot, how much framedrop do you see with/without glow effect?
     
  11. spartan

    spartan

    Joined:
    Mar 10, 2010
    Posts:
    174
    bought your plugin. I have a big issue, if I set the glow to a character, when I put objects trying to hide it, I still see the glow
     
  12. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Thank you for your purchase.

    To answer your original question, on iPhone 4 or iPad 1 the demo above runs at about 15 FPS. Later devices run at 60+ fps. For the iOS project that I am working on I am just disabling most post-process effects on early devices. The devices are at least two or three years old now so you can't get the same amount of power from them.

    In terms of the problem that you are having, do you mind describing your scenario more? From the demo scene, I've disabled the glow on the sphere and placed it in front of the texture that says "glow!". The glow does not go through the sphere. If you want to send a sample project to support@opsive.com I'd be happy to take a look.

    $glow.PNG
     
    Last edited: May 3, 2013
  13. spartan

    spartan

    Joined:
    Mar 10, 2010
    Posts:
    174
    Scenario:
    A world with rocks, trees, etc. The character has glow, I can't disable the glow of each part of the scenario (thats crazy)!
    Keep in mind if you have 3,000 assets on a scenario with custom shaders, you can't disable the glow, that's not a good practice. Your plugin should have a better way to work without touching other original objects/prefabs.
     
  14. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    If you are not using the alpha channel to specify glow, the current way of doing things is to set "RenderEffect"="Glow" for objects that you want to glow. This means that you only have to modify your shaders. I've come up with a better way of doing things though and I am going to upload this new version to the asset store within the next day or two after I finish testing it. I'll send you a PM with the download link.

    Edit: ---

    Edit2: PM sent.

    Edit3: Removed some outdated information to reduce confusion
     
    Last edited: Aug 29, 2013
  15. spartan

    spartan

    Joined:
    Mar 10, 2010
    Posts:
    174
    @opsive pm replied, thanks for your great support!!
    The update works like a charm.
     
  16. wangzy_88

    wangzy_88

    Joined:
    Sep 12, 2012
    Posts:
    14
    Very good effect~!
     
  17. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Thanks wangzy_88!
     
  18. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
    thanks
     
  19. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    A new update went out yesterday which allows you to change the glow color through code rather than using the color of the glow texture. Of course, you are still able to control the glow color through the glow texture as well

    $Glow.PNG
     
  20. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Do you have apk to demo? I have other packages which has problems on mobile on Note2.
     
  21. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    I do not right now, but I am planning on updating the demo scene later this week and I'll create one after that is done
     
  22. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    I've updated the demo scene to show a little bit more what this package is all about:

    $screenshot4.png

    You can see it in motion here. The new scene has been submitted for review.

    You can also try the following apk file out on your Android device. I currently don't have access to my Android device so if it doesn't work somebody please tell me.

    http://www.opsive.com/assets/GlowEffect/GlowEffect.apk
     
  23. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    opsive gives excellent customer support going above and beyond whats reasonable.
     
  24. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    apk works fine on android
     
  25. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Glad you got it working!

    Thanks for trying it out. I didn't like the idea of uploading the apk without trying it out first but figured that it would better to get it out there sooner than later.
     
  26. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    686
    Hey, really want to check out the demo, but it is freaking out on my mac. You can see the problem below. Any chance you could post another webplayer? I have never had this problem before...
    $Screen Shot 2013-05-31 at 11.30.00 AM.png
     
  27. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Whoa that looks awesome. Go ahead and give it another try, I uploaded a new version.
     
  28. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    686
    It works now, thanks for uploading a new version. Nice asset! Definitely have to pick it up.
     
  29. Alf203

    Alf203

    Joined:
    Dec 7, 2012
    Posts:
    461
    For me its not fixed. I just tried it and its freaking my mac here like your screenshot.

    EDIT: I reset my browser and now it works! Strange...

    Anyway, cool effect. Will have to pick it up too.
     
    Last edited: Jun 1, 2013
  30. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    The latest update just went live - adds a color multiplier to the alpha glow as well as includes the new demo scene pictured at the top of this page.
     
  31. PolarTron

    PolarTron

    Joined:
    Jun 21, 2013
    Posts:
    94
    This doesn't work on my android device. Not in the editor either when setting the platform to android.

    I'm using the demo scene. When clicking "Enable glow" it goes black on my device, and it just doesn't glow in the editor.

    I'm using unity pro 4.1

    EDIT: Fixed. Fault on my side (not having android pro)
     
    Last edited: Jun 27, 2013
  32. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Are there any errors? Have you tried creating a brand new project and tried importing just the glow effect package on its own?
     
  33. PolarTron

    PolarTron

    Joined:
    Jun 21, 2013
    Posts:
    94
    Sorry, it was my fault. I guess that's what you get when you're the only one on your team working on an android device while we're supposed to build towards iOS.
    I forgot I was working on a free android licence. I need pro obviously for image effects
     
  34. Emihaa

    Emihaa

    Joined:
    Oct 17, 2012
    Posts:
    5
    Hi. I bought the glow from asset store since I need a glow for my IOS ipad game and since it read that this is mobile friendly and works for ipad.
    Well it doesn't for me.
    Glow works when builded for weplayer but not when builded for IOS device. I have Unity Pro. Any ideas?

    These are the errors i get -> "can't use image filters (npot-RT are not supported or RT are disabled completely)"
     
  35. Emihaa

    Emihaa

    Joined:
    Oct 17, 2012
    Posts:
    5
    Can the error be caused by that I have Unity pro and IOS but not IOS pro?
    I would rather have know this before going on and purchasing the pro version of it.
     
  36. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Hi Emihaa,

    Yes, that is the cause of the error. iOS pro is required to build this asset for iOS.

    Are you planning on purchasing the iOS pro plugin?
     
    Last edited: Jul 2, 2013
  37. PolarTron

    PolarTron

    Joined:
    Jun 21, 2013
    Posts:
    94
    Any way this could work as a replacement of GUI/Text Shader? The text seems to go black. I'm using this in a TextMesh.
     
    Last edited: Jul 4, 2013
  38. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Like this?

    $GlowText.PNG

    You can use this package:
    View attachment $GlowText.unitypackage

    This package contains the ttf font, material, and shader. The shader is really the only part that matters.

    Edit: to expand on the shader, all I did was take a text shader then add the following properties:

    Code (csharp):
    1.  
    2.     _GlowTex ("Glow Texture", 2D) = "white" {}
    3.     _GlowColorMult ("Glow Color Multiplier", Color) = (1, 1, 1, 1)
    4.  
    In my case since I'm not assigning a glow texture to this material I really didn't even need _GlowTex. Then the only other change was to make the "RenderType" equal to "GlowTransparent". The rest of the shader is exactly the same.
     
    Last edited: Jul 4, 2013
  39. PolarTron

    PolarTron

    Joined:
    Jun 21, 2013
    Posts:
    94
    Oh man you're awesome.
     
  40. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
  41. PolarTron

    PolarTron

    Joined:
    Jun 21, 2013
    Posts:
    94
    Me again. I have trouble getting textures to tile on mobile devices. More specific, IPad 3 and Nexus 7. They do tile properly in the editor, but doesn't tile when deployed to a mobile device.
    I'm using the "Glow using Alpha" shader.

    Tiling works when using the Mobile/Diffuse shader thought.
     
  42. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Can you send me a sample scene with the problem? I just tried it on an iPhone and didn't have any problems. support@opsive.com.

    $photo.PNG

    $Screen Shot 2013-07-05 at 12.37.27 PM.png
     
  43. PolarTron

    PolarTron

    Joined:
    Jun 21, 2013
    Posts:
    94
    I found the source of the problem, but it's weird that the same thing doesn't happen in the editor.
    It's pretty obvious thought and I should have noticed it. When changing the tiling of the main texture I should also be changing the tiling on the glow mask texture.
     
  44. PolarTron

    PolarTron

    Joined:
    Jun 21, 2013
    Posts:
    94
    Hey, I have another problem. I'm using the background gradient script(http://wiki.unity3d.com/index.php?title=CameraGradientBackground) on the camera and it works fine in the editor, but when deployed to Android or ipad it's like the background isn't clearing. Everything adds up and it looks like a mess.
    Do you have a solution for this?

    Using alpha glow

    Seems like I'm bombarding you with questions. I'm sorry about that :\
     
    Last edited: Jul 11, 2013
  45. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Hey AtomiCal,

    It looks like there is a bug when you set the camera mode to depth and are on a mobile device. I will look into a solution.
     
  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Alright I have a fix. AtomiCal I'll send you a PM with the download link. I'll also upload this version to the Asset Store.
     
  47. PolarTron

    PolarTron

    Joined:
    Jun 21, 2013
    Posts:
    94
    It works perfectly.
     
  48. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    The latest version of the glow effect has just been approved. You no longer need a separate render camera for mobile devices.
     
  49. JNSVS

    JNSVS

    Joined:
    Jul 25, 2013
    Posts:
    1
    Hi,
    Will the glow effect work on devices which donot support OpenGL ES 2.0. I am trying to make a game using Unity Pro on Samsung Galaxy Tab 8.9. Will Glow work on this tablet?
     
  50. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,128
    Hi JNSVS -

    The glow effect does require OpenGL ES 2.0 so it doesn't look like it would work on that tablet.