|
| 1 | +--- |
| 2 | +title: Debug Rendering |
| 3 | +description: Overview of server-side debugging rendering effects |
| 4 | +author: jumeder |
| 5 | +ms.author: jumeder |
| 6 | +ms.date: 04/09/2020 |
| 7 | +ms.topic: article |
| 8 | +--- |
| 9 | + |
| 10 | +# Debug Rendering |
| 11 | + |
| 12 | +The debug rendering API provides a range of global options to alter server-side rendering with different debugging effects. |
| 13 | + |
| 14 | +## Available debug rendering effects |
| 15 | + |
| 16 | +|Setting | Effect | |
| 17 | +|---------------------------------|:-------------------------------------| |
| 18 | +|Frame counter | Renders a text overlay into the top-left corner of the frame. The text shows the current server-side frame ID, which is continuously incremented as rendering proceeds. | |
| 19 | +|Polygon count | Renders a text overlay into the top-left corner of the frame. The text shows the currently rendered amount of polygons, the same value as queried by [Server-side performance queries](performance-queries.md)| |
| 20 | +|Wireframe | If enabled, all object geometry loaded on the server will be rendered in wireframe mode. Only the edges of polygons will be rasterized n this mode. | |
| 21 | + |
| 22 | +The following code enables these debugging effects: |
| 23 | + |
| 24 | +``` cs |
| 25 | +void EnableDebugRenderingEffects(AzureSession session, bool highlight) |
| 26 | +{ |
| 27 | + DebugRenderingSettings settings = session.Actions.DebugRenderingSettings; |
| 28 | + |
| 29 | + // Enable frame counter text overlay on the server side rendering |
| 30 | + settings.RenderFrameCount = true; |
| 31 | + |
| 32 | + // Enable polygon count text overlay on the server side rendering |
| 33 | + settings.RenderPolygonCount = true; |
| 34 | + |
| 35 | + // Enable wireframe rendering of object geometry on the server |
| 36 | + settings.RenderWireframe = true; |
| 37 | +} |
| 38 | +``` |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | +> [!NOTE] |
| 43 | +> All debug rendering effects are global settings that affect the whole frame. |
| 44 | +
|
| 45 | +## Use cases |
| 46 | + |
| 47 | +The debug rendering API is intended for simple debugging tasks, like verifying the service connection is actually up and running correctly. The text rendering options directly affect the down-streamed video frames. Enabling them verifies if new frames are received and video-decoded correctly. |
| 48 | + |
| 49 | +However, the provided effects do no give any detailed introspection into service health. The [Server-side performance queries](performance-queries.md) are recommended for this use case. |
| 50 | + |
| 51 | +## Performance considerations |
| 52 | + |
| 53 | +* Enabling the text overlays incurs little to no performance overhead. |
| 54 | +* Additionally enabling the overlay does incur a non-trivial performance overhead, though it may vary depending on the scene. For complex scenes, this mode can cause the framerate to drop below the 60-Hz target. |
| 55 | + |
| 56 | +## Next steps |
| 57 | + |
| 58 | +* [Rendering modes](../../concepts/rendering-modes.md) |
| 59 | +* [Server-side performance queries](performance-queries.md) |
0 commit comments