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

Lightmap issue, incorrect colors

 
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Mafia Mods
View previous topic :: View next topic  
Author Message
Mr Robville

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 11 Sep 2006
Posts: 549
Location: Dutchland
255852 Bank Notes
Items

PostPosted: Thu Apr 03, 2014 10:25 pm    Post subject: Lightmap issue, incorrect colors Reply with quote

I'm constantly struggling with this issue and have no idea what may cause it.
I've placed some models and lights ingame. But when I try to bake the lightmap onto them a few polygons show faulty colors that are completely out of tune with the lights ingame:



I've checked if there are any blue lights located in the scene but there are none. Does anyone know how to fix this?
_________________


www.Robville.net
Back to top
View user's profile Send private message Visit poster's website
AsaSK

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 24 Feb 2013
Posts: 695
Location: London, England
12559 Bank Notes
Items

PostPosted: Fri Apr 04, 2014 1:57 am    Post subject: Lightmap issue, incorrect colors Reply with quote

You get this with some of the more intricate models in Mafia, although I'm not sure if it has anything to do with number of polys. I've had this problem with baking lightmaps in MWE, and the colours are nothing to do with those in the scene. I've had blue, pink and green before Wink
_________________

The official Mafioso Mod thread
Back to top
View user's profile Send private message
Mr Robville

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 11 Sep 2006
Posts: 549
Location: Dutchland
255852 Bank Notes
Items

PostPosted: Fri Apr 04, 2014 4:44 pm    Post subject: Lightmap issue, incorrect colors Reply with quote

I found that increasing the resolution and enabling "interpolate normals" eliminates most of these artifacts. Some still remain though. Thinking
_________________


www.Robville.net
Back to top
View user's profile Send private message Visit poster's website
djbozkosz

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 06 Mar 2013
Posts: 94
Location: Czech Republic
1861 Bank Notes
Items

PostPosted: Sat Apr 05, 2014 10:42 am    Post subject: Lightmap issue, incorrect colors Reply with quote

This is bug in MWE because bitmaps for lightmaps have two formats.
First is classic bitmap with X Y resolution in 24bit RGB format (one byte per color).
Second format is used for small pieces of mesh and it has only one color in BGRA format. This causes a bug because red and blue colors are swapped.

Some solutions:
- extremely increase resolution of baked lightmaps
- bake lmaps in external tool
- wait for next sandbox version Wink
- repair these lmap groups in hex editor
_________________

Web | Youtube | Developer at
Back to top
View user's profile Send private message Visit poster's website
Mr Robville

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 11 Sep 2006
Posts: 549
Location: Dutchland
255852 Bank Notes
Items

PostPosted: Sat Apr 05, 2014 1:26 pm    Post subject: Lightmap issue, incorrect colors Reply with quote

Thanks for explaining this one!
I found that increasing the resolution to 10 got rid of most artifacts. A few polygons still remain though.
Is it possible to bake lightmaps externally and then import them into Mafia?
The only way I know of when baking lightmaps externally is to actually bake the shadows onto the textures themselves. This works on single objects (as you can see above), However for objects with tiled textures it is not possible to use this method. Else the textures for the boiler room's walls would require a 4K resolution to maintain a sharp result.

Since I'm totally clueless about editing with Hex I'll just wait for your editor to release. I seriously cannot wait. Very happy
_________________


www.Robville.net
Back to top
View user's profile Send private message Visit poster's website
ASM.

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 10 Jan 2014
Posts: 185

401 Bank Notes
Items

PostPosted: Mon Apr 07, 2014 10:51 pm    Post subject: Lightmap issue, incorrect colors Reply with quote

I've fixed the issue in v0.3.1. You can find the download link in the Mafia World Editor thread. Wink

Thanks to djbozkosz for locating the bug.

Mr Robville wrote:

Is it possible to bake lightmaps externally and then import them into Mafia?

Yeah it is. That's what the guys over at mafiapub did for some of their mods. As far as I know they computed the lightmaps with 3D Studio Max and then exported them to Mafia's format using some script/program written by Mr F. Once you know the lightmap format used by your package, writing such a script should be fairly straight-forward.

Well possible that I still got Mr F's files somewhere...
Back to top
View user's profile Send private message
Mr Robville

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 11 Sep 2006
Posts: 549
Location: Dutchland
255852 Bank Notes
Items

PostPosted: Tue Apr 08, 2014 9:49 pm    Post subject: Lightmap issue, incorrect colors Reply with quote

Fantastic! I've downloaded the new editor and all lightmaps work perfectly now. Thanks a lot! Very happy

Unfortunately I'm a terrible programmer so I won't be able to even write the most simple bit of script.
It would require some practice and trial&error I guess.
_________________


www.Robville.net
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Mafia Mods 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.038 | Queries: 19