fast game transparency?

we’ll i need a way to make fast transparent clouds, i’m making a shooter, and need a way to display some clouds over the background,

i tried to be cleaver, loaded up photoshop, created a blank tile, deleted every thing on it and spray paint some white dots on it, save as .png but when it runs in game, it sloooooowwws down, to very low frame rate, any idea how i can do this, or if its possible to use alpha transparency or something,

whats the best way, or a good way?

Search the board for “balls.jar” (by Abuse) it comes with source. Accelerated full alpha should be the fastest way.

However using openGL won’t be a bad idea :slight_smile:

edit: oh and you can also do it the old fashioned way… with dithering (sprayed dots and just bitmask transparency).

As Abuse says, OpenGL would be a great way to go - much better performance.

For our games (which need 1.1 compatability with no OpenGL) we have resorted to software rendering. Our own sprite draw routines & alpha blending versions seem to be much faster than the standard 1.1 ones, although normal sprites on 1.4+ using BufferedImage were the fastest, but as you have found out the alpha blended ones seem to be suspiciously slow.

However - it is a fair amount of work to get the software rendering working properly, and it is slower than the pure 1.4 Bufferedimage rendering (without alpha blending).

  • Dom

Eeek - gotta dash, an Electrician has come round to turn off the power for a few hours.

[quote]As Abuse says
[/quote]
I didn’t say anything :o ::slight_smile:

Oops - my bad :frowning:
I meant oNyx - I got confused as he mentioned your name in his post, slightly hung over, and our mains supply exploded while I was in the shower.
Its not been a good day so far.

  • Dom

[quote]but as you have found out the alpha blended ones seem to be suspiciously slow.
[/quote}

DirectX problem. I believe I talked about this in the Understanding AWT Image Types article. DirectDraw doesnt HAVE alpha transparency, opnly color key transparency, so we call abck to software. Which means read/modify/write, which gets in the way of caching things in video memory.

Generally a mess.

Today you can do one bit transparency hardware accelerated IF you set it up right. (Again details in that article.) Our 2D guys are working on moving totally of DirectDraw and making Java2D use D3D and/or OGL but its a slow and painful process. Dmitri or Chet could tell you more about the state of that effort.