Bug or not when copying video::IImage with alpha

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Valmond
Posts: 308
Joined: Thu Apr 12, 2007 3:26 pm

Bug or not when copying video::IImage with alpha

Post by Valmond »

Hi!

I mix together clothes for my characters on one texture using video::IImage.

Like I have a base texture (the skin) and ontop of that (at the right places) I copy for example a pair of trousers with:

Code: Select all

//I get a reference "skin":
video::IImage *vimBody=globals.GetDriver()->createImageFromFile(...)
...
//I make a local copy:
vimBody->copyTo(vim,core::position2d<s32>(0,0));
...
//copy the trousers for example:
vimitem->copyToWithAlpha(vim,core::position2d<s32>(0,0),core::rect<s32>(0,0,512,512),video::SColor(255,255,255,255));
If the trousers-pixel is 100%transparent, nothing happens (which is as it should be)
If the trouser-pixel is 0%transparent, it replaces the base-pixel(okay too)
But if the trouser-pixel is semi transparent (say 50%) then it doesn't mix the transparencies but uses the trouser-pixel alpha straight off (which makes holes around the edges of clothes where the alpha is >0% and <100%).

BTW I don't know if the colours are mixed correctly in those areas.


I have a workaround (I just loop and set all pixels to 100%) but I thought I should post it anyway.



Tested on Irrlicht 1.5 and todays SVN version.


Cheers & keep up the good work!

[edit] I use the OpenGL Drivers (and a 8800GT)
Post Reply