Archived

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

Craazer

Transparent graphics

Recommended Posts

Um, in what? In 3D? If that''s what you''re talking about then you want to create a texture with an alpha channel. The alpha channel determines the transparency of the image when it''s drawn.

----
AIDS

Share this post


Link to post
Share on other sites
quote:
Original post by TheAIDSVirus
Um, in what? In 3D? If that''s what you''re talking about then you want to create a texture with an alpha channel. The alpha channel determines the transparency of the image when it''s drawn.

----
AIDS


In 2D

And what i have heard 2D doesnt have that alpha channel, but is it bossible to draw transparent pixel or some technique to make it look like so?

Share this post


Link to post
Share on other sites
Why wouldn''t 2D have an alpha channel? I don''t see how it would matter. Just make sure your image supports it. I personally use 32 bit TGA files w/ an alpha channel.

Share this post


Link to post
Share on other sites
quote:
Original post by DrunkenHyena
DirectDraw(2D) doesn''t support Alpha channels. Direct3D does, so if you use 3D to do 2D you can do it easily. Otherwise you have to hand code it all and it isn''t pretty.

Stay Casual,

Ken
Drunken Hyena


Yes then hand coding it will be!

whats the technique for it?
(i sure know howto draw pixels)



Share this post


Link to post
Share on other sites
OOH another software alpha blender!

read the tutorials on this site:
http://www.gamedev.net/reference/list.asp?categoryid=40#29

should get you going. I''m doing this, and so are atleast one more I know of from these forums. I''m utterly stuck tho, but I''m getting help =D

Good luck, and share your results please

It''''s nice to be important, but it''''s more important to be nice.

Share this post


Link to post
Share on other sites
Its not hard at all, its an option of when you create your texture...

What I do for 2d is use the sprite object, and just use its draw command with the images that I make and transparency works just fine =) I dont see whats so hard about it.


if Self.Transparent = true then
begin
if failed(D3DXCreateTextureFromFileExA(TheDevice,pChar(Self.FImageFileName) , 0, 0, 0, 0,
0, D3DPOOL_DEFAULT,
D3DX_FILTER_NONE, D3DX_FILTER_NONE,
Self.TransparentColor, NIL, NIL,Self.FImage ))
then
begin
MessageBox(0, pChar(''Error creating texture'' + Self.FImageFileName), ''Error'', MB_ICONERROR);
Application.Terminate;
end;
end;

if Self.Transparent = false then
begin
if failed(D3DXCreateTextureFromFileExA(TheDevice,pChar(Self.FIMageFileName) , 0, 0, 0, 0,
0, D3DPOOL_DEFAULT,
D3DX_FILTER_NONE, D3DX_FILTER_NONE,
0, NIL, NIL,Self.FImage ))
then
begin
MessageBox(0, pChar(''Error creating texture'' + Self.FImageFileName), ''Error'', MB_ICONERROR);
Application.Terminate;
end;


Thats delphi stuff of course but basically if my transparent property is true, it creates the texture with transparency, and it sets its colorkey to the transparent color property, very simple stuff.

Bobby

Share this post


Link to post
Share on other sites