Skip to main content

Java 2D and 3D issue

1 reply [Last post]
Joined: 2006-02-14

Hello everyone,

I'm new to Java graphics and have been trying to figure out the best way to improve my particular application. It is dynamic and refreshes at about 75Hz. It contains lots of data points and seems to flicker a lot.

I've concluded that rendering the data may be the problem as I am currently using BufferedImage types, which renders in software if I'm not mistaken.

Now, I've been researching on ways to improve performance by delegating the rendering on VRAM and take advantage of hardware acceleration. What I've discovered is that a new image type has been introduced in Java 1.4 I believe, and this is called VolatileImage, check this link out: and scroll to the section "Hardware Acceleration for Offscreen Images", it has a brief explanation. It apparently takes advantage of hardware acceleration.

I have also discovered that hardware acceleration can also be achieved using OpenGL Java bindings or something along those lines and you can have a look here: Of course OpenGL mainly deals with 3D graphics so hence I'm confused as to what direction I should take.

Either use VolatileImage or OpenGL. VolatileImage is for 2D graphics and the OpenGL is for 3D graphics. I'm confused because OpenGL can also be used for 2D and I'm not sure which one I should use for my application. I'd like to use the most efficient solution possible. Any ideas. Your feedback would be much appreciated.



Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-14

BufferedImage can also get advantage of hardware acceleration. It depends on the type of the BufferedImages you are using. There are things to take care of before trying to turn to VolatileImage or OpenGL. For instance, your flickering can be solved using double buffering, etc.