PICO-8 Lighting: Part 2 – Stitching Lines Together
hackernoon.com
hackernoon.com
Thanks to the author for sharing the implementation step by step.
Here are some other fascinating examples of 2D light and shadow:
http://ncase.me/sight-and-light/
http://nottutorials.blogspot.ch/2009/09/dynamic-2d-soft-shad...
https://www.youtube.com/watch?v=0FZIKX1Y_8I
If anyone out there is considering buying PICO-8, go do it! It's so much fun.
To save on the wear-and-tear on your F5/Cmd+R keys, the plan is for that to happen next Thursday.
The first is flexible range - the light has adjustable brightness which makes it bigger/smaller. The second is the flickering effect applied to each line. Both these things mean that any access to the precomputed table would have to be scaled anyway, which would remove most of its benefit - to the point where all it would save would be one subtraction (sqrt() is taken from a precalculated table in the final version).
I'm concentrating more on the game right now than on making the engine even faster, but I'll try to look into before writing the next part - thanks!