[Feature Request] Instance Index for Instanced Static Mesh in the Material Editor


I would like to have access for the instance index for instanced static meshes in the material editor.

I think it would provide more information about the instanced static mesh data, also you can generate a random number in a shader from this information. So you don’t actually need the RandomNumber in the instaced static mesh.

My current problem with the Per instance random is that it generates a new random number everytime i remove or add a new instance.

Also an Instance World Location node would be also helpful.

I don’t recall running into need of having instance ID in material, but yeah generally I would prefer having something else instead of per-instance fade amount, so upvoted and signed :slight_smile:

As for instance position, last time I checked, there was InstanceLocalToWorld transform matrix for instanced meshes.
If I remember correctly, Object Position node OR (0,0,0) chained to TransformPosition LocaTtoWorld node should give you per-instance world position, if they are used in vertex frequency shader. You could try passing it via custom UV.

For audio visualization purposes it’s good to have the instance index, so you can feed the frequency data into a material collection and play with the mesh scale from the shader. So it gives you a great performance boost. Also if you really need a random number you can really do it in a shader. The other problem with the per instance random is that it regenerates a completely new one for each instance when an instance is removed. So it’s not really useless for instanced static meshes where you need to remove some bubbles

Hello hello Epic :C

Also please since your answer is actually not answering the issue you shouldn’t set it as an answer to the question :stuck_out_tongue: