Epic's GPUlightmass

Seems like this is occuring during the denoising process.


Hi I would just like to cross reference the post, which describes a repository for
Luoshuang’s GPULightmass UE 5.0.3

Has anyone figured out if the native Epic GPULightmass light build can be run from the command line? Using the regular “-run=resavepackages -buildlighting” method seems to only trigger the CPULightmass build even when GPULightmass has been enabled in the editor.

Confirmed bug in UE5.02: GPU Lightmass ignores IES Profiles on Static Lights while building lighting. Only works if you switch to Stationary. For archviz would be nice if this bug is fixed.
Link to upvote here Unreal Engine Issues and Bug Tracker (UE-156122)

aaaand as you may have seen this is fixed in 5.1

1 Like

Another denoiser update in 5.1:

Discoloration Improvement

I’ve further mitigated the discoloration issue of Intel OpenImageDenoise denoiser by introducing some color mapping tricks to make the denoiser more comfortable with extreme dynamic ranges - the issue is the worst when those ranges appear on the same object (lightmap), so you’ll either want to split the object, or add a black enclosure (if your scene is totally interior).

Simple Firefly Remover

Also, I’ve implemented a simple firefly remover as an alternative to the Intel AI-based denoiser. The most important advantage is that it does (almost) nothing when nothing needs to be done. Sounds stupid but thats where typical AI-based denoisers usually fail at.

4 Likes

Another feature update report for 5.1:

Support for SkyAtmosphere

Proper Support for Stationary Skylights

Stationary skylights had always been treated as static lights by GPULM, and now we should have proper support for them: shadows for direct lighting are baked (in the form of bent normals), and indirect lighting is baked into lightmaps. Direct lighting is applied at runtime by the engine, like other stationary lights.
Note that after lightmap encoding you might see banding issues in skylight shadows like the following image. This is because the engine uses 256 levels for each channel of the bent normal vector, not a GPULM problem. The 256 levels encoding works relatively well when the lighting variation spreads across directions (so that each of the RGB channel takes part of it), but can be bad when the directions are highly concentrated.

Volumetric Shadows for Stationary Lights

GPULM now supports generating static shadow depth maps which are used to generate shadows in volumetric fog for stationary lights. Note that ‘Cast Volumetric Shadow’ is disabled for local lights by default in the engine so you need to enable that if you want to see the difference. Also, interactive bake preview for this feature is not quite working and you may need to touch the light to force the shadows to refresh.

Aggressive Leak Prevention for Irradiance Caching

For those who are really concerned about the 1-texel leaks around geometry intersections, this feature can suppress them at the cost of slower bakes and potentially more fireflies (thus the denoiser/firefly remover is recommended when using it). Located in the ‘Advanced’ settings in irradiance caching.

image



6 Likes

Hint for reducing num of files being compiled when testing UE5 source builds:
Nowadays with more and more plugins added to the engine it can easily trigger 6500+ compile actions if you right click the UE5 project in the solution and build. A Big reason for that is the UE5 project is used for creating launcher binary builds and thus it must compile every single plugin regardless of it is enabled or not. There are two ways to reduce files being compiled to around 2500:

  • Create an empty UE5 C++ project and compile there

  • Change bBuildAllModules to false in Engine\Source\UnrealEditor.Target.cs. With this change only the engine modules will be compiled. Later, if the engine prompts you that some modules are missing (due to the plugins enabled in your specific project), you can use the following commandline to build and add them to the engine:

PathToYourEngineInstallation\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.exe -project=PathToYourProject\YourProject.uproject UnrealEditor Win64 Development
2 Likes

Really good changes! I think it might now check almost all boxes as a replacement of CPU Lightmass in my case.

Does GPULM still use maximum volumetric sample density everywhere? Instead of concentrating samples around geometry and discarding elsewhere (and respecting max memory I think) the way CPULM does? That was one of the remaining limitations I had with GPULM (it matters quite a bit when you crank up the density).

