SFML community forums

Help => Graphics => Topic started by: dydya-stepa on December 29, 2011, 01:45:02 pm

Title: Several post effects at the same time?
Post by: dydya-stepa on December 29, 2011, 01:45:02 pm
Interesting question came to my mind - I want to draw a shockwave after an explosion. I'm thinking to do it using a post effect to whole screen. What if many explosions happen one after each other? So they will have to run simultaneously. How can I do that if I can ?
Title: Several post effects at the same time?
Post by: Laurent on December 29, 2011, 01:55:18 pm
You can try to handle several explosions in the same shader directly, if the algorithm can be adapted accordingly.

Otherwise there's still the simple solution to apply as many post-effects as you want in a single frame (apply the first, then apply the second on the result, etc.).

I think that solution 1 should be the best, it's very easy to compute the sum of multiple shockwaves at a given pixel. The only drawback is that it imposes a hard-coded limit on the number of simulatenous explosions that the shader can handle.