Epic's GPUlightmass

Literally, 5.3.2:


5.4.0 (ue5-main):

You see Strata folder in 5.3.2 and there is no such thing in 5.4.0 - it was replaced with Substrate. So that fix can’t be applied to 5.3.x branch - it fails building, because there are a lot more changes was done to 5.4.0 over 5.3.x.

Some commits are isolated and can be easily backported. But not that one.

hi @motorsep ,
The patch is not needed as its already converted and installed in UE5-main-5.4

5.4

if (SimplifySubstrate && (!Substrate::IsSubstrateEnabled() || CVarPathTracingSubstrateCompileSimplifiedMaterial.GetValueOnAnyThread() == 0))

5.3
			
if (SimplifyStrata && (!Strata::IsStrataEnabled() || CVarPathTracingSubstrateCompileSimplifiedMaterial.GetValueOnAnyThread() == 0))

the above is the relevant lines converted from STRADA 5.3 to Substrate 5.4
Thanks

1 Like

I think we are talking about different things. I am using 5.3.0 and I will not use 5.4.0 even after it’s long been released, because Meta lags behind on updating their fork of UE5.
So I needed to port a change from 5.4 to 5.3. I can’t do that for this specific case.

@Jimbohalo10 is correct. You ALSO need to port the strata/substrate code from 5.4 to 5.3, then it will work.

I had to do that myself when I ported the GPULM fixes from 5.4 to 5.3.

Or, in other words, the commit linked by Matthew Ivey can’t be taken directly as is in this case. You need to rename some of the lines.

2 Likes

Can anyone confirm if Landscapes bake properly in 5.4?

Hi @Ozykz and @motorsep ,
@Ozykz I agree with your analysis I actually did that when making my Luoshuang’s GPU 5.4 binary
Some of my time was spent making a 5.3 STRADA to 5.4 Substrate inside the STRADA directory. My version is 5.4 version is backwards compatible with 5.3 .
I have extracted the relevant STRADA directory
Strata.rar (457.7 KB)

The new ue5-main Substrate is NOT backwards compatible with 5.3
I have extracted the relevant STRADA directory, but to find the rest of code fom LGPU 5.4 you must go to downloaded

Local Repository:\LocalBuilds\Engine\Windows\Engine\Source\Runtime\Renderer\Private\STRADA
Could you share the compilation error logs with us, or me by DM/PM.
I maybe able to see the problem, Thanks

1 Like

That’s what I was talking about and I don’t really feel up for it :frowning: Seems like a lot of porting to do.

OMG, 5.3.0 giving me headaches with lightmaps - GPULM refuses to cast shadows from newly added static meshes (static mesh and BP actor with static mesh inside):


(selected pieces should cast shadows, but they don’t)
Has anyone run into the same issue? What’s the fix ?

I’m running into similar issues but using GPU Luosuangs (although it seems the same using Epics one). In my case, only stationary Directional Light is not baking the shadows, nor respecting the source angle even when static (but working fine with other lights). Is this your case? So, maybe, it’s related with all lightmass systems.

Not sure. All my lights are static.

1 Like

An have you tried with CPUL?

I reported a (maybe) similar bug with Lumen where it stopped projecting shadows when more than ~250 meshes in the scene. But They already addressed and solved it.

Trying it right now. Probably will take half a day to build preview quality lighting in that scene :stuck_out_tongue:

I am still on 5.3.0. What is the version they solved the issue in ?

Oh wow, so this is how lighting should look like in my scene (CPULM):

GPULM is f#cked beyond repair in UE5 :frowning:

Are we not at the point yet where Epic scraps GPULM and hires Unity’s Bakery dev to port Bakery to UE5 ? :sweat_smile:

:joy:

Good to know!

My other thing was in 5.2 and fixed in 5.3, if I remember well. But maybe yes, or maybe not, it could be related to this. Too many broken things in UE5 that could be related or not :smiling_face_with_tear:

So, wow, the more I try different settings for GPULM, the more shadows disappear from the scene. Bizarre phenomenon. I guess I gotta get PC upgraded to use CPULM. I don’t see Epic ever really fixing GPULM.

@Matthew.Ivey You’re on the UE team? If so, you are aware that IES lights work again in 5.4 (github) but… the light pattern isn’t occluded like it used to?
See image; the IES light is below the light fixture (static mesh) but the IES pattern extends above the static mesh. In 5.1, you would get a bright top surface in the fixture but the ceiling wouldn’t get direct light. In 5.4 I have to move the light or change the IES pattern to prevent this.

Ugh, no news is bad news in this regard. Just to keep it altogether, here is my GPULM vs CPULM bake (5.3.0):
GPULM:

CPULM:

And some meshes don’t cast shadows with GPULM (for no good reason). The more bake attempts I make, the more object lose their shadow casting ability.

Hhi @motorsep, I have looked into this, basically CPUL and LGPUL use Swarm. Swarm clears the baking cache, so everything rebuilds every time.

Epic GPU Lightmass is built on DXR which uses .ush (Unreal Shaders a dervative of HLSL). Directx 12 MS examples uses HLSL and the MS driver code clears the Shader Cache for HLSL .

I cannot see anywhere in Epic GPUL the cache being cleared except when you first go into the plugin. This imples you have to close the Epic GPUL plugin and restart the Plugin. Therefore you cannot do multiple builds as the Shader Cache is not cleared.

LGPU In Swarm on the menu bar you can clear cache manually, which messes up bake picture!.

Epic GPUL never tests for Directx 12 Tier 1 needed for Shader 6!, but they bypass all this by just call it anyway.

I found this easy description of the tiers

DXR 1.0 with separated ray generation and hit point shaders is preferred for NV and highly recommended for Intel.

DXR 1.1, meaning the inline tracing feature, where we put a traceRay function in a compute shader and then process the result in the same shader, is often faster for AMD.
But inline tracing prevents any reordering optimizations the HW might do (traversal reordering), or actually does for sure (hit point sorting for coherent shading).

In the description above the use of DXR 1.1 is unclear

This all made very clear to me in the post
Solved : Cant Enable RayTracing in UE5 (gtx 1060) patch

UE_LOG(LogD3D12RHI, Log, TEXT("Ray tracing emulation is now enabled. Use at own risk. D3D12 tier 1.1 check ignored. Tra-La-La!"));
GRHISupportsRayTracing = RHISupportsRayTracing(GMaxRHIShaderPlatform);
GRHISupportsRayTracingShaders = GRHISupportsRayTracing && RHISupportsRayTracingShaders(GMaxRHIShaderPlatform);

This emulation ensures the every NVIDA graphics card works the same.

MSI RTX 3060 needs a manual firmware upgrade to support D3D12 tier 1.1

Nvidia RTX 3060 is automatically tests and asks user permission to upgrade firmware.

This probably applies to other RTX manufacturers as well

So, what you are saying is that I need to disable and re-enable GPULM plugin every time I need to re-bake lighting in my level?! :exploding_head:

Hi @motorsep
Without the hardware its not possible to actually test, but looking at the code when the plugin is initialised from the Build → GPU Lightmass plugin.

All the caches are initialised before the BUILD buttons are enabled

The tests are done to see if BUILD or START BUILD LIGHTING for Bake What You See.

Press Red X to exit each time try turning off View Real time off, may help, again I cannot test this as the code is so complex