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

Highlighting System [Released]

Discussion in 'Assets and Asset Store' started by slice3d, Jul 10, 2012.

  1. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160

    slice3d :
    Before updating, could you confirm if it is a bug?
     
    Last edited: Mar 14, 2013
  2. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    Hey xadhoom,

    Just disable any hardware anti-aliasing in your project settings and use AntialiasingAsPostEffect.js instead from the Unity's standard Image Effects (Pro only) package. Using hardware anti-aliasing with any post-processing effects is useless, because this will not work with renderTextures in Unity - highlighted outline edges will remain aliased. This problem is not particularly noticeable in other post-processing effects because they don't combine anti-aliased framebuffer with aliased rendertexture as my Highlighting System does.
    Everything will be fine if you'll use AntialiasingAsPostEffect.js on top of HighlightingEffect.

    Also, simple
    Code (csharp):
    1.  
    2. void OnRenderImage(RenderTexture source, RenderTexture destination)
    3. {
    4.     Graphics.Blit(source, destination);
    5. }
    6.  
    gives me 1-pixel vertical offset. Looks like a Unity bug.
    If anybody knows why this happens - please, point me out to the solution on how to avoid that.
    Thanks!

    angel_m,
    It's only here if you use hardware anti-aliasing.
    As documentation says - it is not recommended. Use AntialiasingAsPostEffect instead.
     
  3. xadhoom

    xadhoom

    Joined:
    Sep 2, 2010
    Posts:
    91
    Hi Slice,

    Thank you for you answer. I would be happy to change AA settings as you suggest unfortunately AA is disabled already. E.g. I use your "Color" demo (so no special camera post effect scripts). I´ve made sure that AA is disabled in "Quality" settings. I checked "Forward" and "Deferred" rendering. In all cases I can see that issue clearly...
     

    Attached Files:

    Last edited: Mar 17, 2013
  4. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Hi, reporting, it deploy on S3, the highlight will grow very huge to fill the whole screen, instead of small highlight. This happens with sample project.
     
  5. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    Hi xadhoom!
    Which Unity version do you use?
    Looks like they've fixed this 1-px offset bug in Unity 4.1, that I mentioned in my previous post.
    May be this will help in your case also, but it looks like imprecision of a RenderTexture on your graphics card.

    Hi imtrobin!
    Sorry, but what is S3 stands for? Samsung Galaxy S3?
     
  6. xadhoom

    xadhoom

    Joined:
    Sep 2, 2010
    Posts:
    91
    Hi Slice,

    I´m using Unity 4.1. As you can see in the screenshot the issue is not a pixel offset bug since it is not only visible on one side but at the edges all around the objects. I would be happy to support you in tracking that down. So if you can recommend how to further debug that issue e.g. analyzing intermediate results, I would give it a try.

    Thank you,
    xad
     
  7. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Yes, Samsung Galaxy S3
     
  8. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    xadhoom
    Thank you for your willingness to help!
    Check your PM here.

    imtrobin,
    Demo scene, from the Highlighting System imported to fresh empty project gives you this results on S3, but in the Unity Editor everything works fine?
    If so - then this is Android + Unity problems. You just can't imagine what a terrible problem with the compatibility of all Android devices / drivers / etc.
     
  9. AlecMoody

    AlecMoody

    Joined:
    Feb 21, 2012
    Posts:
    24
    We are having trouble getting this to work with lightmapped objects. I can set up an object so that it works, then lightmap it, and the effect no longer shows (no error messages or other indication it isn't working). Has anyone used this successfully with lightmaps?
     
  10. gilgm

    gilgm

    Joined:
    Dec 31, 2012
    Posts:
    7
    Baking the included "colors" demo kills the highlights - so this is definitely a bug, or an unimplemented feature, lol. Is there something that we can modify in the source to make this work? Any ideas?
     
  11. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    AlecMoody, gilgm,
    Thanks for your report!

    Researching this problem now...
     
  12. AlecMoody

    AlecMoody

    Joined:
    Feb 21, 2012
    Posts:
    24
    Thanks for the quick follow up slice3d, much appreciated.
     
  13. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    The latest update of the highlight effect doesn't work well with SSAO effect. if we use highlight effect the SSAO will not showed up. Is there any workaround for this?
     
  14. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I think it happened also with the first version.
     
  15. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Now that's funny, it works in me with the first version
     
  16. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    rea,

    Thanks for the bug report!

    If you have problems using Highlighting System with SSAO, then open HighlightingEffect.cs, find this line:
    Code (csharp):
    1.  
    2. shaderCamera.CopyFrom(refCam);
    3.  
    and right after it, add:
    Code (csharp):
    1.  
    2. shaderCamera.depthTextureMode = DepthTextureMode.None;
    3.  
    Now it should work with SSAO.

    Update: No longer required since version 3.0!

    No information about lightmapping problem yet. Working...
     
    Last edited: Sep 14, 2014
  17. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Thanks working on it: SSAO is a usefull effect.
     
  18. rocket5tim

    rocket5tim

    Joined:
    May 19, 2009
    Posts:
    242
    Hi, any update on the lightmapping problem yet? I just ran into this.
     
  19. gsantos

    gsantos

    Joined:
    Sep 30, 2012
    Posts:
    7
    +1

    :-/
     
  20. Jamda

    Jamda

    Joined:
    Apr 3, 2013
    Posts:
    6
    Here is a quick and dirty workaround until the package is fixed:D. Add a second, non-baked copy of the object you want to highlight to your scene. Set the position of your new object so that it matches the baked object. Add the highlight component to the non-baked object. Create a new, empty material and set it to transparent/diffuse. Apply this new material to the object you just added to the scene. Now, set the alpha value of the new material to black (Click on the main color of the material and move the bottom slider marked "A" to the left so it's value is black). Now you have a highlight working with your baked objects..
     
    Last edited: Apr 3, 2013
  21. gilgm

    gilgm

    Joined:
    Dec 31, 2012
    Posts:
    7
    This is a terribly dirty workaround. We've considered taking that leap as a last resort, but I really hope this gets handled soon. I'd rather not duplicate 100+ scene objects and manage them in software. Yuck.
     
  22. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    Sorry for the delay!
    But there's no in-depth information available about how lightmapping works in Unity.
    Finally, I've found where the problem is - lightmapping does something with vertexlit rendering path used for replaced rendering.

    Here's the hotfix:

    In HighlightingEffect.cs, find:
    Code (csharp):
    1.  
    2. shaderCamera.renderingPath = RenderingPath.VertexLit;
    3.  
    and change this to:
    Code (csharp):
    1.  
    2. shaderCamera.renderingPath = RenderingPath.Forward;
    3.  
    Update: No longer required since version 3.0!
     
    Last edited: Sep 14, 2014
  23. Jamda

    Jamda

    Joined:
    Apr 3, 2013
    Posts:
    6
    Thanks!!!! This worked for me.
     
  24. Lypheus

    Lypheus

    Joined:
    Apr 16, 2010
    Posts:
    664
    Hey slice3d, just upgraded from an older build of the highlighting system and I'm seeing two issues:

    http://screencast.com/t/lCyAjwbMgK
    http://screencast.com/t/sI6KRorG

    1. I'm using a script attached to the player to block highlighting from showing through him as per our last discussion (while back) : ) - however since the update i'm seeing a definite outline to him now ... cool effect but i'd like to avoid it if possible.

    Code (csharp):
    1.  
    2. public class PlayerHightlight : MonoBehaviour
    3. {
    4.     void Start( )
    5.     {
    6.         HighlightableObject ho = transform.GetComponent<HighlightableObject>( );
    7.         ho.ConstantOn( Color.black );
    8.     }
    9. }
    10.  
    2. Objects that I've assigned to be highlightable appear black now

    Code (csharp):
    1.  
    2.  
    3.     Used when item is picked up:
    4.        
    5.         // now that the player has picked up this weapon, turn off highlighting
    6.         PlayerHightlight playerHighlight = weapon.transform.GetComponentInChildren<PlayerHightlight>( );
    7.         if( !playerHighlight )
    8.         {
    9.             weapon.gameObject.AddComponent<PlayerHightlight>( );
    10.         }
    11.  
    12.     Used when item is dropped:
    13.  
    14.         // we no longer care about blocking out highlights through this item, so check for and remove ph script
    15.         PlayerHightlight playerHighlight = weapon.transform.GetComponentInChildren<PlayerHightlight>( );
    16.         if( playerHighlight )
    17.         {
    18.             GameObject.DestroyImmediate( playerHighlight );
    19.         }
    20.  
    21.  
    Any thoughts on what has changed to make this code ineffective?
     
  25. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    Lypheus,
    one important thing - it is not available to use multiple HighlightableObject components in one hierarchy branch (Highlighting occluders are also HighlightableObject's).
    HighlightableObject searches for Renderer components in all child objects, caches them and then does rendering with replacement shaders. Consequently, if there are multiple Renderer components catched by multiple HighlightableObject's - rendering goes wrong!

    It is easy to make work-around in HighlightableObject's InitMaterials() method where it uses GetComponentsInChildren functions, but then Highlighlighting System will lose it's universality.

    I recommend you to just apply components in a different nonintersecting hierarchy branches. For example:

    WRONG:
    $HierarchyWrong.png

    RIGHT:
    $HierarchyRight.png
    In this case, SkinnedCharacterMesh object will act as occluder for Weapon1 and Weapon2 objects.

    Update: No longer valid! Nested highlighted objects supported since version 3.0.
     
    Last edited: Sep 14, 2014
  26. rocket5tim

    rocket5tim

    Joined:
    May 19, 2009
    Posts:
    242
    Thanks, that fixed worked for me. Works on iOS as well.
     
  27. Lypheus

    Lypheus

    Joined:
    Apr 16, 2010
    Posts:
    664
    Ok that fixes the weapons showing up black, awesome thanks for the quick reply!

    I'm still seeing that black fuzzy outline (depending on view angle) on the player, is there any way to get around that? Can we set the highlight colour to 'transparent' or something? Ultimately i'd prefer just being able to "block" highlights from passing through an object without the sillouette if possible - the older release supported this so i must be missing something :) !

    With worn items etc, I can just remove the HighlightableObject script when its picked up but not so much with the player itself - it seems to come down to "always on" option in the Player Hightlight script i posted earlier.

    Ideally a script you could drop on a given object to make it "block" highlights from camera would be great.
     
  28. Lypheus

    Lypheus

    Joined:
    Apr 16, 2010
    Posts:
    664
    Hey Slice, any thoughts on how to make my player a highlightable object (constanton) to avoid other highlights clipping through him but at the same time have a transparent/no visual highlight? I'd like to get rid of this effect (black border around him): http://screencast.com/t/g1cl47uw7u
     
  29. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    Hey, Lypheus!

    Have you tried to use ho_OccluderOn() on your character instead of ConstantOn?
    And don't forget to set the 'Use z-buffer' checkbox on the HighlightingEffect component.
     
  30. Lypheus

    Lypheus

    Joined:
    Apr 16, 2010
    Posts:
    664
  31. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    I'm sorry, but currently there is no way to avoid this inner glow going to the occluder from other highlighted objects.

    But as you can see in this post, rea wanted to achieve just such effect for their projects. Why you want to avoid that?
     
  32. Lypheus

    Lypheus

    Joined:
    Apr 16, 2010
    Posts:
    664
    I want to avoid the character being highlighted and having highlights show through him. The highlight effect is being used in my game to indicate an interact-able object. So for instance, if you are looking at a door to interact with, I want the player to see the door frame highlighted, but NOT through the player (player should obscure the object beneath).

    I had this working pre-update ... maybe I can dig up an old version of the highlighting system from a previous backup, it worked fine before - seems like a regression to me. To be honest, I can see a lot of uses for some kind of "OccludeWithoutHighlighting" behaviour in this kit - for instance if you have a diablo approach to seeing lootables in your range, you might want to allow for some things (walls, floors, ceilings, players, etc), to block the highlighting without themselves having to be highlighted.

    Adding an example of what I mean, off my old TPC build, see here: http://screencast.com/t/8i7h2UH9xZXI
     
    Last edited: Apr 8, 2013
  33. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    Lypheus,
    Ok, but I think this is not a big problem for your game.
    As you can see on the screenshot below, highlighting occluders in Diablo 3 gives similar results to my Highlighting System:
    $d3_highlighting_occluder.jpg

    Building here is the occluder for the door object. See this little glowing border on the part occluded by the building?
    It's not too noticeable and as for me, it looks better than just roughly cutted glow.
     
  34. Lypheus

    Lypheus

    Joined:
    Apr 16, 2010
    Posts:
    664
    Right, so what happens if that player is in front of the door and partially covers the highlighting effect? Does it show through the player or highlight around him or does it just get obscured by the player? I'm guessing the latter (haven't played since diablo 1 so its been a while lol). Anyhow, I'll rollback the version I guess and go from there - for me the player *must not* be included in the highlighting nor should they have highlights passing through them ... maybe we can take this to private chat and i can show you some code - this seems like a really obvious use case so maybe i'm not describing my intentions well enough.
     
  35. Lypheus

    Lypheus

    Joined:
    Apr 16, 2010
    Posts:
    664
    Alright, so my approach here is just to rollback and use the older Hightlighting System which behaves as I'd expect, just to be clear - my thought is not so much what is right/wrong for an individual project just why this no longer works in the new release. Here is a SS describing exactly the difference between old vs new HS releases, the old one I've rolled back to is on the left side and the new on the right side - both use identical code and involve ONLY a package update:

    http://screencast.com/t/qTYGOtzv9S

    Notice the wall IS highlighted, to indicate it is interactable, the only difference here is that the player is now being included in highlight rendering - I'd like to basically have the player ignore all highlighting and always appear over top of highlighting - this is what the old release supports so i guess that's where i'm staying :).
     
  36. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    Lypheus,
    Visual behaviour of the Highlighting occluders has changed because I've implemented completely different compositing shader in the 2.0 update, with which it became possible to display actual highlighting colors. Note how the wall highlighting color differs on the left and on the right sides of your screenshot.

    I can't say that this new highlighting occluders behaviour is a drawback of 2.0 update, at least because this is how they work in many other famous games.
    I'm sorry if it's not work as you've expected, but for now there's nothing to do with it.
    May be some day I'll find the solution how to keep old occluders behaviour with the new compositing solution.

    Thanks for your feedback!
     
  37. Lypheus

    Lypheus

    Joined:
    Apr 16, 2010
    Posts:
    664
    No problem Slide, I understand - thanks for the incredibly awesome asset :) !
     
  38. GonzoCubFan

    GonzoCubFan

    Joined:
    Oct 21, 2011
    Posts:
    70
    How can I remove the plugin completely? I have tried all sorts of things. I have tried to locate every occurrence of where we have used the plugin, and removed those, but every time I try to remove the plugin itself, and then try to run the program in the editor - the editor crashes - HARD! This makes it doubly difficult to remove the plugin since we have no information as to where the editor is crashing.

    Yes, I have used the Editor's search capability as well as searching the scripts in my project. Can't find anything so far.

    Is there something I'm missing? The system is wonderful - if you can afford the performance hit. We can't, and we'd really like to remove it completely. Please help me exorcise this from our project.

    = Ed =
     
    Last edited: Apr 19, 2013
  39. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    GonzoCubFan,
    :-/
    You must admit that the Highlighting System is not a virus or something...
    There is not even any dll's with the hidden code.

    Simply remove all files from the package in your project(s) - and you're done.
    Complete file list depends on the versions of the Highlighting System you have used.
    You can see whole list of package contents for the latest version here, for example: http://u3d.as/37m
    In Short - remove:
    Assets/HighlightingSystemDemo folder,
    Assets/Plugins/Editor/HighlightingSystemEditor.cs file,
    Assets/Plugins/HighlightingSystem folder.

    If the problem persists after removing all these files and folders - then it is not caused by the Highlighting System.

    P.S.: After all your messages about hard Unity Editor crashes - it is become clearly that there is something wrong with your PC / Mac / OS / Unity installation.
    I recommend you to make complete OS and Unity reinstall.


    Lypheus,
    Thanks! Glad you liked it! :)
     
    Last edited: Apr 19, 2013
  40. GonzoCubFan

    GonzoCubFan

    Joined:
    Oct 21, 2011
    Posts:
    70
    The only hard crashes I have ever had have been with the Highlighting system, but perhaps you are correct. In any event, all of those are gone, but I will keep looking.

    Thanks for the help.

    = Ed =
     
  41. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    I tested the highlight from Echo Core shader framework, and it works fine. Please try to fix, I bought it for mobile, if it doesn't work, I have to ask for refund.
     
  42. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    imtrobin,
    At first, please check that you set the 'Use 32-bit display buffer' checkbox in your player settings.
    Second - which version of the Highlighting System do you use?
    Third - have you tried to build and install the Highlighting System demo (assembled on fresh empty Unity project) on your device? Does it works?
    Fourth - how did you set the Clear Flags for your camera with applied HighlightingEffect? Please try different settings for this.

    Highlighting in Echo Core shader framework works completely different from my Highlighting System.
    As I see, instead of using post-processing for that type of thing, it just pushes out vertices of the highlighted objects, plus does some rimlighting in pixel shader (both of these techniques described here http://docs.unity3d.com/Documentation/Components/SL-SurfaceShaderExamples.html and you can implement this type of highlighting by yourself after doing some research).
    This techniques may be cheaper for mobile platforms, but it also gives you worse results - only rough flat highlighting, thickness of the highlighting depends on the object's silhouette and even object orientation to the viewing camera, no lerping between framebuffer (probably, you'll not see highlighting on bright backgrounds), and I doesn't know if it even can handle compound objects correctly.
    But if it cover all your needs - it's up to you to request a refund if we will not resolve all your issues.
     
    Last edited: Apr 22, 2013
  43. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    32 bit display on - default settings.
    Highlighting System 2.0
    New empty project.
    No change, all defaults. I just import on a new project and build. On PC it works fine.
     
  44. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    I've been using Highlighting System with forward rendering, and I love it - it's an integral part of my game.

    I just switched to deferred rendering and it's no longer working. It's not a big deal, I don't have to use deferred rendering, but is this a known issue?
     
  45. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    imtrobin,
    Do you have the latest version of Android OS on your device?
    May be you should try to run your project on different (older/newer) versions of Android OS?

    Sorry but I can't do much with that. :( I just can't have every device available on the market for the testing.
    Probably, if it works in Unity and doesn't work on your S3, and you use Unity for Android Pro (not just Unity for Android) to build your game for mobile device, then this happens only because some Unity for Android Pro features are not fully supported as stated in this feature list.
    In this case only Unity Technologies can (and must) fix this. You should report this to Unity Technologies or ask for a refund if you can't wait for the fix.

    daisyDynamics,
    Thanks! Glad you find it useful for your projects!
    Hope to play your game in the near future ;)
    By the way, here's the new video from cool guys at gamesfoundry. They use Highlighting System in production of their own game Folk Tale.
    Also, I've spotted that Richard Garriott (Creator of the Ultima series) also used Highlighting System for their upcoming game Shroud of the Avatar.

    Nope, I use Highlighting System in deferred lighting mode for my own game and it works fine.
    Please give me more info about your case (Unity version, Mac/PC, Project Settings, used post-processing effects, etc.).
     
  46. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    LOL - if your definition of "the near future" includes mid-2014, then yes, I'll be posting a demo then. Still a huge effort ahead, but it's so much fun! :)

    I'm using Unity Pro 4.1.2 on a Mac laptop (NVIDIA GeForce GT 650M 1024 MB). I'm not specifically using any post-processing effects yet (unless an asset I'm using is calling them). I'm using deferred lighting, linear color space, dual lightmaps with "use in forward rendering" checked, and soft shadows. If I deselect "Use Lightmaps", I still get the issue.

    Reproducing the issue is easy: if I switch to Deferred Lighting, highlighting doesn't appear, but if I switch back to Forward Rendering, it immediately works perfectly.

    Highlighting System is awesome and if we can't locate the cause, I'd prefer to forgo using Deferred Lighting rather than remove HS.
     
  47. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Android 4.1.2, I have android unity pro. S3 is a fairly new phone just release less than 6 months ago.
     
  48. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    This issue is solved. I'm using HS with Ultimate FPS Camera, which uses a second weapon camera in addition to the main camera. If I disable that camera and switch to Deferred Lighting, Highlighting System works again (and looks fantastic!).

    I've implemented a workaround using a shader posted by someone else who was having issues with image effects with Ultimate FPSC.
     
  49. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    imtrobin,
    May be that's the reason why some Unity features required for the Highlighting System are not fully supported on this device yet, and we just have to wait for an update? (will it be the drivers update or Unity update)

    daisyDynamics,
    Cool! ;) May be you can post your workaround here for other Highlighting System + Ultimate FPS Camera users, or at least give us a link to this shader?
    Thanks in advance!
     
  50. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    Sure, it's described by makeshiftwings towards the bottom of this page: http://forum.unity3d.com/threads/126886-Ultimate-FPS-Camera-RELEASED/page77

    If you disable the weapon camera and just change the shaders on each weapon prefab to point to the new shader, HS and UFPS work perfectly together in Deferred Lighting mode.