Specific parameter per object

Hi there!

I really want to know how to have a specific parameter for each sprite renderer
such as 1 tree have a colors or texture per each, if I change, it will not effect other
trees with same materials

this is possible?

Thanks!!!

Yes, there are a few ways to go about doing this.

You can use MaterialPropertyBlocks to override specific properties on a per-renderer basis.

Alternatively, you can just create a material for every object. This is what happens automatically if you access the “material” field on a renderer.

I don’t know enough to say which one of those is “better”. I usually use property blocks, though.

1 Like

SRP batcher does not support MaterialPropertyBlocks, so the way to do this in rendering pipelines (at least in 3D) is to use separate material instances (assuming you want to put srp batcher into use).

However sprite renderer has tint/color property and you can use it to chage color of the sprite.

2 Likes

Ok, so it impossible right? what a pity…

Execuse me, excluding base texture and color properties of sprite renderer @chemicalcrux provided you already two possible methods to set parameter per instance and you say it’s not possible…
I am confused.

1 Like