This discussion is archived
5 Replies Latest reply: Dec 13, 2012 3:39 PM by jsmith RSS

QuantumRender giving me some trouble!  Any ideas?

979644 Newbie
Currently Being Moderated
Aloha,

I have written a status GUI around 4 layers of ImageView Objects with transparency 20-75% that shows an Observatory Dome rotating about the fixed foundation. I have 2 AnchorPanes each containing 2 ImageViews and a single Group containing both of the AnchorPanes. The static layout looks good. I then start a TimerTask to change a RotateProperty by 1 degree @10Hz and bind one of the AnchorPane's Z_AXIS rotateProperty to it. The graphic rotation looks good and smooth. The FX-Thread is always runnable and the QuantumRenderer is waiting 99% of the time. Now I need to represent looking down on the Graphic from above (as layed out) and from looking out of the Graphic from below. I chose to just call setRotate(180) on the Y_AXIS of the Group. This "worked" and rendered as I had hoped, BUT now the smooth X_AXIS rotation is very jumpy only updating @ ~1Hz and the FX-Thread is contantly waiting on the QuantumRenderer which never seems to exit the runnable state.

So, what do you think? Have I absused the rotate transforms in some way that is forcing WAY too many screen redraws? Settting CacheHint to ROTATE, did not noticable improve the performance, which remains a runaway; meaning the FX-Thread doesn't get enough CPU time to even process mouse events.

I would appreciate any help.

BTW: I read that the Java8 has addressed some thread concurrency issues between the FX-Thread and the QuantumRenderer, but the beta version did not appear to behave any better.

Mahalo,

Todd
  • 1. Re: QuantumRender giving me some trouble!  Any ideas?
    RichardBair Journeyer
    Currently Being Moderated
    Maybe you have a threading problem? Instead of a TimerTask, try an AnimationTimer, one of the Transition classes, or a Timeline. It may be that you are modifying the FX scene graph from the wrong thread and this is causing the issues you are seeing? Certainly having a Z transform on the rotate should be causing no problems whatsoever (unless the dang thing is tessellating the universe...).
  • 2. Re: QuantumRender giving me some trouble!  Any ideas?
    979644 Newbie
    Currently Being Moderated
    hmm. Thanks, have no other ideas so I'll try those, but I am pretty confident I am not on the FX-Thread. I'm stumped by the drastic change in behavior after a single "setRotate(180)" call. After that point, the update thread that was using 1% starts using 99% and, in theory, is doing nothing more than a single extra transform (possibly cascading to all 4 objects), but I agree with the reply. Nothing so tasking my quad-core should weep in painful surrender.
  • 3. Re: QuantumRender giving me some trouble!  Any ideas?
    jsmith Guru
    Currently Being Moderated
    I am not on the FX-Thread
    That's likely your issue. Anything which reads or writes the stuff displayed in the scene graph must be done on the FX application thread. Using those utilities which Richard mentions will make it so that the work is done on the FX application thread.
  • 4. Re: QuantumRender giving me some trouble!  Any ideas?
    979644 Newbie
    Currently Being Moderated
    Aloha,

    The reason I am "pretty sure" I am not "in" the FX-Thread is because I am using a SimpleDoubleProperty that I bind to. This is the same philosophy used to update a UI progress bar from within a worker thread.

    Anyway, my problem is 1/2 fixed. lol

    I was able to get the 12/06/2012 prelease build of JavaFX8 and the concurrency issue is resolved and the animation is GORGEOUS! But, now only half of the canvas is shown at any angle != 0 or 360. :-/

    So now I speculate the beta code has accidentally shifted in the cache, clipping the render. Shoot...

    So I think, "this" problem is solved for me and I'll open a new forum thread for the clipped cache.

    I would like to thank everyone for such fast responses!!!

    Mahalo Nui Loa,
  • 5. Re: QuantumRender giving me some trouble!  Any ideas?
    jsmith Guru
    Currently Being Moderated
    The reason I am "pretty sure" I am not "in" the FX-Thread is because I am using a SimpleDoubleProperty that I bind to. This is the same philosophy used to update a UI progress bar from within a worker thread.
    I wouldn't advise doing that. Binding anything which is UI related to anything which is updated in a worker thread will get you into thread troubles. The worker thread will update the property which will trigger the binding which will force an update of the bound UI control property (on the worker thread when the update to the UI control property should only have been triggered from the JavaFX application thread).

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points