Friday, 24 February 2012

Scene Graphs

So, today is my weekly RDO and rather than spending it down the beach like I should have, I poked around ...

I was thinking of experimenting with a scene-graph model for GadgetZ (used in ReaderZ); not for any particularly practical reason, just to see how it would work. But I kind of got stuck on how to manage the layout mechanism and then lost interest ... still a bit burnt out from my hacking spree a few weeks ago, and I need a good sleep-in one day to catch up on sleep as well (they're still building next door).

I did however end up spending quite a bit of time playing with the JavaFX stuff. The 32-bit-only build wasn't too much hassle to get up and running on Fedora. It has some (pretty big) issues with focus, and the performance ranges from awesome to barely ok, but it is only a developer preview after-all.

Some observations:
  • The rendering model looks very interesting. Obviously the aim is to provide a fully accelerated zoomable interface via the scene-graph. This is obviously absolutely the right thing to do.
  • And for the most part this works well: it's very snappy when it's snappy.
  • It tries to sync the rendering to the display and double-buffer rendering.
  • The WebView thing looks pretty decent - it's a whole webkit binding, with dom access and the plan is to move to a JVM based javascript eventually.

Some issues though:
  • No printing yet.
  • Performance degrades fairly significantly when a lot of data is present. e.g. in the JavaFX Ensemble demo opening view - trying to scroll list of sample icons.
  • The vsync doesn't work very well, lots of glitches (but i blame this mostly on both pc hardware and linux: even a commodore 64 had hardware well beyond a pc video card for smooth animation).
  • Things like scrolling the WebView is flicker-free, but not as high a frame-rate as i'd expect for hardware rendering. But I don't know if it's delegating rendering to webkit as I do with PDFZ.
  • The documentation needs work.

I'm not about to use it for anything; i'm not even going to bother to try for that matter, but I'll be keeping an eye on it. It seems to finally heading in the direction it initially promised after JavaFX 2 was announced: a high performance modern toolkit with a clean simple(ish) design, media support, and so on. Simple enough to use as a RAD tool, but complete enough to write real applications as well.

It seems as though Java8 will have something to look forward to for once ...

I'm also curious to see how the JVM based JavaScript engine will work; the JVM is fast, but I suspect the language will some bearing on achievable performance as well.

(i've nothing to comment on regards the hope to use it as a flash replacement for internet deployment, i'm just considering it as a desktop application development platform).

No comments: