# Debugging

Flora integrates with Unity’s [Rendering Debugger](https://docs.unity3d.com/6000.2/Documentation/Manual/urp/features/rendering-debugger.html) to provide tools for visualizing and inspecting **instance behavior**, **culling**, and **performance** in real time.

For Editor-only inspection of sources, templates, draws, graphics buffers, and culling-grid structure, use the [Rendering Inspector](/rendering/rendering-inspector.md).

<figure><img src="/files/Yc1H68wTC0p6NE0spzfE" alt="Rendering Debugger tab"><figcaption></figcaption></figure>

***

## Accessing the Rendering Debugger

Flora adds a dedicated tab to Unity’s **Rendering Debugger** window.

### Access Options

* From the menu bar:\
  **Window → Flora → Rendering Debugger**
* In a development build (Play Mode or standalone):\
  **Ctrl + Shift + Backspace**

<figure><img src="/files/VtnOomGjI0CVKNJaG7qK" alt="Flora debugger hotkey" width="563"><figcaption></figcaption></figure>

The Flora panel is available when a `FloraSystem` is active. If the system is not running, the panel shows a **Not Running** message.

***

## Debug Properties

### General

#### Debug Shading Mode

Visualizes internal instance data using shader debug colors:

* **None** - disables Flora debug shading.
* **LOD** - colors instances by selected LOD.
* **InstanceHandle** - colors instances by handle. Editor only.
* **RandomID** - colors instances by the per-instance random value, when allocated.
* **Template** - colors instances by Flora template.
* **Draw** - colors instances by draw entry.
* **DrawVariant** - colors instances by draw variant.
* **CullingBatch** - colors instances by culling batch.
* **BatchDomain** - colors instances by BatchRendererGroup batch domain.

#### Display Culling Stats

Enables collection and display of GPU culling stats in the **Culling Stats** section.

#### Enable GPU Checks

Enables GPU validation checks in the culling system. This is intended for debugging rendering or culling issues and may affect performance.

***

### Freeze Camera

The **Freeze Camera** control freezes culling for a selected active game or Scene View camera. This lets you move other cameras or inspect the scene while keeping the selected camera's culling state fixed.

The camera list is refreshed while the debugger is active and includes up to six entries.

***

### LOD

Controls how Flora selects LODs while debugging:

* **None** - uses normal LOD selection.
* **ForceLOD** - forces all eligible instances to use the selected **LOD Index**.
* **OnlyLOD** - renders only the selected **LOD Index** and culls other LODs.

`LOD Index` is shown only when a LOD mode is active.

***

### GPU Occlusion

These controls are shown when GPU occlusion is available for the active Flora system. If GPU occlusion is disabled by [Runtime Settings](/scripts/runtime-settings.md), [Scene Settings](/scripts/scene-settings.md), or camera settings, the debugger shows an info message instead.

* **Force Never Occlude** - overrides the occlusion test so instances always pass. Use this to confirm whether missing instances are being removed by GPU occlusion.
* **Occlusion Overlay** - draws the occlusion test overlay.
* **Opacity** - controls the occlusion overlay opacity.
* **Count Visible** - includes visible-instance counts in the occlusion overlay.
* **Depth Overlay** - displays the occluder depth pyramid debug view.
* **Range Min / Range Max** - remaps the depth-overlay display range.

***

### Spatial Hash

Displays Flora's culling grid as procedural debug lines.

**Mode**

* **Disabled** - no spatial-hash overlay.
* **Heatmap** - visualizes occupancy/intensity.
* **Level** - visualizes culling-grid levels.

**Types**

* **Blocks** - top-level grid regions.
* **Cells** - mid-level grid cells.
* **Chunks** - instance chunks inside cells.

**Draw Distance** limits how far the overlay draws from the camera.

***

### Culling Stats

When **Display Culling Stats** is enabled, the debugger shows:

* **View Count**
* **Per View Stats**
  * View
  * Visible Draws
  * Visible Instances
  * Occluded Instances

These stats are useful for checking whether Flora is producing draw work for each view and whether GPU occlusion is removing instances.

***

## How To Verify

* Set **Debug Shading Mode** to **LOD** and confirm Flora instances are tinted by LOD.
* Enable **Display Culling Stats** and confirm view rows update while cameras render.
* Enable **Force Never Occlude** when GPU occlusion is active; missing instances that reappear were being occluded.
* Enable **Spatial Hash > Cells** and confirm the culling grid overlay follows active Flora content.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://flora.magneticarcade.com/rendering/debugging.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
