Transparency slows game big time!

When I make any object and set it to have transparency:
AlphaComposite myAlpha = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f);
g.setComposite(myAlpha);
or
Color newColor = new Color(255,0,0,100);
g.setColor(newColor)
then...
g.drawXXX( ... );
the game slows down hugely! I've noticed it doesnt happen for drawn objects with small dimensions. However, my game needs to have layered menus on top of the game animation which can be seen through it.
Help please....

It is activatable via flags though, as is the Java2D opengl pipeline.
if it doesnt get better, you might want to perform any transparency/translucency settings in an outside program (paint/photo applications),
so that your java application needs not worry about setting these values during runtimeThis will not speed upi your app. at all, the reason full alpha is slow, is because it requires read-back of pixels, to be able to perform the composition.
If you are rendering onto an unaccelerated surface (i.e. a BufferedImage backBuffer), the operation will be performed entirely in software.
1) the source pixel is read from main memory, (using up memory bandwidth)
2) the destination pixel is read from main memory (using up more memory bandwidth)
3) the composition operation performed by the CPU, (using CPU time)
4) finally the new value is written back to the destination image in main memory. (using yet more memory bandwidth)
This process is fairly slow, because it uses up CPU time, and chokes your memory bandwidth.
However, if you are rendering full alpha images onto an accelerated surface (such as a VolatileImage, or a BufferStrategy backBuffer), the overall speed will be ALOT SLOWER than performing everything in software!!
This is because the operation is still performed by the CPU, not the GPU.
So,
1) the source pixel must be read from the source image - this will either be a read of main memory (in the case of a BufferedImage), or it will be a VERY slow read-back from vram (in the case of a VolatileImage, or a BufferStrategy backbuffer)
2) the destination pixel must be read-back from the accelerated surface onto which you want to render - Either a BufferStrategy backBuffer, or a VolatileImage. As mentioned earlier, read-back from VRAM is a VERY slow operation.
3) The composition operation is performed by the CPU.
4) the new value is written back to the VRAM destination image. (this uses bus bandwidth)
So, to get faster fullAlpha rendering, you have 2 options.
1) Set the "sun.java2d.translaccel" flag to true, to enable fullAlpha acceleration.
This will hardware accelerate the operation, reducing the cost of the operation to very little.
2) do not use a vram surface for the source or destination images.
(basically do not use VolatileImage or BufferStrategy if you intend on using fullAlpha).
This will allow everything to be performed in software, as efficiently as it can be. The speed won't be impressive, and it will hog your memory bandwidth - but its still ALOT better than alpha compositing onto accelerated surfaces in software.

