transparency: alpha vs. add_color

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.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I can also move the topic. You could still provide more input in here :)
morris
Posts: 36
Joined: Tue Jul 10, 2007 10:10 am

Post by morris »

alright, thank you hybrid :)

i've just wrote a simple app that reproduces the problem. i've precompiled for win xp, but of course included the source:

http://irrlichtirc.g0dsoft.com/morris/alpha.zip
http://irrlichtirc.g0dsoft.com/morris/main.cpp
http://irrlichtirc.g0dsoft.com/morris/test.png

now, to summarize what i've found out so far:

* using EMT_TRANSPARENT_ADD_COLOR works just fine.
* changing MaterialTypeParam to lower values is important to make the borders look good, but this only works for light objects.
* darker objects get a weird lighted border
* using a .tga file instead of .png didnt make any difference
* directx has the same problem (and even worse - see below)

what i think may be the source of the problem:

* a bug in irrlicht's driver(s)
* there are different ways to create alpha channels in graphics programs; one of them might give better results (no success yet)

i eventually tried directx as driver and the same problem appeared, plus the images where extremely flickery while moving the fps camera. don't know why this happens :(.

i hope this helps everyone to understand the problem, and i hope this is not a bug but a thing that can be fixed otherwise.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, found the problem. The color of the transparent part seems to be white (although it's not visible at all in Gimp). Anyway, once I fill that part with other colors the border changes to less visible colors. Maybe it's a good idea to keep the alpha mask a little smaller than the actual image to provide a proper border.
varmint
Posts: 46
Joined: Fri Oct 06, 2006 4:33 pm

Post by varmint »

if your using gimp..make sure you have save colour back ground turned off when saving as a .png... as well if you smooth the edges instead of having sharp cut offs then it blends better :D
Post Reply