JavaFX Graphics Stack

Yes.

I would like to see 2 things in Java2D/JavaFX:

  1. Shader support.
  2. The ability to efficiently get JavaFX’s output as an OpenGL FBO/texture. I’m not talking about overlaying a 2D ui on top of a 3D scene, but fully embedding 2D vector graphics, UI elements and video in a 3D environment.

well even intel is starting to release programmable gpus:

i think consumers realize that they need a proper graphics card to be able to use 3d applications.

i would vote for a greenfield project with shaders as minimum requirement. Constantly asking yourself questions like “what happens if” is not very productive and limits you in your goals.

If you have to target everyone as requirement stay with 2(.5)D and simple effects, JavaFX has already a usable software fallback mode. Every OS vendor provides hardware accelerated effects which use shader under the hood. The motivation to buy a proper graphics card is increasing rather than decreasing nowadays.

[quote]2) The ability to efficiently get JavaFX’s output as an OpenGL FBO/texture. I’m not talking about overlaying a 2D ui on top of a 3D scene, but fully embedding 2D vector graphics, UI elements and video in a 3D environment.
[/quote]
this has been asked already at least a hundred times. Since everything in java is painted, it is really a missed opportunity that we still can’t embed swing and now javafx in 3d scenes. Even if painting would work redirecting events from heavyweight components to the virtual is just a big hack and only works for simple components. It seems like work was already going on in the scenario project with the SGEmbeddedToolkit etc. The only problem is that SG is now a sun internal project and the old sources are under pure GPL (without cp ex).

Well, according to a Java2D bug report:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6766336
“However, there still remain many machines (maybe 50% or more of the Windows market) that are unable to make use of the D3D pipeline due to insufficient drivers and/or hardware…”

Possibly 50%? I think that would be a “yes” - too soon.

Keep in mind many high-end games won’t install if the user doesn’t have the right drivers or graphics chip. Conversely JavaFX needs to install nearly everywhere.

yes brackeen I agree, but in my opinion there is still a difference between 2d and 3d applications in user expectation. 2d apps have to run everywhere - thats the expectation. If effect x does not work on my hardware emulate or disable it thats what JavaFX already does (or will/should do).

3d apps are a bit different you won’t find many who try to run crysis on intel gpus and complain that it does not run for some reason. OpenGL was build from the beginning to work best on GPUs (and the other way around). It is difficult to write software renderers which emulate shaders and perform well. On the other hand, ignoring shaders in a scenegraph is like going 10 years back in time and using everything which is now deprecated in GL 3.0. (this might be even more risky since the only vendor agreed to support deprecated functionality is nv - same problem like before just the other way around). Doing both (shaders when possible with fallback to software or using deprecated features) is a lot of work and will restrict the set of implementable effects.

IMO of course

So in other words: yes it would be awesome, but no, it wouldn’t truly be mass market (perhaps the situation will be different in 5 years). Doing it would mean two tiers of desktop JavaFX: everyone gets 2D and about 50% gets 3D.

But perhaps that’s ok - one tier to compete with Flash, another tier to compete with Unity.

But what is the target audience of JavaFX ?

I don’t think it is for building mainstream games like Crysis/ Left 4 Dead etc…

I think it is for visually impressive browser games/ apps. And these are the kind of things that people acctualy might simply expect to work.

Today:
When playing the latest games like Crysis you need to think about your computers specs.
When playing browser games you usually don’t need to think about it at all.

UNTIL…
GPU accelerated JavaFX

Having different paths like CPU/SSE, GPU Accelerated is great but will developers have to think about scaling the maximum number of particles/sprites/enemys etc based on the graphics path?

Imagine I was developing a JavaFX game on my GeForce 1Million and max it out. It would be foolish to expect that all computers could handle it.

Would it be correct to say that for all possible JavaFX users the different between their CPU power is much less than the difference between their GPU power?

So I guess I am agreeing with you and saying that this could be the start of having to think about your computer specs to player those browser games.

This post is damn ugly lol

What Michael said. Of course I’m not asking for 3d acceleration to be a requirement, Java2D is doing a great job on low-end computers/devices. But I also want JavaFX to enable new possibilities, not drag me back to 1995. It’s perfectly understandable that Sun (and many users) want to cover a broader set of users/devices, but it’s also completely uninteresting to me.

It’s so boring to hear about the god damn low end all the time. If that’s the “mass market” JavaFX wants to target, then why even bother when there are a million solutions already out there? What’s the point? Why limit yourself to the low end when you can appeal to the high end at the same time? It’s like saying, oh damn, Blizzard dared to add support for shaders, real-time shadows and multi-threaded OGL to WoW, look how much they failed. 11 million users and rising, because they now have a better product. I don’t care about the “mass market”. I don’t have to use 2009 tools to satisfy them. I don’t want to provide solutions and products to office users. My market is GPU accelerated and JavaFX doesn’t help me create anything better for them.

A 2D tier can NOT compete with Flash, not good enough.

A 3D tier would NOT compete with Unity, why would it? (if you mean this Unity)

Since JavaFX is clearly targeted at the Flash market given the current demos and description then this:

Is a really good question :). However, there’s no reason JavaFX couldn’t provide solutions for all - it’s just an awful lot of work to support different ends of the market while still providing a simple but consistent rendering model over the top. They’d definitely need more help!

Kev

