I have a single channel texture and my goal is to sample it in world coordinates (xz) to get some normalised value for a density. Then I wanna use this varying density to spawn particles based on it. How can I achieve it?
Morning. A similar question has been asked in this thread . What you want to do is rejection spawning.
the idea is the following:
- Spawn particles everywhere.
- Use the Particle’s position as UVs to sample the Texture.
- Use the Texture’s data to modulate the boolean “Alive” attribute value to kill particles.
More details are in the linked thread . Have a look at it and don’t hesitate to ask if something is still unclear.
Have a great day.
1 Like
It feels like spawning that many particles just to sample the texture could affect performance
It isn’t always ideal, and sometimes it’s better to use baked point caches or proxy meshes. But sometimes sampling a texture is the only solution. You can use the indirect Draw option in the output for this kind of scenario.