Landscape Paint Problem (With Own Auto Material!

Please i need help! There is something wrong with my material (own auto material) I have my auto material layer but also hooked up the snow/Cliff/grass to a own paint layer so you can add more snow or cliff in some spots if you want, but when painting the “Layer 1” for example which uses forest materials, the landscape doesnt show the material in those spots anymore. When reapplying the material it showes up for a short moment, then goes back to default landscape look! Texture Object are set to shared: Wrap!!! Reopening the project doesnt help (also shows up for a quick moment then disapieres again)! Also Note that this Problem only happend when painting the layers that are NOT used for creating the Auto material! So when painting Cliff/Snow this issue doesnt happen! Any idea what this is the unreal docs couldnt help!

Landscape layer painting is a little wacky for sure, a lot of it has to do with how the final blending landscape textures are generated for use in-game. What I tend to do is VERY FIRST paint my base layer (Your forest tex for instance) over all the landscape sections (doesnt need to cover the whole section, just need to ‘register’ the blend layer with the section), then paint the other layers on top.

One thing I do to help visualize is creating a material just for painting that uses base colors (RGBYP…) for each layer and switch to that to see what is going on for each landscape section.

This describes the issues and solution somewhat:

I think you dont understand the problem! Maybe my Information wasnt enough! So basicly i have my Auto Material! The Auto Material is made out of diffrent layer! There is the “Auto Material” Layer which is made out of Cliff/Grass/Snow and Shore Material (I also have hooked up Grass/Snow/Shore/Cliff as a sperate Layer to paint in some spots where i dont want the snow to be for example) So right now we have the following layer: “Cliff Layer”, “Grass Layer”, “Shore Layer”, “Snow Layer”, “Auto Material Layer (made out of the just named layers)”!!! I can also paint all these layer without any problem!!! Now here comes the problem: I also have 3 Aditional Layer named “Layer1/2/3”. I want to use these layer to draw a path trough my forest for example or paint the ground under the forest! The Problem is when i try painting any of these aditional layer it shows up for a quick moment, then Shaders are getting compiled and after that the landscape square in this spot loses the material! I would like to upload a video but since i am a new user i cant!

You might be maxing out the texture sampler using a lot of layers with multiple texture samplers each per landscape component. I think limit for PC is 16 samples, on Android it’s 3 samples.

If your material uses 3 textures per layer that’s AT LEAST 3 samplers used for each painted layer, plus your auto material layers. Adds up quick.

To fix this, pack your texture channels as tight as possible to reduce texture samples. Make sure to reuse sample data and not mistakenly resample.

This is also a performance consideration as texture sampling is one of the more expensive operations on the GPU

1 Like

This usually happens because the painted layer is not properly initialized on each landscape component.

Before painting details, first fill the entire landscape with your base layer using the Fill Layer option. That registers the weight map for every component. If you skip this, Unreal can drop the layer and revert to default.

Also make sure every paint layer in your material uses the same Landscape Layer Blend setup and that each layer has a Layer Info asset created and assigned. Missing Layer Info will cause exactly this flicker and reset behavior.

1 Like

Thats exactly what i have done! I have filled the Landscape with my “Auto Material” Layer and also created a Layer Info for ever Layer Set to: “Weight Blended Layer (Legacy)”! In the Landscape Layer Blend node every is set to “LB_WeightBlended”! And this problem still comes up! Is there any chance we can get into a call on Discord? I would like to post a short Video here but i cant since i am a new user! Are you maybe in the Unreal Engine Community Discord server where we could meet??? Thank for the help anyways!

I am being honest, this COULD be the problem because the way my material works is that each layer is made out of 3 materials (each material is made out of 3 Textures which are Base Color, Normal and ORD) so that makes 9 Texture Object per Layer! But then whey can i paint the Grass, Snow, Cliff, Shore without any problems? All the layers are setup in the same way! That does not make any sense for me. Also i tired to switch the Cliff with the Layer1 and i couldnt paint the Cliff Anymore. So it has to do something with the fact that layer 1,2 and 3 are not connected to the Auto Material in any kind of way!

In the background unreal is compiling the landscape materials down for each landscape component . You can add/paint the layer but it may not build the way you expect. You want to limit the number of layers you paint per landscape component to as few as possible to limit the complexity of the final material.

The link I added above goes over the artifacts of this system and how they handle the number of materials in fortnite.

I also would pack RGBRough in one image and NormalRed,NormalGreen,O,D in a second and derive NormalBlue in the material if you need all the channels. Otherwise drop your O or D and do normal+O/D. That would reduce tex samples by 33% right there.

If you search the forums you’ll quickly find that “auto materials" are a waste of time, resources and performance.

Do everything you need out of the engine and import the paint map as the paint layer if you really must use the landscape system at all.

You’ll have a way easier time and way better results.

You can also pipe your automaterial to a runtime virtual texture and export what it build as a .png.

As far as your sampler limits, make sure they are set to shared:wrap to reuse resources as you can, this can decrease your overhead with regards to sampler-limits. To sidestep sampler limits entirely you can use UDIMs (which come with some limitations) or a texture-collection.

These take the typical UV XY coordinate and add a 3rd coordinate (XYZ) for which the Z is the item in the UDIM/collection you want to use. So instead of a sampler per texture, you get a single sampler where you can specify X out of Y items to use in a given area. It turns a single texture sample into sample-picks-a-page-out-of-this-book.

This might mean you need to re-math some of your logic, how you track alpha’s etc but you can now use singular samplers vs a set per layer.

1 Like

That’s kinda ingenuous actually - especially if you can’t be bothered to figure out how to map from a GIS program which most forum users probably won’t.

Re the rest - let’s not forget that having more than 3 different layers on a landscape component is still just a bad idea due to performance drop… And that’s actually without using most textures on each layer by doing tricks like using the R channel as Specularity map for grass…

1 Like

This really sounds like you’re hitting the texture sampler limit per landscape component.

When you paint Layer1/2/3, the component recompiles. If the total samplers exceed the limit, Unreal drops the material on that component and you get the default look.

Since your auto material already uses multiple textures per layer, adding extra paint layers pushes it over.

Check the material stats and look at texture samplers. Reduce them by packing maps, reusing samples, or using shared samplers. Once you’re under the limit per component, the painted layers will stop disappearing.

Import from GIS, use a shader to touch-up, or add what you need, mark down layers, etc. Hell, paint as many landscape layers as you want because you are just going to export static information anyways, one won’t need a named-layer anymore because he will be baked..

This Sounds Like a Solution but as i Said I dont think that the layer or Texture Limit is maxed out because when I delet all Layers and only have my Auto Material layer but then Plug the Cliff from the Auto Mat into the „Layer 1“ it still disappieres! So I dont think its the Limit of Textures or Layers! I will try to Upload a Video as soon as I can (I cant rn because I am a New User) and This will hopefully help you understand the Problem and Situation!