The Highlight Effect component provides many options. This section covers each one of them:
- Profile: allows you to assign a profile with custom settings. You can create a profile by clicking “Create”, customize that profile and reuse it on any number of highlight effect components.
General Settings
- Preview In Editor: enabling this option will render the effects while in Edit mode. Note that most effects won’t be visible unless the “Highlighted” checkbox is enabled.
- Cameras Layer Mask: let you specify which cameras can render the effects. By default, every camera.
- Ignore Object Visibility: by default, Highlight Plus won’t render the effects if the object is not visible in screen. If you’re using some tool that uses GPU instancing to render the object directly on the GPU and not using the regular renderer component, enable this option to force the effects to be rendered.
- Reflection Probes: enable to render the effects on reflection probe cameras.
- Normals Option: several options to smooth or reorient normals of the geometry of the object. Only used in outline and glow effects when rendering in Fast, Average or High quality mode (mesh-based effects, not used in Highest quality modes or screen-space mode).
- Sub Mesh Mask: bitwise mask that filters which sub-mesh will be highlighted. Useful for objects that have multiple sub-meshes.
- GPU Instancing: enabled by default, improves rendering performance of outline and glow effects.
Highlight Options
- Ignore: let you disable any effect on this object. If you use the Highlight Manager, it will still use this highlight effect component values.
- Include: this option let you specify which other objects will also be highlighted. It’s extremely useful as you can using a single highlight effect on the root of a group of objects for example, and include all the children. The outline and glow effects will be combined and show a single contour around the entire group if they overlap.
- Object Name Filter: let’s you specify which objects will be included (according to the Include option) by filtering their names. For example, if you have 5 children, you could use a prefix or suffix to specify which of them will be highlighted.
- Combine Meshes: this option is useful for objects that do not rotate individually. Highlight Plus will automatically combine the meshes of the group, reducing the number of draw calls dramatically.
- Alpha Cut Off: applies an alpha cutoff to the effects, useful when you’re highlighting semi-transparent objects or objects that exhibit holes or transparent parts in their textures like leaves, fences, etc.
- Cull Back Faces: do not apply the effects to back faces. Enabled by defauflt.
- Fade In/Out Duration: applies a “lerping” effect for the given duration.
- Constant Width: keeps the outline or glow width constant regardless of the distance of the object to the camera.
- Depth Clip: performs a depth buffer clipping so effects are correctly hidden behind solid geometry.
Outline Effect Options
The outline shows a usually thin colored line around the object.
- Outline: controls the transparency of the outline. A value of 0 deactivates completely this effect.
- Width: the width of the outline. The “Constant Width” option in the previous section can affect the actual visible width.
- Color: the color for the outline.
- Quality: there’re 4 quality modes: fast, average, high and highest. The first 3 quality modes use a mesh-based rendering technique which is usually faster. The Highest quality mode uses a screen-space effect which provides a smoother result. The quality modes and the actual result can vary depending on the characteristic of the highlighted object so don’t hesitate to use the mode that looks or perform better in your case, regardless of the name. For example, the “Fast” quality mode usually works best for simple objects.
- Visibility: controls the z-buffer testing for the outline. Let you specify if the outline should be visible on top of everything, only when the object is occluded (check also see-through effect for more options) or normal, which means the outline will be visible when the object is visible as well.
- Optimal Blit: when in Highest Quality mode, performs a blit over the affected region of the screen, instead of using a full-screen blit. This option will improve performance.
- Independent: this option forces the outline to show completely ignoring other highlighted objects that could overlap on the screen. By default, Highlight Effect will merge the outlines of overlapping objects, showing a continuous outline around the mixed group. By enabling the Independent option you ensure that the outline is visible around each group separately.
Outer Glow Effect Options
The outer glow effect shows a bright glow or bloom-like effect, usually wider than the outline, around the object.
- Outer Glow: controls the transparency of the outer glow. A value of 0 disables this effect.
- Width: the width of the glow. Check the “Constant Width” setting in Highlight Options section because it can affect the actual width displayed.
- Visibility: controls the z-buffer testing for the effect. Let you specify if the glow should be visible on top of everything, only when the object is occluded or normal, which means the glow will be visible when the object is visible as well.
- Dithering: only used in mesh-based quality modes, let you control the style of the dithering used in the glow. This is a pure and optional artist-driven effect. You can disable it to show a solid glow.
- Blend Passes: in mesh-based quality modes, the outer glow is achieved by rendering the object mesh using several custom passes. When this option enabled, each pass will be blended with the previous one. If the option is disabled, each pass is rendered additively.
- Glow Passes: let you configure the number and characteristic of each glow pass including color, offset and transparency (alpha).
- Animation Speed: the outer glow will animate if this value is greater than 0.
To quickly change the glow color using scripting, you can call SetGlowColor(color) method on the HighlightEffect component. Check demo scene 1 for an example.
Inner Glow Effect Options
The Inner Glow renders a rim-like effect over the object.
- Inner Glow: controls the transparency of the inner glow effect which renders inside the object, like a rim lighting effect. A value of 0 disables this effect.
- Color: the color for this effect.
- Width: the amount of inner glow.
- Visibility: controls the z-buffer testing for the effect. Let you specify if the glow should be visible on top of everything, only when the object is occluded or normal, which means the glow will be visible when the object is visible as well.
Overlay Effect Options
The Overlay effect adds a solid color over the object with custom transparency.
- Overlay: controls the transparency of the effect. A value of 0 disables this effect.
- Color: the color of the effect.
- Blending: determines how much the color is blended with the original color/texture of the object.
- Min Intensity: minimum intensity for the blending.
- Animation Speed: the speed of the overlay “pulse”. Enter 0 to disable animation.
Target Effect Options
The Target effect adds an animated object floating over the highlighted target.
- Texture: the overlay texture to be used for this effect.
- Color: the tint color for such texture.
- Center: where the target should be positioned. If not set, the center of the highlighted object will be used. However, if the object has multiple parts or children, you could assign a transform of a child instead (ie. part of the body of a monster).
- Rotation Speed: the speed at which the object rotates. Enter 0 to disable rotation.
- Initial / End Scale: used to create a zoom / pulsating effect.
- Scale To Object Bound: the scale of the target image will be relative to the object screen bounds (if object grows, the target effect will also expand). Note that if object rotates and its bounds change, the target effect will also change its size. This can produce a strange result so you may prefer to have this option disabled for rotating characters/objects.
- Transition Duration: the duration of the transparency transition when the overlay texture appears/disappears.
- Align To Ground: projects the target sprite on the ground (as a decal). In this mode, vertical walls will be detected by using the camera depth texture and reconstructed normal of the scene so the decal won’t appear stretched on the wall. Use the Fade Power option to attenuate the target sprite with elevation.
- Stay Duration: how long the overlay texture will be displayed when the object is no longer highlighted until it fades out. A value of 0 keeps the effect visible until it’s deactivated.
- Visibility: controls the z-buffer testing for the effect. Let you specify if the glow should be visible on top of everything, only when the object is occluded or normal, which means the glow will be visible when the object is visible as well.
See-Through Effect Options
The see-through effect, also known as x-ray effect, shows when the object is occluded by other elements, like walls.
- See Through: determines if the see-through will be visible only when the object is highlighted, always when it’s occluded or never. Use “Never” to completely disable this effect.
- Occlude Layer: if this value is different to Everything, the asset will use raycasting to try to determine if an object belonging to a matching layer is occluding the highlighted object. If it hits an occluding object, the see-through effect will be activated.
- Threshold: when using the occlude layer, the object bound size is multiplied by this value when testing occlusion. You can use this value to avoid false positives and only show the see-through effect when the object is really behind another solid object.
- Check Individual Objects: by default, Highlight Plus takes all children affected by the see-through effect of this component and combines the bounds before testing occlusion. If this option is enabled, the occlusion test is performed per each individual child.
- Depth Offset / Max Depth: provides distance limitations to the effect (distance referred to the occluder). A value of 0 will not use these options.
- Accurate: when using the occlude layer, this option enables pixel-perfect occlusion.
- Intensity: intensity of brightness of the effect.
- Color & Color Blend: controls the color and intensity of the blending of the color with the original color/texture of the object.
- Noise: optional, artist-driven, effect.
- Border When Hidden: this option let you show an additional outline but only when see-through is active.
- Ordered: when enabled, it will respect the relative distance to camera when rendering see-through effect.
A common scenario when using the See-Through effect is when you want your character to be occluded by walls and not ground or ceilings. A solution involves assigning your walls to a different layer than the ground/ceilings and specify that layer in the Occluder Layer of the See-Through effect. Enable the “Accurate” option for best results:
In the screenshot above, you can see the see-through effect is visible only over the wall but not over the grass or terrain.
Hit-FX Effect Options
This effect is only usable in play mode. It let you show a “punch” effect by changing the color of the hit object briefly. In play mode you can test it:
Please refer to the “Executing a Hit-FX effect” in the next section for sample code.