# 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;
```


---

# 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/shaders-and-materials.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.
