View previous topic :: View next topic |
Author |
Message |
AsaSK
Mafiascene Veteran Modder


Joined: 24 Feb 2013 Posts: 634 Location: London, England 9864 Bank Notes
Items 
|
|
Hi all,
So I've exported a model with an alpha map texture (i.e. a transparent part somewhere in the texture) and it all looks fine, aside from the fact that some part of the export process or program has 'blurred' the edges of the texture, instead of leaving it 'sharp' like the alpha map dictates.
To illustrate what I mean, below are two screens - one from my custom model and one from one of Mafia's original models. Both use the same texture but mine has an alpha map, whereas I assume theirs used a colour key (though it's worth noting that this problem also occurs when I use a colour key).
IS' model/texture:
My model/texture:
 _________________
The official Mafioso Mod thread |
|
Back to top |
|
 |
ASM.
Mafiascene Veteran Modder


Joined: 10 Jan 2014 Posts: 145
321 Bank Notes
Items
|
|
This is because of the texture filtering used by Mafia. It (probably) uses linear filtering so the pixel color is determined by linearly interpolating between neighboring texels.
In this particular case you have fully transparent pixels right next to fully opaque pixels at the bar borders. When filtered, you get pixels with fractional alpha values there which causes this blurred look.
The reference model/texture is rendered using alpha testing. There, a pixel is only written if it's fully opaque and discarded otherwise which gives these sharp edges. From the looks of it the material flag 0x800000 needs to be cleared, though, otherwise you also get blurred edges, possibly because the game switches to alpha blending when set. |
|
Back to top |
|
 |
AsaSK
Mafiascene Veteran Modder


Joined: 24 Feb 2013 Posts: 634 Location: London, England 9864 Bank Notes
Items 
|
|
Back to top |
|
 |
|
|