Getting an error when building lighting.

Okay so i have never had this error before when building lighting and would love to understand what is going wrong!

If you need any specs. CPU: Intel i5-3570K @3.40GHz. RAM: 16GB. GPU: Nvidia GeForce GTX 660 Ti

Hi ,

The error message being thrown is that you ran out of memory.

Try reducing the size of the lightmap resolution for your instanced foliage. Anything over 4-8 is probably too high.

I reduced it down to 4(was at 8) and i still get the error

Depending on the size of the scene, number of meshes, Lightmap resolution, or whether you’re using a lightmass importance volume (does not work well for large areas).

Lightmass requires some heavy resources to calculate and build lighting. If it’s running out of memory the two alternatives are to increase your RAM or increase virtual memory cache since this is being written to when your computer runs out of RAM. This process will greatly increase build times, but may be a way to work around running out of memory.

I have a total of 30915 meshes in the scene, lightmap resolution is at 4. I am using a lightmass importance volume, I got rid of that and still got the error. How would i go about increasing the virtual memory cache? If all else fails i will get more RAM.

With 30,915 instances I’d imagine you’ve got a large world, right?

If that’s the case it’d probably be a better situation to use dynamic lighting with cascaded shadow maps, and maybe even some distance fields meshes for far shadows and ambient occlusion.

In the release notes for 4.6 static lighting for foliage was introduced along with this statement:

Even using a smaller lightmap resolution with scenes that are large will take up a lot of memory.

If you’ve seen Epic’s GDC Kite World scene you’ll notice that this is using dynamic lighting with cascaded shadow maps and distance fields AO and shadows.

Some of this is explained in the Distance field documentation showing examples from this Kite World demo:

DF Ambient Occlusion: Distance Field Ambient Occlusion in Unreal Engine | Unreal Engine 5.3 Documentation

DF Soft Shadows: Distance Field Soft Shadows in Unreal Engine | Unreal Engine 5.3 Documentation