Landscapes need a rework after years without big changes

Yes, at 100 scale, 1 vertex = 1 pixel = 1 m
if you need better resolution, you need to lower the scale, like 50 or even 25, it will reduce the size of your terrain however.

Also, at 32x32 components, 2x2 sections and 255 quads, the overall resolution of terrain is 16,321.


Anyway, I dont doubt that many people including you, are facing insane memory utilization problem, and landscape tool can certainly use some updates/upgrades.

Hmm my Single textured Landscape and the exact same size as yours (127x127, 2x2, 32x32, 8129x8129, 1024) uses 4GB aswell (with 2 Landscape its 8GB, while PIE it goes over 16GB!). In a clean new project the default Project memory usage is aprox 700mb, after adding a new 8k landscape without anything else it ramps up to about 2GB. I have been trying to recreate the conditions within the new Map (enabling Mesh Distance Fields, equal Lighting etc.) but the landscape memory usage keeps at about 1,3GB, while in the other Project every Landscape adds aprox 4GB.

So I agree, apparently there is something that is tripling the landscapes memory footprint.

PIE memory doubling are expected I would guess, I would assume that it recreates all Assets within the Level and loads it into the Memory, that way you are able to make changes during PIE, which are not represented in the Editor after stoping PIE.

However it would be really good to know what’s actually causing the Landscape memory tripling. 1,3GB per 8k Landscape would be alot more reasonable than 4GB.

As for the work flow, you might want to look into Levelstreaming Level Streaming in Unreal Engine | Unreal Engine 5.2 Documentation - it actually helps a lot for huge Landscapes. If you select Window > Levels you can dynamically disable and enable whatever levels you would like to be loaded into Memory.

And yea, if PIE wouldn’t be that memory intense, that would increase productivity alot (loading in huge files like the landscape take quite a while) - I’m not quite sure how easy this would be to implement though.

Okay… So what I found that if I resize or resample the landscape the memory usage goes up and stays up. It does go up while editing the landscape as well, but usually it comes down to normal after editing is done. I suspect it is a memory leak and utilized memory isn’t free after usage.

I Noticed that aswell, this is not the Memory Triple I experience though. I have restarted the editors plenty of times during my tests and the discrpeancy between one projects landscape and the others remain.

Just if someone want better performance on landscape (especially with tesselation)

Thanks, to edit can be usefull, but for gameplay don’t think disable shadows in an option :confused: In other side I notice the other day the Far shadows take more resources than the normal shadows o_O

Bwt, you still will see backed landscape shadows (with only dynamic lighting). In my project it is sometimes hard to find difference.

Btw, I’ll probably try to adjust engine code to use only far cascade for landscape shadows.

If your directional light does not move you can precompute per landscape component that is it even possible to cast a shadow. Normally over 50% of my landscape components can skip dynamic shadows because those are too flat.



for (ULandscapeComponent* c : l->LandscapeComponents)
{
    FLandscapeComponentDataInterface CDI(c);           
   
    bool canCastShadow = false;
    for (int32 y = 0; y < c->ComponentSizeQuads; y++)
    {
        for (int32 x = 0; x < c->ComponentSizeQuads; x++)
        {
            FVector center = CDI.GetWorldVertex(x, y);
            FVector up = CDI.GetWorldVertex(x, y + 1);
            FVector left = CDI.GetWorldVertex(x + 1, y);
            FVector upLeft = CDI.GetWorldVertex(x + 1, y + 1);
            FVector n0 = FVector::CrossProduct(up - center, center - upLeft);
            FVector n1 = FVector::CrossProduct(upLeft - center, center - left);
            canCastShadow |= FVector::DotProduct(lightDir, n0) < 0.f;
            canCastShadow |= FVector::DotProduct(lightDir, n1) < 0.f;
        }
    }
    c->bCastDynamicShadow = canCastShadow;
}

Reduced shadow depth time twice using such trick - https://github.com/michail-nikolaev/UnrealEngine/commit/dae31d014c8bc829c87bb739fdbdf3bd7b413cfd

Instread of using tessellated landscape LOD for shadow - create invisible one without tessellation only for shadowmap.

Hey I missed to give you the thank you for that, but thanks! I’m using it now :stuck_out_tongue: