Alpha Transparency in 2D

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
morlok
Posts: 4
Joined: Fri Jan 02, 2004 11:33 pm

Alpha Transparency in 2D

Post by morlok »

is it possible to draw a transparent 2D bitmap?? (I don't talk about COLOR_KEY, I mean real transparency with a 8 bit Alpha value)

I tried this but it doesn't work: (in the exemple I loaded the "m_pIRRTexture" with the "driver->getTexture(sFileName)" function).

...
short nAlpha=128; //semi transparent
...
IRRDriver->draw2DImage(m_pIRRTexture, core::position2d<s32>(X,Y), rect, 0,video::SColor(nAlpha,255,255,255), true /* or false */);...

(I've forced 32bit textures with "IRRDriver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT,true);" changes nothing...)

thanks!
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

Post by rt »

check out this thread http://irrlicht.sourceforge.net/phpBB2/ ... .php?t=517

i've found that i had to tweak some directx and opengl settings in the irrlicht source to be able to load 32bit .tga and .png so that the alpha would show properly.
Guest

Post by Guest »

thanks, i'll try your modification

i hope it will be implemented in next version of IRRLicht thought :-)
Post Reply