Custom shaders for JavaFX

John C. Turnbull ozemale at
Fri Jun 21 03:43:39 PDT 2013

Hi Richard,

I am very pleased with your response!

I am pleased that it was a quick and assertive response.

I am pleased that Oracle seems committed to supporting more advanced 3D
graphics techniques and allowing an application to render using OpenGL is
definitely the way to go (which would of course include custom shaders).
Let's face it, OpenGL is *the* universal graphics API and runs on just about
every OS and device.  The obvious exceptions are Windows Phone 8 (as far as
I know) and Windows 8 "Metro" mode but one could argue that no one really
cares about them anyway :-)

I am pleased that you are hinting that such enhancements may be available
*before* the release of Java 9.

I am pleased that you are suggesting GLSL may be the best way to go for a
shader language.  GLSL is mature, well understood and very powerful.  No
need to reinvent the wheel or use some other dubious 3rd party language.

I am pleased that you are talking about some kind of automatic mapping of
OpenGL to Direct3D as that would take care of the 2 platforms that I
mentioned above that don't support OpenGL.

OpenGL is everywhere, even in the browser through WebGL, and *even* IE is
mooted to support it in IE 11.

I am definitely looking forward to the day I can mix advanced 2D and 3D
graphics in a Java program that runs on just about every conceivable device
simply by choosing JavaFX as my graphics toolkit.

Please keep up the great work and make all this a reality!



-----Original Message-----
From: Richard Bair [mailto:richard.bair at] 
Sent: Friday, 21 June 2013 17:41
To: John C. Turnbull
Cc: openjfx-dev at
Subject: Re: Custom shaders for JavaFX

> 1.       What are Oracle's plans (if any) for custom shader support in
> future versions of JavaFX?

What we've been looking at is not custom shaders, but the ability to allow
an application to do all its own OpenGL and give it back to us. Custom
shaders might be viewed as a separate issue, such as a way to do custom
Effects (which is another long-standing wouldn't-it-be-great-if). Which one
are you looking for specifically?

> 2.       Is such support planned for FX9?

I'm hoping before that, in an 8 update release.

> 3.       How will the issues of supporting both OpenGL and Direct3D be
> overcome?

Don't know. One idea is to just expose a way for applications to give us a
texture, and leave it up to them to give us the right kind. Sort of lame.
Another is to only expose OpenGL and then have a way to use OpenGL on
windows. You'd probably have to opt-in to this so that if it crashes because
of bad drivers it isn't our bad. Another way is to use a mapping layer like
WebGL does.

My personal view is that we only expose OpenGL and have a way to map from
OpenGL to D3D on Windows.

> 4.       If any of the above are answered, has a "language" been chosen
> defining shaders (e.g. OSL)?

I would like to be able to just use OpenGL and say GLSL is our language.


More information about the openjfx-dev mailing list