For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

#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:

#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:

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

Per-instance shader data

Add FloraAdditionalRendererSettings 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 for source requirements, sampling modes, and diagnostics.

Last updated