Download

Max Landscape Layers per Component

There is a number limitation to layers that can be painted in each component of a LAYERED MATERIAL of a LANDSCAPE?
I have 13 layers (26 textures color/normal)… I also set “Max Landscape Layers per Component” to 13, but when I start to paint the 5 layer in the same component, the textures disapears and the gray checkboard apears…



you can’t use more than 4 layers per Component?

Hey There 3dPhil,

As far as I understand it this is a limitation of shader model 3 not Unreal Engine. Each component has it’s own material, but in SM3 a material can only sample 16 textures (and in UDK 2 of those were reserved for lightmaps).

You could get around it in UDK by using a thing called a texture atlas, but it required a custom node in the material that used a bit of HLSL that apparently is not available in UE4 yet.

While we’re on that topic… flutters eyelids at epic any chance that will be back on the menu any time soon?

Ambershee, feel free to chime in and add your support :slight_smile:

It is indeed a hardware/software limit and nothing to do with Unreal. Some of the maps are still reserved for lightmaps.

You can have a lot of layers, but you can’t have many textures.

You need to come up with ways of combining textures together by splitting channels up, using alpha, using a texture atlas, and so on. These are advanced tricks not easily covered in a forum post.

Aren’t we up to Shader Model 5 now? I’m sure that was what UE4 was using by default. The 16 Texture limit really does suck, but one of the advantages of PBR is you don’t need spec maps anymore.

oh, now I unterstand. Just wanna clarify that I can use all the textures (26) in one material, but I can’t paint many layers in each landscape component… so in one Landscape component I can paint 4 layers (each layer use color/normal textures) and in other Landscape component I can paint other 4 different layers, but not 8 layers in just one component.

Also I understand that I can use chanels/alphas/etc for reduce the number of textures… for example I can take one alpha (from one texture channel) and Lerp 2 “3vectorColors” (or more complex operations) BUT I think that never could “recreate” the same color richness that the original texture has.
I have created my textures making photos in a park/forest so I have very good detail textures (4096px) and a nice range of transitions.

Schermata_2014_05_05_alle_17_02_03.png

Also, if wasen’t for that problem… evrything was looking very good and detailed… so I would really like to find a way to obtain the same result without the problem.

maybe texture atlas can be a solution (don’t know how to use it in UE4) but with texture atlas I must reduce the texture resolution.
anyway if there aren’t others solutions I must use the Hourences suggestions. (hey Hourences great work on Solus! really nice!!)

I’ve come across this issue in UE3 and UE4, and it’s as Hourences has described. You can paint many layers over an entire landscape, but each component can only hold 4 layers.

You should be able to still create compelling landscapes with 4 layers per component though. Make use of decals and geometry to cover some of the less-used materials.

I however don’t quite understand this setting. It seems clear to me that this should indeed increase the number of layers you can use on a single component, but clearly that isn’t happening. Maybe this is where SM3 comes into play.

You can save the RGB images of a texture in the alphas of three other textures, then reconstruct by combining R+G+B. That way you got 4 textures by using 3. If textures are mostly one color like green grass, you may also manage to take for example the Blue channel out and reuse that for something else.
You can also use the Blue channel in normal maps. You import normal maps without Blue, then regenerate Blue based on Red and Green, thereby you can add 5 normal maps into 3 normal map textures (if you use alpha also, which you may want to be careful with given the compression settings).

To get the most out of this stuff you need a very well thought through approach, and it is a bit unfortunate it has to get to such complex level just to paint some sand on the ground…

I intend to do a video some day in the future that goes over advanced texture control in general.

this isn’t what Hourences describes. According to his words you can have many layers if you don’t use textures. If you plug Color constants into your layers there’s no limit of 4.

And just to confirm, I’ve painted much more than 4 layers per component in UE3. at some point it does break depending on texture amounts and/or instruction counts, but it’s definately more than 4

I’d love to see how you’re doing this, because everyone I’ve spoken with (many licensees included) have issues when painting more than 4 layers onto a single component. Maybe we’re just having an error in communication…

I probably also shouldn’t have made the assumption that the poster wants to use textures, not constant values. The projects I’ve been involved with in the past have all wanted landscapes with some detail applied to them.

Don’t know how helpful this will be, but it was an excellent read and still is if you haven’t already seen it. An article by Andrew Maximov Art Is A Verb - "Ditching Diffuse Maps" by Andrew Maximov

no problem. here. it’s all one component and you can already see 6 painted layers. this is UE3 btw, not UE4
e643d41e89c094fc138b992bd6e9096df8e78bca.jpeg

but just to be clear, is your problem purely about painting amounts of layers, about exceeding the texture count, both, or something else? that something else can also be exceeding the maximum shader instruction count

Thanks for the pic! As an average, I’d guess each layer held a unique diffuse and normal map, along with some math functions and other parameters.

I noticed on the new Roadmap that Epic has it planned to move to the SM5 sampler limit of 32.

“separate textures and samples, increase SM5 limit to 32”

That would be a welcome change.

Yeah very much so. Would make a big difference for me as well.

Any update on this? I’m trying to create a “master” landscape than can blend at least 10 materials but I can’t get above 4. Anyone know an alternative to painting the terrain?

any alternative to painting the terrain will just make things worse, because at least the layers system is smart enough to “cull” out the parts of the material that aren’t used if the layer isn’t used

how many types of textures are you using? diffuse only? +normalmap? +specular?

My landscape material have 16 materials in it with their own base color, alpha, roughness, normal and height map.
You need to use texture atlases just like they mention earlier in the thread, or put your textures in less channels, but you’ll never get very good results. With atlases you don’t loose quality.
Right now I have 8x8 textures in my atlas, one for base color and alpha, one for normal and one for roughness and height. So that’s 16 materials but only 3 texture samples.
Nothing prevents you from putting in another atlas to increase it to 32 or even higher.

atlases are also tricky, and far from being the best solution.
the first thing is that mipmaps have seams so you must spare some extra instructions in nodes to fix this.

secondly, you’re still limited to the amount of textures from *different *atlases.
with a 2048 texture that’s divided into 4x4 you get 16 512x512 textures, and this is barely in the limits of ‘good quality’. if instead you divide your 2048 texture into 2x2 you get 4 nice 1024x1024 textures, but then again it’s only 4 of them, which forces you to use multiple atlases.

now let’s imagine you want 16 materials in your landscape and you’re using a 2x2 atlas setup, which means you need 4 atlases. now if you paint 4 layers -each from a different atlas texture- you’re still using the 4 atlases into one component. since you’re using diffuse+normal+spec this adds up to 12 texture samplers of 2048x2048 textures. hardly optimal and you’d already break the rendering of that component.

different scenario. let’s say you can increase the editor’s limits and allow it to use 4096x4096 textures (should be doable in a config file, IIRC), and you still want your 4x4 atlas setup. this means you get 16 1024x1024 textures which should give you ‘good enough’ quality (unless you’re aiming for AAA graphics). I’d say this setup would be the ideal one, but if you ever need more than 16 materials then using a second atlas might make it too expensive

Maybe someone could explain this to a beginner. Here is my material

97ffb4063e69aaa7186ca1d0bbe7d10030dd6a9d.jpeg

The material has 4 layers: Grass, leaves, dirt, mud
the grass layer is an LB alpha Blend and the other 3 are LB Height Blend
each layer except the last is a combination of 2 textures (diffuse and normals only)
all the textures are 2048x2048

is my problem that I have too many textures? or that the textures are too big?

sanford: does this material break on painting too many layers? cause you only have 9 texture samplers and 116 instructions there