Skip to main content

Hardware Acceleration in Mustang

9 replies [Last post]
ylzhao
Offline
Joined: 2004-08-22
Points: 0

Recently, I have read some materials about the OpenGL-based Java2D pipeline hardware acceleration improvement in Mustang, and this feature is available in Tiger also, though it is disable by default.

On Windows platform, DirectX is the core rendering engine and supports hardware acceleration, and this factor is more important in the next Windows version - Vista. So I have a question: What API does the windows version of JDK use to rendering graphics and images? Does it support hardware acceleration by default or only use soft rendering?

Thanks!

Message was edited by: ylzhao

Message was edited by: ylzhao

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ylzhao
Offline
Joined: 2004-08-22
Points: 0

For the Java2D rendering, if I operate pixels of the image directly, it seems that Java2D rendering engine will not use hardware acceleration. Is it true?

trembovetski
Offline
Joined: 2003-12-31
Points: 0

If you get a hold of the pixels directly (with getRaster().getDataBuffer()) we won't be able to create an accelerated copy of that image in video memory because we can't guarantee that the cache will always be up to date.

Thanks,
Dmitri
Java2D Team

mgrev
Offline
Joined: 2003-08-12
Points: 0

Dmitri,

Can't you (as in Sun) optionally wrap the returned data buffer in some way so that the user can request it, modify it, and then give it back to the rendering pipeline?

It would be good to have a simple way to modify pixels fast and then don't have to go around and "re-accelerate" the bitmap manually with a create/copy.

Just a thought.

Cheers,
Mikael Grev

trembovetski
Offline
Joined: 2003-12-31
Points: 0

We're considering this kind of api for the next release.
If you have specific ideas, let us know! Like what kind
of api would be more convenient to you as a developer.

We're also looking at giving faster access to image's
pixels (than set/getPixel) w/o losing the ability to
accelerate an image.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6205557

Thanks,
Dmitri
Java2D Team

trembovetski
Offline
Joined: 2003-12-31
Points: 0

In tiger we have a DirectX/GDI pipeline, which is enabled by
default. Plus an OpenGL pipeline which is disabled by default.

In mustang we still have the default DirectX/GDI pipeline,
and the more advanced Direct3D pipeline which is enabled
in fullscreen mode.

Also, the OpenGL pipeline in mustang is much faster than in tiger.

Thanks,
Dmitri
Java2D Team

gfx
Offline
Joined: 2003-06-14
Points: 0

I worked quite a lot lately on intensive 2D operations and the OpenGL pipeline is really great. Basically it gives you the performance you can reach by optimizing your code (using compatible images, volatile images, clipping rectangle, and so on). That means if you do write good Java2D code you can have impressive results with this pipeline. Also the default pipeline on Windows is also much faster than Tiger.

linuxhippy
Offline
Joined: 2004-01-07
Points: 0

Yep, the OpenGL pipeline is really great - thanks a lot!
Sad that the nvidia-drivers are that slow with copyArea on FBOs otherwise this pipeline would be my default pipeline for Netbeans based development.

Really great work, the gradient accerlation is one of the most useful parts I've seen in a 2d rendering engine.

In my eyes Java2d is one of the most powerful, fast and most stable rendering engines arround - no commercial engine I know can provide this feature-richness nore performance.

Great work guys, thanks a lot!

linuxhippy
Offline
Joined: 2004-01-07
Points: 0

depends, by default java starting with 1.4 uses hardware rendering.
There have been improvements to the "normal" rendering pipeline (default) which uses both DirectX and GDI in a save way + there have been DirectX and OpenGL pipelines which accerlate also higher-leven stuff like transculesent images.

So both, DirectX and OpenGL are supported, althought OpenGL is a bit better supported.

lg Clemens

rjlorimer
Offline
Joined: 2003-06-10
Points: 0

Sun's Java on Windows ships with a DirectX pipeline currently (it shipped before the OpenGL support) - and that pipeline, at the completion of Mustang, is supposed to be more architecturally in-line with the OpenGL pipeline.

I'm basing all of these statements on posts I have read by various Sun committers such as Chet Haase. I'm having trouble tracking them down at the moment due to a corporate firewall impeding me, but the information is out there!