We have received many questions about our lighting workflow for archviz in UE4, so we decided to write this article and detail some of our process.
OBS: This tutorial is outdated since in version 4.18 of the engine it was released multi-bounce sky lightning. We should write a new tutorial soon.
Lightmass is the system responsible for calculating indirect lighting within Unreal Engine 4. We blazed through the Lightmass settings and will share what we found.
We have been developing this lighting workflow since I have started with Unreal Engine 4 (more than one year ago). I tried to migrate the same lighting concept’s from my vray’s lighting workflow to UE4, with a simple and intuitive way to lit all kind of scenes. In this article you can see some images of our work and the beautiful quality of lighting achieved in UE4.
It all starts with a Skylight
We will begin with a very simple scene adding a Skylight for general lighting. Why we use a Skylight? This is the most correct method to approach the real-world lighting behavior. When we work with still images renders as Vray or Mental Ray, we are able to simulate more light using hidden lights into the room to let the environment balanced.
Let’s take two examples:
The lighting of an apartment where the user can walk through every room, or a house where the user can walk on the outside and inside area: It is not correct to add extra lighting (bounce card). Also is not recommend changing the intensity of the indirect lighting of the scene (via postprocessvolume or in the lights itself), since the standard already suggests a similar quality to the behavior of indirect lighting in the real world (physically correct).
Therefore, using the skylight to lit the scene, we will have a standard intensity of the natural light (sky light) in all open spaces(doors, windows, etc). If any of your indoors is too dark, we simply use the method from real life … Open your windows, doors and turn on the lights.
In this way, we will have the same correct behavior of the lighting on the outside area, however we need a controller for increasing and decreasing the exposure of each environment (external / internal) – in the same way as in our eyes and more sharply in a photographic camera.
Note: Imagine am indoor space in a sunny day, the human eye gives the possibility to see a balanced image of what is around us and what is outside. However when going out to an external environment, our eye adapts to the amount of light decreasing the lighting entry in our iris in order to be able to see in a balanced way these environments.
A photographic camera also has a similar system, however it can not balance the exposure of the external lighting with the internal. To better understand this topic I recommend this article about Dynamic Range.
To reduce this contrast deficiency and light balance of a conventional camera, an architectural photographer uses techniques such as bounce cards and tends to turn on the artificial lighting available if the environment is too dark. However in cases of well-lit environment with natural light, this is not necessary.
So in an environment that is not adequately illuminated the ideal balance is always with the artificial and natural lighting, it will not be practical to use a PostProcessVolume to balance the exposure for each specific environment.
Since when I started thinking about this workflow, I realized it was never tested and there was not correct parameters to improve the calculation of general indirect lighting. There was only a few parameters available in the Editor and the level of scalability of these configurations (Preview, /Medium, High and Production). But this method was not enough to achieve an acceptable quality for an archviz scene, so the only way out would be to study the BaseLightmass.ini.
Note: We do not use the bounce card method. I do not recommend it because besides increase your render time, it will never be possible to render an internal / external environment with the same quality.
Setting the parameters in Editor. We will work with these values at first.
Static Lighting Level Scale = 1.0
Num Indirect Lighting Bounces = 20
Indirect Lighting Quality = 10
Indirect Lighting Smoothness = 1.1
So we will use the default UE4 configurations: In the first image we have our first test, with the default configurations of UE4, rendered with the light preset “Medium“.
To have a higher definition in the shadows of lighting in general, we will work with the “Static Level Scale”.
Here are some examples of how it looks when we start to reduce this value:
-
Static Lightning Level Scale 1.0
-
Static Lightning Level Scale 0.75
-
Static Lightning Level Scale 0.5
-
Static Lightning Level Scale 0.15
Note that if we set the “Static Lighting Level Scale” to 0.15, spots on the lighting coming of Skylight begin to appear . To fix this, we will open the BaseLightmass.ini and change the value of the parameter “NumHemisphereSample“.
We will change it and test again:
As we can see, this parameter is responsible for eliminating some lighting problems.
We can always work with the following relationship: the lower your “Static Lighting Level Scale” is, you will have to increase the value of “NumHemisphereSamples” to get away any bugs, thus causing a considerable increase in render time.
Finally we have the last image rendered with the value of Static Lighting Level Scale = 0.01 and NumHemisphereSamples = 512.
There isn’t so much visual impact, then we can consider the value between 0.15 to 0.3 ideal for these scenes.
On these scenes I used the “Static Level Lighting Scale” of 0.15 with the lightmap of 1024×1024, 512×512, 256×256.
As we can see, there is little significant loss in the definition of the shadows. In a large-scale scene we will have to abdicate of perfect shades definitions for a render time optimization and also to optimize the project timing.
These small glitches in the shadows will be not so perceptible in a scene in motion and therefore I consider valid we use lightmaps in low resolution in some cases.
I recommend using 1024 (or greater) for lightmaps in walls / floors / ceilings that will receive a lot of shadow details from other objects in the scene.
Setting Artificial lights on Unreal Engine 4
In some situations those parameter could not eliminate all artifacts of lighting, especially in areas where we have little lighting or areas where we will have artificial lights.
For this we have to optimize other parameters. We will begin this scene by adding a few spotlights and point lights. All of them are set as “static” and the lightmap size to 1024.
Starting from the last configuration:
(Editor) Static Lighting Level = 0.15
(BaseLightmass.ini) NumHemisphereSamples = 256
As we can see, several light leaks appeared coming from artificial lighting. This is because we have an insufficient photons towards improving this calculation.
We will then modify the following parameters:
IndirectPhotonSearchDistance = 180 ( This parameter will help us to eliminate the light flickers at the corners of the walls. If the maximum radius is set too high, large parts of the kd-tree will be searched to find the nearest n photons in sparse regions, only to result in a very low radiance and your scene will be too dark on the corners. This is a waste of computation time. If the radius is much too low, you will experience a lot of small lighting leaks and you will have to increase a lot of your IndirectPhotonDensity.
Start with a large maximum radius and keep reducing it and rerender until artifacts become visible. You should set a value “lower enough” for this. It’s a trial-and-error process sometimes.
We can get optimized render time lowering this value, however we will have to greatly increase the two previous values (IndirectPhotonDensity and IndirectIrradiancePhotonDensity) to prevent light leaks.
After many tests I suggest using a value between 180 and 240). This was the best range of values that I have found between quality/rendering time.
NumIrradianceCalculationPhotons = 4096 (Leave it at 4096)
IndirectPhotonDensity = 3000
IndirectIrradiancePhotonDensity = 1500
The flicker of illumination gradually begin to dissolve, however we need to increase these values until they disappear completely:
There are still flickers, we will increase again:
So we will have a good result, free of flickers in lighting. Check the whole process below:
Conclusion
We must begin to test the lighting only with the walls and the main static objects in the scene. The reason for this is the slow calculation of Lightmass. I suggest start testing the scene with the following parameters:
Using “Medium” preset on Editor.
NumIrradianceCalculationPhotons = 4096 (Fixed)
Static Lighting Level = 0.6
NumHemisphereSamples = 64
IndirectPhotonDensity = 3000
IndirectIrradiancePhotonDensity = 1500
IndirectPhotonSearchDistance = 180
It is normal in this part of the process to appear some light/shadows leaks, however what we want here is check the balance of the lighting between the natural lighting (Skylight and Directlight) and artificial lighting (Spotlight and PointLight).
After we have achieved a nice lighting balance, we can move on to the following settings:
Static Lighting Level = 0.4
NumHemisphereSamples = 128
IndirectPhotonDensity = 6000
IndirectIrradiancePhotonDensity = 3000
IndirectPhotonSearchDistance = 180
Finally, we will use the following configuration for the final lighting:
Static Lighting Level = 0.2 (Below that we have not much impact)
NumHemisphereSamples = 256 or 512 (above 512 will have not much difference)
IndirectPhotonDensity = 12000 (If there are still flickers of artificial lighting, increase this value along with the parameter below)
IndirectIrradiancePhotonDensity = 8000
IndirectPhotonSearchDistance = 180 (180 - 240)
With this workflow I was able to eliminate 98% of Lightmass indirect lighting problems. Still, we may experience some lighting problems.
This is still an experimental documentation created by me and UE4Arch company and hopefully in the future there will be other ways to achieve better results and in less time. I hope this helps other Archviz professionals migrating to Unreal Engine 4 and maybe some game creators too.
Visit our Youtube’s Channel to learn more about our work : https://www.youtube.com/channel/UCjpFOf-YWpois6WVG6hqXNQ
In the next part of this article, I will explain how to achieve a good balance beetween natural and artificial lighting, with proper colors and propagation.
Great Guide! Thank you so much!
Excellent tutorial!
Thank you so much.
Thanks for the tutorial! Great job you guys!
we love you rafael
Great! Thanks, Love your work!
perfect tutorial, great job! thank you
Thanks! I needed such a clear tutorial! Would you make a tutorial on reflections (especially screen space reflections)?
A church for us.
Thank very much forma this!
great tutorial.But could you tell me how you managed to light your scene only using skylight.If i add only skylight the scene is very dark.cant see a thing.
dark here 🙁
Same problem here again. Did u find any aswers ?
same problem, 1 skylight get all black
Hello! Can you post your question in our forum? https://ue4arch.wpengine.com/forum/
Regards!
Great! Can’t wait for next part!
Legit ! 😀 . Thank you.
With “NumHemisphereSamples” do you mean “NumHemisphereSamplesScale”? Because I cant find the other value 😉
Besides that…thank you very much for your awesome insights! 🙂
Hi, it is numhemispheresamples! Best regards
Hey if i’m adding only a skylight to the scene it is not illuminating.Should i add any extra light?
The same problem
Mine is illuminating but the interiors are far darker than in the real world (I’m reproducing a real building). Opening or enlarging the existing windows is not an option unfortunately. Is there anything I can do (except boosting the exposure in the post process volume)?
Hello! Can you post your question in our forum? https://ue4arch.wpengine.com/forum/
Regards!
Hello! Can you post your question in our forum? https://ue4arch.wpengine.com/forum/
Regards!
I think that i love you <3 ahahahh
Thanks a lot!!!
Really nice tutoriol!
Thank you so much for this article, Really nice!!!
you are so awesome !
Thx for bringing the UE4 ArchViz Community one step forward.
Awesome tutorial! Besides Koola, you are my mentor! 🙂
Can’t wait for part 2
Cheers
Marcel
Thanks for the guide, is very clear and interesting. The lightning process could be very tricky within Unreal and is great that you guys tell your experiences and tests with us. Very instructive!
Excellent guideline ! very very inspiring .
can’t wait to experiment all these stuff.
please don’t forget part 2 😉
Hello !
did i miss something ?
The skylight alone cant light a room since it’s not a lightning source ? did you let the bp_skysphere up, or the direct light up while using skylight ?
Cant wait to test your parameters.
Cheers !
Hello! Can you post your question in our forum? https://ue4arch.wpengine.com/forum/
Regards!
this guide. omg this guide.
i use test parameters, oh mygod . veryslow.. 3 hours 8%… cpu i7 3770
also slow with test param…cpu i7 4790 and only wall model with LM res 1024
excellent and superb
Hi thanks for the work that was put into this. I read the entire 13 page forum thread that this originated from 🙂 I can’t help but ask why production quality is not used? Was it determined that the impact was negligible?
I would also like to add that there is a little bit of confusion and contradiction in what I have read.
https://ue4arch.wpengine.com/forum/viewtopic.php?f=5&t=8
On here (I would imagine the same person wrote this) there are different figures and it was written after this post. Can this please be clarified?
Hello! So, the tutorial was made for version 4.10 and under of UE4. 4.11 has launched new lightning settings and the workflow is different. Regards!
great info..i manage lighting but few problems like light leaking from edges of models and small black long splotch and floor color bleeding … looking for a detailed premium training. thank you
Good stuff, anything updated for new versions of UE4?
Sure, the Lake House project is updated to 4.13 version. Regards!
Great Tutorials and Its very useful for me, Thank you 🙂
Thry a HDRI Texture in the Skylight 😉
(SLS Specified CubeMap)
DFA, I followed your breadcrumbs here, LOL!
when will the Part 2?
NumHemisphereSamples = 64
IndirectPhotonDensity = 3000
IndirectIrradiancePhotonDensity = 1500
IndirectPhotonSearchDistance = 180
Where i find those parameters in the editor ?
Hello Elon, those settings are outside UE4, on the baselightmass.ini file. But also, this tutorial is a little old and the lightning workflow has changed a lot. Regards!
Hi . im wondering when i change variable in baselightmass.ini its effect immediately or i must restart UE4 ?
Hello! first of all thanks for this! but.. i have some troubles to follow from the behining, you said to start with a skylight, but what it is the light source? maybe i miss something.. and second, once i had my base lighting i cant get indirect shadows from the object, like tables and chair shows their direct shadow from the directional light, but there is no indirect soft shadow, what i am doing wrong? If you can though me some tip it would be great! thank you very much
Hello Daniel, I am Nik (I bought the Riviera House previously). Could you share the actual colour of the sun and skylight (maybe screenshots)? And maybe you have the updated the workflow for lighting?
Hi can i ask after you did changes in BaseLightmass.ini and world setting do you put render quality on preview or you use production ? i asking cause i achieve very decent quality by editing BaseLightmass.ini and world setting and other stuff in preview mode ( and is just take 5 minute to building light ) but when i just put in medium setting its take more than 24 hour !
im wondering different level of light quality just multiplication values in BaseLightmass.ini ?
and could i ask for your final result you just use preview mode or use for production mode ?
thanks .
looking forward to your replay .
Thanks for this great guide, I have a question please ..
Do you advice to put all the meshes ( Structure + furniture) into the scene before starting to test the lighting? or we can set the general atmosphere and the main lighting settings based on the main structure elements then import the furniture and other scene accessories and do some tweeks?
Thanks already
to bad i don’t have the ram for that
I noticed the BaseLightmass.ini has changed a lot when we moved to Unreal 4.17.2, where would these numbers be punched into now, there are multiple entries now for a lot of those values, now it can be found under different areas.
Here:
[DevOptions.PrecomputedDynamicObjectLighting]
bVisualizeVolumeLightSamples=False
bVisualizeVolumeLightInterpolation=False
NumHemisphereSamplesScale=2
Here:
[DevOptions.ImportanceTracing]
bUseCosinePDF=False
bUseStratifiedSampling=True
NumHemisphereSamples=16
here:
[DevOptions.StaticLightingProductionQuality]
NumShadowRaysScale=8
NumPenumbraShadowRaysScale=32
ApproximateHighResTexelsPerMaxTransitionDistanceScale=6
MinDistanceFieldUpsampleFactor=5
NumHemisphereSamplesScale=8
Would just altering the settings under
[DevOptions.StaticLightingProductionQuality]
and choosing it in the Editor work?
Thanks
Mike
I was wondring in now that th elightinh workflow has changed, is it still needed to change the baselightmass.ini ?
Thanks
Wondering the same thing! I don’t believe most of these are needed with 4.18 with multi-bounced skylights.
For these parameters need a quantum computer
From a few days to a week, even on an I7 processor.
Hi, are you still going to write a new tutorial for 4.18? this tutorial helped a lot but it would be great to have it updated?
HI guys , great tutorial but is it still working or Unreal engine has improved
aren’t you gonna update it for us please ???
it is almost 3 years now .
wow although outdated, and yes if you ever get the time to redo this in hand with all the industry experience since then that would be amazing but this is like gold dust. I am very new to unreal engine about two years now and trying to make the real natural lighting environments and this is not always easy, this has been a great help for my understanding so thanks for the share.
really wonderful thanks