Download

Instanced Mesh Comp: why no "PerInstanceIndex"?? "PerInstanceRandom" is not enough

Hi guys,
hope you can help because I’m struggling trying to make per-instance variations on a material applied to an “instanced static mesh component” (which contains hundreds of instances).

Scenario:
a building with hundreds of instanced windows, whose material I want to vary for every instance.

Examples of what I’m trying to do:

  1. I’d like a specific group windows (say index range 50-100) to have a specific base color.
  2. I’d like to be able to make a color progression from white (first window) to black (last window).
  3. I’d like to assign to my instances different normal maps inside my Material
  4. I’d like to assign to specific instances a totally different material.

I don’t understand why a “PerInstanceRandom” is provided and can be used inside the Material Editor, but there’s no way to retrieve the Index of the instances.

Could you please explain me why ? Am I missing something trivial about how the engine works?
More important, do u know any work around that I might use for my needs?

Bonus question: I guess creating from the same mesh hundreds of instanced static mesh components with a single instance inside would be pointless performance-wise, right?

thanks a lot!