The Source for Java Technology Collaboration
User: Password:



Chris Campbell

Chris Campbell's Blog

Effectuation: The Intro

Posted by campbell on February 01, 2008 at 02:32 AM | Comments (22)

For the past few months, I've been involved with various aspects of Project Scene Graph and the JavaFX Script runtime libraries. Hans has already introduced the core elements of the scenegraph package, and Chet has donned his Groucho mask to explain the animation package in great detail (three chairs for that!).

Today I'm finally going to talk about the third major component of the overall Scene Graph project, and that is the Effects Framework. If you've been wondering why I've been quiet lately, this is the reason.

Our team has already had plenty of experience in delivering GPU-accelerated imaging operations. Now we've taken it to the next level, by offering a long list of effects commonly used by designers, packaging them up into an easy-to-use API, and providing a sophisticated implementation that can take advantage of GPU acceleration (and later, SIMD instructions on the CPU) for blazingly fast performance.

All of this integrates seamlessly with the scenegraph and animation packages, and soon will be exposed just as pleasantly through the JavaFX Script runtime APIs. You can even take advantage of the Effects Framework in existing Swing and Java 2D applications.

Anyway, enough yapping; let's move on to the introductory demo... This application demonstrates just a few of the effects available in the new API. I'll let it speak for itself. (Requires Java SE 6 or above.)


intro.png

      webstart.small2.gif    With default options -- will take advantage of the Direct3D-based backend (if possible*) on Windows...

      webstart.small2.gif    With OpenGL backend enabled -- for Windows, Linux, and Solaris (if possible*); Mac OS X coming soon...

      webstart.small2.gif    With all GPU-acceleration disabled -- try this if you have problems with one of the above.

(*) GPU acceleration requires the latest build of JDK 6uN, a compatible graphics card, and up-to-date graphics drivers. If GPU acceleration cannot be enabled for any reason, the framework will automatically fall back on the software-based implementation. Yes, the software-based backend is much slower than it should be; we're working on that.


These projects are still in the early stages, but over the next few weeks, I'll have much more to say about (and more demos to share from) the Effects Framework and the Scene Graph project at large, so stay tuned. In the meantime, take a gander at the JavaDocs and let us know what you think. Hans should have news shortly of an 0.5 release that includes all of this and more.



