Jump to content

  • Log In with Google      Sign In   
  • Create Account


Alpha Transparency


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 bbxx   Members   -  Reputation: 122

Like
Likes
Like

Posted 27 January 2000 - 05:23 PM

hello everyone, I am planning on putting alpha blending into a 2d game i am making. I know that DDraw doesn''t support it so I did it in software. Except how am I supposed to make alpha values for my surfaces? Are there any image editors where you can edit the alpha values? should i have seperate buffers with my alpha values in them? Another thing that I noticed as I browsed the DirectX SDK help was that the overlay surface has a bunch of alpha flags and stuff.. do overlays support alpha transparency? if so, do most video cards support overlay surfaces capable of this? Any help would be appreciated, Matt Teiken bbxx@hotmail.com

Sponsor:

#2 Gromit   Members   -  Reputation: 144

Like
Likes
Like

Posted 27 January 2000 - 07:04 PM

You have to use Direct3D to do alpha blending. Unless, like you said, you create your own routine.

#3 alexmoura   GDNet+   -  Reputation: 450

Like
Likes
Like

Posted 27 January 2000 - 09:58 PM

The way I did it, was something like this: I started working in 32 bit format, filled the first 8 bits for alpha,and used my routine to do the blending, then I switched to 16 bit (for speed) and had to use a buffer alpha
To get the alpha, though, I use my own 32 bit image format, wich i build from 2 24 bit bitmaps, where one bitmap has the image info, and the blue component of the second gets to be the alpha. When using 16 bits, i just convert the file values to 16 bit and channel the alpha info into the buffer.

#4 Melo   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 January 2000 - 02:48 AM

The "MMX enhanced alpha blending"-article helped me much when I was going to code my alpha-stuff. Check it out at GDnet/Reference/Programming

Cya

#5 bbxx   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 January 2000 - 02:53 AM

thanks alexmoura. could you also use green and red for the alpha? is blue better for a reason? also, what''s a good way to identify the alpha buffer with the image?

#6 alexmoura   GDNet+   -  Reputation: 450

Like
Likes
Like

Posted 28 January 2000 - 06:30 AM

You can use wichever color you well please (i don''t even remember why I picked blue, actually I just needed 8 bits for alpha) but if you use just one of the colors you can even paint your "alpha mask" in grey without much fuss.
As for identifing the the budffer with the image, I have a class for storing the dd surfaces, so I just added the buffer to the class, and instead of manipulating dd surfaces I just move the class around. A struct with a LPDDSURFACE and a BYTE * or whatever will do fine.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS