Alpha blending in directx....
Can I render a bitmap with alpha blending in directdraw surface ?Since I want to do some semi-transparent feeling.....
Not in DirectDraw. To render Alpha blending, you have to use Direct3d.
It''s the only way.
But I got a better Idea for you for 3d or simulate 2d...
--> OpenGL
It''s the only way.
But I got a better Idea for you for 3d or simulate 2d...
--> OpenGL
Are you sure? DDraw5 had stuff about alpha blending in it! And using D3D for pure 2D stuff is overkill unless you''re going to need lots of transformations, probably.
Read about my game, project #1
NEW (18th December)2 new screenshots, one from the engine and one from the level editor
John 3:16
Read about my game, project #1
NEW (18th December)2 new screenshots, one from the engine and one from the level editor
John 3:16
quote:Original post by Daivuk
Not in DirectDraw. To render Alpha blending, you have to use Direct3d.
It''s the only way.
But I got a better Idea for you for 3d or simulate 2d...
--> OpenGL
For as long as I have used directx (DX5) there has ALWAYS been a way to set a transparent color.
1. Set the color key (this color is usually the transparent color throughout the game)
2. load your textures with the key color applied
3. set the BltFast parameter to DDBLT_SRCCOLORKEY
As far as semi transparancey, that really goes with how you set your SRCCOLOR high and low values. As far as blending from an ACTUAL alpha channel, I am not sure if you can do that or not. You can do a lot of tricks within your art to simulate this however.
you CAN use alpha blending in DDraw. I''ve done it back when I used Allegro. It is really slow though, I would recommend using D3D. It''s not overkill; you can use graphics hardware better.
quote:
you CAN use alpha blending in DDraw. I've done it back when I used Allegro. It is really slow though, I would recommend using D3D. It's not overkill; you can use graphics hardware better.
DirectDraw doesn't support hardware alpha blending like d3d but it is possible to write your own software alpha blending routines. Being software vs hardware it will be much slower. There is a tutorial or article somewhere on GameDev that shows you how to do it in 16bit color for DirectDraw, probably in the articles and resources section
To be fair, there is no such thing as "overkill" when it comes to eeking as much speed and performance as you can out of what is available. With that said, I myself have not yet delved into the d3d realm of directx mainly because I don't feel I have even come close to learning what I should from DirectDraw and the new vocabulary of d3d seems a bit daunting to me as well
edit: here is the link to that article
[edited by - evillive2 on March 7, 2003 11:26:29 PM]
You could try this:
Add a color key and then just draw the image in a way that it looks semi-transparent.
Maybe color key white and the image has every second pixel white.
-CProgrammer
My Website
Add a color key and then just draw the image in a way that it looks semi-transparent.
Maybe color key white and the image has every second pixel white.
-CProgrammer
My Website
Reality is harsh, toss DirectDraw in the trashcan.
There was a reason for Microsoft dropping it, and that reason is that noone implements DDraw acceleration in hardware anymore, while everyone implements 3D acceleration.
Take the time to learn the basics of D3D (which atleast up to the next release of OpenGL will be superior), and rewrite your code using it. You don''t need to learn a whole lot, and once you''ve got a few basic functions down you can stick them into your code instead of the ddraw-functions, and everything will be looking the same (or better), with a pretty nice improvement in speed.
--
MFC is sorta like the swedish police... It''''s full of crap, and nothing can communicate with anything else.
There was a reason for Microsoft dropping it, and that reason is that noone implements DDraw acceleration in hardware anymore, while everyone implements 3D acceleration.
Take the time to learn the basics of D3D (which atleast up to the next release of OpenGL will be superior), and rewrite your code using it. You don''t need to learn a whole lot, and once you''ve got a few basic functions down you can stick them into your code instead of the ddraw-functions, and everything will be looking the same (or better), with a pretty nice improvement in speed.
--
MFC is sorta like the swedish police... It''''s full of crap, and nothing can communicate with anything else.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement