Jump to content
  • Advertisement

Archived

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

alexmoura

Quick question, Alpha blending

This topic is 6774 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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!

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
A cool http://www.gamedev.net/reference/programming/features/mmxblend/ can be found here at GDnet. Check it out!

Share this post


Link to post
Share on other sites
A cool http://www.gamedev.net/reference/programming/features/mmxblend/ can be found here at GDnet. Check it out!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!