fps decrease when loading translucent image

hi,

i just added a translucent image to my game’s intro screen and noticed that the game’s framerate goes down by 50% even if the translucent image isn’t shown during the game.
i understand that there may be some hardware acceleration performance issues with translucency but i don’t understand why the framerate is affected throughout the whole game when i display the image on the intro screen (and only there).

i solved the problem by making the image non-transparent but i’m curious what the reason for the problem is.

if you wanna have a look: http://games.rastaduck.org/ProjectEscobar/ProjectEscobar.jnlp
(this is the version with the non-transparent image, therefore you will not have a slow framerate. it’s just to give you an idea about what i mean with intro screen
'n stuff)

I’m assuming you’re not using any of the accelerated pipelines (opengl, d3d in 1.6 or the special
translucency flag in 1.5).

The reason a single translucent image could affect the performance of the app
is the surface punting mechanism we have.

Initially the backbuffer (if it’s a volatile image) is placed into vram so the rendering to
the backbuffer can be accelerated. But if we notice that you’re trying to render something
unaccelerated to a VI (such as translucent image), something that requires reading
from the video memory (which is slow), we assume that it’d be faster if the VolatileImage’s
surface was localed in the system memory, so the surface is “punted”.

Later if we notice that you stopped rendering unaccelerated primitives to this image and copy
this image to an accelerated surface (like screen) it should be “unpunted”, and placed
back to the video memory. Apparently that’s not happening for some reason with your app.

Thanks,
Dmitri
Java2D Team

I’m assuming you’re not using any of the accelerated pipelines (opengl, d3d in 1.6 or the special
translucency flag in 1.5).

yes, you’re right. i don’t know enough about these things and didn’t have the time to look into it.

well, it isn’t a real problem for my game. i can always try to find a solution that works without translucent images.
thx for the info.