Lets make Lightmass EPIC (and understandable)

great test !!

thanks all

Just a quick question: Where can I see how long my build time is? Are you guys sitting next to your computer for 4 hours or is there a timestamp somewhere? Thank you!

In the Output Log. (window->dev tools->output log)

Open up Swarm Agent. Go to “Log” tab. You will get all details.

Just weighing in on this badboy (awesome thread, gutted I didn’t find it sooner).

One major improvement I’d like to see to lightmass is an improvement to the map processing. Currently it’s not possible to divide a single texture up across multiple threads, so build times are always capped at the largest lightmap resolution you have in the scene (usually anyway), and only one thread can do that work while the rest are doing nothing. Something similar to xNormals method where lightmaps are processed one-by-one and split accross all the threads might make lightmass significantly faster. I would have a pop at it myself if I had the first clue where to start, but this is probably one for the rendering team anyway.

…or ability to choose number of cores, so one can surf/whatever while lightmass is calculating… just a thought… :wink:

Fantastic results from the portal lights.

I see the suggestion here is to use uncompressed lightmaps. Doing that I also found the quality higher, esp. when larger surfaces considered. But using a lof of 512/1024px maps, this seem to facilitate higher memory usage and thus lightmaps mip-mapping.
Which shouldn’t be a problem with 12gb vram of Titan-X, but I couldn’t stop this process by changing all .ini files I found on internet. No matter if I set shadow/lightmap mip-maping to 0/false, or rised value for memory pools, both in project and general folders, etc… it would always mip-map those lightmaps,
which is just visually horrible. Anyone with similar issue got this solved ?

I did my best in post #8, I don’t have a better explanation than that =) I know ideal would be images and comparisons to explain each one but I don’t have time for that.

Skylights shouldn’t interfere with other light’s indirect lighting. So if you need to jack up photon density for some reason, introducing a skylight will not change that.

Increasing photon density will only increase the photon emission part of the build by that factor. Photon emitting is usually 15% of a build, so you can raise it quite a bit before doubling your build time. Look at the stages in the swarm visualizer or the swarm log stats once a build completes. In contrast, NumHemisphereSamples and StaticLightingLevelScale are probably the quickest way to increase your build time.

Well they still only exist on my computer so… Realistically it will be 4 months before any code change I make today will make it into a released build. Of course you can build latest directly from github (once it’s checked in), but that tends to be very unstable.

That was true in UE3 lightmass, but it’s been improved in UE4 lightmass. Specifically, the final gather is split into tasks of 128^2 and distributed to any threads that are idle. The largest lightmap component will still be the bottleneck, but your CPU is better utilized during it. This makes the biggest difference in small scenes where you are going for high quality, so there aren’t enough components to keep all threads busy. This is done in FStaticLightingSystem::CalculateIndirectLightingTextureMapping in code.

Now, there are still other parts of lightmass work for a simple component’s lightmap that could be multithreaded better - specifically area shadows.

This can be set in Swarm agent settings. You can bring up the swarm agent by starting a lighting build once (in a tiny map, or just cancel it), then find the icon hidden in your taskbar and double click it.

Portal light is a bit of a misnomer, they’re not lights as they do not emit light. ‘Light portal’ makes sense though.

Make sure you are on Epic scalability settings.

Texture streaming poolsize settings come from Engine/Config/DefaultScalability.ini

[TextureQuality@3]
r.Streaming.PoolSize=1000

You can also disable lightmap streaming in your project’s DefaultEngine.ini. You have to rebuild lighting and resave after changing this. Here’s the default (from Engine/Config/BaseEngine.ini)

[TextureStreaming]
AllowStreamingLightmaps=True

Why Ue4 not use bc6h for lightmaps? Quality should increase significantly.

Like suggested, increase your memory streaming pool. I had the same problem on my gtx 980 4gb. I increased it to 4000 like that : r.streaming.poolsize 4000 (no more mip mapping like crazy)
Never had a problem after that and I usually have 4k textures and 2k lightmaps sometimes!

Really really happy I managed to finish this scene in 59 mins (lighting build time)! I have shadows everywhere :slight_smile: The only settings I adjusted was the lighting level scale.
I took an evermotion model and optimized it for Unreal. I managed that lighting/shadow quality in 59 mins because of this thread and community. You guys rock!

Every tile has geometry, walls also have extruded parts, so it wasn’t THAT easy to remove all lightmaps artifacts.


Looks great Phil. However, I found that it’s a bit odd that using smaller value for Static Lighting Level Scale can make the rendering more faster (as long as the other value in Lightmass kept to default, except Indirect Lighting Bounce). Especially because the tooltip says that using smaller values (less than 1) will increase build time greatly. I also found that using 0.4 gives better shadows and faster rendering time than value of 1.

Yes it will increase the build time but compared to the other settings, it’s really not that bad. I left indirect lighting quality to 1, bounces to 10, smoothness to 1 and it’s the defaut baselightmass.ini. I really only used a scale of .4, uncompressed lightmaps. :slight_smile: My previous version took 16 hours and looked worse with the other settings cranked up. This scene lighting is simple tho, just a skylight with Epic’s HRDI.

Also, by leaving the rest of the settings to default, I was able to raise the resolution of my lightmaps to 1024 to clear all artifacts, something impossible in my previous attempt that took 16 hours with 256x256 lightmaps :-S

@: is this Production lighting or less? If you’re able to achieve this lighting in 1 hours at Production level you won the competition :smiley:

This is production lighting yes.

But it’s a big outdoor (mostly) scene, no furniture and small objects that would need huge amount of detailed shadows!!!

Ok, now I’m curious to see the test using an interior scene…like the one uploaded by :wink:

Could you also post your system specs? just for comparison :slight_smile:

My 2 pc were used to build the scene. Main is core i7 4970k+16gbram+gtx980, second pc is core i7 2600k+8gb ram+gtx 760ti

I will take an old interior/exterior scene I’ve made that took 10 hours to build and try to see how I can reduce the time while achieve similar quality. stay tuned.

I have now checked in my Lightmass solver quality improvements:
A) Adds light portals - these solve static skylight quality in highly enclosed areas like the example
B) Fixed high IndirectLightingQuality settings disabling adaptive sampling - this improves static skylight quality
C) Fixed light leaks when using spotlights with StaticLightingLevelScale .1 - StaticLightingLevelScale is no longer applied to photon emission

These changes will be in 4.11 which will probably be in about 4 months.

So to wrap up 's original post

This is addressed by A) + B)

This is addressed by C)

Sadly that’s all the time I can spend on Lightmass atm, otherwise I would like to investigate some more complex scenes.