I have shrine in my levels and I want them to turn all grass around them darker.
To do that, I retrieve all foliages actors, I use for each and branch to only “select” grass.
Then I use another loop and branch to only affect the grass that are within range of the shrine actor.
For the instances within range, I check if they use a dynamic material instance, if they don’t I create it.
Then I modify the dynamic material instance to make it darker.
But when I do that, nothing happens for a while, then at some point, all my grass becomes darker.
I suppose UE make all instances of a foliage type to share the same material for performance reason.
So here are my questions :
How do I ensure that each grass mesh has its own individual material instance?
Is it even stupid to try to do that or will my computer melt once I have 20k dynamic material instances?