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!
I'm working on an iPhone app that overlays Irrlicht onto a video feed and uses Irrlicht to render a 2D transparent PNG which is being textured onto a flat obj. Looking at the result the image has a slight "halo" of white around it. I would like the "halo" to not be there.
Irrlicht is not to be blamed here, it`s your image. It`s because the bilinear filtering uses some of the alpha covered pixels. Either not use bilinear filtering, or best open your .png and fix your image background pixels around the borders to be close to the border colors, not white and if not, check your alpha channel once again.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
The image was fine but turning off bilinear filtering did help. Partial transparency still seems lighter when I take a screenshot with IVideoDriver::createScreenShot() in contrast to the iPhone screenshot.
Still looks incorrect. Disabling bilinear filtering is not a solution in case you need the image filtered. I still think the problem is caused by the image. I can take a look at how you made your .png if you post some of the test images here. Did you tested it with the .png-s from the Irrlicht media folder, or some other not created by you?
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
There has been a post some weeks ago which told that png stores a background color which can come through on transparency blending. Maybe check if your export tool can change that color.
As hybrid said, the issue is that your fully transparent pixels have color. Bilinear filtering uses samples from nearby pixels, so the color of your transparent pixels bleeds in. The easiest solution is to open your image in Paint.NET and re-save it. Paint.NET converts all fully translucent pixels to black, so it won't be noticeable.
I used Photoshop CS5 to create the PNG files. I was not aware of the background color, thanks for pointing that out I'll see if I can change that. I use a Mac so it would be preferable to come up with a solution that does not require Windows.
Or else, use the TGA format. TGA requires that you create your own alpha channel (something not very hard in any painting program) but it respects all the original pixels, which, in your case, may be what you would want.
It would be useful to have a routine to combine color images with alpha channel images.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
on windows and linux i use irfanview for correct alpha channeled png's
there you can select a pixel on save-action that would be used as the transparent color, and all pixels equalling the chosen pixel will be saved as 0x00000000
TGAs have Run Length Enconding, which is virtually useless for images with few similar colors right next to each other.
GIMP has an option for saving the background color with PNGs, so I'm pretty sure Photoshop does too.