Performance

If you are developing for a low-end platform or are experiencing performance issues in general, you may want to consider taking the following steps:

Disable highlighters when out of view

Try to keep the number of active highlighters in the scene as low as possible. Every active highlighter script creates additional camera passes that the GPU needs to render, even if it is out of view.

Disable features that aren't visible

If you are using the highlighter, for example, to highlight your character when it gets hit, you should activate the highlighter, show the desired effect, and then deactivate the highlighter to prevent it from rendering any more unnecessary camera passes.

Use one highlighter script for multiple renderers

If you need to render highlights for multiple objects, you should consider using only one highlighter script for all of them. This is especially useful if you are using the outer glow feature, which can be computationally expensive. You should investigate whether grouping your objects together into clusters will improve the performance of the highlighters. Remember to use the rendering bounds options to help understand what is happening.

Reduce the number of blur algorithm iterations

The Blur Iterations property determines the number of times the shader will be applied to each pixel. You should try to keep this value as low as possible to improve performance.

Reduce blur render scale

The Blur Render Scale property allows you to change the size of the blur buffer. Lowering this value will significantly reduce the amount of work that your GPU needs to do.

Reduce Info Render scale

This option scales all the texture buffers that are used for rendering highlights. Lowering this value will greatly increase performance.

With objects that have a lot of triangles consider using Outer Glow over Mesh Outline

The Mesh Outline feature requires two additional passes to draw the mesh, while the Outer Glow feature only requires one pass to draw the mesh and one screen space pass. This may result in better performance for the Outer Glow feature when used with objects that have a large number of triangles.

Disable masking

If masking is disabled in all active highlighters, the depth mask buffer will not be rendered, which will save on performance.

Reduce Rendering Bounds Size

Try to reduce the size of the rendering bounds as much as possible to minimize the number of pixels that the GPU needs to render for the highlighter each frame.

Do not enable and disable the highlighter script too often in the Built-in

For built-in, try to enable and disable all features rather than enable and disable the highlighter script since it relies on temporary render textures which might be expensive if they need to be created really often, and this could lead to memory leaks.

Last updated