( MAKE IT STICKY! ) Light Build, How to set-up the Lightmass -tutorial for beginners

Hi. Since as a beginner I had really a lot of problems with setting my lightmass appropriately ( I had very long light build times, lot of crashes to desktop when building or saving ) - I want to ask the Epic crew to share some information about it, that beginners could make use of. I mean that someone ( advanced users or Epic team ) could post basic rules, that should be obeyed in order to get best light build times and best stability ( like “place lightmass importance volume in your map and set it size… bla bla bla” Thank you

Here you can find some general information about lights :slight_smile:

For the build times/crashes:

  • make sure that you add a lightmass importance volume -> defines the area with the best light quality
  • use good lightmaps (upper links)
  • when you get crashes, make sure to post them on answerhub so that we can check what could be wrong -> could be a bug or a corrupted mesh :slight_smile: https://answers.unrealengine/index.html
  • when you get some errors, make sure to check the upper wiki page

https://docs.unrealengine/latest/INT/Engine/Rendering/LightingAndShadows/Lightmass/Basics/index.html
https://docs.unrealengine/latest/INT/Engine/Rendering/LightingAndShadows/Lightmass/index.html
https://docs.unrealengine/latest/INT/Engine/Content/Types/StaticMeshes/LightmapUnwrapping/index.html
https://docs.unrealengine/latest/INT/Engine/Rendering/LightingAndShadows/LightMobility/StaticLights/index.html

Hi wielkiczarnyafgan,

Eric and I are in the process of doing exactly this. We’ve got a good start with basic lighting troubleshooting and tips on our Wiki Lighting guide (Located in my signature). We have plans to add a lightmass troubleshooting section along with some more UV lightmap oriented sections.

You can follow progress in my post here: https://forums.unrealengine/showthread.php?56777-Photons-Be-Free-Mini-tutorials-and-other-curiosities&p=220501&viewfull=1#post220501

I’ve got the ones listed that are done, ones that are being worked on, and ones that are eventually planned to get up. Unfortunately, neither Eric nor myself have had the time lately to get these completely finished.

Lightmass is definitely one that is asked about very often.

In the mean time, if you’ve not already seen our documentation with lightmass you can check that out here. It’s not a how-to, but it’s got a lot of information that is helpful.

https://docs.unrealengine/latest/INT/Engine/Rendering/LightingAndShadows/Lightmass/Basics/index.html
https://docs.unrealengine/latest/INT/Engine/Rendering/LightingAndShadows/Lightmass/index.html
https://docs.unrealengine/latest/INT/Engine/Content/Types/StaticMeshes/LightmapUnwrapping/index.html
https://udn.epicgames/Three/Swarm.html

There are plans for a lighting video series as well to go over some of the basics as well. No eta yet for when that will be posted, but keep an eye on the learn tab in the launcher! :slight_smile:

Just to go over some of the other things that you mention:

Long build times: There are a few factors that can cause this. Hardware specs, number of meshes or complications of your scene, number of lights, Lightmap resolutions, calculations of bounce, whether there is a lightmass importance volume in your scene, size of world, and some other contributing factors depending on if settings have been adjusted in the world settings for lightmass.

All of these can affect your light build which makes it very difficult to give a general answer for why light builds take a while. :confused:

I’m working on getting something helpful together though. These questions do come up quite often.

Here’s some more things to talk about: give us general info on building large, open worlds. I take it that the larger the world, the more important it is to lower resolutions on meshes that are small? Like grass, bushes, small rocks for example? I would also like to know how the lightmass volumes work. Simply saying ‘use a lightmass volume’ doesn’t explain a lot. Use it how? How many? Whats the size for each? Keep in mind that A LOT of people want to make big open worlds so you need to tailor your tutorials that way. After reading all your tutorials, I still have no clue how to build effective lighting for an outdoor world. Nobody cares about a small little hut on a 2x2 floor because that isn’t a realistic example. So please change your tutorials to focus on realistic examples such as large open worlds.

Now obviously I might not be understanding the bigger picture, but I’m giving you feedback as someone new to UE4.

EDIT: okay I just read on answerhub (https://answers.unrealengine/questions/133023/handling-huge-terrainbug.html) that you can remove baked lighting entirely which might be the best solution for large open worlds. He says to just use moveable lights only for your scenes. Can you comment here with your suggestions/advice/tips/etc?

Large worlds are typically better using dynamic lighting. Trying to build lighting for very large worlds, even with multiple lightmass importance volumes, is a intense process. You will more than likely run into hardware limitations doing this where the computer will run out of memory. Using build farms will make this process easier to split the tasks.

Epics latest GDC Demo with Kite World, which is a large open world at 100 km squared, is using solely dynamic lighting. No pre-computed lighting at all. Likely you would run into texture streaming issues since all the lightmaps for the objects in the scene would need to be streamed in as well. This would probably cause more of a bottleneck or performance hit than using dynamic lighting.

This document goes over what a Lightmass Importance Volume is and why it’s useful along with all things Lightmass oriented. This was linked above.
https://docs.unrealengine/latest/INT/Engine/Rendering/LightingAndShadows/Lightmass/index.html#lightmassimportancevolume

Take the time to read through the documentation above and you should come away with a clearer understanding of how this works with UE4.

Some things to consider.

  • Large worlds are a very specific thing and not specifically something that covers a lot of lightmass issues. Again, large worlds are typically using dynamic lighting (Skyrim, GTA, Fallout, Assassins Creed), as this is going to be a better solution than thousands of baked lightmap textures streaming.
  • Moderately sized worlds can be OK to use lightmaps on and by using multiple Lightmass Importance Volumes you can focus the photons that are cast (explained in the documentation above) to a specific area rather than the entire level. Not everything needs to have the best looking shadows if the player is not able to access the area. This is the point of the lightmass importance volume.
  • The trouble shooting guide that Eric and I have been working on is geared towards more common trouble topics for basic issues. This is not a guide that was asked for by Epic, but instead something that we put together to help the community since these questions come up often. While we plan to expand this with many more topics we do not plan to do anything beyond educating users in basic lighting issues and tips with clear examples.

Even though you added the edit I still wanted to address some of the concerns you had mentioned before hand.

Using some of the tips and troubleshooting topics that we’ve already addressed in the Wiki Lighting Troubleshooting and Tips guide should help with dynamically lit large worlds.

In time, I would like to do some simple troubleshooting with Distance Fields Shadows as well (some of this is already covered in the DFAO and Ray Traced Distance Field Soft Shadows documentation) along with more general lightmapping and UV things.

Currently the two that I’m more focused on getting examples together for is Lightmass/Swarm Agent Troubleshooting and Modular mesh seams/color variation.

My biggest suggestions out the gate would be:

  • Use LODs for your meshes so that dynamic lighting doesn’t have to calculate complex meshes at distances. It’s a waste of resources.
  • Don’t expect shadows to work for miles for every object. There is a hard limit for how far cascaded shadow maps can stretch. It’s better to use a combination of DFs and CSM in this respect. Keep CSM at a lower distance, 5000 to 10000 range then use DFs or Far CSM for objects that need them at far distances (Far CSM will be in 4.8).

Okay yeah that’s good to know about the kite world being dynamic. If that’s mentioned in the documentation, then that’s my fault obviously for missing that.

For the meshes, I’ve bought assets that don’t come with LOD’s. Obviously they sound very important as you’ve pointed out. Is there a process for creating these LOD’s that I could do once I have the meshes? Like for example let’s say I buy a nature pack and it has 20 trees and rocks but no LOD’s. Is this a fault of the asset creator or something I need to set up manually?

Thanks guys!

As for lighting, let me give you an example on a world I’m setting up: I have a dynamic light as the sun for a day/night cycle and that works well.

I have meshes that give off lights as well however (for night time and stuff) so if the whole map is going to be dynamic, is it best to use a moveable light for these objects? I have been building these lights with a static light which I take it has to be built into the map? If you can clear this up for me then I can make my map fully dynamic and not have to worry about light maps. Shadows are also not a big deal to me either, I’d rather have performance over crazy shadows. I don’t mind PMing you some pics of my world if you want to take a look and have a visual example. I just don’t want them public yet.

Edit: alright well I went ahead and removed all the lightmaps, replaced my static lights with stationary ones that don’t cast shadows (because they’re not really needed for my world) and it looks fine. So thanks for the help and getting me to think in the right direction. I would still like help on the LOD issue but should I make a new thread for that as to not derail?

You can make LOD’s, but it might be a pretty involved task and will require knowledge of Blender/3dsMax/Maya.
I don’t think it’s anyone’s fault, just something to check/look out for in the future (LODs aren’t always required, but almost always people will want LODs).

Just part of the learning process.

In the marketplace submission guidelines there is no information about requirement of LODs. So this is up to the content creator if they choose to offer LODs. Honestly, it’s in their benefit to offer LODs because it makes their assets more efficient with minimal additional work.

There are options for creating LODs. Typically these involve a 3d modeling application though. If you have a access to 3Ds it’s pretty simple and without much headache (IMO). You can see my process for doing this here: https://forums.unrealengine/showthread.php?56777-Photons-Be-Free-Mini-tutorials-and-other-curiosities&p=227697&viewfull=1#post227697

Simplygon offers a plugin for UE4 that can do this (not sure what their plugin cost is). https://www.simplygon/

With a time of day system I would say go fully dynamic, which I see you made the call to do in your edit.

While it’s possible to use a directional movable light for your time of day and then bake in shadows with static or stationary lighting from other light sources it can give improper lighting look with shadows. If you’re world doesn’t need shadows anyway, a directional light that is movable that does not cast shadows is actually more efficient than a static light casting shadows.

Feel free to post a thread discussing your LOD questions if you like. This would make it easier for anyone seeking that type of information if they were to search. :slight_smile: