Forum Discussion
xrdyne2
Oct 10, 2023Copper Contributor
Shader error in 'Universal Render Pipeline/Terrain/Lit': maximum ps_5_0 sampler register index (16)
Looks like LightCookieInput shader from URP is breaking some of the rules in the build for mesh. How do i fix this im not a unity pro Error building Player: Shader error in 'Universal Rend...
CameronMicka
Microsoft
Oct 16, 2023Hi xrdyne2, unfortunately this is a Unity limitation and not one imposed by Microsoft Mesh. The terrain material (and in turn shader) is using too many texture samplers. Some platforms can't sample more than 16 textures in a single shader. Note texture samplers != number of textures necessarily, but when authoring shaders this is often the case.
There are a few ways to fix this, you might be able to disable some of the rendering features on your terrain to strip out shader features and reduce texture utilization. Or, you can try using a different terrain shader, or author your own terrain shader.
There are a few ways to fix this, you might be able to disable some of the rendering features on your terrain to strip out shader features and reduce texture utilization. Or, you can try using a different terrain shader, or author your own terrain shader.