Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (624)
Games in Android Showcase (176)
games submitted by our members
Games in WIP (676)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java 2D / Re: Transparency Problems on: 2011-06-11 08:02:15
Hey, first of all thanks for your answers!

I added:

but nothing changed.

What's the performance like when you:

a) use Transparency.TRANSLUCENT (instead of BITMASK)
b) use the BufferedImage returned by ImageIO directly (instead of going through the legacy process of making it compatible)

When i´m unsing Transparency.TRANSCLUENT the framerate even dropps lower.. The quality of the images increases but we only have now about 7 fps.

When i return the ImageIO directly, i ´ve only 2 fps! Sad

Might be interesting comparing cpu snapshots on the different OS, using jvisualvm.exe.
Here is a screenshot of a windows pc:

i´ll add a linux screen later

2  Java Game APIs & Engines / Java 2D / Transparency Problems on: 2011-06-10 18:54:09
Hey everyone

we are currently developing a game in Java using the Java2D API and are experiencing some strange performance issues when running it in an Linux environment.
Our frame rate drops from an average of 62fps on Windows and Mac systems to about 10fps on Linux. After some hours of debugging and testing various JVM flags it seems to be that BufferedImages using a bitmask are not being accelerated under Linux.

We tested our game on different pc´s, with different hardware under Linux, and the effect stays the same. It´s an project for an university class, which has to run under Linux perfectly  Sad

We have a some sprites on your screen, which have a lot of transparent pixels. After removing sprites and other transparent images the framerate returns to constant 60fps.
Currently we are loading our images via

img =;

and are then creating a device compatible BufferedImage using the following method:

private static BufferedImage createCompatibleImage(BufferedImage img) {

    // Get default graphics device
    GraphicsDeviceService graphicsDevice = ServiceProvider
    GraphicsConfiguration config = graphicsDevice

    // Get desired transparency mode
    int transparency = img.getColorModel().hasAlpha() ? Transparency.BITMASK
            : Transparency.OPAQUE;

    // Create device compatible buffered image
    BufferedImage ret = config.createCompatibleImage(img.getWidth(),
            img.getHeight(), transparency);

    // Draw old image onto new compatible image
    Graphics2D graphics = ret.createGraphics();
    graphics.drawImage(img, 0, 0, null);

    // Return compatible image
    return ret;

We are already using the "pmoffscreen" property.

I´ve seen that many topics about transparency problems already exists in this forum, but I didn´t really find an answer to our problem.

Has anybody an idea, what we can do, to ensure a good framerate but still using transparent images?

Thanks for reading!
I would really appreciate help Smiley
Best regards

p.s. nice forum registration process Smiley
Pages: [1]
KaiHH (15 views)
2015-10-11 14:10:14

KaiHH (15 views)
2015-10-11 13:26:18

BurntPizza (43 views)
2015-10-08 03:11:46

BurntPizza (21 views)
2015-10-08 00:30:40

BurntPizza (26 views)
2015-10-07 17:15:53

BurntPizza (42 views)
2015-10-07 02:11:23

KaiHH (47 views)
2015-10-06 20:22:20

KaiHH (21 views)
2015-10-06 19:41:59

BurntPizza (38 views)
2015-10-06 19:04:48

basil_ (52 views)
2015-09-30 17:04:40
Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!