Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Max layers exceeded, but I do have less than 16.

I get this error:

Error [SM5] error X4510: maximum ps_5_0 sampler register index (16) exceeded

Which I assume means I have too much textures. But that is not true, I have 9 diffuse textures. And I am hooking them up to a Layer Blend node. I am using Height Blend and each layer has it's input of a B/W map set at the correct size. That makes a total of 18 inputs. I thought that may be the problem (even if technically there is only 9 layers) so I removed a couple of them. But still not working. I does work with only 2 layers, each with its splatmap. Which is weird. Is the limit really 16?

I also painted the terrain before with the other method, Landscape Layer Weight, and it worked fine with all the textures added. There were 14 diffuse textures in total. And I imported the splat maps into the layer info.

I am using the LayerBlend method to add normals to the terrain (as far as I know I can't do that with LayerWeight).

Any idea why it says I am exceeding the amount? Or any idea if I can add normals and displacement with LayerWeight?

Product Version: Not Selected
more ▼

asked Jun 26 '14 at 02:29 PM in Using UE4

avatar image

81 8 9 12

avatar image SuIXo Jun 26 '14 at 02:34 PM

After playing around a little bit it seems to be related to "Preview Weight"

I have them set to 0.5, otherwise it won't work. But if I set it to 0 on some of them, the material does work (leaving holes were the rest is missing)

I have only 4 layers with the texture weight set to 0.5, the rest is at 0. Of 9 total.

If any one could explain what exactly does that parameter do I may be able to understand why it doesn't work.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi SuIXo,

There is a shader limit of 16 texture samplers total. We are looking to increase that to 32 in an upcoming release.

But for now, the limit for use inside a material is 13 user textures, because 2 are used lightmap cooefficients, and one is used for the Specular cubemap. If you set the "Fully Rough" checkbox on the material, the Specular cubemap is not used and that gives you 14 user textures.

The landscape weightmaps (textures automatically generated from your painting) uses 1 texture for every 4 layers you use. So for a regular material with roughness and up to 4 layers, that should leave you 12 textures you can work with, or 11 with up to 8 layers.

There shouldn't be any usage difference between the blending method (LandscapeLayerWeight or LandscapeLayerBlend).

Can you post your material .uasset files if you're still having trouble?

Regards, Jack

more ▼

answered Jul 02 '14 at 10:20 AM

avatar image

1.3k 37 11 48

avatar image RyanB STAFF Jun 26 '14 at 03:52 PM

Are all your 9 layers using the same texture as the B/W height map? If not, then each layer is two textures meaning you have 18 textures. Otherwise it would be 10 if they share the same height.

I did a test-case and for some reason, I could only paint 8 height-blended layers on the same component before it caused the shader to break. I could paint all 9 without problem if I made them Alphablended instead.

I think we have a lower than 16 texture limit for landscapes because of the weights and lightmaps but I am not 100% sure. Assigning to Jack who can answer definitively.

avatar image SuIXo Jun 26 '14 at 08:06 PM

In another post one of the staff said there was a known bug.

And no, each of my diffuse have separate height maps. I didn't try alphablend, I don't know how it works. Is it something like layerweight node?

This issue must be only with the layerblend node, because there is no problem at all with the layerweight.

It's strange. Plus something I noticed is that when I change the preview weight in the layerblend node, the... i don't recall how it's called... in the console where errors apear, there is a number like X/16, which must be the amount of used layers. Well, when changing the preview weight sometimes that number goes up, sometimes it goes down. It a weird behavior, I can't make any sense of it.

avatar image SuIXo Jul 02 '14 at 10:58 PM

Nice, thanks for the info.

I don't think I'll have any more trouble. This explains it very well.

avatar image Chrys Aug 21 '14 at 05:27 PM

hello JackP,

do you know when the 32 textures support will be implemented ? Is it soon or further down the line ?

avatar image Narg Mar 05 '16 at 04:48 PM

2016 and still no 32 texture support :-/

avatar image JackP_oldaccount Mar 07 '16 at 02:17 AM

Hi Narg, we've had a solution to this since version 4.6 (in 2014 :-)

You just need to so set the TextureSample node's SamplerSource property to one of the Shared inputs (probably Shared: Wrap if you want your texture to tile).

Using this method you should not run out of texture sampler slots.

  • Jack

avatar image razee01 May 30 '18 at 03:52 AM

2018 and still no 32 texture support :-/

avatar image JackP STAFF May 30 '18 at 03:54 AM

As mentioned above, we have shared samplers so this is no longer a practical limit. We limit SM5 to16 samplers so materials for that shader model will work on all platforms where we support SM5.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question