Search Unity

[FREE] [OPEN-SOURCE] Outline Effect

Discussion in 'Assets and Asset Store' started by cakeslice, Mar 28, 2015.

  1. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    Edit
    I have working this asset, is easy to use it, but isn´t working in a Galaxy S9 and works fine in a Xiaomi Mi 5.
    Any suggestion are welcome
     
    Last edited: Jul 3, 2019
  2. lordcrekit

    lordcrekit

    Joined:
    Dec 9, 2017
    Posts:
    2
    I don't know where to report issues for this, but I have one. If you're doing additive scene loading when using this asset, you drop like 60 frames per second or more. Don't know why. Whenever I change or load a scene my fps goes to nothing.
     
    IndieFist likes this.
  3. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    I have found my problem, when i use auto graphics API in build settings isn´t working on some android devices, if i remove the check then is working in my S9, but ii left in first position OpenGL2
     
  4. Will_Dev

    Will_Dev

    Joined:
    May 24, 2017
    Posts:
    27
    Does anyone know how to modify ths shader so that the outlines do not show when it is behind an object?
     
    IndieFist likes this.
  5. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
  6. Will_Dev

    Will_Dev

    Joined:
    May 24, 2017
    Posts:
    27
    When I built to mobile, the outline effect does not show. Does anyone else have this issue. Is this not supported on mobile
     
  7. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    Are you read my answer?
     
  8. Will_Dev

    Will_Dev

    Joined:
    May 24, 2017
    Posts:
    27
    I read it. Thanks. But I have another problem now. The outline doesn't show on mobile devices. Is it not supported?
     
  9. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    Have you tryed removing Autographics in player settings and set only opengl2?
    And i have stopped to use it in android, media and low quality devices expend so many fps
     
  10. Will_Dev

    Will_Dev

    Joined:
    May 24, 2017
    Posts:
    27
    Does it not work on open GL3?
    Also do you know any other alternatives for the outline effect to use for mobile devices
     
  11. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    Nop, working fine without loss a lot of fps no.
     
  12. Will_Dev

    Will_Dev

    Joined:
    May 24, 2017
    Posts:
    27
    Wait so does it or does it not support OpenGL 3?
     
  13. Owen_Lewis

    Owen_Lewis

    Joined:
    Oct 25, 2018
    Posts:
    1
    I recently found this package (it looks great!), but I have found an issue when I add unity's post processing effect. The screen turns black and all I can see is anything in the UI canvas, and the highlight shape it self. If I disable the post processing, everything returns to normal.

    What am I doing wrong?

    Note:
    I have even tried changing the order of the components on the camera, If the outlineEffect component is above the post processing, then the outline isn't event seen.

    [SOLVED]
    If anyone else runs into this, you must disable "Directly to Camera Target" checkbox in the post processing layer. Everything looks fine now ;-)
     
  14. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    Are you using post-processing in mobile devices?
     
  15. Will_Dev

    Will_Dev

    Joined:
    May 24, 2017
    Posts:
    27
    Can someone please confirm if this shader works on OpenGL 3?
     
  16. pixelR

    pixelR

    Joined:
    Sep 16, 2013
    Posts:
    58
    Of course it does. :)
     
    IndieFist likes this.
  17. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    Maybe its wrong for OpenGL 3 in mobile? I have tested and isn´t working in my s9 but workis fine in Xiaomi mi5. And drop alot of fps.
     
  18. Amitloaf

    Amitloaf

    Joined:
    Jan 30, 2012
    Posts:
    97
    Anyway this could be ported to HDRP? There just isn't any good outline for HDRP anywhere!
     
    reggie5538 likes this.
  19. Will_Dev

    Will_Dev

    Joined:
    May 24, 2017
    Posts:
    27
    It didn't work when I set the graphics API to OpenGL3. Nothing showed up in my Samsung A50 phone. When I switched to OpenGL2 the outlines showed.
     
  20. Kurdiez

    Kurdiez

    Joined:
    Feb 6, 2017
    Posts:
    72
    I want certain Mesh Renderer game objects to not be affected by Outline Effect.

    upload_2019-7-27_23-40-57.png

    I set the Erase Renderer to true but this object is still shining with Color 0.
    What is happening here?
     
  21. agoradesignsllc

    agoradesignsllc

    Joined:
    Jul 11, 2019
    Posts:
    1
    Hi,

    In iPhoneX with iOS 12.3.1, highlighter has not been appeared for selected objects, while it's working properly in other models. I have tested with 4 iPhoneX mobiles. it's working in one of that device and no highlight appearance for other three devices. Can anybody help me to overcome this issue?
     
  22. Flarup

    Flarup

    Joined:
    Jan 7, 2010
    Posts:
    164
    First of all, let me just point out that this is a GREAT asset! And it was really easy to get working. So thank you VERY MUCH for your great work on it.

    However, on Samsung Galaxy S8 it doesn't render properly. Typically it's the right side of the object that doesn't get outlined. Sometimes it does, but most of the time it doesn't. On Sony Xperia and iPhone SE it works perfectly fine all the time.

    Anyone knows a fix for getting it to work properly on Galaxy S8?

    Thank you very much in advance.
     
  23. Littlstar

    Littlstar

    Joined:
    Jun 28, 2015
    Posts:
    2
    Great asset!

    I'm encountering an error with cardboard VR Camera where both the left and right eye are gray with android and iOS builds. Seems to work fine for non-vr cameras and in-editor. Seems to be gray on some devices and fine on others. Issue occurs for both iOS and android builds. Using Unity 2018.3.14f1.

    I'm assuming it's something to do with the additional Outline Camera conflicting with the cardboard camera. Any thoughts on what might be happening? Thanks!
     
  24. Littlstar

    Littlstar

    Joined:
    Jun 28, 2015
    Posts:
    2
    Switching from Single to Multipass Rendering in XR Settings fixed the issue.
     
  25. wojteknician

    wojteknician

    Joined:
    Mar 4, 2019
    Posts:
    1
    Hey morphinegames, I downloaded your edit and I added the Outline to one of my 2D sprites but somehow only the original 3 colors seem to work. Any ideas? I'm looking to have exactly five colors but when I used yours the 4th color went back to LineColor0 and the 5th color went back to LineColor1. Thanks in advanced!

    EDIT: If anyone else can help me with getting 5 colors in total that would mean a lot to me. I'm still new to Unity so I'm not too sure how to edit the shader files.

    EDIT2: I would like to state that it does work. I just had the original files hidden elsewhere and it conflicted with my code.
     
    Last edited: Aug 29, 2019
  26. UnetDev

    UnetDev

    Joined:
    Aug 28, 2017
    Posts:
    54
    Hello!
    First of all, thanks to the author of this wonderful asset !!! He is gorgeous!
    I work in Dragon Bones and all other OutlineEffects/Shaders (outline mesh, outline fx and others) loomed very badly on my 2D objects. This asset solved this problem. Thank.

    But now I have another problem:
    This asset consumes VERY many resources. With OutlineEffect disabled on MainCamera, I get 60 fps on an Android device, but when I turn it on, the frames drop to 25-30, and it doesn't matter if there are any objects in the scene that this outline applies to or not.

    The device I use - LG G2(Snapdragon 801 + Adreno 330 have 129.8 GFlops), ran as with OpenGLES 2.0 and with 3.0 same result.

    Does anyone know what the problem is?
     
  27. UnetDev

    UnetDev

    Joined:
    Aug 28, 2017
    Posts:
    54
    Is this topic already dead?
     
  28. Flarup

    Flarup

    Joined:
    Jan 7, 2010
    Posts:
    164
    @UnetDev I suspect that the asset is no longer updated, unfortunately. Really a shame, and I would love to pay for it on the Asset Store if it was maintained.
     
  29. UnetDev

    UnetDev

    Joined:
    Aug 28, 2017
    Posts:
    54
  30. freakadelle

    freakadelle

    Joined:
    Jan 9, 2018
    Posts:
    5
    Heyho @cakeslice,
    thanks for the asset. Is it somehow possible to draw the outlines behind a WORLD space canvas. My complete UI has already an OnTop-Shader. I also set your shader to Queue Background (in both shaders and via script), but I can't get it work.

    Thanks and best regards
     
  31. Flarup

    Flarup

    Joined:
    Jan 7, 2010
    Posts:
    164
  32. UnetDev

    UnetDev

    Joined:
    Aug 28, 2017
    Posts:
    54
    Ah, I understand you. Yeah, same me too
     
  33. cakeslice

    cakeslice

    Joined:
    Oct 18, 2014
    Posts:
    197
    Hello guys!

    Sorry but it's really hard to maintain an open source project while still working full time, I will do what I can...

    Someone has been working on the project and I just merged his changes.

    If you're interested in seeing what has changed, check out the fork: https://github.com/JimmyCushnie/Outline-Effect-but-its-faster

    For the latest version go to: https://github.com/cakeslice/Outline-Effect

    I will release it in the asset store soon :)

    If you find any bugs it's better to post an issue on github where we can track it. Use this link: https://github.com/cakeslice/Outline-Effect/issues



    PS: Many thanks to https://github.com/JimmyCushnie !!!
     
  34. ManicArts

    ManicArts

    Joined:
    Dec 10, 2017
    Posts:
    29
    Hey! Would it be possible to add the ''Erase option'' to particle sytems to hide the outline effect behind particles? Great asset otherwise!
     
  35. divakar_vs_longbow

    divakar_vs_longbow

    Joined:
    Oct 27, 2019
    Posts:
    1
    This outline effects is not working for LWRP any work around for this
     
  36. Masea1

    Masea1

    Joined:
    Jun 9, 2018
    Posts:
    41
    I've been looking for such an effect and finally found it, even a free one. I can't thank you enough for this, really, I am very grateful to you!

    The main purpose that I am writing this comment is actually to give you an idea though. Which is, if we had an option in Outline script (not Outline Effect) to basically disable joining the lines with other object's lines, it would be so cool. For instance, the specific object will always have its own shape (and lines) and it'll never be reshaped whenever any other object with other lines conflict with it. In short, there should be an option in Outline script to make the specific object have its own line at all times and not join with others'.
     
    MNNoxMortem likes this.
  37. PaulDyatlov

    PaulDyatlov

    Joined:
    Jul 6, 2019
    Posts:
    25
    Hey, any chance to make it work in latest HDRP?
     
    reggie5538, defiak and MadStuntman like this.
  38. mLuby

    mLuby

    Joined:
    May 26, 2014
    Posts:
    2
    I too had an all-black game screen with just the red highlight visible. There was no "Directly to Camera Target" checkbox as mentioned in the quoted post (though I appreciate they included is, so I'll pass it forward).

    [SOLVED]
    What finally worked was adding the demo scene into mine and making the Main Camera's child Outline Camera my scene's Main Camera's child.

    No idea why that worked; perhaps the Demo Scene's saved Outline Camera is subtly different from what a fresh install creates? Anyway, thanks for the free effect, and I hope my struggle shortens someone else's.

     
  39. AlexForTheWin

    AlexForTheWin

    Joined:
    Feb 24, 2019
    Posts:
    1
    You could use the Erase Renderer option included in the Outline script.
    When an object with Erase Renderer enabled occludes an outlined object, it removes the outline and fills the covered portion with Line Color 3. Just set that to white and the original color will be displayed.

     
    ADNCG likes this.
  40. dlearmonth

    dlearmonth

    Joined:
    Sep 8, 2015
    Posts:
    6
    Thankyou Cakeslice (and all other contributors) for this amazing outline effect. It works great.

    It currently doesn't work with Sprite_Skin from the 2D Animation package. It outlines the original sprite, and doesn't update to the skinned version.

    The 2D animation package is in preview still. Has anyone looked into this or can anyone give me a pointer on where to look for a solution?

    outlineShaderWithSpriteSkin.JPG
     
  41. prajwalshetty_

    prajwalshetty_

    Joined:
    Feb 9, 2020
    Posts:
    3
    Hi, has anyone tried this plugin in Universal-Windows-Platform? The plugin works well in the editor, osX and windows standalone, but in the UWP the outline seems to have an offset from the object, and it also kinda moves as the camera move, though the object position is fixed.
     

    Attached Files:

  42. darthdeus

    darthdeus

    Joined:
    Oct 13, 2013
    Posts:
    80
    Did anyone get this working with URP? It doesn't seem to work there.
     
  43. tomcb

    tomcb

    Joined:
    Apr 3, 2017
    Posts:
    15
    Hi, For some reason this doesn't work on some objects I have in the scene but does work on others.
    As far as I can tell there is no difference between the objects that work and those that aren't (except for the mesh itself of course). Any idea on how to solve this?
    upload_2020-8-5_14-33-19.png

    This is the object:
    upload_2020-8-5_14-34-18.png
    upload_2020-8-5_14-34-3.png

    This is on the camera (as I mentioned it does work on other objects):
    upload_2020-8-5_14-34-44.png
     
  44. unity_ITKAeZaFsbPmSQ

    unity_ITKAeZaFsbPmSQ

    Joined:
    Aug 27, 2020
    Posts:
    3
    There is a bug upload_2020-8-28_22-58-40.png



    if there is some objects with outline scripts but one of those with the chexbox erase render true it becomes this
     
  45. cakeslice

    cakeslice

    Joined:
    Oct 18, 2014
    Posts:
    197
  46. cakeslice

    cakeslice

    Joined:
    Oct 18, 2014
    Posts:
    197
    This is not a bug, that is exactly what Erase Renderer is supposed to do. Please take a look at the demo scene to see a variety of use cases.
     
  47. FinleyOderSo

    FinleyOderSo

    Joined:
    Mar 31, 2019
    Posts:
    5
    First of thank you very much for sharing this project with us.
    However, I encountered a problem.
    I have the outline rendering on a 2D sprite, but it doesn't seem to work when there's a video playing in the background...

    No Video playing:
    upload_2020-12-17_1-56-24.png

    Video playing:
    upload_2020-12-17_1-56-3.png
     
  48. FinleyOderSo

    FinleyOderSo

    Joined:
    Mar 31, 2019
    Posts:
    5
    I don't know if this is intended, but the outline is actually drawn underneath the sprite. I was wondering why I didn't see the fill color. Maybe it's also drawn underneath the Video...

    upload_2020-12-17_9-56-36.png upload_2020-12-17_9-56-18.png
     
  49. cakeslice

    cakeslice

    Joined:
    Oct 18, 2014
    Posts:
    197
    How are you rendering the video?

    Maybe if you render it to a texture and use the video in a Material applied to a mesh it will work
     
  50. FinleyOderSo

    FinleyOderSo

    Joined:
    Mar 31, 2019
    Posts:
    5
    While your suggestion does indeed work I would much rather stick to using the render mode "camera far plane". It would be great if it somehow worked with this render mode too.