The other day, I was reading about kd-trees. I was looking for a concrete and simple situation where such a data structure could be useful. Does anybody have such an example?
I used a kd-tree to simulate light transport through spray generated by a wave. This made it possible to render droplets of spray that weren't just illuminated by lamps, but also indirect lighting coming from other droplets.
I stored points of spray in a kd-tree and then used the kd-tree to quickly find which points were near each other, and hence which droplets of water were illuminated by each other. (Actually, it was a little more sophisticated, but the structure was still a kd-tree.) This made it possible to render a nice glow through the spray.
Here's a picture of the method in use.
Note how the spray around the lights is glowing with scattered light.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With