Search Unity

Highlighting System [Released]

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

  1. nickpettit

    nickpettit

    Joined:
    Dec 31, 2013
    Posts:
    33
    @chanhpomme @slice3d @DirtyHippy I have an ugly-but-effective solution to the "grey tint" bug. For me, it occurs any time the application loses focus and regains focus. If I switch away from the game and then come back, that's when the grey tint appears. It also *sometimes* appears on startup, which seems to be a little more random.

    I noticed that in the editor, I'm able to remove the grey tint by turning the image effect off and then back on again. Classic solution to any IT problem, right? :) Fortunately, it's possible to write a script that turns it off and on again, on startup and on application focus. Simply add this script to any cameras that use the image effect and you should be good to go - it fixed it well for me.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using HighlightingSystem;
    4.  
    5. public class HighlightingCameraFix : MonoBehaviour {
    6.  
    7.     void Start() {
    8.         TurnItOffAndOnAgain();
    9.     }
    10.  
    11.     void OnApplicationFocus() {
    12.         TurnItOffAndOnAgain();
    13.     }
    14.  
    15.     private void TurnItOffAndOnAgain() {
    16.         HighlightingRenderer highlightingImageEffect = GetComponent<HighlightingRenderer>();
    17.         highlightingImageEffect.enabled = false;
    18.         highlightingImageEffect.enabled = true;
    19.     }
    20.      
    21. }
     
  2. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    Yeah, thanks - I already did something like this the day I found the issue. I haven't really had a problem with this since I added it. I was planning to post about it but forgot :-(
     
  3. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    @nickpettit @DirtyHippy @chanhpomme
    I̶'̶v̶e̶ ̶f̶i̶g̶u̶r̶e̶d̶ ̶w̶h̶a̶t̶'̶s̶ ̶c̶a̶u̶s̶i̶n̶g̶ ̶t̶h̶i̶s̶ ̶i̶s̶s̶u̶e̶ ̶a̶n̶d̶ ̶t̶h̶i̶s̶ ̶i̶s̶ ̶d̶e̶f̶i̶n̶i̶t̶e̶l̶y̶ ̶n̶o̶t̶ ̶a̶ ̶b̶u̶g̶ ̶i̶n̶ ̶t̶h̶e̶ ̶H̶i̶g̶h̶l̶i̶g̶h̶t̶i̶n̶g̶ ̶S̶y̶s̶t̶e̶m̶.̶ ̶T̶h̶i̶s̶ ̶A̶d̶v̶a̶n̶c̶e̶d̶I̶n̶s̶p̶e̶c̶t̶o̶r̶ ̶a̶s̶s̶e̶t̶ ̶y̶o̶u̶'̶r̶e̶ ̶u̶s̶i̶n̶g̶ ̶r̶e̶m̶o̶v̶e̶s̶ ̶h̶i̶g̶h̶l̶i̶g̶h̶t̶i̶n̶g̶B̶u̶f̶f̶e̶r̶ ̶t̶e̶x̶t̶u̶r̶e̶ ̶a̶s̶s̶i̶g̶n̶e̶d̶ ̶t̶o̶ ̶t̶h̶e̶ ̶c̶o̶m̶p̶M̶a̶t̶e̶r̶i̶a̶l̶ ̶_̶H̶i̶g̶h̶l̶i̶g̶h̶t̶i̶n̶g̶B̶u̶f̶f̶e̶r̶ ̶p̶r̶o̶p̶e̶r̶t̶y̶ ̶(̶a̶n̶d̶ ̶r̶e̶p̶l̶a̶c̶e̶s̶ ̶i̶t̶ ̶w̶i̶t̶h̶ ̶U̶n̶i̶t̶y̶D̶e̶f̶a̶u̶l̶t̶2̶D̶ ̶t̶e̶x̶t̶u̶r̶e̶)̶.̶
    AdvancedInspector.png

    A̶s̶ ̶a̶ ̶w̶o̶r̶k̶a̶r̶o̶u̶n̶d̶ ̶y̶o̶u̶ ̶c̶a̶n̶ ̶f̶o̶r̶c̶e̶-̶a̶s̶s̶i̶g̶n̶ ̶t̶h̶i̶s̶ ̶t̶e̶x̶t̶u̶r̶e̶ ̶b̶a̶c̶k̶ ̶i̶n̶ ̶t̶h̶e̶ ̶H̶i̶g̶h̶l̶i̶g̶h̶t̶i̶n̶g̶B̶a̶s̶e̶.̶c̶s̶ ̶B̶l̶i̶t̶(̶)̶ ̶m̶e̶t̶h̶o̶d̶ ̶i̶n̶ ̶e̶a̶c̶h̶ ̶f̶r̶a̶m̶e̶ ̶l̶i̶k̶e̶ ̶t̶h̶i̶s̶:̶
    Code (CSharp):
    1.         // Blit highlighting result to the destination RenderTexture
    2.         public virtual void Blit(RenderTexture src, RenderTexture dst)
    3.         {
    4.             compMaterial.SetTexture(ShaderPropertyID._HighlightingBuffer, highlightingBuffer);
    5.             Graphics.Blit(src, dst, compMaterial);
    6.         }
    B̶u̶t̶ ̶I̶ ̶t̶h̶i̶n̶k̶ ̶y̶o̶u̶ ̶s̶h̶o̶u̶l̶d̶ ̶a̶s̶k̶ ̶A̶d̶v̶a̶n̶c̶e̶d̶I̶n̶s̶p̶e̶c̶t̶o̶r̶ ̶d̶e̶v̶e̶l̶o̶p̶e̶r̶(̶s̶)̶ ̶f̶o̶r̶ ̶a̶ ̶p̶r̶o̶p̶e̶r̶ ̶f̶i̶x̶.̶

    UPDATE
     
    Last edited: Apr 19, 2016
  4. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    Well, since I don't use this asset, I suspect this is not the reason for this issue on my machine :). In any case, I'm not super worried about it anymore, my workaround works fine.
     
  5. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    @DirtyHippy @nickpettit @chanhpomme
    Thanks! I appreciate your feedback!
    You helped me to reproduce this issue even without the AdvancedInspector asset so please disregard my previous message.

    Seems like Unity is not serializing (even for runtime purposes) textures assigned to the materials if Properties shader block does not have corresponding field. And disk writing is causing re-serialization of everything (even materials instantiated at runtime) so this is what triggers this bug.

    The right way to fix this is to change Properties block of the HighlightingComposite.shader to this:
    Code (CSharp):
    1. Properties
    2.     {
    3.         [HideInInspector] _MainTex ("", 2D) = "" {}
    4.         [HideInInspector] _HighlightingBuffer ("", 2D) = "" {}
    5.     }
     
    nickpettit likes this.
  6. nickpettit

    nickpettit

    Joined:
    Dec 31, 2013
    Posts:
    33
    @slice3d That fixed it! Thanks so much. :)
     
  7. ittinop

    ittinop

    Joined:
    Nov 9, 2015
    Posts:
    15
    Hi,

    I am having weird issue with highlighting renderer
    I just got the latest version.
    And now when I press play, with highlighting renderer component on, it will put on a weird white out filter, as shown below. When I pause and play again, it will go away. (and if I click out of Unity and click into Unity again, it will come back)
    Do you have any idea what might be causing this?

    upload_2016-4-24_10-50-45.png upload_2016-4-24_10-51-26.png
     
  8. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    @ittinop
    Hi! Yeah, seems like the same issue as discussed above (gray tint instead of highlighting) so please use this hotfix and let me know if it helps.
     
  9. rocket5tim

    rocket5tim

    Joined:
    May 19, 2009
    Posts:
    242
    Hi, highlighted objects are showing up as solid colors on the PS Vita. The same issue occurred on iOS w/Metal support which was resolved by adding version.Contains("metal") to HighlightingBase in version 4.1. Is there a similar fix for Vita support?

    Thanks!
     
  10. SunnyChow

    SunnyChow

    Joined:
    Jun 6, 2013
    Posts:
    360
    I get some errors when setting camera clear flags as "depth only"

    Dimensions of color surface does not match dimensions of depth surface
    colorHandles[0].object->backBuffer == depthHandle.object->backBuffer​

    Any suggestion?
     
  11. SimonsCat

    SimonsCat

    Joined:
    Mar 11, 2015
    Posts:
    49
    Hi Slice,

    I have a problem with the highlighter after a gameObject is being disabled and enabled again.

    At start the highlighter works fine and looks good. If I disable the game object (in the editor) and re-enable it the highlighting works in a strange way. It looks like it does not render all the renderers in the hierarchy of the prefab.

    Look at the dfference between image 1 before I disabled the gameObject/prefab and 2 after enabling it again.
    Image1.jpg

    Image2.jpg

    The structure of the prefab (gameObject tree) did not changed.

    Any idea how to solve this?

    edit: the highlightableRenderers List contains the same number of elements in both cases.

    edit2: the edge under the highlight on the second image is actually a separate mesh rendered with a different shader (cutoff)... however its the same thing in both cases...
     

    Attached Files:

    Last edited: May 25, 2016
  12. QFord

    QFord

    Joined:
    Nov 9, 2013
    Posts:
    17
    Does Highlighting System support in VR mode now?
    when I used it in HTC Vive ,I found that Highlight Outline in the wrong postion.
     
    Knil likes this.
  13. Knil

    Knil

    Joined:
    Nov 13, 2013
    Posts:
    66
    Running into the same issue, would love to see SteamVR support.
     
  14. saranyak23

    saranyak23

    Joined:
    Jun 3, 2016
    Posts:
    1
    Hello,
    Hello, I'm trying to run the Highlighting system demo on my system. It fails due to "material null" error in the HighlightingBase code attached to the camera. When I try to debug, I find that the problem is due to missing shaders such as:
    "Hidden/Highlighted/Blur",
    "Hidden/Highlighted/Cut",
    "Hidden/Highlighted/Composite", and also missing opaque and transparent shaders: "Hidden/Highlighted/Opaque" and "Hidden/Highlighted/Transparent" as define in the HighlighterInternal. Have anyone come across this problem? If you have workarounds please let me know.
    FYI: I'm using a Intel i7-6700 CPU that runs Windows 10.
     
  15. Aleks1992

    Aleks1992

    Joined:
    Feb 12, 2016
    Posts:
    2
    Hello.
    I try use Highlighting System with canvas ui "Render mode -> Screen Space - Camera" and it doesn't work correctly. All interfaces are under highlighting
    upload_2016-6-3_11-23-30.png
     
  16. Knil

    Knil

    Joined:
    Nov 13, 2013
    Posts:
    66
    I'm emailed the creator and he said:
    "I haven't checked that by myself but I've got several reports from users stating that you have to put the HighlightingRenderer component on your camera above the Steam VR_Camera Flip script or it will not work properly.
    Please let me know if that also fixes your issue."

    This seems to be working for me :)
     
  17. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    @rocket5tim
    Hi! That's probably because PS Vita is using flipped coordinate system. Try adding
    Code (CSharp):
    1. || device == GraphicsDeviceType.PlayStationVita
    to uvStartsAtTop getter in HighlightingBase.cs script if you're using Highlighting System v4.2 or higher.

    @SunnyChow
    Seems like depth buffer and color buffer render textures having different dimensions for some reason.
    Could you please send me your example project so I'll be able to figure out what wrong?

    @SimonsCat
    Hi! Is there a way I can reproduce this in my example scenes (e.g. Compound demo scene)? If not - could you please send me your example project so I'll be able to see how you setup your highlighted objects?

    @QFord @Knil
    I haven't checked HTC Vive specifically, but Highlighting System supports Unity VR. You might have to tweak uvStartsAtTop getter in order to make it work properly with this device (see my reply to rocket5tim above), because I'm not sure which graphics API and coordinate system this device is using.
    As for the SteamVR, as Knil already mentioned - I have customer reports stating that you have to put the HighlightingRenderer component on your camera above the Steam VR_Camera Flip script.

    @saranyak23
    Hello! Please try redownloading and reimporting Highlighting System and let me know if this issue persists.

    @Aleks1992
    Hello! That's intended behaviour because UI in 'Screen Space - Camera' or 'World Space' modes in Unity is rendered as transparent geometry, before highlighting buffer is applied on screen. You have to find the way to render it after this (e.g. by using separate camera with higher depth which will render only UI).
     
  18. mmonly

    mmonly

    Joined:
    Mar 25, 2015
    Posts:
    8
    Screenshot_2016-06-27-14-28-46.png Screen Shot 2016-06-27 at 2.29.09 PM.png
    I'm now using Highlight System v4.2 on Unity 5.3.4f1
    The highlight border run on android device look way more thinner and ugly.
    How do I fix that.
     
  19. Jean-Michel585

    Jean-Michel585

    Joined:
    Dec 9, 2014
    Posts:
    7
    Hi Slice3D,
    I inherited an old project that has your plugin Version 2.0
    I have not Unity Pro ... but Unity version 5.3.5f1 personal
    Does your latest release needs of Unity Pro?
    How much is the upgrade?
    Thanks a lot
     
  20. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    @mmonly
    Oh, that's because different screens have different screen resolutions and DPI, but currently highlighting has constant size in pixels no matter which device it is running on.
    Nice catch! I will try to add an option to resolve this issue in the next update. If you can't wait - you can make a workaround yourself which will change HighlightingRenderer settings at runtime based on Screen.dpi value.

    @Jean Michel
    Hi Jean,
    No, starting from Unity 5.0 - Pro version is not required.
    Upgrade from v2.0 to the current 4.2.1 costs 15$. Please make sure to apply this hotfix after upgrading.
     
    Jean-Michel585 likes this.
  21. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    308
    Hi,

    I just bought the Highlighting System on the Unity Store. I like the visual quality and the way it works on transparent (cutoff) shaders - very nice!

    I however have two issues:

    The first is that from the description I was expecting a mode in which the highlighting is not visible if an object is behind another object (by default). It seems to me this is only possible in your system if I add an occluder script to basically ALL OTHER objects in my scene. Is this correct? If so, is there any way to avoid this and to simply only show highlighting for objects as seen from the camera(s), i.e. if they are not occluded by ANY other object?

    The second is that I am using your script in combination with SteamVR (HTC Vive). I did not manage to configure the script such that a camera fade-out (with the built-in SteamVR_Fade script) no longer shows highlighted object. No matter the order of the scripts in the camera, the highlighting is always shown. Do you have any input on this matter?

    Thanks!
     
  22. nickpettit

    nickpettit

    Joined:
    Dec 31, 2013
    Posts:
    33
    Hi @slice3d

    Love your product! My game wouldn't be possible without it. :)

    I just updated to Unity 5.4 RC1 and it looks like the Highlighter script no longer works on static gameobjects. If I uncheck static, it works fine. I realize Unity 5.4 still is not released, but obviously it's in the RC stage now and something is different about static gameobjects that probably will still be true in the final release. Any ideas on what it could be or how to fix it?
     
  23. KyleOlsen

    KyleOlsen

    Joined:
    Apr 3, 2012
    Posts:
    237
    It looks like highlighting fails with Single-Pass Stereo Rendering enabled for VR. I know this is a very common problem with post processing effects supporting this VR optimization, but just a heads up! :)
     
  24. M-Hanssen

    M-Hanssen

    Joined:
    Sep 8, 2014
    Posts:
    34
    Unity 5.4 crashes on highlighting a gameobject with a missing mesh!
     
  25. nickpettit

    nickpettit

    Joined:
    Dec 31, 2013
    Posts:
    33
    Update on this: I managed to fix this by re-importing the asset. Nothing was different (I was completely up to date).

    Prior to reimporting, I was getting some really strange issues. Sometimes objects with no highlighter script would highlight or flicker, objects that should highlight wouldn't highlight - it didn't seem to matter if an object was static or non-static like I originally thought. I have no idea what changed. Maybe Unity reloaded the shaders or something? Who knows.
     
  26. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    @plmx
    Hi!
    I've already replied to your email, but just in case this will help someone else:

    1. There is no need to add occluders to all other objects in your scene to make them occlude highlighting in case frame depth buffer data is available. Read section '6.4 Highlighting occlusion' of the provided documentation for more info. In most cases - disabling hardware antialiasing in quality settings is the only thing you should do to enable this highlighting depth occlusion feature in your Unity project.

    2. At first - please make sure that Steam VR_Camera Flip is located below HighlightingRenderer component on your camera. Secondly, seems like fading in SteamVR_Fade is rendered in OnPostRender stage, while Highlighting System (as all other Image Effects in Unity) is rendered right after in OnRenderImage stage. So that's why you see highlighting on top of the fading. To resolve this - you have to find the way to render fading in OnRenderImage stage and put this SteamVR_Fade component below HighlightingRenderer and/or HighlightingBlitter on your camera. Or possibly setting fadeOverlay option to true when calling SteamVR_Fade.Start might help in making fading render on top of the image effects (haven't tried this myself yet):
    Code (CSharp):
    1. SteamVR_Fade.Start(color, duration, true);
    @nickpettit
    Hi Nick!
    Thanks for your kind words!
    Some weird issues can appear in Unity when the Library folder gets corrupted for any reason. Glad that it works as intended now, but please keep an eye on this and let me know if redownloading and reimporting highlighting system from the Unity Asset Store and then calling Assets > Reimport All won't help to fix your issues if they will appear again.

    @M-Hanssen
    Thanks for reporting about this issue!
    This definitely needs to be fixed on the Unity side. In the meantime, I will try to find a workaround and release a hotfix. Sorry for the inconvenience!
     
  27. matej_mnoucek

    matej_mnoucek

    Joined:
    Mar 6, 2014
    Posts:
    17
    Hello,

    I have a problem with this asset on WebGL builds. When I enable it (enable script on main camera, even if nothing is highlighted) and build the project for WebGL, it starts only with black screen. Do you have any ideas how to solve this?
    Unity 5.4, Highlighting system 4.2.1

    Thank you,

    M.
     
  28. ozonex

    ozonex

    Joined:
    Dec 7, 2012
    Posts:
    22
    I have similar issue with Highlighting 4.2.1 and Unity 5.4.0f3. Works fine with dynamic objects, but something strange happens with static objects. Highlighting shows on other object than I added a Highlighter. For example I added it on table and highlighting shows on bricks in background. When I disable static flag on bricks, then it highlight something other, but not the table.
     
    Alverik likes this.
  29. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    308
    @slice3d:

    Thanks, but this isn't possible in VR projects. As both Valve and John Carmack of Oculus have stated, MSAA is a MUST for VR up to the point where he talks about immediately rejecting games which do not use it (see his Facebook post). Since the automatic occlusion doesn't work with MSAA I have to add occluders to everything.

    Thanks, but setting the parameter to true does not change the behavior. Highlighting is still rendered even when everything else is faded out. For others trying to achieve this, I can recommend disabling the entire highlighting system on fadeout. This will not fade the highlight but cut it off and on, but it is still better than showing it all the time during fade out. Essentially, you do this:

    Code (CSharp):
    1. GetComponent<HighlightingRenderer>().enabled= false;
     
    Last edited: Aug 3, 2016
  30. WaaghMan

    WaaghMan

    Joined:
    Jan 27, 2014
    Posts:
    245
    Hello, we've purchased the plugin and fiddled around a bit with it. Looks like it matches what we need, however we found an issue that I'm not sure how can we get around it:

    In order to save performance (and because it's not needed), our main camera has a rather low draw distance (farClip set to 30 meters). However, we want to show highlighted items way further than that (say 200 meters).

    Since the highlights use the same renderer, we can't just change the per-layer culling distance, and AFAIK using a different camera wouldn't help either, since the secondary camera would render non-highlighted objects too.

    I've looked into the code and see if there's a point where we can just change the far clip plane of the camera, render the highlights, and restore it back to the original value, but haven't been able to (seems like a hard thing to do with commandbuffers).

    Any advice on how to do this would be appreciated :)
     
  31. WaaghMan

    WaaghMan

    Joined:
    Jan 27, 2014
    Posts:
    245
    Ok, I managed to get it to work, here's what I did:

    * Have a second camera as a child of the main one, with the same projection params but a higher Far clip, and culling mask set to None (so it doesn't render anything). Add the Highlight renderer to this camera.
    * Add the highlight blitter to the main camera.
    * Comment a line in FillBuffer() in the HighlighterRenderer that checks the lastCamera variable (since OnWillRenderObject() won't get called with the highlighter camera, the variable would never be set). I think that check is made to cull objects outside the camera frustum, so in our case it shouldn't be an issue.

    With this, we managed to have a main camera with low draw distance, and still show highlights from a far distance. Not perfect since we now have two cameras, but at least it shouldn't be a performance hit.
     
    Last edited: Aug 8, 2016
  32. Berati

    Berati

    Joined:
    Dec 13, 2015
    Posts:
    5
    Hi everyone , I have a blackscreen problem on webgl.I tryed 5.4.0 and 5.4.1 version of unity , but still same screen.That's my player settings and Quality settings.Please help its its last step of my project. @slice3d
     

    Attached Files:

    Last edited: Sep 10, 2016
  33. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    @Marduker @Berati
    Hey guys,
    Thanks for reporting about this!
    I've been able to track down the source of this issue (details in my comment here).
    So I packed an example project and sent it to the Unity Technologies. They've replied to me with this:
    So it seems like we just have to wait. The workaround is to either downgrade to Unity 5.3.x or use 1 iteration in the HighlightingRenderer settings. Though please note that the last option will provide poor highlighting quality in some cases (especially if downsampling is not set to None). I recommend you to use 'Solid 1px' preset. Sorry for the inconvenience!

    @ozonex
    This is probably related to the GPU instancing they've introduced in Unity 5.4 (and they're still fixing issues related to this change). I'll see what I can do in order to fix this for the Highlighting System.
    For now - please don't use static flag on highlightable objects.

    @plmx
    Thanks for sharing this useful information! Unfortunately I can't do anything to fix this. In Unity - you can either use MSAA or access native depth buffer. Not both. Let's hope it will change in the future versions of the engine.

    Please nevermind what I said above. It should be much better to perform fading with full-screen UI rect. Not sure if it's possible in VR though, but I'll check this out. I got my own HTC Vive recently, so I'm going to start resolving VR-related issues for the Highlighting System.

    @WaaghMan
    Hello!
    Uhh... Such a custom rendering setup! And that interferes with Unity's renderers culling and LOD system. So not sure if I'll be able to resolve this in general, but seems like exposing Highlighting System low-level rendering API can help (something like highlightingRenderer.ForceRender(Renderer renderer))?
     
    plmx likes this.
  34. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    308
    Instead of using the SteamVR_Fade script it should be possible to use a world canvas (other canvases won't work) attached to the camera so it is always in front of it, and use that to fade. I've used a world canvas in a similar way successfully for a different purpose (displaying a HUD), but not (yet) for fading. I don't know how that will interact with the Highlighting System though. Thanks for having a look at the VR issues, very much appreciated!

    -plmx
     
  35. Ibukii

    Ibukii

    Joined:
    Jun 23, 2016
    Posts:
    45
    Hi, I've bought your asset but the glow isn't working on my project. On your project it works. Is there any settings or restrictions that I should know?

    Just in case:
    My resolution is 3240 * 7680
    My camera view is Orthographic.

    Please let me know if I have to set any settings to make it work?
     
  36. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    @plmx
    Hmm, true - 'Screen Space - Overlay' modes won't work in VR yet, but 'World Space' canvases are rendered in the regular Transparent geometry pass, so they won't occlude highlighting. I'll see what can be done here.

    @Ibukii
    Hi!
    Oh, that's very high resolution! Probably Unity can't make such big RenderTexture if MSAA is enabled. Try to disable Anti Aliasing for all quality levels in Quality Settings of your project.
     
  37. Ibukii

    Ibukii

    Joined:
    Jun 23, 2016
    Posts:
    45
    Hi,

    I've tried using your application and setting it to my resolution and it works; although the framerate drops alot.
    In my program it doesn't work at all.

    I tried setting all to disabled but still doesn't work.
     
  38. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    @Ibukii
    Can you send me your example project so I'll be able to reproduce this issue on my end? (Don't share the link here - send it to support at deepdreamgames.com)
     
  39. faraz-glu

    faraz-glu

    Joined:
    Sep 21, 2016
    Posts:
    6
    Hi slice3d, first of all, thanks a lot for creating this asset. Visually, it's stunning (aside from what mmonly has mentioned a few posts above which is easily fixable).

    We are using it for creating a mobile game that we are going to release for iOS and Android. Functionality wise, it is great. However, we are doing an optimization pass on our game right now, and we are having a lot of issues with this system on Android. On iOS, it is great, but on Android, it is making our game almost unplayable. For example on Galaxy S6, when the highlighting System is on, frames jump from around 16 ms to 50-60 ms. We are also on Unity 5.4.0p3. I was wondering if you could help us resolve this issue or if we should look into other solutions.

    Highlighting Off:

    HighlightingOff.png

    Highlighting On:

    HighlightingOn.png

    Cheers,
    Faraz
     
  40. Ibukii

    Ibukii

    Joined:
    Jun 23, 2016
    Posts:
    45
    Hi, I've sent you the email with the working file package with a SS. Please help :( Thanks!

    EDIT: Oh my god, I'm dumb. I never noticed my camera did not have HighlightingRenderer attached. Ah well. Thanks for the awesome support.
     
    Last edited: Sep 22, 2016
  41. GameNative

    GameNative

    Joined:
    Apr 17, 2014
    Posts:
    40
    Two questions,

    Is there a way to make the default behavior for a highlighted item to automatically be occluded by any objects without the need to add an occluder to every object. For example, building walls, etc.

    Also how can I make an object not show the highlight under terrain?
     
  42. sindrijo_

    sindrijo_

    Joined:
    Aug 15, 2016
    Posts:
    7
    I'm in a very similar situation, but I'm so close to release I will just have to remove it from the Android version of the I'm working on... for now.
     
  43. slice3d

    slice3d

    Joined:
    May 7, 2011
    Posts:
    207
    @faraz-glu @sindrijo_
    Hi! Glad you enjoy using Highlighting System for your projects!
    At first - please make sure that you're using Highlighting System v4.2.1 and apply all known hotfixes for this version listed here.

    Regarding the performance issues you have - please read this article first:
    So, 60 FPS = 60 frames per second, 1 second = 60 frames, 1 second = 1000 milliseconds, 1000 milliseconds = 60 frames.
    For 60 FPS - 1 frame should be rendered in less than 1000 / 60 = 16.667 milliseconds.
    For 30 FPS - that number is 1000 / 30 = 33.333 milliseconds
    and so on (for 60, 30, 15, 12, 10... FPS):
    So, from what I see on your screenshots - adding Highlighting System to your game makes it exceed this threshold of 16.667ms per frame, so VSync takes place to lower refresh rate from 60 to 30 FPS. (Gfx.WaitForPresent means 'CPU is waiting for GPU', but in it's turn GPU is doing nothing but waiting for VSync here). If you want to keep using Highlighting System in your projects and still render at 60 FPS - you can optimize other parts of your frame rendering time (usually bottlenecks on mobiles are in particles, transparent shaders and other expensive things leading to increased overdraw / fill rates) so the overall frame rendering time will be below 16.667 ms.

    Of course using Highlighting System is not free in terms of performance, and eats a couple of milliseconds of your frame rendering time. But as you can see - this is not the source of such frame rate drops you're talking about. (The last pint of beer drunk last night is not the source of a hangover you'll have in the morning ;))

    @realmzero
    Yes, disable MSAA (hardware antilaiasing) in Quality Settings for all quality levels (and use Antialiasing as Image Effect instead from Unity Standard Assets package if you need anti-aliasing), and native depth buffer will be used to occlude highlighting without the need to add occluders manually. This will also work with the Tarrain.
     
    Alverik likes this.
  44. faraz-glu

    faraz-glu

    Joined:
    Sep 21, 2016
    Posts:
    6
    First of all, thanks a lot for getting back to me. I understand everything you have mentioned. I would not have asked a question here if I hadn't done my investigation. I am not talking about the last beer here. As you can see in the 2 sample frames that I have posted, one is at 13 ms (without highlighting, it is under 16.667 ms) and the other is at 52.70 ms (with highlighting and well above 33.333 ms). These are two sample frames, but a good representation of what I am seeing across other frames too. This is more like a full whiskey bottle and then some tequila shots on top of it :D I would be more than happy to take a couple of milliseconds when Highlighting System is on, but just a couple, not 40.

    Also, note that this does not happen with iOS devices. I have profiled multiple Android and iOS devices we have at the office. Even on iPhone 4S (ancient device), I am seeing acceptable results. This is an Android only issue.
     
    Last edited: Sep 28, 2016
    Dog_Like likes this.
  45. stefanob

    stefanob

    Joined:
    Nov 26, 2012
    Posts:
    68
    I get an offset between my mesh and the glow effect. Please look at the image in the bottom part. Any idea what's going wrong? Thanks.
     
  46. GameNative

    GameNative

    Joined:
    Apr 17, 2014
    Posts:
    40
    www

    @slice3d

    I read your reply and Anti-Aliasing is disabled. I still have the same issue.
     
  47. JonBednez

    JonBednez

    Joined:
    Jan 16, 2014
    Posts:
    4
    If I have a game object using shared materials, does the Highlighter component break the shared materials on the game object.

    Thanks!

    - Jon
     
  48. MalboM

    MalboM

    Joined:
    Apr 29, 2013
    Posts:
    66
    Hello!
    just bought the plugin, really cool :)
    one thing, is it possibiile to unhighlight certain child objects ?

    for example I have a particle effect in the item set as a child and gets highlighted too.
    let me know!
    Thanks
     
  49. faraz-glu

    faraz-glu

    Joined:
    Sep 21, 2016
    Posts:
    6
    @MalboM One easy way you can do that would be to comment out lines 16 and 17 in Highlighter.cs where it says:

    typeof(ParticleRenderer),
    typeof(ParticleSystemRenderer),

    That would affect everything tho. Another thing you can try is to add an empty script called HighlighterBlocker on those children.
     
  50. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    Hello, great asset. I have a question. I currently observe this behavior:

    -If there are 2 highlighted objects, and one is in front of the other, the highlighting of the back object doesn't show through the object in front of it. This is good.
    -If instead, for the same 2 objects, only the back object is highlighted, it's highlighting shows through the front object. I'd prefer to have the highlighting to not show through the front objects, whether or not the front object is highlighted.

    Is there a way to make it work like this? Thanks!