I understand that Unity ECS uses the BRG (BatchRendererGroup) approach for rendering objects. After reading the BRG documentation, I have a question.
In the BRG documentation, the following part caught my attention:
</
m_BatchID = m_BRG.AddBatch(metadata, m_InstanceData.bufferHandle);
>
It seems that metadata (which I believe refers to the metadata declared with UNITY_DOTS_INSTANCED_PROP in DOTS instancing shaders) can be used to distinguish between each instance’s InstanceData (custom data for each instance). With this, it looks possible to assign different UV values, colors, or scales to each instance.
I’m curious how we can inject custom data like this into the ECS rendering system, such as with RenderMesh. Among the methods I’ve found, the most promising one seems to be Material Property Override. Is this the best approach? Or is there another method that I should consider?
Let me know if you need any further adjustments!