Shader is using too many Samplers: 23 (only 16 supported)

OK so i hade followed a yotube tutioral he didn’t get the error but I got this
here is the tutioral :- Advanced Landscape Auto Material - Building Worlds In Unreal - Episode 18 - YouTube
here is the error I got

LogShaderCompilers: Warning: Failed to compile Material /Game/Megascans/Surfaces/TEXT_landscape.TEXT_landscape (MI:/Game/Map/Mapauto.Mapauto:PersistentLevel.Landscape_0.LandscapeMaterialInstanceConstant_1026) for platform PCD3D_SM5, Default Material will be used in game.
LogShaderCompilers: Display:     /Engine/Generated/Material.ush(2537,21-40):  warning X4008: floating point division by zero
LogShaderCompilers: Display:     /Engine/Generated/Material.ush(2555,21-40):  warning X4008: floating point division by zero
LogShaderCompilers: Display:     /Engine/Generated/Material.ush(2581,21-40):  warning X4008: floating point division by zero
LogShaderCompilers: Display:     /Engine/Generated/UniformBuffers/Material.ush(35,14-41):  err0r X4510: maximum ps_5_0 sampler register index (16) exceeded
LogShaderCompilers: Display:     /Engine/Generated/UniformBuffers/Material.ush(33,14-41):  err0r X4510: maximum ps_5_0 sampler register index (16) exceeded
LogShaderCompilers: Display:     Shader is using too many Samplers: 23 (only 16 supported)
LogShaderCompilers: Display:     D3DCompileToDxil failed
LogShaderCompilers: Display:     Invalid ray tracing shader parameter 'LandscapeParameters_NormalmapTextureSampler'. Only uniform buffers and loose data parameters are supported.
LogShaderCompilers: Display:     Shader is using too many Samplers: 24 (only 16 supported)
LogShaderCompilers: Display:     Invalid ray tracing shader parameter 'View_SharedBilinearClampedSampler'. Only uniform buffers and loose data parameters are supported.
LogShaderCompilers: Display:     Shader is using too many Samplers: 22 (only 16 supported)
LogShaderCompilers: Display:     Invalid ray tracing shader parameter 'LandscapeParameters_NormalmapTextureSampler'. Only uniform buffers and loose data parameters are supported.
LogShaderCompilers: Display:     Invalid ray tracing shader parameter 'View_SharedBilinearClampedSampler'. Only uniform buffers and loose data parameters are supported.

I can explain you a error so it might help you out, “sampler” is equivalent of texture node in material. The current GPU specifications allow single shader to sample only 16 textures (but multiple samplers can have same texture) on same time, if you got that error that means you got too much texture nodes.

You can overcome this limitation for example by using spreadsheets (single image file containing multiple textures)

3 Likes

I had similar problem and it got fixed when i changed each texture sampler source to shared: wrap.
It said 20/16. After changes it reduced down to 6/16. Hope this helps. I found this as to a solution to a different problem where landscape would go black and white check boxes while painting. I found this YouTube video stating the solution -

12 Likes

This fixed it for me. Thanks!

1 Like

This fixed it for me too! (Texture Samples!!!) now I have 2 on my Landscape Material