how can i seed random material values by object?

If you’re using Instanced or Hierarchical Instanced Static Mesh components to populate your objects you can use the PerInstanceRandom material node to have the system generate a random value between 0.0-1.0 that can then be leveraged.

Alternately you can have a blueprint generate a random value that’s passed to each objects material instance as a parameter. (Can be seed based or not)

Either way, to make life easier you can create two material functions like the image below that will allow you to use that random number more effectively. (My functions are for scalar values, but they could be adapted for float3 values)

The top function uses the random value, a target value, and a deviation [<1.0 smaller, >1.0 is larger] value to generate an output that randomly deviates from the target value by up to the specified deviation percentage.

The bottom function uses the random value (misnamed as Input Percentage) to select from within a range. (Basically a lerp now that I think about it…)

2 Likes