[java] Hardware Accelerated Images

Started by
4 comments, last by Son of Cain 18 years ago
Hiya, I know that java supports hardware acceleration for opaque and transparent images, but not for translucnt (png) images. Is there a way to use some kind of alpha blending to create smooth particles in java games and still take advantage of hardware acceleration? cheers
Bow before me... for i am l33t!
Advertisement
Can you use OpenGL? If you can, 2d in OpenGL would be quite fast, probably even in Java.
LWJGL, Light Weight Java Graphical Language, offers fast 2d and 3d support, i'm just wondering if i could use java's native libraries to look at an image that uses alpha blending for an image (similar to what you would do in opengl)

I have worked with openGL, it sounds like a good idea, but i'm just curious about whether i can do this in java.
Bow before me... for i am l33t!
Alpha blending is supported experimentally in Java2D:
http://forums.java.net/jive/thread.jspa?messageID=87705&tstart=0

The advantage of Java2D is obviously that you do not need to use 3D mode, but it will transparently use openGL under Linux/Unix.

If you want it now, then you're stuck with Java3D (or alternative 3D libraries), but that brings a whole lot of baggage.


Or are you having problems with transparency when using PNG images specifically?
The only problem that I am running into is that translucent images are not hardware accelerated, thus much slower to render to the screen. I just wanted to see if there was a way to get around this. In my application, there will be a lot of sparks represented in a panel (its a game) and just wanted a faster way of displaying them.
Bow before me... for i am l33t!
There's a JVM option that starts OpenGL acceleration - default value of such option is false. I don't recall the exact name of it, but searching on google would bring you something.

Java2D is great and can manage much things for you, but if you're used to OpenGL and you want to see the power of Java unleashed, take a look at one of the most popular OpenGL bindings out there: JOGL and LWJGL. I'm very fond of LWJGL, but I started to use JOGL for a small game and so far I'm loving it too. =D

Son Of Cain
a.k.a javabeats at yahoo.ca

This topic is closed to new replies.

Advertisement