Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Several post effects at the same time?  (Read 1179 times)

0 Members and 1 Guest are viewing this topic.

dydya-stepa

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Several post effects at the same time?
« 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 ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Several post effects at the same time?
« Reply #1 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.
Laurent Gomila - SFML developer

 

anything