Highlighting System package allows you to easily integrate outline glow effect for objects highlighting in your Unity project.
Available in the Asset Store: Highlighting System | Particles/Effects | Unity Asset Store
WebGL demo
Documentation
Hotfixes and Tips
Development Trello
Main features:
-
Works as an Image Effect on Camera
-
Compatible with Forward and Deferred rendering paths, HDR, Gamma and Linear Color Space, GPU Instancing
-
Original renderer materials remains intact (sharedMaterials will remain shared)
-
VR: Compatible with Single Pass (Fast) Stereo Rendering Method
-
Fully compatible with LODGroup component
-
Works with static and skinned meshes
Three highlighting modes available to cover all your needs:
1. Hover
Useful for highlighting objects under the mouse cursor.
2. Tween
Useful to pay attention to a specific object (e.g. tutorial item).
3. Constant (with optional fade in/out)
Can be used to constantly highlight objects (e.g. pickable items or currently selected objects).
Tested on:
- PC
- Mac
- XBox One
- HTC Vive
- Android
- iOS
Basic Usage:
- Assign HighlightingRenderer component to the camera
- Add Highlighter component(s) to your gameObject(s):
using HighlightingSystem;
protected Highlighter h;
void Awake()
{
h = gameObject.AddComponent<Highlighter>();
}
- At runtime - call one of available methods to turn on/off, fade in/out highlighting, etc:
// Fade in constant highlighting
h.ConstantOn(Color.yellow);
// Turn off constant highlighting
h.ConstantOffImmediate();
// Start flashing from blue to cyan color and frequency = 2f
h.FlashingOn(Color.blue, Color.cyan, 2f);
// ...
Changelog:
v5.0
-
Fully reworked and improved Highlighter component which is now capable of covering more than 90% of all highlighting use-cases without any scripting.
-
Now you can inherit from the HighlighterCore class to implement custom highlighting logic without having to worry about breaking compatibility with the future versions of the package.
-
Highlighter / HighlighterCore has been optimized and is no longer using Update() or Coroutines. (See Unity Blog for more info)
-
Flashing highlighting mode has been replaced with fully-featured tween, which supports color gradients.
-
Implemented ability to specify Renderers and submeshes of each Renderer to highlight (RendererFilterâs).
-
Fully reworked demo scripts intended to teach you the best and most performant ways of using Highlighting System in your own projects.
-
Implemented solid fill alpha value control (affects all Highlighterâs).
-
Orthographic Camera Projection mode compatibility.
-
Fixed rendering to texture when Stereo Rendering is enabled.
-
Improved documentation, which is now also available online.
-
All demo scripts have been moved into the HighlightingSystem.Demo namespace to avoid type name collisions. You will have to add using HighlightingSystem.Demo; directive to reference them from your own scripts.
-
Fixed highlighting of negatively scaled Renderers. Trello
-
Fixed NullReferenceException in Highlighter.FillBufferInternal. Trello
-
Fixed setting material properties (e.g. _Color) via MaterialPropertyBlock also affects highlighting if property name matches. Trello
-
Fixed Dither.shader wonât compile as of Unity 2017. https://trello.com/c/QIM6kksZ
v4.3
- Virtual Reality Single Pass (Fast) Stereo Rendering Method is now supported
- Implemented support for highlighting geometry rendered with GPU instancing
- Static and Dynamic batching will no longer produce z-fighting artifacts under any circumstances. Dynamic Offset and Factor options have been removed from the HighlightingRenderer component
- Highlighting depth occlusion now works even if MSAA is enabled. This is no longer necessary to manually add HighlighterOccluder components to GameObjects (use HighlighterOccluder component only to achieve see-thorugh occluders). Non-seethrough occluders is now never rendered, so that saves performance
- Added API for runtime control of highlighting presets. Now they are stored in HighlightingRenderer components (previously they were stored using Unity EditorPrefs)
- Exposed Blur Directions settings for HighlightingRenderer component (options: Diagonal, Straight, All) to allow finer control of solid highlighting modes
- Exposed Anti Aliasing settings for HighlightingRenderer component (options: Use Value From Quality Settings, Disabled, 2x Multi Sampling, 4x Multi Sampling, 8x Multi Sampling). That will define the state of anti-aliasing for the highlighting buffer
- Added forceRender option to the Highlighter (to make it ignore frustum culling and occlusion culling)
- Improved cross-platform compatibility
- Fixed highlighting depth occlusion not working if Camera Clear Flags set to Depth only or Donât clear in Forward or VertexLit rendering paths
- Fixed no longer used highlighting materials kept in memory (turns out Unity is never releasing unreferenced materials without the Resources.UnloadUnusedAssets() call, so explicit Destroy() call is required) (Trello)
- Fixed âgray tint instead of highlightingâ bug (Trello)
- Fixed HighlightierRenderer.EndOfFrame generating garbage every frame (Trello)
- Fixed âWARNING: Shader Unsupported: âHidden/Highlighted/Blurâ â Pass â has no fragment shaderâ or even âEXC_BAD_ACCESSâ exception when running on iOS Metal device (Trello)
- Improved documentation
v4.2.1
- Fixed null reference exceptions if Highlighter has disabled GameObjects in hierarchy
v4.2
- Support for multiple cameras and different camera clear flags
- Support for LODGroup component
- Improved compatibility across all platforms
- Proper culling of invisible highlighting renderers
- Implemented optional HighlightingBlitter for blitting highlighting results to the screen using different camera
- Improved and refactored highlighting system core
- Implemented ability to dynamically change constant on/off transition times (no more common constantOnSpeed/constantOffSpeed static properties â use ConstantOn(float time) and ConstantOn(Color color, float time) instead)
- Disabling GameObjects with Highlighter components or Highlighter components directly in Unity Editor properly affects highlighting (toggling them from scripts at runtime works well as before)
- Fixed null reference exceptions after re-enabling HighlightingRenderer component
- Implemented HighlighterBlocker to prevent highlighting of specific objects in hierarchy
- Optimized memory allocation in HighlighterInternal.GrabRenderers method
- Exposed seeThrough property. SeeThrough(bool state), SeeThroughOn(), SeeThroughOff(), SeeThroughSwitch() methods deprecated and will be removed in the next version
- Exposed occluder property. OccluderOn(), OccluderOff(), OccluderSwitch() methods deprecated and will be removed in the next version
- Compatibility with iOS Metal graphics API
- Fixed iOS build crash when stripping engine code is enabled in Unity 5.2.0+
- Windows Store Apps: Fixed compilation error caused by inability to access C# classes from Boo and JS scripts on WSA platforms (without checking .NET Core Partially in Compilation Overrides in PlayerSettings)
- Reworked all demo scripts and scenes
- Highlighter item revealer example added
- Added new demo scenes: LODGroup, Revealer, RenderTexture, ViewportRect, CustomBlitter, ClearFlags, FPSCamera1, FPSCamera2, Toggle, VR
- Changing properties of HighlighterInteractive, HighlighterConstant, HighlighterFlashing and other highlighter components in Inspector affects highlighting in realtime
- Other fixes and improvements
v4.1
-
Implemented see-through mode for highlighting occluders (occluder in this mode wonât receive any highlighting on itâs area)
-
SpriteRenderers highlighting is now rendered from both sides. Makes highlighting visible if used on sprites with negative scale (mirrored sprites)
-
Fixed producing a lot of RenderTexture garbage (previously causing out of memory issues on mobile devices)
-
Fixed highlighting materials not being destroyed on loading scenes
-
Fixed disabled / invisible renderers uninitialization
-
Fixed improper highlighting offset on Android and iOS devices for solid highlighting modes (when HighlightingRenderer Downsampling property set to None)
-
Fixed improper highlighting when emulating OpenGL ES device (Android or iOS) in Unity Editor on Windows
-
Fixed improper highlighting on Xbox
-
Fixed artifacts when used with bloom image effect
-
Other minor fixes and improvements
v4.0
-
Unity 5 compatibility
-
Windows Phone 8 compatibility
-
Highlighters now rendered via CommandBuffers. Simplified setup and usage â only HighlightingRenderer component is required on Camera
-
Highlighters now culled on the CPU before rendering
-
Ability to save custom highlighting Presets in editor (Presets shared between projects)
-
Added support for ParticleRenderer (Legacy) and ParticleSystemRenderer highlighting
-
Other improvements and performance optimizations
v3.0
- In this version, highlighting occluders doesnât work with Sprites! This might be fixed in the future releases of the Highlighting System, but you shouldnât upgrade in case you heavily rely on this feature in your project
- Mobile optimizations (9 FPS vs 25 FPS on iPhone 4)
- Highlighting occlusion feature (highlighters is now occluded with scene objects without the need to add highlighting occluders to all of them). Not compatible with hardware anti-aliasing!
- Per-Highlighter see-through mode (controls when the highlighting should be always visible)
- Hardware anti-aliasing (MSAA) support (highlighting buffer is now also anti-aliased. RenderTexture anti-aliasing support was introduced in Unity 4.2)
- Support for nested highlighted objects (previously it was causing an error)
- Invisible highlighted objects culling (they will not be affected by the material replacement routine. Scenes with huge amount of highlighted objects now should work faster)
- Depth Offset Factor and Offset Units settings added to avoid visual artifacts when Dynamic Batching is enabled in Player Settings
- Real stencil buffer is now used during highlighting buffer rendering (speeds up rendering. Stencil buffer access was introduced in Unity 4.2)
- Fixed lightmapped objects highlighting
- _CameraDepthTexture / _CameraDepthNormalsTexture is no longer cleared when the camera.depthTextureMode property is set to DepthTextureMode.Depth / DepthTextureMode.DepthNormals
- RenderTexture restore operations avoided in most of the cases and âTiled GPU perf. warning" is suppressed in all other cases. Uncomment DEBUG_ENABLED define in HighlightingBase.cs script to see when this happens
- Null reference exceptions now prevented in case highlighted GameObject or Renderer was removed, but ReinitMaterials() wasnât called
- Fixed one empty pixel border around highlighted objects on a devices without support for NPOT (non power of two) textures
- Fixed one texel vertical offset in Direct3D 9
- Coroutines, used in HighlightableObject (Highlighter) were replaced with simple frame number comparision
- Combined highlighting shaders. Fixed function states (ZWrite, ZTest, etc.) is now driven by the material parameters (feature was introduced in Unity 4.3)
- Events/delegates used to control HighlightableObjectâs (Highlighterâs) state from HighlightingEffectâs (HighlightingRenderer / HighlightingMobile) were replaced with Highlighter components management
- Added HighlightingSystem namespace (to avoid potential name conflicts)
v2.0
- Linear blending of the highlighting and frame buffers (gives true highlighting colors)
- All shaders now compatible with the Highlighting System out of the box (no need to adapt each custom shader anymore)
- Batching and shared materials support
- Correct highlighting of transparent materials
- Highlighting occluders
- Handy highlighting effect quality and intensity controls with presets
- Effect inspector helpers (will help you correctly setup Highlighting System in your project)
- Bug fixes, shaders optimizations and other performance improvements
v1.2
- Unity iOS Pro support
v1.1
- Improved folder structure. Now itâs possible to use HighlightingSystem from JavaScript and Boo.
- Fix: HighlightingSystem now highlights only MeshRenderer, SkinnedMeshRenderer and ClothRenderer components, because you probably doesnât want to see highlighted meshes created by ParticleRenderer, ParticleSystemRenderer, LineRenderer and TrailRenderer components.
- Fix: Turning on Hardware Anti-Aliasing doesnât cause flipping anymore.
- Fix: Camera Clear Flags = Donât Clear doesnât cause flipping anymore.
- Fix: Non-standard camera normalized viewport rects now works correctly.
- Fix: Highlighting now doesnât affect alpha channel of framebuffer.
- Some performance improvements.
v1.0:
- Initial release
Feel free to ask any questions.
Thanks!