@demofox Hey! I vaguely remember a post somewhere about using a blue noise (or similar) texture to do poisson disc sampling/placement of things. I know this is super vague! Do you have any idea what I'm on about?
=> More informations about this toot | More toots from bobbydigitales@mastodon.gamedev.place
@bobbydigitales I'm not sure if it's the same one, but a couple (5?) years ago there was a blog post for foliage placement. They showed the "corn row effect" and white noise clumping. I can't find it, but lemme share some info & resources in case useful.
=> More informations about this toot | More toots from demofox@mastodon.gamedev.place
@bobbydigitales So yeah, blue noise can be a good choice for organic object placement, because it's "randomized, but roughly evenly spaced". Depending on your needs, there are different methods and trade offs for making these points.
A real simple algorithm for generating nice quality blue noise points is "Mitchell's Best Candidate Algorithm"
https://blog.demofox.org/2017/10/20/generating-blue-noise-sample-points-with-mitchells-best-candidate-algorithm/
it can be slow though, depending on how many points you need. It can be sped up with a grid but still.
=> More informations about this toot | More toots from demofox@mastodon.gamedev.place
@bobbydigitales that will give you evenly spaced points in a rectangle easily. If you want more complex shapes (circle, triangle, etc) you can do rejection sampling - ignore any candidate that is in an invalid location.
If you want different densities based on a density map, you should be able to change how distance between points is calculated to account for that I think.
=> More informations about this toot | More toots from demofox@mastodon.gamedev.place
@bobbydigitales If you are looking more for like, picking sparse pixels on the screen in a nice blue noise pattern, thresholding a blue noise texture tiled on the screen is a better option for performance. It supports arbitrary densities too.
You can also animate them if using "Spatiotemporal blue noise" (hit me up if interested. I'm the creator of the stuff haha)
https://github.com/NVIDIAGameWorks/SpatiotemporalBlueNoiseSDK
=> More informations about this toot | More toots from demofox@mastodon.gamedev.place
@bobbydigitales There is also something called "multi class blue noise" where if you have bushes, and trees, and you want them to all be generated randomly but roughly evenly spaced, but trees need more space around them than a bush does, MCBN will do that. A nice way to make points in space that do that is with "sliced optimal transport" and isn't too hard to code
https://blog.demofox.org/2023/12/24/making-blue-noise-point-sets-with-sliced-optimal-transport/
=> More informations about this toot | More toots from demofox@mastodon.gamedev.place
@bobbydigitales if you ever need to query "what is the closest blue noise point to this location?", there was a recent paper that gave decent (not best) quality blue noise that allowed this. you might be better off using higher quality blue noise though and using a grid to accelerate lookups. I can't find it at the moment but can try harder if this would be helpful info.
=> More informations about this toot | More toots from demofox@mastodon.gamedev.place
@bobbydigitales a simple way to make blue ish points (reduce clumping) is to make a grid and put a point in each cell, in a random location. This is a "jittered grid" and has some desirable properties, while not being very good blue oise.
There's also dart throwing, but im not a real big fan of that.
Also algorithms based on voronoi diagrams, but the optimal transport algorithm is strictly better as far as i know and have seen.
=> More informations about this toot | More toots from demofox@mastodon.gamedev.place
@bobbydigitales any of this very helpful?
=> More informations about this toot | More toots from demofox@mastodon.gamedev.place
@demofox Yes very helpful indeed, thanks so much for taking the time to post all the responses. I'll read them and get back to you :)
=> More informations about this toot | More toots from bobbydigitales@mastodon.gamedev.place This content has been proxied by September (ba2dc).Proxy Information
text/gemini