Randomize emission node strength for multiple objects

I am making a scene with multiple stars in it with an emission material. Now I want to make them twinkle randomly, by changing the emission strength, preferable by adding a noise modifier in the graph editor. Since I have the same material given to multiple stars, all the stars twinkle at the same time, which I don’t want. So is there any way to achieve this other than manually creating individual materials and keyframing the emission strength?

Edit: It would also be great if I could set the range for emission values for a bit of control.

Blend file: https://pasteall.org/blend/6f96dfe71ec243c3841e589a508a84dc

I can’t check your file right now, but if they are individual objects you can use objectID to control who are affected by what. I use it for picture frames, if object info/object index > 0 then use texture1, if >1 then use texture2 (rgb mix node) and so on.

So how can I achieve the random twinkling effect with this setup?

You could use the new random per mesh island variable (geometry node) and multiply it by your animated value, but that would keep all the stars in perfect sync… (although with different intensities), so my advice would be instead to use an animated 3D procedural texture such as musgrave to control the stars’ intensity.

Thank you very much!
I’ve been struggling for quite some time for this. This is really an elegant solution.

Here’s the node tree if anyone’s interested:

2 Likes

Oh, I thought you were going for having specific stars twinkle. Like how Sirius is about the only highly visible twinkling star in the northern hemisphere. I’ve still not gotten around to checking the file, lol.