2
\$\begingroup\$

I'd like to be able to make the screen like blurry and wavy, like when a player enters a portal in Minecraft.

How would I make this with pygame?

\$\endgroup\$
3
\$\begingroup\$

My suggestion would be to use surfarrays in conjunction with NumPy.

Assuming you already have an algorithm for the post-processing effects you want, all you'll have to do is port it into NumPy syntax, which will probably just take some tinkering. Examples of usage can be found here, here, here, and here.

After manipulating the surface, you just have to take whatever is output and blit it back to the screen.

A word of warning: full screen processing in pygame, even with surfarrays and NumPy, can be very slow. I once tried to create a desaturation post-processing effect for a pygame game, and struggled to get the game to run at 30fps at something like 640x480 resolution. Of course, if you get speedy results, I'd love to see how you did it :)

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Great, I will start doing some work on this. I haven't really done any algorithm for this, but I will start working on it right now. This was a great answer, thanks a lot! \$\endgroup\$ – Tyyppi_77 Sep 25 '13 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.