# Luoshuang's GPULightmass

**URL:** <https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474>\
**Category:** Rendering\
**Tags:** unreal-engine\
**Created:** [April 13, 2018, 5:44am UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474 "2018-04-13T05:44:47Z")\
**Posts on this page:** 20\
**Page:** 66

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [August 20, 2019, 8:00pm UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1351 "2019-08-20T20:00:17Z")

</div>

> [@](#):
>
> Not sure what you mean.
> 
> I replace .h and .cpp file in my UE4 source tree with GPULightmass ones and then build the engine. Then I download GPULightmass binaries for 4.22.3 and copy it over to respective folders in my freshly build engine source tree, replacing existing ones. The only .DLL I don’t copy if the UnrealED one. Then I edit my base lightmass ini file and it’s good to go.
> 
> It’s the only way I can get GPULightmass working when building from source. If I only use cpp and h files, I don’t get any lightmaps building at all.

Not even I am sure of what I mean. lol  
I had this thought: I saw your post, I supposed you managed to get GPULightmass working on 4.23 by building it from the source with GPULightmass source. So I believed that you had the resulting dlls and exes from the build that everybody else just needed to overwrite in the launcher version of 4.23 in order to use GPULightmass’ files compatible with it.

Is that it? Because if its, I guess if you share the same dlls and exes that come in the binary versions of GPULightmass, but built with your 4.23 source, they could be used to replace the launcher version files. Unless you modified 4.23 prior to building, of course.

---

<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 20, 2019, 8:25pm UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1352 "2019-08-20T20:25:19Z")

</div>

