要支持 DOTS 实例化,着色器需要执行以下操作:
#pragma target 4.5
DOTS_INSTANCING_ON
#pragma multi_compile _ DOTS_INSTANCING_ON
注意:Unity 在 URP 和 HDRP 中提供的 Shader Graph 和着色器支持 DOTS 实例化。