Page 1 of 1

Blur and threshold in the main loop to simulate fluids

Posted: Mon Feb 27, 2012 1:20 pm
by kbups
Hello,

Do you know how to implement the example below with Love2D?

http://www.patrickmatte.com/stuff/physicsLiquid/

I know how the physics engine works but I do not know:
- How to do the blur and then the threshold?
- Which are the better functions to use (for performance)?


Thanks in advance for your reply.

Re: Blur and threshold in the main loop to simulate fluids

Posted: Mon Feb 27, 2012 1:28 pm
by Ellohir
I guess you'd have to print the scene to a FrameBuffer and then apply the filters. But I think you would have to implement those filters yourself, I think there aren't any integrated in Löve.

Re: Blur and threshold in the main loop to simulate fluids

Posted: Mon Feb 27, 2012 4:24 pm
by richapple
I think you are trying to do something that is achieveable with shaders (PixelEffects in LÖVE)
They are added in 0.8.0

You should practise with pixeleffects first and see some great examples in this thread

And because pixeleffect is similar (basically the same) to GLSL there is very handy site with online glsl coding