> For the complete documentation index, see [llms.txt](https://flora.magneticarcade.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flora.magneticarcade.com/rendering/shaders-and-materials.md).

# Shaders and Materials

How Flora works with your existing shaders, and what to consider when authoring new ones.

Flora supports Shader Graph and manually authored DOTS-instanced shaders. Supported URP and HDRP Lit and Unlit graphs receive Flora's instancing include automatically.

***

## Shader requirements

Every rendered pass must include the following pragmas. Flora requires shader target 4.5 or later.

```hlsl
#pragma multi_compile _ DOTS_INSTANCING_ON
#pragma target 4.5
```

For URP, you can use this `include_with_pragmas` directive to configure the pass for DOTS instancing:

```hlsl
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
```

For Scene view picking, ensure the `ScenePickingPass` returns `unity_SelectionID`, not `_SelectionID`.

Some third-party shader templates return the wrong value. Update the template's picking fragment shader when necessary:

```hlsl
// return _SelectionID; Replace this line with:
return unity_SelectionID;
```

## Per-instance shader data

Add [`FloraAdditionalRendererSettings`](/scripts/additional-renderer-settings.md) when a shader needs Random ID or Variation Color. Enable only the streams it reads.

## SpeedTree wind

Flora supplies Unity's current `DOTS_ST_WindParam*` and history `DOTS_ST_WindHistoryParam*` properties to render prototypes detected as SpeedTree wind sources. Unity's compatible DOTS-instanced SpeedTree shaders consume these properties automatically.

A custom tree shader must follow the same property contract and use the history values for correct motion vectors. See [SpeedTree Wind](/rendering/speedtree-wind.md) for source requirements, sampling modes, and diagnostics.