It should be adaptive - if not there is probably a bug and we can take a look at your scene.

OK, I’ll check later. I haven’t tested GPULM for a while so it’s probably that. Thanks.

@YujiangW

So I tested latest ue5-main and had some issues

Landscapes seem to crash GPU lightmass. I get

Assertion failed: Resource [File:E:\Unreal\5_0\Engine\Source\Runtime\RenderCore\Private\ShaderParameterStruct.cpp] [Line: 590] 
Null resource entry in uniform buffer parameters: FLandscapeUniformShaderParameters.Resources[2], ResourceType 0x5.

if there is a landscape present. I deleted the landscape to continue testing.

Volumetric ligthmap building seem to be buggy, most times all the probes end up being pitch black (therefore there is no fog and anything that uses it will be black).

One time it built correctly, so it seems to be semi random, and also while building it seems like it starts building OK (because you can see the fog “building up”) but at some point it turns black. I tested on a few maps and it happens in all of them. However if I try it on a test level I created to try to reproduce it, it works fine, so I guess it needs to be “big enough” to happen.

The statationary directional light fog works correctly however (even if all the lightmap samples end up black).

My setup in all these cases is Stationary directional light + static skylight + mix of static and stationary lights + volumetric fog.

All these maps work fine with CPU lightmass.

This is not always an issue. This happens with CPU lightmass as well with stationary lights because the direct lighting is not baked into the VLM, if the indirect lighting is not intense enough they will appear as black in the debug view.

You really need to test it by adding moveable objects to the scene, not by relying solely on the debug view.

@nSpeednSpeed
Actually this is indeed a bug :flushed: and I just submitted a fix which should be visible on github later today, along with a fix to the landscape crash.

2 Likes

@YujiangW

Ok so compiled and tested at commit 19ae9b947b25b474c1ce8c5ab040fa39ace4e785

The landscape crash is fixed

The volumetric lightmap still has issues though.

It seems to be improved, first bake (at 200 density) seemed to by fairly good. Then, I did two bakes at 50 density (what I need to get decent quality in interiors) and both had a lot of black samples (but better than before your fix)

I have screenshots of 4.27 with CPU Ligthmass (with settings fairly cranked up), ue5-main GPU Lightmass with default settings except density at 50, and path traced. I added a movable sphere. You can tell which is which by the UI.

(Ignore the seam on the left wall, I was testing something there)

Also the adaptive density in GPULM seems to be much less aggressive than CPULM. Here you can see the how the density decreases in both.

I think in CPULM it drops density at 150cm from the mesh, while GPULM drops at 300cm from the mesh. It would be nice to have a setting to configure these, because GPULM is overkill in my case with the density

This one is much trickier to debug - possible to send me a repro?

I could send you a copy of the map I guess, I can’t really reproduce it on a small test map. It seems to be related to relatively long builds because you can see the samples start building fine and then they turn dark.

Where should I send it?

You can put it into an upload service like dropbox/Google Drive/OneDrive and send me the link.

@Luoshuang @YujiangW

Sent you a DM to @Luoshuang with the map

Quite happy to see your improvements and updates @YujiangW ! It can almost replace your unofficial GPUL :slight_smile:

I have still not tried the v5.1 (I can’t wait!) but, maybe, this error will be still present there: trying with a little scene I have, I get great results with your GPULE (E = Epic) and with your old GPULL (L = Luoshuang’s), but with GPULL seemed to be less noise/artifacts in certain points, like this one:
GPULL:


GPULE:

Sorry, I can’t show the full scene because it’s of a course I’m teaching at, but I could send you the empty scene, just with the lamp and the empty room, if you need it (in that case, the lamp is cleaner, like not being contaminated with all those furniture colors, but still quite worse than the same result with GPULL):
GPULE (with all settings at 8192! O.o):

Thank you for your hard work!