Sign in to follow this  

[java] Hardware Accelerated Images

This topic is 4273 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

This topic is 4273 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this