10 ms·
I don’t fully understand the code but this appears to be a very brute force way of doing it, which slows down as you add more raindrops, pixels, and lights. I
by erikpukinskis 9y ago
I don’t fully understand the code but this appears to be a very brute force way of doing it, which slows down as you add more raindrops, pixels, and lights.
I suspect you could do the same with signed distance fields in a way that runs in constant time irrespective of the number of drops at least.
You could also then scale and distort the car lights and add as many as you like without affecting performance either.
- ttoinou 9y agoIt's already constant time but he calls the function twice in order to have big bubbles and little bubbles overlapped
- erikpukinskis 9y agoAren't the bubbles in a vector?
- ttoinou 9y agoLike an array ? No they aren't. He creates a grid of bubbles and displaces that grid