Luoshuang's GPULightmass

i dont know when we can get rid of this lightmap creation in ue4 :mad::mad::mad:
its old Technic and take our time

i hope baking in dxr dont depend on lightmaps !!!


Does somebody know what is cooking with the light baking ? @Luoshuang is quite quite now - i suppose very busy now.
No news where the light bake process i going to and how RTX will be used for baking in near future. :frowning:

One more thing @3Seventh : look at your normals direction! UE4 uses one-sided faces and its opposite normal is completely transparent for engine ( if you do not use two-sided material - but two-sided is not recommended for current GPU light bake ).
It is not important for path-tracers but here in Real-Time it is.

Not possible RTX to bake light AFAIK. It’s a pathtracer, only RT. On the other hand, GPU light solver (like Loushuang’s one) is the best approach so far. Some wishlist though:

*Working with stationary lights (Raytraced)
*Denoising lighmaps (OptiX anyone…?)

As I know nVidia used RTX to bake lights in their test scenes ( early scenes B&W with that UE4 characters before the Star Wars demo). You just have to project GI on the light maps… somehow.
Here is the video:

Hmmmmm… Interesting…

Hmmm not sure. It says Lightmas Baking Preview, so I think it means that, as previously, “preview” was calculated with real-time movable shadows, but this time, movable lights and shadows are RayTraced, so the baking preview is much more similar to the final result when light will be already baked. So I think it’s not possible to bake RayTraced shadows, but I wish! Probably it will be a little different than doing that literally, but for sure they will release a method to bake shadows and lights calculated with “rays”, using a similar and really fast method as Ray tracing is.

@Miguel1900 I think that you may be wrong. Cause when nVidia compares sth then shows something On and OFF ( even in that video compares SSR vs RTX). If you see carefully then you will able to see all LightMaps mistakes that were made by author of this scene in UVW. As we see it takes some time to complete and this looks like caused by progress of light bounces.

I hope that I understand it well:


Beautiful tone and mix of colors! The irregularity on the shapes are very natural also.

I finally wanted to give it a try because many of your results are gorgeous.
Unfortunately, I struggle with weird outputs. Light is rather poor quality with some uneven spots.
I used only one light source - HDRI map.
My settings were set to production and to the “Insane Quality” into LightmassConfiguration.bat.
For this simple, tiny scene baking time took over 1h on GTX 1070.

Hi, Mr.Roman) Glad to see you here too!
Can you please share some wisdom, how you fill the room with light? What is your workflow?
What settings you use for postprocess and sun,sky intensity? Indirect lighting?
As for me I get room with dark shadows, so I raise Indirect lighting in postprocess and in light sources to 2 or more.

If I have Lightmap resolutions squared multiplied by 32-bits (8-bit RGBA) totalling 2.6GB, how do I estimate how much sys-mem and gpu-mem will be required to GPULightmass bake? (I only have a GTX-1080 which only has 8GB gpu-mem, and it ran out of memory about 75% progress). I read somewhere that Luoshuang said that estimating it required consideration for tri’s as well. I have only 179,002 tri’s in the scene. I suspect its more of a function of the tri’s on the mesh and the mesh’s lightmap res. Any formula or detailed guidelines?

Some corrections:

  • Disable Ambient Occlusion and Auto Exposure in your Project Settings.
  • Add a Post Processing Volume and increase Exposure and Global Illumination.
  • Disable “Compress Lightmaps” in World Settings, this will increase your build size but you´ll see better quality in lightmaps.
  • Also check if add a “Lightmass importance Volume” and Portals in every openning or windows.

First project “finished” using Luoshuang GPU Lightmass.
Impressive results in few hours.
GTX 1080 Ti / i7 7820 / 64 Gb RAM
All used models are High poly detail.
Project size (win 64 compiled): 2.3 Gb
Bake time: 4 h 20 min aprox
First I tried disabling “Compress Lightmaps” but I get some errors while compiling, after enabling again this function everything works as expected but I can see some artifacts in lightmaps.

Does GPU lightmass work with portals? Any quality improve with portals?
As for me, in regular CPU lightmass - portals give only more bake time, with no significant quality improvements.

Anyone know how to decide which GPU the “GPU Lightmass” is using during the baking process?
If yes, is there any possibility to decide which one will be dedicate for the baking purpose?

Thanks so much in advance.

Fantastic job on this @Luoshuang I’ve just installed it and am taking a look at the GPU baker in a simple test scene with a Skylight and a directional light in 4.22

I’m getting some noise from the skylight that I can’t remove completely by cranking up the Lightmass, lightmap resolution and setting the lightbake quality to Production. Are there any settings that can be changed for the GPU baker as well? Or is this a by product of the GPU rendering? No grain/splotchiness when used with directional lights. See attached pics for more info.

Many thanks,


Hi everyone;
I did everything exactly same what i did at 4.19 to build scene with GPU but at 4.22 it build scene with CPU instead of GPU :(( I did not understand where the trick is that i forgot to make…
How can i swap my build unit from CPU to GPU ?