crashinvaders / gdx-vfx

libGDX post-processing visual effects
https://crashinvaders.github.io/gdx-vfx
Apache License 2.0
191 stars 25 forks source link

[EFFECT REQUEST] Earthquake Screen Shake #4

Closed raeleus closed 4 years ago

raeleus commented 5 years ago

A screen shake effect would be a welcome addition. This is a commonly used effect when there are explosions on screen or if a character falls onto the ground very hard. Please see an example here: https://www.shadertoy.com/view/wsBXWW

I would love to write a PR, but unfortunately I'm in the middle of a project right now. Thanks for your consideration!

metaphore commented 5 years ago

Not sure about this one, for such effect it's always better to just shake the camera, will save some GPU resources.

arthurtemple commented 5 years ago

Moving the camera indeed looks like the cleanest path.

Maybe you can work this out from the example here https://github.com/spookygames/gdx-gfx/blob/master/src/test/java/net/spookygames/gdx/gfx/demo/fx/ScreenShake.java? (all kudos go to this article by Jonny Morrill).

metaphore commented 5 years ago

Wow, I didn't know that project existed. I was in one letter from stilling its name :)

metaphore commented 4 years ago

Sorry, due to the previous conversation and the fact I'm trying to keep the number of the built-in effects down to the only essential ones, I'm gonna reject this one. I still need to revisit the existing effects and clean them up/remove some, but that's for the next release I guess.