> 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

Flora supports a wide range of Unity shaders and includes utilities for patching both Shader Graph and manually authored shaders for compatibility with instancing and selection.

***

### Shader Requirements <a href="#patching-shaders" id="patching-shaders"></a>

Every pass **must** include the following **pragma**, and will only work when the shader target is greater than 4.5.

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

For Universal, you can use the following **include\_with\_pragmas** to automatically setup the pass for DOTS.

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

Additionally for picking to work, ensure the **ScenePickingPass** correctly returns `unity_SelectionID` and not `_SelectionID`.

This is a common error in 3rd party shaders, and affects Amplify Shader Editor (a bug request has been submitted). For ASE, modify the template shader and replace the return result of `_SelectionID` with `unity_SelectionID` in the fragment shader of any templates you are using.

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