Shader error in 'Nature/Terrain/Standard': maximum ps_5_0 sampler register index (16) on Android

I’m getting the following errors while trying to build for Android on 2021.3.2f1

Shader error in 'Nature/Terrain/Standard': maximum ps_5_0 sampler register index (16) exceeded at Files/Unity/Hub/Editor/2021.3.2f1/Editor/Data/CGIncludes/TerrainSplatmapCommon.cginc(62) (on gles3)

Compiling Subshader: 0, Pass: FORWARD, Vertex program with DIRECTIONAL DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON INSTANCING_ON LIGHTMAP_ON SHADOWS_SCREEN SHADOWS_SHADOWMASK _ALPHATEST_ON _NORMALMAP
Platform defines: SHADER_API_GLES30 SHADER_API_MOBILE UNITY_COLORSPACE_GAMMA UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HARDWARE_TIER1 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_NO_CUBEMAP_ARRAY UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_RGBM UNITY_NO_SCREENSPACE_SHADOWS UNITY_PASS_FORWARDBASE UNITY_PBS_USE_BRDF3
Disabled keywords: FOG_EXP FOG_EXP2 FOG_LINEAR LIGHTMAP_SHADOW_MIXING LIGHTPROBE_SH UNITY_ASTC_NORMALMAP_ENCODING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING VERTEXLIGHT_ON
Shader error in 'Hidden/TerrainEngine/Splatmap/Standard-AddPass': maximum ps_5_0 sampler register index (16) exceeded at Files/Unity/Hub/Editor/2021.3.2f1/Editor/Data/CGIncludes/TerrainSplatmapCommon.cginc(62) (on gles3)

Compiling Subshader: 0, Pass: FORWARD, Vertex program with DIRECTIONAL DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON INSTANCING_ON LIGHTMAP_ON SHADOWS_SCREEN SHADOWS_SHADOWMASK _ALPHATEST_ON _NORMALMAP
Platform defines: SHADER_API_GLES30 SHADER_API_MOBILE UNITY_COLORSPACE_GAMMA UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HARDWARE_TIER1 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_NO_CUBEMAP_ARRAY UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_RGBM UNITY_NO_SCREENSPACE_SHADOWS UNITY_PASS_FORWARDBASE UNITY_PBS_USE_BRDF3
Disabled keywords: FOG_EXP FOG_EXP2 FOG_LINEAR LIGHTMAP_SHADOW_MIXING LIGHTPROBE_SH UNITY_ASTC_NORMALMAP_ENCODING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING VERTEXLIGHT_ON

I’m using 2021.3.2f1 and it’s a brand new, flat terrain made using this version. Here are my build settings:

What is the problem here and how can it be solved?

Could you solve it? I’ve just faced the same in 2019.4.40f1.

Still getting this error

If I delete ‘library’ this works initially, then after some time the error comes back again. What’s going on? This is preventing building for Android.

This is still an issue.

1 Like

I concur, this is still an issue.

This is an error for me in 2021.3.19, unable to build my project because of it

Any updates on this from Unity? I’ve tried clearing my shader caches, and reinstalling the editor.