Raveball

Wanted to see if I could make a post-processing effect to distort previously-drawn screen pixels.
It works, but it's probably too slow to be practical - the much, much cooler thing here is a serendipitous glitch-art effect that happens when the screen isn't cleared between frames. Hit the ZO key to toggle that.
The distortion effect works like this: It copies the frame buffer into the sprite sheet, then redraws a portion of the screen, pixel by pixel, by reading the sprite sheet - but it modifies the sprite lookup position for each pget() call, so you get the spherical bump when it's done.
Can anybody give me some optimization tips? I feel like there's some kinda trickery out there to make it more powerful (the demo here uses radius=26, but if I put it above 28, it drops to half-fps, at least on my laptop). If you've dealt with lots (thousands) of individual pixel draws per frame, let me know what you learned!
I tried using peek() and poke(), but it seemed like it ended up being slower than pset() for drawing pixels one-at-a-time, since the image data is packed with two pixels per byte - so they had to be separated and joined a bunch of times. Maybe there's some super-lean way to do that, which I didn't think of?



Close
Connection Error!

Please check your connection and try again.