Skip to content

Comment on Ask HN: What's the hardest problem you've ever solved?

Comments

When I was a teenager, I was doing some experimentation with 2d shadows in Flash. The first version was done by using a BitmapData by iterating over every pixel and lighting it if it was not obscured. This took ~15 seconds to compute.

I was happy with this, until a friend challenged me to make it realtime. I managed to re-implement the same thing by using the built-in vector drawing (and as a bonus, this also gave anti-aliasing) and managed to get this down to 15ms.

The third version was using the 3D acceleration, and managed to get 100 lights to render in realtime. Was pretty proud of myself and I wrote an article about it, which was cited a few times by different people.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.