We are about to switch to a new forum software. Until then we have removed the registration on this forum.
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:
layer.colorMode(RGB);
layer.endDraw();
image(layer, (width-rWidth)/2, (height-rHeight)/2, rWidth, rHeight);
rotate(rotation);
layer.filter(INVERT);
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
at com.sun.javafx.tk.Toolkit.checkFxUserThread(Toolkit.java:236)
etc...
Answers
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.