I think you have the right idea halo.
First, decide on the granularity of your grid. Ie, all locations where a plant could be. Then for each location within the player's view, using floating point locations if you need to to make your grid fine enough, multiply the Y by the width, and then add the X and use that as your unique random number seed.
Then, for each location, after you set the random number seed, do rnd(0, 1) and multiply this by the foliage density map's color divided by 255.0. This will produce a number from 0..1 with 0 wherever the foliage density map is black, and a random ditribution within it.
Then, if your result is say, > 0.9, randomly select, scale, and rotate a plant, or randomly generate a plant using however many random numbers you need.
This will ensure that plants appear at the same locatons, and look the same every time. And it will still allow you to generate only those numbers for the region surrounding the player, and adjust the foliage density for each area according to your density map!
First, decide on the granularity of your grid. Ie, all locations where a plant could be. Then for each location within the player's view, using floating point locations if you need to to make your grid fine enough, multiply the Y by the width, and then add the X and use that as your unique random number seed.
Then, for each location, after you set the random number seed, do rnd(0, 1) and multiply this by the foliage density map's color divided by 255.0. This will produce a number from 0..1 with 0 wherever the foliage density map is black, and a random ditribution within it.
Then, if your result is say, > 0.9, randomly select, scale, and rotate a plant, or randomly generate a plant using however many random numbers you need.
This will ensure that plants appear at the same locatons, and look the same every time. And it will still allow you to generate only those numbers for the region surrounding the player, and adjust the foliage density for each area according to your density map!