I’ve been trying to figure this out for some days but I can’t find out how to do this, or if it is even possible:
I’ve set up PCG foliage spawning on a large terrain and it works really well: I’m now using an attribute filter that puts trees wherever the “Forest“ landscape paint layer attriubute has a value of 0.03 or higher.
However, I would like to control the density of the forest by making it dependent on the actual value of the Forest layer attribute: as in, for instance, that if the value would be > 0.5 it would spawn the current amount of trees - a real forest - but if the value would be lower than that it would spawn less trees, maybe down to no trees at all when it’s 0.0.
I first tried it by chaining a couple of attribute filters, with the first set to > 0.5 (and passing the inside filter to the static mesh spawner), then feeding the “outside filter” link to the next attribute filter set to > 0.25, passing that inside filter to a density filter that removes half the points - and so on for two more subsequent steps.
I couldn’t get this to work, though. I don’t have a clue why: when I only have that first filter level active, it works OK and spawns trees wherever I paint a forest layer of > 0.5. But as soon as I connect the “outside filter” to the next attribute filter, the first level doesn’t spawn any trees any more, though that second layer then works. It’s as if using the outside filter invalidates the inside filter.
Regardless of that, it would still make things much easier if I could extract the Forest layer value, multiply it by 2 and feed that into the upper bound value of the density filter node - that would automatically adjust the density filter based on the value of the Forest layer.
And though I’ve found several things that come close, like adding an attribute based on an existing one, I cannot figure out how I can retrieve an attribute and use it somewhere else in the graph.
I do have a hunch that this is not possible because attributes from the point cloud are of another size order (for lack of a better word) than the input the density filter needs, which is basically one static value. Maybe that also explains why that 4-tier filter doesn’t act as I hoped.
But maybe there is another way to do this? I though that using a landscape layer’s value would be perfect for this, but if there’s a better way I’d love to know ![]()
Luthien