# Epic's GPUlightmass

**URL:** <https://forums.unrealengine.com/t/epics-gpulightmass/139357>\
**Category:** Rendering\
**Tags:** unreal-engine\
**Created:** [March 5, 2020, 12:52pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357 "2020-03-05T12:52:56Z")\
**Posts on this page:** 20\
**Page:** 18

<div class="post-metadata">

**Author:** ![Miguel1900](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/miguel1900/32/1010694_2.png) [@Miguel1900](https://forums.unrealengine.com/u/Miguel1900)\
**Post date:** [August 22, 2022, 6:04pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/344 "2022-08-22T18:04:45Z")

</div>

Wow, so fast!

Thanks Yujiang. Scene already sent. Also with this plant area, where there is the another big difference:  
GPULL:

 ![HighresScreenshot00005](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/e/4ae01e0344b3b990c65af56ed6d203d5fb2615e2.jpeg)  
GPULE:  
 ![HighresScreenshot00004](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/b/90b18c3a8e5eaf54b35825df4aaec6c7c8f2fad1.jpeg)

Thank you so much!

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [August 24, 2022, 2:50pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/345 "2022-08-24T14:50:07Z")

</div>

I don’t seem to be able to bake stationary point and spot lights with GPULM in UE 4.27.2. Is it a bug or just not supported ?

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [August 24, 2022, 3:22pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/346 "2022-08-24T15:22:58Z")

</div>

Works for me

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/2/1/e21d4e018bd58d0aaecf106c6834b78a2a07ce19.jpeg)

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [August 24, 2022, 3:57pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/347 "2022-08-24T15:57:39Z")

</div>

I have static directional and skylight in the scene, and stationary spotlights. Perhaps when there is a mix of lights it fails ?

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [August 24, 2022, 4:09pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/348 "2022-08-24T16:09:37Z")

</div>

Still working correctly for me.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/a/e/2ae0040318cb4569bada13238a92a6d111576a11.jpeg)

If you’re using realistic light intensities for the sun then maybe your spot/point lights are just being drowned out by the light from the sun?

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [August 24, 2022, 4:23pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/349 "2022-08-24T16:23:10Z")

</div>

