Alphablending

Started by
5 comments, last by Pellebert 23 years, 10 months ago
I can't succeed when I'm trying to use Alphablending in directx... I want the texture to be transparent in som parts and not in other parts, defined by a grayscale image. (I think you know what I mean) I'm using direct3d in directx7... Anyone who can help me?? Edited by - Pellebert on 6/16/00 6:36:30 AM
Advertisement
Not to be much of help, but I have the same problem
I''ve managed to make all the parts that are exactly black (0,0,0) or white (255,255,255), but the color values near these (e.g. (0,1,2)) aren''t transculent which they should be.
Alphablnd need many things :
-hardware support
-texture with alpha channel or material...
-the renderstate alphablend enable.
-the renderstate srcblend, destblend (if allowed by hw!!!!!)

May be, you want to use colorkey wich is more easy a supported....



-eng3d.softhome.net-
-----------------------------------------------"Cuando se es peon, la unica salida es la revolución"
I don''t know if this will help you, but there''s a detailed tutorial on Mr. Gamemaker that deals with alpha blending in directx. You should check it out.

-> Briar LoDeran <-
I''ve been doing nothing but trying to figure this out myself for days. Here are my conclusions --

Use Direct3D or else you''re going nowhere. You''ll have to enumerate devices and do a bunch of other stuff, BUT IT''S WORTH IT.

Use DXTEX (DX texture tool) and load in your alpha channel, and save as a DDS. Load directly into a texture in your project and you''re good to go. DXT3 seems to be the best format, from what I can tell...

Given just moderately good hardware, your alpha blended, zoomed, and rotated blits will be VERY fast. Just for reference, I''m getting about 60fps blitting 50+ alpha sprites on a PII-400 with a Permedia 2 (fairly lame) 3D card. Don''t try to do it with DirectDraw only or you will be frustrated!!
DirectDraw still does not support alphablending. You''ll have to do that manually, or via Direct3D / OpenGL
Check out NukeDX, it has great alpha blending routines. They work very quickly.

If you are considering Direct3D, I suggest taking a look at D3DX, the Direct3D extensions added in 7.0, specifically the sprite drawing functions - VERY cool.

Clay
Clay LarabieLead DeveloperTacendia.com

This topic is closed to new replies.

Advertisement