the worldofwarcraft argument when it comes to the number of users with hardware is a real one, and its been around awhile, maybe its time to step up and use the gpu even if some office works miss out? content doesn’t just live on the web, it also lives in a number of other places- some of them places can only realistically work with the gpu in mind…

but if we are cool with 6fps when scrolling 600*600 graphics; then maybe java2d will be ok for a few more years yet- but how many do we think?

LOL

Actually I don’t see a point in JavaFX if it doesn’t try to set itself apart from competers (read “flash”), even loosing a pile of the market to them, if that means gaining a vacant niche on the other hand and perhaps the image to be the right tool for gfx intense web applications…

AMD launches 760G platform

well the foundation for such a discussion is a JavaFX runtime which is as fast as Java2d: http://weblogs.java.net/blog/opinali/archive/2009/01/javafx_first_pr_1.html then we could estimate how long java2d will be ok.

[edit]fixed typo

Poor FX results in the blog above is not related to rendering (you can see that Swing app using the same rendering pipeline - Java2D) performed well), but to the scenegraph scalability issues.

Having said that, Java2D (on windows with the d3d pipeline) is fine for image-based rendering, but shape rendering performance is sub-par even with the accelerated pipeline.

Dmitri

i know alex, it is rather a combination of multiple factors. I filed a bug for one of them: http://javafx-jira.kenai.com/browse/RT-3051
(effects like gaussian blur are another example where JavaFX performes very well because of its hw accel. backends and native implemetations)

Interesting blog entry that is. Runs at a mere 19fps here though, and this is the most powerful computer I’ve ever used! Strikes me I could get an applet running that at 500fps on the same machine with a bit of LWJGL-love.

Cas :slight_smile:

my results (winxp, 1.6u11, 1.6ghz core duo, ATI X1600 mobile, battery mode):

128 balls:


JavaFX (optimized-bitmapped "weblog version"): 14fps CPU 50%*
Flex:                                16fps CPU 90%
Java (vecor-based):                  20fps CPU 50%
Silverlight 2.0 CLR:                 30fps CPU 86%
Flex (bitmap):                       55-60fps CPU 60% (vsynced?)
swing (unoptimized):      vsynced to 60fps CPU 5%(!!!)
swing (optimized):        vsynced to 60fps CPU <4%(!!!)
pulp core:                           90fps CPU 40% (maybe a sleep in the rendering loop?)
explicit hw-accel category:
LWJGL/Slick:                         780fps CPU 35%
JOGL: TODO

javafx 1.0 bubblemark: http://weblogs.java.net/blog/opinali/archive/2009/01/javafx_first_pr_1.html
all other tests are from: http://bubblemark.com/

observations:
-silverlight&flex make use of multi core systems
-swing (speak java2d) performs extremely good
-javafx does not…

I haven’t found the LWJGL benchmark :stuck_out_tongue:

*see trembovetski’s post; 16 balls run with 250fps and 35% CPU load -> clearly a scalability issue

[edit] added another benchmark
[edit] added urls
[edit] added kaptas LWJGL benchmark

My shiney new Acer Aspire One netbook (XP, Atom 1.6ghz, 1/2gb, Intel 945 Xpress GPU, £150 from Asda!) doesn’t like it much at all - 128 balls (image) gets a meager 5fps.
128 balls (2D) doesn’t even register on the scale - a lot less than 1fps :smiley:

Ofcourse, I didn’t expect it to be performant - I suppose atleast it ran :wink:

I was running on battery at the time though.

:edit:

I just tried revisiting the page while operating on mains, only to find no application on the page.

I did a refresh, and was met with this dialog:
“Java is required to run JavaFX applications.
You will now be redirected to a Java update site to get the latest version”
It auto-downloaded the installer, but gave me this message:
“This software has already been installed on your computer. Would you like to reinstall it?”
I refused, causing it to display this dialog:
“The current version of Java on this system (0 - Java Not Enabled) does not support JavaFX.
You will now be redirected to a Java update site to get the latest version.”
It again began to auto-download the installer!!!

As I didn’t have the patience to explore such an infinite loop, I cancelled it. Strangely I was then greeted with a 100% operational app. :S

Given that i’m running a totally clean system (the only java related installation i’ve made is the latest jdk release), it seems very odd that such a malfunction should occur.

Arg it isn’t a one-off either, every time I now visit the page i’m greeted with the same broken sequence of dialogs.
I believe the latest jdk version ( build 1.6.0_11-b03 ) simply doesn’t work properly unless you also independently install the jre… and even then it doesn’t work without first doing a page refresh?!
I also get 2 Java icons appearing in the system tray!
Fresh OS(XP), Fresh Browser(FF3), Fresh Java(latest) -> JavaFX Broken

Since you have Intel graphics board, d3d pipeline isn’t enabled => performance is (even more) sucky.

Re: java install dialog issues: Yes, there’s an existing bug for this, it’s being worked on.

Dmitri

I had the same error (but Vista x64, FF3) and the only way to get java to work again was to disable the next generation java plugin in the java control panel.

Is the ‘latest’ JRE download being pushed out to users realy a beta? :o

Ignoring the obvious hit in Javas appearance of reliability, it seems very risky.

If you inadvertantly push out a beta that breaks the auto-update system you’ll permanently lose huge numbers of users! (as they won’t know or care how to fix it, and the update system won’t be able to do it for them)