> [@Arkiras](#):
>
> If you’re using realistic light intensities for the sun then maybe your spot/point lights are just being drowned out by the light from the sun?

I definitely don’t use any realistic values. Just what looks good to me. And when I bake with CPULM, it shows as expected.  
Are you sure in your screenshots it’s baked stationary and not real-time stationary ?

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [August 24, 2022, 4:34pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/350 "2022-08-24T16:34:41Z")

</div>

> [@motorsep](#):
>
> baked stationary and not real-time stationary

I don’t know what this means, can you elaborate

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [August 24, 2022, 5:17pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/351 "2022-08-24T17:17:08Z")

</div>

> [@Arkiras](#):
>
> I don’t know what this means, can you elaborate

> **[Lighting the Environment in Unreal Engine | Unreal Engine 5.8 Documentation...](https://dev.epicgames.com/documentation/en-us/unreal-engine/stationary-lights?application_version=4.27)**
>
> Topics that demonstrate features and tools for lighting scenes in Unreal Engine.

> The direct lighting of stationary lights is rendered dynamically using deferred shading. This allows the brightness and color to be changeable at runtime

I guess this answers my question - I am using forward rendering ☹

---

<div class="post-metadata">

**Author:** ![YujiangW](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YujiangW](https://forums.unrealengine.com/u/YujiangW)\
**Post date:** [August 25, 2022, 1:30am UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/352 "2022-08-25T01:30:50Z")

</div>

Your scene revealed some critical issues inside the volumetric lightmap renderer and I decided to expedite the planned rework to the renderer.

 ![ScreenShot00001](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/c/3/6c381ecdaf95da193049b864e9f8b32ee75d74f2.jpeg)

# Volumetric Lightmap Renderer Rework

![Animation](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/b/f/ebf21e9216ebf47aade83c4b5381c82abfeb38d2.gif)

Instead of rendering the entire scene’s volumetric lightmap probes all at once, now the renderer progresses through the probes by batches. **This breaks interactive preview for volumetric lightmaps** , but has much better irradiance locality and saves significant amount of both work and GPU memory. Now it takes only ~1/4 of the original GPU memory to bake volumetric lightmaps. The computation needed for VLM is also cut down by 50% so things should be generally faster. The batches of probes are processed following Z-order curve to further improve locality.

Since the rework breaks interactive preview, now you may see weird things like black strips and seams in VLM while its being baked. They should be gone once the bake finishes.

Also, VLM probe placement has been tightened. The original idea was to place more probes to reduce leaks, but after some careful testing that was not really working as expected, while wasting space. After tightening we should have ~25% fewer probes now.

 ![ScreenShot00002](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/b/71b71fc07ab46a7f9749e97638e2a9c49a956c0d.jpeg)

Reason why your VLM probes were turning dark was that since the probes were rendered all at once, they were poking the entire scene which had absolutely terrible locality and destroyed the content of irradiance cache. And in such cases IC had a bug that would return invalid samples (😳) which made the VLM probes black. During the rework the bug was fixed so we shouldn’t get black samples even if that happens again.

Above changes should be visible on github up to

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [August 25, 2022, 4:07am UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/353 "2022-08-25T04:07:55Z")

</div>

On the topic of the VLM… Is there any hope we’ll be able to use VLM with level streaming in the future, without having to bake all the levels at once? This seems like it’s going to be a really big pain point unless average GPU memory skyrockets in the near future

---

<div class="post-metadata">

**Author:** ![nSpeednSpeed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nSpeednSpeed](https://forums.unrealengine.com/u/nSpeednSpeed)\
**Post date:** [August 25, 2022, 6:24pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/354 "2022-08-25T18:24:41Z")

</div>

Impressive work! I wanted to try it and see if everything’s fixed, but UE isn’t working for me at that commit (some error about module not loading or something, it’ll probably get fixed soon).

With these fixes I think GPULM is capable of replacing CPULM in production, at least for my use cases.

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [August 25, 2022, 7:26pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/355 "2022-08-25T19:26:22Z")

</div>

I second that… Having it with level streaming is essential.

---

<div class="post-metadata">

**Author:** ![YujiangW](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YujiangW](https://forums.unrealengine.com/u/YujiangW)\
**Post date:** [August 29, 2022, 5:10pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/356 "2022-08-29T17:10:08Z")

</div>

So not surprisingly, this discoloration issue is caused by the denoiser. You have a point light right under the lamp which creates high dynamic range on the same object:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/2/a/f2ab411e9bc755042a30cce2c78750d0939d0f06.jpeg)

While I do have some idea to further improve the Intel denoiser, for such cases my best suggestion would be disabling denoising all together (or use Simple Firefly Remover in 5.1) and use a higher GI samples value like 4k. GPULM in 5.1 behaves very close to the OG Luoshuang’s GPULM when IC&FBRG is enabled denoising is disabled:

 ![ScreenShot00017](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/5/0/350825750f5f20291b1e4f6405b99cbee30171b5.jpeg)  
 ![ScreenShot00018](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/b/e/2be9e1b173b5f3c82d8a275e9dd370006dfef6b4.jpeg)

And the mesh actually has a Min Lightmap Res of 256 while the lightmap res in the scene is set to 128:

 ![MinRes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/9/9/1991b07f5ed8dedacb65ca79f9ba4769c3dcf408.png)

![ActRes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/6/2/d62d84ac7c08586adcb1a796c128eda9864035dc.png)

After bumping lightmap res from 128 to 256 the left issues are all fixed:

 ![ScreenShot00019](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/e/6/0e61508c6e494aa2cfd8abb48374c8aa3c60a5d2.jpeg)

Settings used:

 ![Settings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/3/d/33db3b34dcb239c45b02b54daa9fe7422a539572.png)

# Automatic Two Sided Lighting for Two Sided Materials

 ![ScreenShot00016](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/d/f/6df571e331a9f665d182c4443320a495ce50d47b.jpeg)  
 ![ScreenShot00015](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/5/a/85a2e50a05a13aaa5352e5ea3ebb47f1d8c3ccb6.jpeg)

I’ve just submitted another change which should fix the black backfacing leaves. Interestingly this has been an issue since CPULM and I did a fix in Luoshuang’s GPULM but didn’t port it over. Be aware that since our surface lighting representation is inherently single sided (L1 SH but corrected to hemisphere), while it is not pitch black now there can be some directionality loss (less effective normal maps) and brightness issues, but better than before. To get ‘true correct’ results VLM (with high density) is needed which uses full sphere L2 SH, but as you guys have pointed out above, it is not really a practical advice without proper volumetric lightmap streaming support.

---

<div class="post-metadata">

**Author:** ![YujiangW](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YujiangW](https://forums.unrealengine.com/u/YujiangW)\
**Post date:** [August 29, 2022, 6:56pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/357 "2022-08-29T18:56:50Z")

</div>

Another feature update for translucency in 5.1:

# Translucency Compliance in GPULM 5.1

GPULM had limited support for translucency because of perfomance limits. The only translucency model it supports is Thin Translucent. Yet it seems like a lot of people do like CPULM behavior for translucent shadows. Thus in 5.1 GPULM supports translucency as follows.

 ![GPULM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/3/c23bfac8c6484c38204e5e0aa9adaf8cabf1d335.jpeg)

When the shading model is Default Lit and blend mode is translucent, GPULM behaves like CPULM to cast colored shadows (from static lights). Internally this is actually emulated by a Thin Translucent model with parameters Opacity = 0, TransmittanceColor = lerp(1, BaseColor, OriginalOpacity). When the shading model is indeed Thin Translucent, GPULM behaves like the path tracer and uses the parameters the path tracer uses.

 ![ScreenShot00022](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/9/c/59c1fdc86edcaae8415a4dcd47af157dfa45fb24.jpeg)

Note that GPULM does not support any open, single sided geometry. They are treated as invalid and GPULM uses them to remove invalid samples inside geometry (like, around the corners of two walls intersecting). Any single piece geometry should either be marked as two sided or with the front face facing the scene (like, you are baking an interior and the window glasses can be single sided with the front side facing the inside). When the requirement is not met expect certain features especially FBRG to break (grid patterns):

 ![ScreenShot00023](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/a/5/7a58ab09d80967f99ba4e1f82ab10b8badfc2955.jpeg)

---

<div class="post-metadata">

**Author:** ![motorsep](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/motorsep/32/918698_2.png) [@motorsep](https://forums.unrealengine.com/u/motorsep)\
**Post date:** [August 29, 2022, 7:34pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/358 "2022-08-29T19:34:10Z")

</div>

Really impressive stuff!

Do you think we’ll get support for streaming levels for GPULM in 5.1 or not just yet ? @Luoshuang @YujiangW

---

<div class="post-metadata">

**Author:** ![Rawalanche](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rawalanche/32/906578_2.png) [@Rawalanche](https://forums.unrealengine.com/u/Rawalanche)\
**Post date:** [August 30, 2022, 6:27pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/359 "2022-08-30T18:27:28Z")

</div>

Huh, this is surprising. I remember reporting issues with GPULM volumetric lightmap creating invalid samples, causing high contrast probes with burnt black areas on UDN over a year ago. I was told that this was due to GPULM not supporting bent normal skylight illumination. That answer sounded odd to me, but I never disputed it. It’s crazy to believe that bug survived for such a long time, but I am glad it’s on the radar finally.

For me, the GPULM produced both faster and more accurate surface lightmaps, but I’ve almost never ran into a level where the volumetric lightmap result wasn’t broken/corrupted.

---

<div class="post-metadata">

**Author:** ![YujiangW](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YujiangW](https://forums.unrealengine.com/u/YujiangW)\
**Post date:** [August 30, 2022, 7:44pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/360 "2022-08-30T19:44:36Z")

</div>

Well, the fixed bug was actually introduced in 5.1 by the solver refactor, so your problem is unlikely to be the same. That being said, since we don’t have spherical harmonics de-ringing in GPULM, you can indeed have negative values in high contrast lighting conditions. It could be a bug, if you are seeing high contrast probes in one case but not in another (similar) case.

---

<div class="post-metadata">

**Author:** ![Rawalanche](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rawalanche/32/906578_2.png) [@Rawalanche](https://forums.unrealengine.com/u/Rawalanche)\
**Post date:** [August 31, 2022, 7:28am UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/361 "2022-08-31T07:28:48Z")

</div>

Yes, I often see high contrast probes in scenario where the high contrast lighting should not be present. CPULM never has this problem. Anyway, if there are actual negative values, then there should be no question whether it could be a bug or not. Negative lighting value is always a bug. Even if there is no deringing, shouldn’t the probe light values as the very least be bottom clamped to 0? If a sample returns negative value, then obviously something invalid was sampled.

---

<div class="post-metadata">

**Author:** ![Luoshuang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Luoshuang](https://forums.unrealengine.com/u/Luoshuang)\
**Post date:** [August 31, 2022, 6:21pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/362 "2022-08-31T18:21:06Z")

</div>

Well it’s slightly complicated than that - spherical harmonics is a representation that can generate negative values on its own, whenever there’s drastic lighting change over directions. Known as ‘ringing’, this effect actually improves sharpness on the non-negative part of the sphere. CPULM removes the negative values through de-ringing at the cost of blurring lighting overall. That being said, this is to be implemented but I haven’t got there

---

<div class="post-metadata">

**Author:** ![AE\_3DFX](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ae_3dfx/32/1194637_2.png) [@AE\_3DFX](https://forums.unrealengine.com/u/AE_3DFX)\
**Post date:** [September 2, 2022, 5:31pm UTC](https://forums.unrealengine.com/t/epics-gpulightmass/139357/363 "2022-09-02T17:31:53Z")

</div>

Amazing volumetric rework for 5.1, especially reduction of computation time, thanks.

[Previous page](https://forums.unrealengine.com/t/epics-gpulightmass/139357.md?page=17)

[Next page](https://forums.unrealengine.com/t/epics-gpulightmass/139357.md?page=19)
