I am currently working on making a realistic grass shader in blender, but there's one thing I'm stuck on. I made a few different variations of textures in substance designer to make some of the grass blades look dead or discolored. I split the grass up into multiple particle effects each with a different texture, and while it looks okay, it's too inefficient for me since I already use multiple particle effects each with different object counts and size/rotation settings, so it becomes noticeable that each texture variant is applied to a different particle layer. You can see what I mean here:
I have never found any resource online that can show me how assign a different texture based on particle index, so I spent some time messing around and got this as my node setup. I divided by 15000 (number of particles in my test layer) to get a value from 0-1, then rounded it to a whole number.
...And to my surprise it works! But not really. You can see in my test render (I used a solid red and blue texture so I can visualize it better) that the texture variation is split down the middle of my render. I did not know this how particle index works.
So basically what I'm getting at is I need to know either: how can I randomize particle index distribution, or is there a better way altogether to do this? I should also mention that in my particle settings under "Emission" I have the "Random" box ticked.