> [@](#):
>
> Not even I am sure of what I mean. lol  
> I had this thought: I saw your post, I supposed you managed to get GPULightmass working on 4.23 by building it from the source with GPULightmass source. So I believed that you had the resulting dlls and exes from the build that everybody else just needed to overwrite in the launcher version of 4.23 in order to use GPULightmass’ files compatible with it.
> 
> Is that it? Because if its, I guess if you share the same dlls and exes that come in the binary versions of GPULightmass, but built with your 4.23 source, they could be used to replace the launcher version files. Unless you modified 4.23 prior to building, of course.

Where did you see me saying 4.23 ? I said 4.22.3

---

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [August 20, 2019, 8:57pm UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1353 "2019-08-20T20:57:45Z")

</div>

> [@](#):
>
> Where did you see me saying 4.23 ? I said 4.22.3

It was right after some of comments about 4.23, and I supposed wrongly. xD  
Sorry.

---

<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 20, 2019, 9:18pm UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1354 "2019-08-20T21:18:08Z")

</div>

> [@](#):
>
> It was right after some of comments about 4.23, and I supposed wrongly. xD  
> Sorry.

I’d like to use it with 4.23 :o

---

<div class="post-metadata">

**Author:** ![pax\_invictus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pax\_invictus](https://forums.unrealengine.com/u/pax_invictus)\
**Post date:** [August 21, 2019, 5:05am UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1355 "2019-08-21T05:05:20Z")

</div>

I managed to port GPU Lightmass to 4.23.0-preview-6. Here’s the download for the binary engine integration:

> **[GPU Lightmass Binaries](https://www.dropbox.com/sh/fjr63yeutafmip9/AAA54ghH1gCrd5VFnpYezFena?dl=0)**
>
> Shared with Dropbox

And here’s my UE4 fork with GPU Lightmass cherry-picked from 's code on top of 4.23:  
https://.com/irobot/UnrealEngine/tree/GPU-Lightmass-cherry-pick-4.23.0-preview-6

Hope you guys find it helpful!

---

<div class="post-metadata">

**Author:** ![ihisam72](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ihisam72](https://forums.unrealengine.com/u/ihisam72)\
**Post date:** [August 21, 2019, 9:30am UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1356 "2019-08-21T09:30:32Z")

</div>

for people who need to see difference between cpulightmass and gpulightmass  
watch?v=j\_IQRPOLfGI

---

<div class="post-metadata">

**Author:** ![whooosh](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@whooosh](https://forums.unrealengine.com/u/whooosh)\
**Post date:** [August 21, 2019, 7:48pm UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1357 "2019-08-21T19:48:18Z")

</div>

[quote=“ihisam72, post:1236, topic:109474”]

for people who need to see difference between cpulightmass and gpulightmasshttps://youtube.com/watch?v=j\_IQRPOLfGI[/QUOTE]

Lighting looks completely different, did the directional light change? Great video btw.

---

<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 21, 2019, 8:03pm UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1358 "2019-08-21T20:03:40Z")

</div>

What does GPULightmass NOT support compare to CPULightmass ?

---

<div class="post-metadata">

**Author:** ![pax\_invictus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pax\_invictus](https://forums.unrealengine.com/u/pax_invictus)\
**Post date:** [August 21, 2019, 8:32pm UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1359 "2019-08-21T20:32:32Z")

</div>

> [@](#):
>
> I managed to port GPU Lightmass to 4.23.0-preview-6. Here’s the download for the binary engine integration:  
> [Dropbox - GPU Lightmass Binaries - Simplify your life](https://www.dropbox.com/sh/fjr63yeutafmip9/AAA54ghH1gCrd5VFnpYezFena?dl=0)
> 
> And here’s my UE4 fork with GPU Lightmass cherry-picked from 's code on top of 4.23:  
> https://.com/irobot/UnrealEngine/tree/GPU-Lightmass-cherry-pick-4.23.0-preview-6
> 
> Hope you guys find it helpful!

Updated for UE4.23.0-preview-7. Binaries download link is the same.  
Source branch: https://.com/irobot/UnrealEngine/tree/GPU-Lightmass-cherry-pick-4.23.0-preview-7

---

<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 21, 2019, 8:48pm UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1360 "2019-08-21T20:48:44Z")

</div>

> [@](#):
>
> Updated for UE4.23.0-preview-7. Binaries download link is the same.  
> Source branch: [https://.com/irobot/UnrealEngi…23.0-preview-7](https://.com/irobot/UnrealEngine/tree/GPU-Lightmass-cherry-pick-4.23.0-preview-7)

Great news! Is there any way you can provide a patch so that people can integrate it into their source UE4 builds (for example I am using Oculus fork of UE4 and I could use patch instead of weeding out changes from the entire stock UE4 and implementing them into Oculus fork of UE4) ?

---

<div class="post-metadata">

**Author:** ![enoes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@enoes](https://forums.unrealengine.com/u/enoes)\
**Post date:** [August 21, 2019, 8:50pm UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1361 "2019-08-21T20:50:59Z")

</div>

out of core is support ? i think not support. 4 light support. Ohooo gpulightmass not forwarding.This is not even baby step.

---

<div class="post-metadata">

**Author:** ![pax\_invictus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pax\_invictus](https://forums.unrealengine.com/u/pax_invictus)\
**Post date:** [August 21, 2019, 9:20pm UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1362 "2019-08-21T21:20:23Z")

</div>

> [@](#):
>
> Great news! Is there any way you can provide a patch so that people can integrate it into their source UE4 builds (for example I am using Oculus fork of UE4 and I could use patch instead of weeding out changes from the entire stock UE4 and implementing them into Oculus fork of UE4) ?

If you look at the commit log, you’ll notice that the only difference from the original EpicGames source are the last three commits, which I simply cherry-picked from 's fork (with some merge conflicts resolved, obviously). You could do the same for the OculusVR fork.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_67d56d66](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_67d56d66](https://forums.unrealengine.com/u/anonymous_user_67d56d66)\
**Post date:** [August 23, 2019, 8:55am UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1363 "2019-08-23T08:55:58Z")

</div>

Has anyone encountered this problem? I’m not sure what am I doing wrong. Tried all settings already and the result is still the same. 4.22.3, gtx 1070. Just applied 4.22 version onto mine, then replaces StaticLightingProductionQuality in baselightmass with lines:

NumShadowRaysScale=32  
NumPenumbraShadowRaysScale=64  
ApproximateHighResTexelsPerMaxTransitionDistanceScale=9  
MinDistanceFieldUpsampleFactor=7  
NumHemisphereSamplesScale=100  
NumImportanceSearchPhotonsScale=6  
NumDirectPhotonsScale=32  
; Decrease direct photon search distance so that we will have more accurate shadow transitions. This requires a higher density of direct photons.  
DirectPhotonSearchDistanceScale=.5  
NumIndirectPhotonPathsScale=32  
; Need a lot of indirect photons since we have increased the number of first bounce photons to use for final gathering with NumImportanceSearchPhotonsScale  
NumIndirectPhotonsScale=64  
NumIndirectIrradiancePhotonsScale=32  
; Decreasing the record radius results in more records, which increases quality  
RecordRadiusScaleScale=.45  
InterpolationMaxAngleScale=.75  
IrradianceCacheSmoothFactor=.75  
NumAdaptiveRefinementLevels=3  
AdaptiveBrightnessThresholdScale=.25  
AdaptiveFirstBouncePhotonConeAngleScale=2.5  
AdaptiveSkyVarianceThresholdScale=.5

Sorry if I’m repeating this problem, thanks in advance!

---

<div class="post-metadata">

**Author:** ![leoletsrock](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@leoletsrock](https://forums.unrealengine.com/u/leoletsrock)\
**Post date:** [August 26, 2019, 9:38am UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1364 "2019-08-26T09:38:02Z")

</div>

Hi Guys,

Why is my GPU usage remains 16% when Im using GPU lightmass bake? While CPU is 3X% and higher?

Also my memories usage most of the time remain 75-95%, and when memories drop to 50% the cpu usage will go up to 40-50%, does it mean my PC memories is relatively low that holding the CPU back in the rendering process?

Thanks again for those who script such a powerful GPU baking tool!

Thanks  
Leo

---

<div class="post-metadata">

**Author:** ![GrayAxen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GrayAxen](https://forums.unrealengine.com/u/GrayAxen)\
**Post date:** [August 26, 2019, 10:41am UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1365 "2019-08-26T10:41:29Z")

</div>

> [@SuperLaLBoy](#):
>
> Has anyone encountered this problem? I’m not sure what am I doing wrong. Tried all settings already and the result is still the same. 4.22.3, gtx 1070. Just applied 4.22 version onto mine, then replaces StaticLightingProductionQuality in baselightmass with lines:
> 
> Sorry if I’m repeating this problem, thanks in advance!

If you had read the first page before installing it, you’d have seen:

> [@](#):
>
> Lightmass parameters and quality settings specified in the editor are ignored except for **Num Indirect Lighting Bounces**
> 
> - **Current the number of samples (quality settings) is hardcoded in the program** and you cannot change it since I haven’t found an reliable way to expose them to the user

This extends to a lot of the lightmass settings in baselightmass I believe.

Adjust  
[DevOptions.GPULightmass]  
NumPrimaryGISamples=32  
NumSecondaryGISamples=16

In the bottom of BaseLightmass, which you might have gotten rid of accidentally if you copied it in from a different project/engine version.  
You can use https://.com/sgeraldes/LightmassConfiguration/ to make tweaking that a bit more practical, since you can just hop between quality presets between bakes easily with it.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_67d56d66](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_67d56d66](https://forums.unrealengine.com/u/anonymous_user_67d56d66)\
**Post date:** [August 27, 2019, 10:20am UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1366 "2019-08-27T10:20:11Z")

</div>

> [@](#):
>
> If you had read the first page before installing it, you’d have seen:
> 
> This extends to a lot of the lightmass settings in baselightmass I believe.
> 
> Adjust  
> [DevOptions.GPULightmass]  
> NumPrimaryGISamples=32  
> NumSecondaryGISamples=16
> 
> In the bottom of BaseLightmass, which you might have gotten rid of accidentally if you copied it in from a different project/engine version.  
> You can use https://.com/sgeraldes/LightmassConfiguration/ to make tweaking that a bit more practical, since you can just hop between quality presets between bakes easily with it.

Thanks for the response! But I believe you’re talking about these lines? I’ve had them in the tested results

I’ll try that link, thank you again!

---

<div class="post-metadata">

**Author:** ![GrayAxen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GrayAxen](https://forums.unrealengine.com/u/GrayAxen)\
**Post date:** [August 27, 2019, 3:29pm UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1367 "2019-08-27T15:29:53Z")

</div>

> [@SuperLaLBoy](#):
>
> Thanks for the response! But I believe you’re talking about these lines? I’ve had them in the tested results
> 
> I’ll try that link, thank you again!

Yes, correct. Those pretty much align with a ‘low/medium quality’ preset, there.  
Bumping them up a decent bit, like with the LightmassConfigurator should give more samples and smooth out the final result a lot.  
Bumping it up to 64/16 or 128/32 would give you a high/very high quality setting, pretty much.

---

<div class="post-metadata">

**Author:** ![aka.prime](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@aka.prime](https://forums.unrealengine.com/u/aka.prime)\
**Post date:** [August 28, 2019, 9:16am UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1369 "2019-08-28T09:16:40Z")

</div>

> [@leoletsrock](#):
>
> Hi Guys,
> 
> Why is my GPU usage remains 16% when Im using GPU lightmass bake? While CPU is 3X% and higher?
> 
> Also my memories usage most of the time remain 75-95%, and when memories drop to 50% the cpu usage will go up to 40-50%, does it mean my PC memories is relatively low that holding the CPU back in the rendering process?
> 
> Thanks again for those who script such a powerful GPU baking tool!
> 
> Thanks  
> Leo

Look at CUDA core to see your GPU working.

---

<div class="post-metadata">

**Author:** ![Andres\_H\_RG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Andres\_H\_RG](https://forums.unrealengine.com/u/Andres_H_RG)\
**Post date:** [August 29, 2019, 10:12pm UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1370 "2019-08-29T22:12:21Z")

</div>

> [@](#):
>
> Updated for UE4.23.0-preview-7. Binaries download link is the same.  
> Source branch: https://.com/irobot/UnrealEngine/tree/GPU-Lightmass-cherry-pick-4.23.0-preview-7

Awesome, You rock!

---

<div class="post-metadata">

**Author:** ![leoletsrock](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@leoletsrock](https://forums.unrealengine.com/u/leoletsrock)\
**Post date:** [August 30, 2019, 2:04am UTC](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/1371 "2019-08-30T02:04:16Z")

</div>

> [@aka.prime](#):
>
> Look at CUDA core to see your GPU working.

Tried to bake a scene and the CUDA usage is around 80%.  
Didnt know can check CUDA like that, thanks!

[Previous page](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474.md?page=65)

[Next page](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474.md?page=67)
