I am getting the following error in Unity 5.6:
maximum ps_4_0 sampler register index (16) exceeded at line (on d3d11)
Compiling Fragment program with POINT
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA
I have a custom shader that uses 15 sampler2d. In Unity 5.5 the shader was working perfectly but since the update it has gone pink.
It appears that the update has added some new samplers. The only Unity post I have found on this is an issue ticket here: https://issuetracker.unity3d.com/issues/regression-5-dot-4-rtp-rtp-terrain-shader-rendering-is-broken-after-upgrading-project-to-5-dot-4
The instructions however are quite unclear and although they do mention that the custom shaders need to be changed manually to accommodate the new samplers, it's unclear exactly how this needs to be done in the shader code. I have tried to add the various suggested #define and #undefine tags as suggested, but the surface of my model is still pink and the error isn't fixed.
Any suggestions how to fix this?
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
95 People are following this question.
How to force the compilation of a shader in Unity?
Depth texture override leaves black skybox
Self Illumin Shader Artefacts
GLCore graphics API - Sampler limit
Mobile Bumped Diffuse problem