Diagnostics Toolbar

The diagnostics toolbar is a utility for displaying information about the performance of Sansar and the scenes you are in. It is useful for measuring graphical impact, which can help you make informed decisions about how to improve performance in your scenes.

To enable the diagnostics toolbar while editing or visiting a scene, select More Options > Diagnostics from the App Launcher on the left side of the screen. While editing a scene, you may also choose Tools > Diagnostics from the toolbar at the top of the screen.

Disable diagnostics for visitors


A world owner can disable the ability for visitors to use their diagnostics toolbar in the scene for various reasons.

To disable the use of diagnostics in your scene, during edit mode go to the top left menu and select Tools > Scene Settings.

Then in the Scene Settings panel Scroll Down to Visitor Settings > Toggle Diagnostics to off

Statistics


The diagnostics toolbar displays the following statistics at all times:

  • Rate - The current frame rate, measured in frames per second. Higher values are better, it is possible to set a cap for this in the settings panel.

  • Time - The amount of time elapsed in milliseconds for the last sampled frame. Lower values are better.

  • Draws - The number of draws required to render the current view. Larger numbers of draws have a larger negative impact on performance. This number changes as the number of visible objects enter and exit the viewable area. Number of objects, Overdraw, lighting, materials, the objects shader type and avatars are some of the things that are counted towards this.

  • Prims - The number of triangles (also known as primitives) currently being drawn. When visiting a scene, occlusion culling reduces the number of triangles, but occlusion culling is not performed while editing a scene so this number remains fixed, visit your scene during runtime to see this change. The larger the number of triangles, the bigger the negative impact on performance.

  • Geom - Your scene's total geometry size in MB, lower amounts help with performance and loading times.

  • Tex - The total texture size of your scene, this heavily impacts loading times and VRAM usage, using smaller textures can help keep this down.

NOTES:

  • Some optimizations only occur fully during runtime and require you to visit for a true performance overview.

  • As a rough guide for a performant world try keeping your Draws below 6k while in runtime, your Prims below 8 million and your Tex below 8GB. These numbers fluctuate when optimizations occur during runtime so try to visit your scene how you intend your guests to see it.

Metadata settings


You can temporarily adjust the lighting in your scene to provide additional contrast and visibility while using the metadata modes by clicking these two icons and adjusting the sliders.

Lighting

This setting adjusts how much of the normal scene lighting is visible. You can turn this down to help the glowing metadata highlights stand out, making it easier to identify "hot spots" of triangle density or overdraw. Turn it back up again to help navigate the scene and identify the underlying models.

Sensitivity

Adjusts the brightness of the glow from the rendering metadata modes. At low sensitivity, only the most dense or complex areas are highlighted. At high sensitivity, dense and complex areas glow very brightly.

Extra Settings

Some Metadata modes have some extra settings, if they do, a cog symbol will appear and can be clicked for other options.

Rendering metadata modes


The diagnostics toolbar can toggle several viewing modes to help you identify performance issues in your scene. You can use these while editing and during runtime. Select from the following modes in both VR and Desktop.

To use Diagnostics view in VR you can cycle through modes by selecting the 'Diagnostics' button located on your main wrist menu.

No Metadata


No rendering metadata is displayed. This is the default view.

Lighting complexity


Overlapping lights especially when casting shadows, is possibly the biggest hit to the performance of a scene.

This mode provides information regarding the number of lights illuminating the same area in the scene (in other words, "overlapping lights"). This information is only displayed for point lights and spot lights. Areas with a low lighting complexity appear as dark purple. Objects with a high lighting complexity appear a bright yellow/orange. Areas of high lighting complexity have a negative impact on performance since processing time is required to calculate the effect of each light illuminating the area.

Here you can see 3 point lights that look like they are not touching.

But in diagnostics we can see they are actually overlapping.

Additionally when a light hits an object it is being rendered twice, making your PC need to render it again, every light that touches an object makes your PC render it another time, so in this image, cube 1 is being rendered twice, cube 2 three times and cube 3 four times! this can soon add up especially with complex objects. Reducing the overlap and the amount of lights hitting an object can drastically improve performance.

Lighting complexity modes


You can use the Lighting complexity modes to filter which lights are displayed by the Lighting complexity metadata mode. Lighting complexity mode can filter the following kinds of lights:

  • All lights - Includes all spot lights and point lights.

  • Shadow casters only - Only includes lights that can cast shadows.

  • Active shadow casters only - Includes only lights that cast shadows that are currently being updated, or "active". Shadow casters are active when an object in the light’s region of influence moves.

