Ligthmap for game environment?


I’m building a game level in 3ds Max and it has rooms, floor, walls, towers, columns, pillars and all these kind of things a classic FPS map has.

I built here a **quick example **

What you see here is an example of “map” for a game… the way I would do it in 3ds Max.

There is the base structure (grey and red areas), some turrets (pink objects), some architectural columns (green cylinders) and some other stuff (blue box for example).

The **texturing **process here is easy: each object (turret, column, box) has its own UV map.
I divided the base structure in first floor (grey area) and second floor (red area) to make the UV process easier.

Before exporting to UE4, I group all of those objects (turrets, columns, boxes…) and export them.

Now… what about the Lightmap?

What should my approach be here?

Should I** create a second UV channel for each object** (turret, column, box), the same way I did for the texturing process and then export them all as a group?

Will UE4 be able to understand that it is a group and each piece of the map has its own lightmap?

OR should I create a single UV map for the WHOLE map? That’d be a mess!



**Please note: **
I’m a programmer, not an artist.
I’m sorry if I didn’t bring here a real ISSUE but I prefer to ask preventive questions… I’m not really into level design and I wouldn’t want to do things uselessly.

Thanks in advance!

You have 2 options.

In 3ds Max once you have your texture UV map done collapse the Edit UV down to the base form and add a New Unwrap UVW modifier and change the mapping channel.
The other option is to just let UE4 create the lightmap for you when importing the FBX.

I prefer not letting UE4 autogenerate a Lightmap for me whenever possible. I want to learn to do it myself.

So please tell me if I got it right:

I create a UV map for each object in the game level (turrets, fountain, door frames, columns…) and texture it.
After that, I add another UV modifier and just change the mapping channel.

And… then? What do I do next?

Group all the objects together and export? Will UE distinguish each object’s UV map in the group? Or will it see a unique UV map which is the sum of all the UV maps of all the objects?


I want to make game maps and need to know how to prevent UE from mixing up all the UVs

Well as a primer an object can have as many UV mapping channels s you wish by changing the mapping channel in the UV map modifier When you change the channel you are asked if you want to copy the previous map into the channel or abandon the previous map to create a new one.

The normal process for UE4 is to the first map for the colour map and the second channel for the lightmap. The rule is the lightmap can not be tiled or overlap but the editing requirements and process is still the same as the first channel following the requirements.

Best practice once you are done your edit you can bake the channel into the object by collapsing the stack. At this stage the object contains 2 UV mappings, one for the colour map and another for the lightmap,and once imported into UE4 the second channel will be selected as the lightmap channel, which you can change.

If for any reason after the fact you can edit any channel by placing a UV edit on the stack, select the channel you want to edit, an abandon when asked. once done collapse the UV edit to bake the channel.

**This **is what I do when I have a single object to texture/lightmap for UE4.

But consider an **entire game map **with different floors, bridgets, towers, turrets, pillars… for instance, take this Quake map

You see? There are many architectural elements… bridges, floors, walls, hallways, stairs… AND THAT’S ONLY ONE ROOM!
The map is much bigger than you see.

On **3DS Max **it’s easy: each element could be a separate object with a separate UV map

When EXPORTING to **Unreal **I group all these elements and finally everything becomes one .FBX that is then imported inside the engine.

The problem is Unreal Engine does not separate the UV maps of single elements… but sees a unique, big, messy, UV map which is basically the union of all the UV maps of all the elements.


So, what should my workflow be here?

Ah cool some context.

OK so when you export the parts they are still in parts but will combine in UE4 if “Combine Mesh” is checked the separate objects are imported as a single object and in the process jumble the lightmap channel. Objects are still relative to the object but they overlap.

A heads up.

It’s not a good idea to group objects as a single object as the engine will not be able to cull what is not visible to the camera

That said if the plan is to import all objects as a single object, say your using a texture atlas, you can remap the lightmaps by selecting all of the objects and placing a UV Edit on the stack as an instance and selecting the lightmap channel and “repack” the UV’s. Now when imported the UV’s are not jumbled.

Best practice though is to export each object one at a time.

This sounds interesting but I don’t quite know if I understood correctly. This is what I’ve done:

I select all the objects that make the structure of the level
Then apply a UVW Unwrap modifier to the selection
Then I open the UV editor and go to Tools->Pack UVs

This produces the following result:

So **THIS **is the lightmap of the whole game map?

Well the thing is, we’re not talking about game assets here like chandeliers, torches or other objects that can be placed afterwards.
Here we’re talking about the real structure of the level

A quick Shadowplay blast of an instanced UV map

Brilliant! Thank you very much for your help and time! :slight_smile: