Q & A Session With DanielW
Here’s the Q & A Session With DanielW
@Nicolas3D : What I have observed is, if we are using other lights along with Skylight we don’t need the high Photon Density(Direct as well as Indirect).
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 the Photon Density, increases the build time by the factor of amount of increase from default value(400).
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.
@DanielW: Are portals going to be included in a release soon?
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.
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.
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.
…or ability to choose number of cores, so one can surf/whatever while lightmass is calculating… just a thought…
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.
Fantastic results from the portal lights.
Portal light is a bit of a misnomer, they’re not lights as they do not emit light. ‘Light portal’ makes sense though.
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 ?Make sure you are on Epic scalability settings.
Texture streaming poolsize settings come from Engine/Config/DefaultScalability.ini
[TextureQuality@3]
r.Streaming.PoolSize=1000You 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
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 emissionThese changes will be in 4.11 which will probably be in about 4 months.
So to wrap up Raghu’s original post
- How to remove the splotches in the area where there is no skylight hitting directly (Areas far from windows). As you can see in the above images there are so many splotches in gallery, despite having Indirect Lighting quality to = 10 and static Lighting Level scale = .1
- Shadows become somewhat messy after a certain distance. How to make area shadows more clear and smooth.
This is addressed by A) + B)
- Whenever we put spotlights to remove dark areas, it almost always gives the annoying problem of light leaks. Clearly evident in the above images.
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.
Is there a workaround for point C) at the moment?
If possible kindly provide us the solution to the - “Light leaks due to spot/point/direct lights in static mode” as I can safely assume that you have already figured it out.
The light leaks that occur with a stationary spot light come from application of the .1 StaticLightingLevelScale to photon settings. In particular, a ton more photons are emitted at StaticLightingLevelScale .1 and the search distance is decreased. This is supposed to increase the quality of the photon representation, but for some reason (I have not been able to determine) it results in a huge amount of variance / noise / splotchiness. This causes the phantom lights ‘light leaks’ in your images.
I simply disabled application of StaticLightingLevelScale to the photon settings in code. You can probably achieve the same workaround by increasing IndirectPhotonSearchDistance by 10x if you use StaticLightingLevelScale .1, effectively canceling out the scale. I have not tested this myself though.
@ DanielW - As now I am trying to learn Lightmass and Photon mapping deeply, It’s kind of a mystery to me, what these settings change (in BaseLightmass.ini or may be in some other config files) when we manipulate them in editor -
Static Lighting Level scale from 1 to .1
Indirect Lighting quality from 1 to 10
Indirect Lighting Smoothness from 1 to .25
StaticLightingLevelScale - this scales the density of every computation lightmass makes. It has two big noticeable impacts - for final gathering (which computes first bounce GI from lights + sky light direct) it increases the density of light gathers. It won’t actually increase the quality of light gathers, just how far apart they are on a surface. This improves contact shadows but explodes your build time. It also increases the density of photons emitted, this is what I disabled in my latest change to work around the phantom lights.
IndirectLightingQuality - this mostly increases the number of rays traced at each final gather, also known as NumHemisphereSamples in the ini. A value of 10 means 10x more rays and therefore 10x longer build time. You can think of more rays as a higher resolution image being resolved, so it improves the quality of light gathers.
IndirectLightingSmoothness - we filter between light gathers a bit to hide the last little bit of noise. The default amount of smoothing is quite high, so it can be useful to lower this to get more detailed shadows. Note that smaller values for StaticLightingLevelScale also decrease smoothness, so with a StaticLightingLevelScale of .1 you probably don’t need to reduce smoothing anymore. IndirectLightingSmoothness doesn’t affect build time.