Quick question, Alpha blending

Started by
6 comments, last by alexmoura 24 years, 3 months ago
If your trying to do a transparent bitmap, the answer is NO, unfortunately, but you can use a texture map with D3DTLVERTEX vertices and render a blended texture mapped square to the screen, with the texture being the bitmap you want to display of course. This also has the advantage of using the 3D acceleration. This is how we do the transparent menus in JAKKAL.

------------------
--Shannon Schlomer, BLAZE Technologies, Inc.

--Shannon Schlomer, BLAZE Technologies, Inc.
Advertisement
Dang... Well, thanks anyway. I think I'l just code it myself, and if I find out I need the speed, I'll dig into D3D. Thanks again!
I tried responding before, but my message got "bounced"...Anyways...
__I know DirectDraw doesn't handle it, but I could swear OpenGL can do it in 2D. I wish I had an OpenGL prog book. Can someone confirm/denounce this?
OpenGL doesn't do 2d stuff very well... it does indeed to alphablending in 3d... and you could project a 3d rendered scene to make it look 2d, and use this feature.. but thats a pretty major waste.

I'd probably laugh pretty heartily if someone used stencil buffered alphablending to blit a font to the screen in a 2d game...

------------------
*oof*

*oof*
Just q quick question to avoid spending time seaching for it on the docs: does directdraw support any kind of alpha blending or do I just have to code it?
(in 16 bit, 32bit, whatever)
Thanks in advance
Well, coding an alpha blend routine by hand for use with DirectDraw (I assume you will be using hardware acceleration) will suck...speedwise. It doesn't matter how great you optimize your code. The bottleneck is the bus. Writing to video memory causes an incredible slowdown. If you really want to write your own, your best bet is to not use hardware acceleration for any rendering, and do everything by hand to a system memory buffer, and then only copy that to a video memory backbuffer surface, and flip your primary surface.
However, I simply suggest that you read up on some Direct3D and use TL polygons for your sprites, and texture them with the bitmap. This has numerous advantages, like hardware accelerated scaling, filtering, alpha blending (of course), color modulation, etc...many, many good things.
A cool http://www.gamedev.net/reference/programming/features/mmxblend/ can be found here at GDnet. Check it out!
A cool http://www.gamedev.net/reference/programming/features/mmxblend/ can be found here at GDnet. Check it out!

This topic is closed to new replies.

Advertisement