
Shaders and Materials
How to get Shaders and Materials working with Flora.
Batch Renderer Group
When using BRG as the culling pipeline, no shader modification should be necessary for rendering. However selection still uses the legacy pipeline, and if the shader's selection passes aren't configured for instancing, selecting Flora instances might not work as expected.
If selection isn't working, make sure your selections passes (SceneSelectionPass and ScenePickingPass) both have the line:
#pragma multi_compile_instancing
If using Amplify, modify the shader template so that both shader passes include that line.
Shader Graph
Injection
Flora automatically patches Shader Graph, requiring no additional setup if you're using Shader Graph for your shaders.
By default, the patcher excludes URP and HDRP targets that are incompatible with instancing. If you encounter issues with the patcher, you can disable the automatic injection via the global setting under Project Settings -> Flora -> Disable Shader Graph Injection
.
ShaderGraph Node
When ShaderGraph injection is disabled, the Setup Flora Instancing Data
node will become available in Shader Graph. Connect this node to the Vertex Position block in your Shader Graph to enable instancing for Flora.
Patching Shaders
In the Project window, right-click on a selection of Materials or Shaders to access the patching option.

In the Inspector window, right-click on a material to convert the Material to Flora.

Location
Patched shaders are saved alongside the original shader with the suffix (Flora)
. If the shader is located in a package or a non-asset directory, the patched shaders are saved at:
Assets/Flora/Shaders/Original/Shader/Path
Flora Shader

Non-Destructive Importing
Flora shaders never modify the original shader. They use scripted importers to read the source shader and generate a new shader whenever the original changes. Unity's asset dependency management ensures that the Flora shader remains up-to-date with the latest modifications of the original shader.
This allows modifications to the original shader without needing to manually re-generate Flora shaders. Additionally, if the shader originates from another asset developer, Flora shaders will always stay synchronized with the latest changes.
Last updated