Best way to spawn particles based on a heightmap in VFX Graph?

Hi,

I have a heightmap. What is the best way to spawn for example some grass on a hill, based on this texture?

Currently i create two random values (x and z) via the random node for each particle and use these values as texture coords. I then use the texture lookup value to get the complete position of the particle.

The problem is that this is not really “triplanar” friendly, as the points are evenly (randomly) distributed based on a 2d grid. Hills have now holes as the distance between two points is still not enough to cover the slopes.

So i wonder if there is a better way of placing particles based on a texture.

Another problem i have is that i dont really have a way to “not” spawn particles based on a value. Say that i want to only spawn these particles if the height goes > 0.5 … i can only move them out of the way via flooring, but this seems wasteful.

Anyone has an idea?

I’m going to shamelessly necro this and ask how did you combine a given particles coordinate with it’s height, for what i want it even the low height to coordinate resolution is acceptable but my solution only works on first line and all the rest are flat.

Thanks