Results 1 to 6 of 6

Thread: C++ 2D Alpha Blend

  1. #1

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    C++ 2D Alpha Blend

    ....I had a post on this topic already, it seems as if the title was removed so I cannot acsess the thread...All I see is my name....I am using Mozilla

    Anyway.

    I was asking for a 2D AlphaBlending routine to fade the screen to black...
    I wrote one myself and it works just fine, absolutely fine....SLOW, SO VERY SLOW.

    NoteMe suggested 3D, which if you search around on this topic everyone is suggesting use 3D thus hardware to deal your alpha blending.

    Well I plain dont want to. I want it done simple and easy in 2D, there is no other easy way to intrigrate it in my game. A simple screen fade that is it.


    So is there anyway to speed up the 2D GetPixel() SetPixel() AlphaBlend technique. All I do is look through the source pic, get the pixel from the destination and the source, using an alpha value I calculate the new pixel and set that pixel on a new surface I call AlphaSurface.

    It runs fairly fast on small pics. But for the entire screen, it takes forever...5-10 seconds a frame to slowly fade the entire screen (backbuffer then flip).
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  2. #2
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: C++ 2D Alpha Blend

    Quote Originally Posted by Halsafar
    ....I had a post on this topic already, it seems as if the title was removed so I cannot acsess the thread...All I see is my name....I am using Mozilla

    Look at the right side of that line..and press the arrow..then you get to the last post in that thread, then scrool up, and edit your first post, and edit the subject line...

  3. #3
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: C++ 2D Alpha Blend

    If you are still onto that fading thingy...and you are doing the whole window...why not try out the Gamma Control in DX7...that should be faster...


    ØØ

  4. #4

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: C++ 2D Alpha Blend

    Thats a darn good idea.

    Gamma it down to nothing and back up again...I think I've read somewhere that can apply in 2D as well.

    Thanks.

    Still looking for some insight on how to speed up the 2d alphablend...there has got to be a way, it was the method of choice througout Atari, Nes, Snes.
    like pong for example i read was the first game to use entire alpha blending for all gfx....


    Edit:
    Clicking the arrow like you said for that other post brought me to a different older post of mine....
    Last edited by Halsafar; Dec 6th, 2004 at 03:06 PM.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  5. #5

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: C++ 2D Alpha Blend

    I read you can enumerate a MMX processor...if it exsists then it should be able to handle two pixels at once cause its 64-bit.
    That should then double the speed of the API alphablend.

    I do not have a MMX processor....so I am still looking for an alternative, plus I can't find any example of how to take advantage of 2 pixels at once processing.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  6. #6
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: C++ 2D Alpha Blend

    Quote Originally Posted by Halsafar
    I read you can enumerate a MMX processor...if it exsists then it should be able to handle two pixels at once cause its 64-bit.
    That should then double the speed of the API alphablend.

    I do not have a MMX processor....so I am still looking for an alternative, plus I can't find any example of how to take advantage of 2 pixels at once processing.

    THat is not very easy to do. And there isn't that many prosessors that has it. I have it, but few or no games uses it. You could try to look up and see if 3DNow or SSE or SSE2 has some similar support.

    ØØ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width