Overdraw Complexity


Excessive overdraws is one of the main culprits of bad performance.

This mode provides information regarding the number of objects in the scene that are being drawn in the same space on the screen, or "drawn on top of each other". Overdraw occurs when objects are drawn in the same line of sight, but are separated by space. Objects with low overdraw complexity glow dark purple, and objects with high overdraw complexity glow bright yellow-orange. Areas of high overdraw complexity have a large negative impact on performance as processing time is required to render objects that are ultimately hidden by objects closer to the camera and would be culled normally during runtime. If a single part of mesh is visible to the camera the entire object is being rendered. It is important to note that items with alpha shaders will not cull items behind them.

Triangle Density


Triangle Density provides information regarding the number of triangles on screen. Objects with a low triangle density glow dark purple. Objects with high triangle density glow bright yellow-orange. The higher an object's triangle density, the larger its negative impact on performance. Use this mode to try and find areas and objects that have a lot of density and try reducing it with less items or more performant objects.

Triangle density modes

There are two modes, which are accessible through the gear icon on the Diagnostics toolbar:

  • Screen space - Calculates triangle density per pixel. Objects that are further away from the camera (and therefore smaller on the screen) have the appearance of higher triangle density, since there are more triangles within a smaller rendered area.

  • World space - Calculates triangle density relative to the size of the world. This mode is not dependent on the camera, which allows for easier identification of higher density objects in the scene.

Viewing triangle density of an object in a scene, with Lighting set low and Sensitivity set to default. Areas of low triangle density appear purple, and areas of higher triangle density are highlighted more brightly.

Visible Backfaces


Visible backfaces shows when a mesh is showing a flipped normal or the backface of a piece of mesh, you can use this to determine if an object has flipped face normals.

Wireframe


This rendering metadata mode outlines all visible triangles in the scene. This directly correlates with the scene's Prims statistic. You can use this mode to identify objects with geometry that may be considered heavy for the size of the item, using this, you can try to find objects and layouts that can be simplified or changed in order to reduce primitive count and triangle density in the scene.

Unlit


Unlit shows the base colors of the world's objects without any lighting or shadow effects, this can be useful to see the true colors of items in darker areas or to build without needing to change lighting in dark scenes.

Normals


Normals shows the normal maps of all objects and is useful to determine if a normal map is being used on low poly objects instead of a high poly object being used where it is not needed.

Scale


Scale shows a grid across the scene that takes into account if an item has been scaled up compared to the others around it, there is some use for this in figuring out if an object has been scaled beyond its original intended size.

Radiance


Radiance shows the Global Illumination and Bounced lighting color effects within the scene without other sources of color or lighting. This mode can help you identify if the GI is achieving desired results and where certain lighting effects may be coming from.

Texture Size


Texture size shows using a color coded map the sizes of the texture maps used on all the objects in a scene. Use this to help identify objects using larger maps than is necessary.

These show per material slot and can be filtered to just show the texture type you would like to examine or the largest map if using the default 'all' setting.

Texture Instancing Caveat

A caveat of the view is it cannot tell if objects are sharing a single texture. Sansar uses texture instancing so having a single 4k atlas that is used on many objects can be considered ok as it uses no more resources if more objects use the same texture.

For example: if you used a 4k concrete on a very large bridge that required it, you can use that same 4k map on all your concrete objects in the scene and its only counted as being used once, but these objects can all show as using 4k.

Once you have identified objects you think could be improved, check your scene stats panel in build mode to see if the texture is shared with other objects and weigh up the usecase.

Reading the color map

  • Using the Cog symbol next to the diagnostics selector choose the map type you wish to examine, if you select 'All' the largest texture size of the material slot will be shown, you can then change the type to determine the individual map sizes of that object.

  • Map sizes are determined using the power of 2. For a map to be in the 2k range it must be over 2048x2048 but lower than 4096x4096.

  • The tool accounts for maps being any size within these ranges by using brightness.

  • a map that is nearing the 4k range but is still under the threshold will appear as a brighter red than one that is closer to 2048x2048.

  • If an object does not contain the map you are filtering it will appear as Dark Grey or Black.

Color Reference

Size
Color

0

Darker Gray

< 8x8

Dark Gray

< 128x128

Dark Green

128x128+

Bright Green

256x256+

Cyan

512x512+

Yellow

1024x1024+

Orange

2048x2048+

Red

4096x4096+

Magenta

Last updated