A collection of Unity Editor Tool(s) that assist in understand usage and performance.
These are being used to help identify and optimise use of shaders and texture size in performance constrained environments.
Distributed as a git package (How to install package from git URL)
https://github.com/ActuatorDigital/Clarity.git?path=Packages/Clarity
Clarity adds the following Menu Item(s).
Edit/Clarity/Find All Lights- Sets the Hierarchy to filter by typelight.Edit/Clarity/Save Last Build Report- Converts last unity build report to json format. Saved in location defined in editor preferences.Edit/Clarity/Open Build Scenes- Changes EditorSceneManager to have all the scenes in the build unloaded, so that you can switch between scenes the build can access quickly.
Clarity provides the following editor window(s).
Configured via Preferences->Clarity.
In the editor, the matching name Profiler Recorder will be checked during playmode. If the value goes above limit in the settings, a Debug Log Warning or Error will be emitted.
A value of 0 will skip the check.
If Hard Error is ticked, Clarity will pause the game with a confirmation dialog box when the error threshold is exceeded.
Example workflow:
- Profile target hardware to determine allowable draw calls per frame.
- Set the limit in the Preferences to near that determined value.
These settings are intentionally saved with the project rather than with the user, so limits can be set once and have effect project wide for all developers.
Editor window found in Window->Clarity/Group By Shaders. Finds all renderers, and shows them grouped by the shader they use.
The top text field will do a partial match on the shader name and collapse matches.
Example workflow:
- Open a scene.
- Open
Group By Shaderswindow. - Scroll through to find shader(s) that are known expensive, e.g. 'Standard'
- Click on Renderers underneath the shader.
- View the material they are using.
- If it could use a simpler shader, change it.
- Return to the window, it will update it's content.
- Goto 3.
Editor window found in Window->Clarity/Group By Shadows. Finds all renderers, and shows them grouped by the shadow settings.
Example workflow:
- Open a scene.
- Open
Group By Shadowswindow. - Scroll through to find settings that are known expensive, e.g. 'On, True'
- Click on Renderers underneath the heading.
- View and determine if these settings are required for this object.
- Return to the window, it will update it's content.
- Goto 3.
Editor window found in Window->Clarity/Group By Textures. Finds all renderers, and shows them grouped by the texture compression mode and size.
Example workflow:
- Open a scene.
- Open
Group By Textureswindow. - Select Texture that is larger than expected or desired
Isolatein scene.- Lower max resolution.
- No visual difference, Goto 5.
- Revert 1 step.
- Apply change.
- Goto 3.
Editor window found in Window->Clarity/Locations. Shows a list of folders/files configured via Preferences->Clarity.
Example workflow:
- Add relative path to common folder e.g. Name
fmod project, folder../fmod_projectviaPreferences->Clarity. - Open
Locationswindow. - Click the
Opennext to the name you've given it.
Presently Locations supports the follow special names, resolved when requested.
| Path string | Dynamic Result |
|---|---|
Application.persistentDataPath |
calls Application.persistentDataPath |
TestContext.CurrentContext.TestDirectory |
calls TestContext.CurrentContext.TestDirectory |
Clarity provides the following runtime components.
The scene view can be set to render mode miscellaneous->Mipmaps. This tints texture magnification blue, and tints texture sample below mip level 1 red. This is useful in tweaking texture size to match texel size. Unfortunately it is editor only and scene view only.
The Clarity/Debug_MipMap produces a similar effect in a shader. This allows for checking mipmap usage in the game view, during play and also in builds where device specific settings might otherwise be hard to replicate.





