Hi there,
I really want to start a discussion about the way lighting is build in unreal. While we indeed have seen impressive examples. It´s very hard to get there. There are cases where lightmass simply is unable to produce clean or correct results. Some lighting behaviours are simply not to achive. For example clean mesh lightning. While all these concerns in theory may or may not be overcome with massive tweaking and faking the last and most problematic issue remains. Speed. Especially the way Network rendering is handled. I will now compare Lightmass as best as I can with Vray without comparing apples with oranges. So please read to the end before you tell me that. I choose Vray simply because that´s the renderer I know best. It should be similar for other modern renders like Octane, Corona and all the others.
-
The render allgorithm.
Lightmass as far as I can tell relies on Photon Mapping as secondary GI and final Gathering as Primary GI. Exactly as Mental Ray does. Basically the reason why no one really uses Mental Ray anymore. More modern renderer like Vray rely on more advanced methods for the secondary GI like Lightcaching wich is a modern way of photon mapping that is way faster much more accurate, less memory intensive and supports also indirect skylight by default. Photon Mapping the traditional style is together with radiosity the oldest and the worst allgorithm to produce indirect lighting. Also as primary GI much better allgorithms exist. Brute Force various path tracing allgorithms for example that produce absolute sharp and crisp shadows compared to Lightmass. Now one might argument that in Unreal we need to calculate a whole scene and not just an image wich is what the modern allgorithms are made for. Well, wrong. I can bake out light and shadow maps in Vray using these methods without a problem. Baking Lightmaps in Vray compared to unreal shouldn´t be to much of a difference. You have an unlit scene, you bake out lightmaps and compose them over your shader. Unreal might need to handle them later in another way or other format but that shouldn´t matter for the way light is casted to these maps in the first place. I will later in this post show some example. -
Some experiments.
Most problems and lightleaks seem to happen in the photon mapping stage of lighting calculations. I switched off final gathering in the config to see how far I can crank up the photon mapping itself. Attached are two pictures. 01_UE4_PM_only.jpg without and 02_UE4_PM_and_FG.jpg with FG. This seems to be the absolute maximum quality I can get out of the photon mapping. The size of the photons seems to be controled by the parameter IndirectIrradiancePhotonDensity wich has no effect anymore above a value of roughly 2000 and by the way crashes my machine in a scene with lots of lights. As you can see in the final gather image (red circle) there is still a lightleak at the wall. This is caused by the photon mapping asthis lightleak is also visible in the photon mapping only picture. The next minor problem are dark streaks at the edges where a wall meets the ceiling for example (blue circles). They get worse as higher the quality is. There seems to be no way around this. This is highest quality I could get for an indirect lighting around a corner after tweaking the config by trial and error for hours. With standard Lightmass setting through the editor it´s even worse as you can see in the other next two pictures I attached. This is result of lighting level scale 0.1 and quality 10. See 03_UE4_PM_only_EditorSettings.jpg and 04_UE4_PM_and_FG_EditorSettings.jpg
I attached another image wich is a lightmap rendered with Vray for comparision. 05_Vray_Lightmap.jpg I´ll talk about the speed later. -
Mesh Lights
I tried using Mesh Lights in UE. I simply couldn´t get to a point where I would even get a half decent lighting quality. Blotches everywhere. The last settings I tried had brutal render times and the result was still miserable.See 06_Mesh Lighting.jpg . Just compare this to the baked Vray Lightmap wich also contains the same mesh light. It´s basically perfect. For simple Mesh Lights I tried the source radius and length parameters. Well those lights work OK if one doesn´t has a more complex shape. Yet they are not perfect. They still somehow behave like a point light. the shadows for example are wrong compared to a real mesh light.
Last but not least the biggest issue. Speed !
Let´s say all of the issues I listed above can be overcome by tweaking and maybe having a better understanding of the config parameters. Or maybe the GI quality in your case is good enough and you don´t want Mesh Lights anyway. The biggest problem for me still is the way Lightmaps are calculated in UE4. One per Process. This makes things extremly slow. The majority of render power is wasted because of this. Most of the Archviz people and probabely most of the game studios have a small or medium size Renderfarm in the office. The utilisation in UE4 is more than worse simply because every map is rendered using one virtual core instead of all computers using bucket rendering to calculate one map at a time, one after the other. You could do exactly this in Vray and you have 100% of available power used all the time. In UE all computers start. Most drop out after a few seconds and in the end you have a handfull of cores that render forever. So let´s talk about times. The UE example I attached wich uses the editor settings only, took 1400sek to finish. On all possible computers, well basically only on one because of the named issuesit took 23 Minutes and the result is still not perfect. I´m not event talking about the atomic blotches with the mesh light. In Vray rendering out a single lightmap at the same size with the same amount of computers took 40 seconds. That´s less than 5 Minutes for all 7 objects in an absolute perfect quality even with Mesh Lights. Not because the Lightmass allgorithms are slow by default simply because the way it renders, only utilizes a fracture of the available power.
In general I see the problems in the old rendering methods that are used and in the way distributed rendering is handled. It´s probabely nothing that can and will change in the near future as it´s not just tweaking a little here and there. It may sound a bit harsh but the only solutions I can image is. Rewrite Lightmass from scratch . Include a third party renderer. The most reasonable and viable solution would be to open the lightmap format so that one can bring in lightmaps rendered in a third party application. Means that a lightmap can be matched to an object, wich is not the case at the moment. And that you can convert an external lightmap to the “non human readable” format that UE4 uses. I mean after all it´s just energy and color placed on a pixel. So this somehow must be possible.
I hope I didn´t offend anyone. But this is biggest problem we are running into when making projects for our customers. Very often we´re just sitting there trying to repair things that lighmass messes up.
cheers