FAQFAQ    Board RulesBoard Rules    SearchSearch    LotteryLottery    RouletteRoulette    UsergroupsUsergroups
     RegisterRegister  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Shop    Log inLog in 
View posts since last visit View your posts View unanswered posts

Alpha map/colour key looks different to original game model

 
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding
View previous topic :: View next topic  
Author Message
AsaSK

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 24 Feb 2013
Posts: 575
Location: London, England
8240 Bank Notes
Items

PostPosted: Sat Jan 09, 2016 9:06 pm    Post subject: Alpha map/colour key looks different to original game model Reply with quote

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
View user's profile Send private message
ASM.

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 10 Jan 2014
Posts: 98

221 Bank Notes
Items

PostPosted: Sun Jan 10, 2016 8:52 pm    Post subject: Alpha map/colour key looks different to original game model Reply with quote

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
View user's profile Send private message
AsaSK

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 24 Feb 2013
Posts: 575
Location: London, England
8240 Bank Notes
Items

PostPosted: Mon Jan 11, 2016 5:57 am    Post subject: Alpha map/colour key looks different to original game model Reply with quote

You're a marvel ASM, thank you so much.
_________________

The official Mafioso Mod thread
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Generation Time: 0.011 | Queries: 19