Shaders and Materials
Setting up Unity shaders and materials for Flora's instancing.
Last updated
Setting up Unity shaders and materials for Flora's instancing.
Last updated
Flora automatically patches Shader Graph, requiring no additional setup if you're using Shader Graph for your shaders. This includes fixing instancing with Shader Graph for the Built-in renderer, allowing you to use Shader Graph seamlessly with the Built-in renderer.
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 -> Shader Graph -> Disable Shader Graph Injection
. Once disabled, the node Setup Flora Instancing Data
will become available in Shader Graph. Connect this node to the Vertex Position block in your Shader Graph to enable instancing for Flora.
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 Materials and Shaders to Flora.
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 in Flora -> Shaders -> Original Shader Name
.
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 your Flora shader remains up-to-date with the latest modifications of the original shader.
This allows continuous modifications to the original shader without needing to re-generate Flora shaders. Additionally, if the shader originates from another asset developer, Flora shaders will always stay synchronized with the latest changes.
BOXOPHOBIC's visual engine supports Flora natively. To enable Flora for TVE, see their documentation on how to setup shaders for indirect instancing.