Do filters behave differently with different rendering engines?

edited August 2016 in Questions about Code

Hi, I am revisiting an old project in which I save a bunch of ellipses to a PGraphics object, then draw that, apply the INVERT filter to it, scale it down a bit and draw it again (the goal is to create color interference patterns).

With JAVA2D, which I used previously, drawing, inverting and re-drawing works fine, with FX2D, which gives me ~6 times the fps and therefore would be awesome to use, both instances I draw have the same color instead of complementary colors. Anything I am missing?

Here's the relevant code excerpt:


image(layer, (width-rWidth)/2, (height-rHeight)/2, rWidth, rHeight);
image(layer, 0, 0);

Thank you in advance for any insights! :)

On a side-note, ever since using FX2D I also get this (doesn't seem to impact functionality, though, is this related? - I use Processing in Eclipse BTW)

Exception in thread "JavaFX Application Thread" java.lang.IllegalStateException: Not on FX application thread; currentThread = JavaFX Application Thread


  • FX2D works miserably for me anyway, much worse than JAVA2D, but I don't think that should happen. Try using the other filters and see if they cause similar problems. Report that here too, I'm sure we could learn something from it.

Sign In or Register to comment.