Creating custom lightmap for a mesh that will be exported to UDK
Hello.
I have resently dived into UDK and have been trying to make a housemodel for UDK.I have A lot of problems from modular creation which i dont understand quite good yet.
I have a wall model with a multisub object applied with uv,s.ID1 and ID2,What i have heard its possible to create a lightmap ,Here is the part that confuses me.
Do i create a third ID or do i apply a unwrap modifier over the unwrap i created with ID1 and ID2 ?What i have heard its just making a flatten mapping for the lightmap?
Cant find any explanation or tutorial on this 
Also I'm not sure how i would cut my model into modular pieces,Its so many ways .Floor by floor,or smaller sections,Should the windows be attached to the walls,etc etc....
Thanks a lot!!!
Yes now i know a little bit more 
But still I'm confused about the light map creation process.I'm not sure if a picture will help?
Also my English is a bit limited and bad so this wont make it easy to explain 
Anyway,I have 2 different diffusemaps applied to one of my objects(Meshes) that is included in the building.This is just a test so the maps are a bit ugly.
At Material ID1 i have a brick texture and Material ID2 has some various surfaces.This is where i get confused,If i change to "CHANNEL 2" in the unwrap editor and
apply a flatten mapping which will explode the mesh it also affects channel 1,I'm not sure but i think the light map should have its own material channel
but as i said it will destroy my original UV setup 
I have included a picture and i hope it wont get to large
And Jackyboy --> A Big thank you!
No worries :) Glad It helped,
I see what you mean now a bit better. I am not familiar quite how max does it's unwrap as I haven't used it in over a year! But in the Introduction to Unreal Materials DVD it goes over how to set up a model and assign different material IDs (UV channels) to an object better.
I think what you would want to do is to create another UV channel, channel 3, then unwrap it again so there are no overlapping pieces, you can do this all automatically with the unwrap tools. This UV set doesn't need to be laid out well as the computer automatically places the shadow "texture" for you. Then when you are in UDK you can tell the object to use UV channel 3 as it's lightmap UV set.
Hope this helps again, and I hope you understand what I wrote! 
If you don't I will be happy to explain any part again with pictures 
Hello jacky!
Thanks again for taking the time to explain!!
But i think i got it now,Not imported it to UDK yet but the only way i can have 2 different uv sets is by creating a second channel.
Channel and id,s isn't the same and it has been very confusing.Now i have set a second channel,No material id though.
Not sure if the light map requires a material channel?
And I'm not sure if the light map would use channel 1 or 2 or if that's even matter?
Anyway a big thanks to you!!Here is a screenshot of what I'm talking about
I was always pretty familiar with using lightmaps from the time I worked at Vstep, but since that's been some time, please correct me if I'm wrong.
I think the best approach is to first make the complete model modular, like Jackyboy explained.
Texture the separate pieces and use them to rebuild the model and maybe even some different buildings (since the pieces are re-usable)
When you have a whole building set up, attach all the pieces to each other (adjust pivot and such) and on the second UV channel bake a lightmap.
- If you plan on using more buildings next to each other, you could wait with baking the lightmap untill the other buildings are done. This way you can make the correct shadow of one building fall correctly on another building 
You don't need to separate the modular pieces of one building afterwards, since (most) engines render on a per-material-basis it should be separated automatically...
Hello Rob!
Okay so if i get this right you mean
1.Break the model into smaller pieces
2.Unwrap each part and assign a texture ID or 2 to it and a second channel which the light map will use.
3.Attach all parts again and by that you mean inside UDK?? ( If you mean inside 3ds max then its not modular pieces when imported to UDK? ) so i assume you mean UDK
Question,How do i attach pieces in UDK?I assume you mean attach it to one mesh.
Many thanks to you guys and forgive me for my stupid questions :/
I think I might have made some mistakes in my earlier post
so let's do this again...
I'll use the words re-usable piece when referring to 3DsMax/other 3dModelling-package and I'll use the words Modular piece when referring to UDK, to make things better understandable. Also, you may notice that I write jargon and terms we use in our proffession with capitals, just to make them stand out a bit 
Please read the complete text ^^
The Diffusemap - Channel 1
You have a full building modelled now.
Some parts are re-usable, since they have the same geometry and will also use the same Diffusemap.
To keep your scene and head organized you could refer to them as Window_type01, Window_type02, Window_type03, Wall_type01, Wall_type02, etc.
Now, there are different ways to approach this:
- 1
Keep the fully modelled building as 1 Mesh and assign Material IDs to the different re-usable pieces (you can use a Multi/Sub-object Material with different colors to track of what you're doing)
Unwrap one of every re-usable piece, then use the unwrapped piece to replace other pieces of the same Material ID.
- 2
Detach the re-usable pieces to separate Meshes and give each different type of re-usable piece (which is now it's own Mesh) it's own Texture-slot.
(Window_type01_01 and Windows_type01_02 will have the same Texture-slot assigned to them)
Unwrap one of every re-usable piece, then use the unwrapped piece to replace other pieces of the same Material ID.
I think this is the best time to paint the Diffusemap, since you can clearly see the tiling and seams now.
You're always able to Attach or Detach the re-usable pieces, but you should make your choice on the following:
The Lightmap - Channel 2
- 1
Since you have the complete building as one Mesh you can select it and unwrap it completely on Channel 2 (either manually or using Flatten Mapping)
Once this is done, you can render a Lightmap.
Every triangle of the Mesh will have it's own part of a big Lightmap, however this disables the ability to make them Modular pieces in UDK.
- 2
In this approach you have the complete building, but in separate re-usable pieces. This means you'll have to Unwrap every re-usable piece separately, on Channel 2.
Once this is done, you can render a Lightmap for each type of re-usable piece.
Every re-usable piece of one type will use the same lightmap, which could cause weird shadows at some places, but keeps the pieces modular for UDK.
Except for the exporting this is pretty much all that has to be done in the 3dModelling package.
The rest can be done in UDK or probably any engine.
Which approach to use is dependant on a LOT of things, but I think you can narrow it down to 2 categories:
Beauty (We as artists want to create mind-blowing, detailed settings and want the viewer/player to experience a certain virtual, visual 'high'.
and
Efficiency (Real-time rendering has it's limits and we, as artists, should make sure that we don't cross those limits too much. Think: optimization, frames per second, etc.)
Now, to get to a conclusion, cause I'm rambling on way too far...
Assuming this is a portfolio-piece, so you can sacrifice quite a lot of Efficiency to get more Beauty.
Pretty curious to what you guys have to say about this view 
wow thanks a million for taking the time to explain all this!!
No probs mate 
Does anyone want to comment on the text I wrote above?
No probs mate 
Yea that looks fine 
This is a really helpful and complete explanation. Thanks a lot.
Rob, I will use your info in my project! TAHNKS!
Hey guys. I have a one question about this topic. How to assign light map to static mesh in UDK? Of course we have 2 channels with separate textures for example 1 diffuse main textures, 2 is baked light map/ao for whole static object (like auto flattening in 3dsmax) so this maps are not the same. How to assign this 2 different textures/mix it in material graph in UDK?










Hey, Just thought I would throw in what I thought
Modular can be done in alot of different ways, but in the pic is one way I would do it, Depends what the requirements or limitations are really.
You want to break it up into enough pieces So you aren't doing lots of work over and over, but you want them big enough to still have some individuality.
And as for the lightmap question, I think you are coming from max so I don't quite understand the words you are using, but you should only really need 2 UV sets, then in the static mesh properties, you go to the lightmap and tell it to use uv set 2, this one can't have any overlapping UVs otherwise it just doesn't work properly.
Hope this helps, or at leasts pushes you in the right directions.
Also this makes you look at your model and see where else you can reuse bits, Like could you use the bits at the bottom at the side around the front too? and change the side windows so they could work at the front aswell. Then you could use things like Decals to cover up the seams/repitition.
Riki goes over this in the Materials dvd, it is for the Unreal editor, but the premise is the same. In the Fountain DVDs he also goes over modular model creation
Maya|Zbrush|Photoshop|UDK