Home Unreal Engine

Limited number of textures on a landscape compnent?

Is there a cap on how much textures can be painted on one component square on a landscape? everytime I try to paint a different texture the editor crashes. Is there a way around this?


  • DeadlyFreeze
    Offline / Send Message
    DeadlyFreeze polycounter lvl 17
    The UDK doc says 16 is the limit for the landscape material if your using SM 3.0, no idea how accurate that is.

    Are you using more then 16?
  • Perfect_Rolemodel
    6 different diffuse textures with 6 of it's specs and 6 normals 18 textures total for the entire material? But there isn't an error in the material editor. Should that be ok? It's like a component can only have 3-4 textures painted per square anymore than that will crash.
  • SanderDL
    Offline / Send Message
    SanderDL polycounter lvl 7
    That's probably too much. See if you can optimise things. Do you really need 6 different variations? Especially with all different spec and normal.
  • ambershee
    Offline / Send Message
    ambershee polycounter lvl 17
    18 is far too many. Most terrains in UT3 as an examples used around six textures total. The trick is in how you handle your normals and specularity.

    The limit to the number of textures is 16 - however around 4 of these are occupied already by stuff the landscape does behind the scenes, so you only really get around 12.
  • Hourences
    Offline / Send Message
    Hourences polycounter lvl 18
    Generate your specular in the mat editor instead, use mergemaps, or use the blue channel from the normal map for specular, and you should be able to retain your 6 layers with spec and normal mapping probably, if the landscape wants to accept all that in its material.
  • wes.sau
    Offline / Send Message
    At work we've run into this all the time...

    It's not necessarily the total number of textures in the material, that's why the material editor will not error... I think it only looks at the first layer with the highest "preview weight". Note that the texture sampler limit in the mat editor will change from 15 to 12, once the "used with landscape" material option is enabled and the material is saved.

    As you paint a layer that is new to a particular landscape component, you will notice a hitch as that landscape component will have a new material instance constant generated for that component specifically (you can see these in the package associated with your world as you do with lightmaps) This new material only uses all the textures used in the layers activated by the weights you painted on it. So each landscape material that is generated "under the hood" is unique to the weights you painted on them.

    The 16 sampler cap is a DX9 shader model cap. Typically the component will turn checkerboard when it uses more than 12 user textures, as the other 4 are reserved for lightmaps, heightmaps, blendweightmaps and other things. There's no special cap per layer, you can put all 12 in a single layer. HOwever I think as you add more blend layers on a component, it might reduce the 12 texture cap in practice as it needs to add more blendweight maps.

    So there are several ways to get around this limitation. If you can, geographically spread out your layer painting so you keep to no more than 3 layers per component (if you are using 3 tex per layer) . You can turn on "show terrain patches" or whatever it's called to view the edges of the components when you're painting a new layer. This viewport method I think is legacy to terrain, so sometimes i've had to toggle the different viewport shading types to get the bounding boxes to show up.

    If you've already painted everything, you can use the landscape options to change the component size; normally we see that the new layer stroke just barely touches one corner, sending it over the limit. Making more components that are smaller tends to keep the number of layers a component needs much lower, but of course it results in more draw calls as well as more frequent hitching as you paint, since it will need more materials to generate. Also having more components means you have a longer material compile time when you have the landscape level open and are changing the graph in the landscape material.

    Other ways involve just packing down your textures as others mention- use gradient remapping and such. Or getting by with less textures.

    If you don't require mesh LOD then it's also worth looking at just using a static mesh for the terrain with specific material propagation. It's not as friendly to iterate on, but it will have better runtime performance if you break up your materials manually so that each polygon has only the visible textures/shader code assigned to it. Compare this to large landscape components, where every triangle is evaluating the sum of shader instructions for all layers used on the component regardless of what's visible on each triangle face.

    Hope that info helps.
Sign In or Register to comment.