Similar Messages

  • My internet speed just slowed down big time!

    Hello everyone,
    About 5 or so days ago my browsing speed just got so slow. I can't effectively view streamed media anymore and downloads are far too slow. I have a 1.83 gHz 15.4 Macbook Pro with 1.5 gigs of ram and maybe a week after a full system reboot my browser just got slow. I was using camino and thought maybe that was the deal but safari was also slow as balls. I have high speed wireless internet here and the other PC's in the house run at normal speed. Techtools shows everything is in order. Is there anything else I can check or any settings I can change to get my speed back? All my software has been updated.
    Aaron

    I find that by rebooting once a week, everything stays working , including internet connection times, smoothly. I have noticed the RAM usage is at a higher level prior to the reboot and more RAM is available after the reboot. Using Firefox, the other day I was unable to log into my e-mail account; rebooted and the the log in went as expected.

  • Slow Performance Over time, Drawing Access Forms

    we've been using a small access database for almost a year now, written from scratch using only Access 2013
    over time drawing of one of the forms slows right down, once the form is draw its fine, but if you switch to a different form at the top then switch back it draws slow, maybe 7-8 seconds compared to the usual 1 second, sometimes it can work all day no problem,
    sometimes after an hour it starts drawing the form slow, the only way to cure it is to restart the machine.
    Logging off and logging back on doesn't cure it, only restarting it, it does get restarted every night automatically as an attempt to help the problem
    this happens on 2 machines, both have intel HD graphics, (previously one was using a NVidia GT 250 which had appalling performance in design mode (even with hardware acceleration disabled) so we switched to the on-board, although this issue happens
    with both machines)
    Back end gets compacted/and repaired every night on a schedule as I did notice a big slow down if you let that go a couple of weeks, I've decompiled/recompiled the front end, short of re-writing the form I'm not sure what to do, it does have a lot of controls,
    around 30 textboxes 1 combo box + 20 or so labels and 4 buttons, one embedded report, it only happens on this one form, I have embedded reports in other forms which don't have the same issue and have the same number of controls.
    I'm a bit of a loss, its not a huge issue, but just an annoyance, when I get time I'm tempted to try recreating the form from scratch, but there is a lot of VBA code behind it, before trying that just wondering if there are any suggestions to improve performance?
    *edit* the form is loaded from a list of customers, so it gets opened closed a lot, I thought simply hiding the form instead of loading/unloading all the time would speed it up, it does slightly improve the speed after viewing the second lot of details,
    however it suffers the safe fate of slowing down over time, it seems to be only drawing the form and not accessing the db

    I think you would benefit from a code review by a strong Access developer. What you are describing is not normal and may be caused by systematic programming choices.
    -Tom. Microsoft Access MVP
    Just wondering, once this does happen going into design mode on any form is slow to draw, but only the one form at runtime once it starts happening.
    the only visible difference apart from waiting is seeing the 'property sheet' on the right hand side gets visibly drawn left to right on any form once this happens, switch back to form view you see it get wiped out slowly, fade from left to right as it blanks
    the form out
    I had this 'slow' behaviour constantly with the NVidia card in one of our machines, even on new blank databases.
    I'm not even sure if this is linked to the form I've made or not, its just the only reason I notice it is that it's frustrating to use.
    Is this code review idea something that people volunteer to check or is it a paid service?

  • Slow shut down times in 10.8.2

    I bought a new 13" retina about two weeks ago, a few days ago i updated from OSX 10.8.1 to 8.2. Since then ive been having very slow shut down times, upto 30 seconds....whereas 10.8.1 i had 1-2 second shutdowns.
    Are apple aware of this / are they trying to fix it? or do they simply not see it as a big issue.
    Such an expensive 'top-brand' machine shouldnt have this problem, not to mention the fact that this is happening with SSD.
    Any insight into what's going on is appreciated.

    The fix for me was to close all running applications then tick the box to re-open windows when logging back in (I had it un-ticked before).
    The shut down went from >20 seconds to about 1 second!
    Now whether this stays fixed is another matter!

  • How to create transparent image at run-time?

    How to create transparent image at run-time? I mean I want to create a (new) transparent image1, then show other (loaded) transparent image2 to image1, then show image1 to a DC. The problem is - image1 has non-transparent background...

    i'm not sure, but you can set the alpha value to 0 in all pixels which are 'in' the background..
    greetz
    chris

  • WhyI payment item in clash of clans game once time nexttime donot payment ? It show messenger Please contace itune support to complete  this transaction

    WhyI payment item in clash of clans game once time nexttime donot payment ?
    It show messenger Please contace itune support to complete  this transaction

    These are user-to-user forums, if you haven't already done so then you can contact iTunes support via this page and ask them why the message is appearing : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • Application selects  is relatively slow in some times

    Dear Friends,
    Some selects of our application is relatively slow in some times (When database is slow) . But same selects shown good performance in most of the time. Database is always not slow in peak hours. I feel there would be insufficient space in Execution plan area or Sort area.
    Can you give me how i change these settings in my database. and where these execution plan and sort area located.
    regards
    upul Indika.

    Hi,
    Try to check for the SGA size in your database. Accordingly increase the shared pool size and the buffer cache size which wil generally improve the performance of the queries. Make sure you donot increase the sixe of shared pool in excess of the size of the SGA.
    Regards
    Bharath

  • HT1338 My MacBook Air is very slow. Every time I click the mouse, the spinning wheel appears and remains for up to 30 seconds. Can you help me?

    My MacBook Air is very slow. Every time I click the mouse, the spinning wheel appears and remains for up to 30 seconds before the screen changes. This has been happening the past 24 hours. Any ideas?

    First, back up all data immediately, as your boot drive may be failing.
    If you have more than ten or so files or folders on your Desktop, move them, temporarily at least, somewhere else in your home folder.
    If iCloud is enabled, disable it.
    Disconnect all wired peripherals except keyboard, mouse, and monitor, if applicable. Launch the usual set of applications you use when you notice the problem.
    Step 1
    Launch the Activity Monitor application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ If you’re running Mac OS X 10.7 or later, open LaunchPad. Click Utilities, then Activity Monitor in the page that opens.
    Select the CPU tab of the Activity Monitor window.
    Select All Processes from the menu in the toolbar, if not already selected.
    Click the heading of the % CPU column in the process table to sort the entries by CPU usage. You may have to click it twice to get the highest value at the top. What is it, and what is the process? Also post the values for % User, % System, and % Idle at the bottom of the window.
    Select the System Memory tab. What values are shown in the bottom part of the window for Page outs and Swap used?
    Step 2
    You must be logged in as an administrator to carry out this step.
    Launch the Console application in the same way as above. Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left.
    Post the 50 or so most recent messages in the log — the text, please, not a screenshot.
    Important: Some personal information, such as your name, may appear in the log. Edit it out before posting.

  • Slow query execution time

    Hi,
    I have a query which fetches around 100 records from a table which has approximately 30 million records. Unfortunately, I have to use the same table and can't go ahead with a new table.
    The query executes within a second from RapidSQL. The problem I'm facing is it takes more than 10 minutes when I run it through the Java application. It doesn't throw any exceptions, it executes properly.
    The query:
    SELECT aaa, bbb, SUM(ccc), SUM(ddd), etc
    FROM MyTable
    WHERE SomeDate= date_entered_by_user  AND SomeString IN ("aaa","bbb")
    GROUP BY aaa,bbbI have an existing clustered index on SomeDate and SomeString fields.
    To check I replaced the where clause with
    WHERE SomeDate= date_entered_by_user  AND SomeString = "aaa"No improvements.
    What could be the problem?
    Thank you,
    Lobo

    It's hard for me to see how a stored proc will address this problem. I don't think it changes anything. Can you explain? The problem is slow query execution time. One way to speed up the execution time inside the RDBMS is to streamline the internal operations inside the interpreter.
    When the engine receives a command to execute a SQL statement, it does a few things before actually executing the statement. These things take time. First, it checks to make sure there are no syntax errors in the SQL statement. Second, it checks to make sure all of the tables, columns and relationships "are in order." Third, it formulates an execution plan. This last step takes the most time out of the three. But, they all take time. The speed of these processes may vary from product to product.
    When you create a stored procedure in a RDBMS, the processes above occur when you create the procedure. Most importantly, once an execution plan is created it is stored and reused whenever the stored procedure is ran. So, whenever an application calls the stored procedure, the execution plan has already been created. The engine does not have to anaylze the SELECT|INSERT|UPDATE|DELETE statements and create the plan (over and over again).
    The stored execution plan will enable the engine to execute the query faster.
    />

  • NEED HELP BIG TIME!

    I wrote a few days ago about this and was told that gathering
    information from a form using Post as the method and having the
    results emailed to someone wasn't a good idea and that it didn't
    work very well. People basically told me to investigate scripting
    or hiring someone, or use a pay service like MailChimp. None of
    these are options for me right now, I absolutely have to get this
    site done tonight and the person I'm doing it for will not pay for
    a service.
    The client wants to have a form on his site to collect email
    addresses so he can compile them into a mailing list to send out
    infrequent emails notifying people of upcoming events he's putting
    on. He's a local artist with a very modest following, nothing big
    time. I have no idea about databasing or MySql, and the person
    doesn't want to pay for a service, so basically I'm stuck doing it
    the "unreliable" way.
    Can someone walk me through how to do this in Dreamweaver? I
    assume I add a form field, and put a text field and submit button
    inside of it. Here's my questions, to get this to work and use the
    mailto: thing, what do I put for...
    Form Field: Name, Action, Method, Target, Enctype
    Text Field: Name
    Button: Type, Name, ID, Value
    Any help would be greatly appreciated by one stressed out,
    hack web designer, thanks!

    If this client doesn't want to pay for a service then tell
    him the best
    you can do is gather INDIVIDUAL emails from his site and have
    them
    emailed to their email address. Then it's up to them to mail
    out to
    their modest following INDIVIDUALLY.
    Basically you put a form on the site to collect the email
    address of the
    user. Like this:
    <form name="emailForm" method="post"
    action="formmail.php">
    <p><label for="email">Enter email
    address</label><br>
    <input type="text" id="email" name="email"> </p>
    <input type="submit" name="Submit" value="Submit">
    </form>
    You would then need to send the submitted form to a formmail
    script
    which will then send it on to the clients email address.
    A free script named Formmail does exist if you search for it
    in google
    under Free formmail script
    You would need to alter the script as per the instructions
    which should
    come with it and then upload it to your cgi-bin assuming you
    have one on
    your server.
    You then point the form at the script by filling in the
    action attribute
    like:
    <form name="emailForm" method="post"
    action="
    http://www.yourdomain.com/cgi-bin/formmail.cgi">
    I no longer use formmail because it can be a bit of an issue
    to set up
    for beginners.
    I now tend to use server side scripting like php to gather
    the
    information. IF you have php running on your server then
    NateMail is
    FREE and very very simple script to set up. It comes with
    clear pdf
    instructions that will do the job in about 10-15mins.
    http://www.mindpalette.com/scripts/index.php#NMAnchor
    xslamx wrote:
    > I wrote a few days ago about this and was told that
    gathering information from
    > a form using Post as the method and having the results
    emailed to someone
    > wasn't a good idea and that it didn't work very well.
    People basically told me
    > to investigate scripting or hiring someone, or use a pay
    service like
    > MailChimp. None of these are options for me right now, I
    absolutely have to
    > get this site done tonight and the person I'm doing it
    for will not pay for a
    > service.
    >
    > The client wants to have a form on his site to collect
    email addresses so he
    > can compile them into a mailing list to send out
    infrequent emails notifying
    > people of upcoming events he's putting on. He's a local
    artist with a very
    > modest following, nothing big time. I have no idea about
    databasing or MySql,
    > and the person doesn't want to pay for a service, so
    basically I'm stuck doing
    > it the "unreliable" way.
    >
    > Can someone walk me through how to do this in
    Dreamweaver? I assume I add a
    > form field, and put a text field and submit button
    inside of it. Here's my
    > questions, to get this to work and use the mailto:
    thing, what do I put for...
    >
    > Form Field: Name, Action, Method, Target, Enctype
    >
    > Text Field: Name
    >
    > Button: Type, Name, ID, Value
    >
    > Any help would be greatly appreciated by one stressed
    out, hack web designer,
    > thanks!
    >

  • What happened to Big Time Moms

    What happened to the latest episode of Big Time Rush? Sunday afternoon it was in the store and when I went to watch it it was the previous episode. When I went back to the store it was no longer available.

    Thanks Jon, I appreciate the info.
    I guess I saw a bit about that in the wikipedia but I still will have to figure out why audio isn't working in my FCS2 exports on this PC using this software.
    cause I know its there in the final mpg but it just won't play.
    anyone using media shout?
    I have checked their website and their forum as well.... hopefully will get an answer there.
    If anyone runs into this as well I can post my findings here as well.....
    Thanks for the help.
    DROCK.

  • My Mac Book Pro is slow and at times I have to reboot to connect to the net

    My Mac Book Pro is slow and at times I have to reboot to connect the net.  Also wondering how do I check if my software is up to date?  Thank you.

    To check to see if your software is up to date, go to >Software Update and you can check for updates.
    No idea why your Mac is slow--there could be a variety of things that could cause slowness. A good start would be to see if all your RAM is recognized. >About this Mac will show you how much RAM you have. You can also open Activity Monitor and check your RAM usage.
    Also, how full is your hard drive? You should have a minimum of 10% free space for the OS to operate properly, and 15% to 20% is better.
    No idea why you have to reboot to connect to the internet, but it could be related to the slowness. Rebooting will free up RAM among other things.
    Which MBP do you have and which version of the OS are you running?

  • Slow Shut Down Time For Macbook Pro Retina Snow Leapord

    Hello, I was hoping somoene could help me with the following problems.
    I have brand new Macbook Pro Retina, 15inch, 16G RAM, 500G of SSD, running Mountain Lion, and lots of professional recording software. My macbook frequently shuts down after 30 seconds, that wonderful grey wheel spinning in the center of the screen as if it were an old PC.
    I've contacted apple frequently. They check to see that I've repaired disk permission, they reset...the RAM i believe, they ask if i shut down all the programs. Even through doing all of this, usually my macbook takes 30 seconds to shut down. Sometimes it takes only 5, which is how it usually should be. ANd this occurence seems to be inconsistent with the apps I use. Sometimes it takes long to shutdown when i've barely used a thing. Other times it shuts down immediately when i've used a lot of different programs at once. So there's no constant.
    The apple boys suggest reformatting the computer to make sure it isn't a hardware issue. I refuse to accept that after only 3 months of use I already have to reformat everything. It's not the most enjoyable experience because I'd have to reinstal all my audio software despite Time Machine's magic tricks. Any suggestions?
    Here is a link I've found on the matter: http://thecustomizewindows.com/2013/02/fix-mountain-lion-slow-shut-down-time/

    These terminal commands decrease the excecution time of a process that has caused slow shutdown times for many users. This resolved my slow shutdowns. IF you are comfortable using terminal you can give them a shot, but be VERY careful using terminal.
    These terminal commands should also fix the problem then and kill the services after 2 seconds:
    Code: 
    sudo launchctl unload /System/Library/LaunchDaemons/com.apple.coreservices.appleevents.plist  sudo defaults write /System/Library/LaunchDaemons/com.apple.coreservices.appleevents ExitTimeOut -int 2  sudo launchctl load /System/Library/LaunchDaemons/com.apple.coreservices.appleevents.plist

  • Tell me what is ******* going on!!!????! The time and date issues!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Every times I went to Apple store, the phone automatically works good time, but when I came back, my phone is working very slow with wrong time!

    The time and date issues!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Every times I went to Apple store, the phone automatically works good time, but when I came back, my phone is working very slow with wrong time!
    I want to get a new iPhone to replace this defective phone. I am gonna be crazzzzzzzyyyyyyyy with anger,!!!,!,,,!  I takes2 hours to go to Regent street apple stores for three times!!!!!. It is a lot of transport fees !
    PLz tell me why! How to deal with it !

    Unless it's confirmed officially that your phone is defective, then you can ask for a replacement. Or you have to live with you. However you can trade it for a new one if you don't care the price drop.

  • I pre-ordered the Big Time Rush album 24/seven and never recieved anything

    I pre-ordered the new Big Time Rush album 24/seven a month ago. I haven't gotten any email and the album released today. A lot of people (on twitter) were going crazy saying how awesome the album is and yet I have recieved nothing. What do I do to get it to download?
    I have the automatic downloads option clicked for both my computer and iPhone.

    Look under the Store menu in iTunes for the "Check for available downloads" command and select that. You may find the tracks there to be downloaded. If not, check the Purchases area of the iTunes Store and you may be able to download the album there:
    http://support.apple.com/kb/ht2519
    If not, go here:
    http://www.apple.com/emea/support/itunes/contact.html
    to report the issue to the iTunes Store.
    Regards.

Maybe you are looking for