Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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]
DesertCoockie (21 views)
2018-05-13 18:23:11

nelsongames (69 views)
2018-04-24 18:15:36

nelsongames (66 views)
2018-04-24 18:14:32

ivj94 (750 views)
2018-03-24 14:47:39

ivj94 (80 views)
2018-03-24 14:46:31

ivj94 (604 views)
2018-03-24 14:43:53

Solater (96 views)
2018-03-17 05:04:08

nelsongames (169 views)
2018-03-05 17:56:34

Gornova (387 views)
2018-03-02 22:15:33

buddyBro (1047 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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!