Search Unity

"Simple glow around object"- shader

Discussion in 'Shaders' started by _Adriaan, Apr 20, 2010.

  1. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    Hello forum folks!

    I'm looking for a simple glow shader, a shader that draws light, fading from high opacity to low, around the object. I've tried to search for it, but the word 'glow' seems to relate too much to 'bloom' and I can't find what I am looking for.

    Can anyone please point me into the right direction?

    Thank you!

    (cookie for answer.)
     
  2. ikriz

    ikriz

    Joined:
    Dec 3, 2009
    Posts:
    98
    Is this what you mean ?

    http://unity3d.com/support/documentation/Components/script-GlowEffect.html
     
  3. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
  4. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
  5. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    I'm afraid this lies too far away from my capabilities - I'm not really a (good) programmer and writing a shader is far beyond my reach...

    So, does anyone know an already-built shader for this?
     
  6. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Did you look at the shader in the project? All you need to do is make a ramp.
     
  7. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    With a ramp you mean a black-to-white image? I have one, so what should I do with it?
     
  8. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Seriously, have you looked at the shader yet? It should be pretty obvious what you need to do there.
     
  9. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    Found out I was looking at the wrong shader, the shader called 'EdgeDetectNormals' (which actually IS the obvious one to look at.)

    This is very close to what I need, except that the color inside the black edge and the black edge need to be gone... I can't seem to solve this with a transparent ramp... Any suggestions?
     
  10. greg767

    greg767

    Joined:
    Nov 6, 2009
    Posts:
    113
    I think you made a typo, because the obvious one is the funky glowing things effect.

    The black edge can be taken off easily, but if you take out the color inside the black edge, there is no more glow, so I don't really understand what you want to do.

    Here is a screenshot without the black edge:
     

    Attached Files:

  11. bruscid

    bruscid

    Joined:
    Apr 29, 2010
    Posts:
    3
    "The black edge can be taken off easily, but if you take out the color inside the black edge, there is no more glow, so I don't really understand what you want to do. "

    Hi, I am having a problem with this shader as well. You say that the black edge can be taken off easily but I don't know how to do that. Do you change the shader or the texture assigned? If you change the shader then can you tell me which line?
    Dom
     
  12. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    greg767 only changed the ramp texture. The original one has a purple/orange ramp with a black line in it, whereas the one used above is just a blue ramp.
     
  13. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    I got that working, but I need the object itself to be clear of any overlaying color.
     
  14. showoff

    showoff

    Joined:
    Apr 28, 2009
    Posts:
    273
  15. Cosmin

    Cosmin

    Joined:
    May 7, 2010
    Posts:
    10
    i have a problem with this example... i get some errors :
    "Attempting to release RenderTexture that were not gotten as a temp buffer
    UnityEngine.RenderTexture:ReleaseTemporary(RenderTexture) (at /Users/build/builds/unity-iphone-1.5/iphone-1.1/Runtime/Export/Generated/Graphics.cs:2225)
    FunkyGlowingThingsEffect:OnDisable() (at Assets/Glowing Things/FunkyGlowingThingsEffect.js:70)"
    "Assets/Edge Detection/EdgeDetectEffectNormals.js(6,24): BCE0019: 'depthTextureMode' is not a member of 'UnityEngine.Camera'. "
    "Assets/Edge Detection/EdgeDetectEffectNormals.js(6,43): BCE0005: Unknown identifier: 'DepthTextureMode'."

    and there are some shaders vars that have no links on "Funky glowing things Effect"

    can someone give me a hint with what should i do?

    Tnx
     
  16. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Are you using Unity Pro?
     
  17. Cosmin

    Cosmin

    Joined:
    May 7, 2010
    Posts:
    10
    Yes 1.5.1 pro
     
  18. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Replacement shaders were only introduced in Unity 2.1. If you're actually still running 1.5, you should at least upgrade to the free 1.6.2. I'm not sure if there's a public download link, but I'm sure you can get a copy if you talk to support.

    Otherwise, I highly recommend upgrading to Unity 3. You'll get access to the public beta once that starts, and you can use Unity 2.6 in the mean time.
     
  19. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    Wherever this discussion is going, I still haven't found the shader that I was aiming for... I'm starting to think this has never been written before.

    I am going for a workaround for my problem. Thanks to you all for the help!
     
  20. BrandonE

    BrandonE

    Joined:
    Feb 22, 2010
    Posts:
    6
    Im trying to remove the black edge too because I need to create an Aura Effect around a character. I looked at the color ramp and it doesnt look like there is a black line to remove. What do i do?
     
  21. Orion

    Orion

    Joined:
    Mar 31, 2008
    Posts:
    261
    Hmm. I'm unable to properly open the Shader Replacement project. After converting I get a lengthy list of error messages and a couple of empty scenes.

    Errors are things like:
    hundreds of
    Rebuiling GUID cache: Deleting metadata library/metadata/00/00000000000000002000000000000000 because it is an invalid meta data file!
    MetaData class can't be loaded

    Assets/Glowing Things/FunkyGlowingThingsEffect.js(2,9): UCE0001: Unknown pragma 'implicit'

    Cg in program 'frag': error C1010: expression left of ."depth" is not a struct or array at line 23

    A tree couldn't be loaded because the prefab is missing

    and so on.

    I use Unity Pro 2.6.1f3
    Should be good, right?
     
  22. Yomadorr

    Yomadorr

    Joined:
    Sep 25, 2010
    Posts:
    1
    Sorry, meh11: could you explain it a little more in detail how do you made your glow? its exacly what we're searching for!! :D
     
  23. rasq

    rasq

    Joined:
    May 25, 2009
    Posts:
    51
    Hmmm material based glow shader... i think this is far beyond imagination of many people heare.

    Iam also serch for somthink like this... in UKD this is very simple and also in Shiva3D... but in Unity... someone must write this shader.