In my ears: Enon, "High Society"
In my eyes: Found Magazine #3


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • oh god
    * now i need a fresh set of underwear *

    Posted by: liquid on February 01, 2008 at 03:26 AM

  • w00t !

    That's very, very cool.
    Do you have any plan to expose the SiMD stuff to Java developpers too ?
    A SIMD framework with aligned data structure, the common operators, ect, would be very cool to have in Java.

    Posted by: twilightworkshop on February 01, 2008 at 06:22 AM

  • Unfortunately with 6uNb11 with D3D, I see no images at all. Just the text and big solid color squares. Normal apps seem to work just fine.

    I can see it all with the non-GPU version though, and the blend modes work fast enough to play smoothly. We can always count on you for the coolest demos chris. How did you get 3D text and lighting effects without D3D or OGL!

    I'm interested in how I might use these effects with Java2D though, without the scene graph. I hope to see Composite/BufferedImageOp classes for these.

    Posted by: benloud on February 01, 2008 at 08:47 AM

  • Would be nice if you say somewhere if you fell back on the software-based implementation.

    My cpu is 100% but I don't know if the hardware- or software-based implementation is on.

    Posted by: keeskuip on February 01, 2008 at 09:46 AM

  • @keeskuip: When the blend mode scene starts up, look in the lower left corner of the window. It should say "Using {CPU/OpenGL/Direct3D} backend"; if it's pegging your CPU, I'm guessing it's not able to use one of the GPU backends.

    Posted by: campbell on February 01, 2008 at 09:51 AM

  • benloud, could you please set env. variable J2D_TRACE_LEVEL=4 and run any swing app from the console and post the output (or send to me: tdv at sun dot com)?

    On my system with Nvidia 7800 it runs fine with the d3d pipeline. CPU
    utilization is

    Thanks,
    Dmitri
    Java2D Team

    Posted by: trembovetski on February 01, 2008 at 10:04 AM

  • Duh.

    ... utilization is less than 5% during the demo.

    Dmitri

    Posted by: trembovetski on February 01, 2008 at 10:04 AM

  • Ah, benloud, do you have a multiscreen system? If so, currently d3d accelelrated effects will only work on the primary screen. To be fixed soon.

    Dmitri

    Posted by: trembovetski on February 01, 2008 at 10:16 AM

  • @benloud As far as i can tell, this seems self-contained and does not depend on scenegraph and animation at all. I guess that's chris meant by seamlessly.
    I had to fiddle a bit to integrate it with a scenegraph scene, but it really is simple, create an SGEffect, and setEffect one of the effects in the library, setChild one SGNode.
    (Severely blurring some swing components in real time allowed me to experience how one of my friends 'sees' without his glasses, thanks for that Chris :)

    Posted by: liquid on February 01, 2008 at 10:32 AM

  • And when were you planning on telling us about JSL?!? That's the most exciting part of this project! JSL appears to let us write our own effects and have them run on the graphics card. Can you give us any more information on it?

    Posted by: spiff on February 01, 2008 at 09:43 PM

  • All demos fails with:
    com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://download.java.net/javadesktop/scenario/effects/demos/Intro.jar

    Posted by: martin_dk on February 04, 2008 at 03:00 AM

  • martin_dk: download.java.net is apparently down right now.

    Posted by: trembovetski on February 04, 2008 at 09:47 AM

  • This is why web start is really cool. I got the demo while it was up and even though the link seems to be broken I can still show it to people. I know I would have had to jump through some hoops to load an applet once the original site went down.

    Posted by: aberrant on February 04, 2008 at 05:16 PM

  • someone should please put the data to an other server and update the links of the project page. The effects framework is currently on the opengl.org frontpage.

    the first impression works just once ;)

    Posted by: mbien on February 05, 2008 at 10:32 AM

  • They're still having issues with download.java.net's content, unfortunately =(

    Posted by: trembovetski on February 05, 2008 at 12:05 PM

  • hi Chris, sorry this is off topic a bit, but I'm wondering whether heavyweight and lightweight components are closer to playing nice together. E.g. will a lightweight component ever be able to render over a heavyweight component? I remember hearing this was on the horizon a year ago ... thanks!

    Posted by: xcolwell on February 13, 2008 at 02:53 PM

  • @xcolwell: The AWT forum could provide more details, but heavyweight/lightweight mixing should be improved in an upcoming JDK 6 update release. This means better support for heavyweight components embedded in lightweight, but not necessarily the other way around (heavyweight rendering typically blows through to the screen, so we can't render on top).

    Posted by: campbell on February 13, 2008 at 04:54 PM

  • Unfortunately all of OGL-pipeline related demos result in black artefacts (Geforce8800GTS, Windows XP, Update N b12) . From time to time I can see new rendered regions with text. I have the same problems with all the jogl-demos which utilize the OGL-pipeline.

    At first it seemed to be a driver bug. My system crashed when I tried the pipeline using the first drivers I got for my card. The crashes gone away but the artefacts came. Maybe it's something with cleaning up the FBO that's going wrong on the newer Geforce series.

    Posted by: saxer_de on February 27, 2008 at 01:52 PM

  • OMG! it's animation! Again (and again and ... and again ...).

    The effects are nice, but the CPU is running near-flat-out (on my adequate but not a gaming machine laptop), and the result is occasionally jittery. As "Q" said to 007: "never let them see you bleed". Applications with special effects that shudder badly when they cannot get a firehose worth of CPU are going to look lousy. You never want your applications to look lousy.

    Every few years new developers fall in love with the latest special effect that looks "kewl" in demos but prove tedious in repeated use. Seems this cycle has repeated every few years since (at least) the late 1980's.

    I am all for adding interesting and useful visual effects to GUI applications, but the end effect has to be seamless, even when the box we are running on is not the fastest, and even when the box is busy doing other things. Otherwise the user experience is ugly.

    It is a natural thing for developers to consider their application the most important thing running on the box, but users do not see things the same way. You have to be a good citizen in the little community of code running on the end user's box, and CPU-sucking special effects are ... at least dubious.

    Posted by: pbannister on May 05, 2008 at 06:27 PM

  • @pbannister: These effects use close to 0% CPU when the GPU-accelerated backends are in use, which will be the case for a majority of end users' machines by the time JDK 6u10 ships in a few months. As for the remaining machines where the GPU is not a viable option... Since this blog was posted, performance of the CPU-based backend has improved considerably thanks to an optimized native backend, which is significantly faster than the unoptimized pure Java backend (50% faster, and that's just the beginning).

    Posted by: campbell on May 05, 2008 at 07:00 PM

  • well done
    _

    Posted by: dante52 on June 17, 2008 at 10:40 PM

  • It doesn't use my GPU here on Linux Ubuntu 8.04.1, although all the proprietary drivers are installed and anything else in my system is able to use the GPU. I hope Sun will not keep Linux out with a CPU-only solution.
    I got GeForce 7600GT 256MB.
    Java update 10 build 27.

    Posted by: xlinuks on July 19, 2008 at 01:10 PM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds