Archived

This topic is now archived and is closed to further replies.

alexmoura

Quick question, Alpha blending

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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*

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites