- Home /
Unity 5 - Build Shader Error
Hello Everyone,
I was trying to build my game recently and I ran into some issues. I couldn't finish building my game, because couple of errors showed up that pointed to the 'unity standard shader'. The error stated that there are too many math instructions for SM2.0 and that I need to switch to pragma target 3.0, but I don't really know how to do that.. Can someone give me some tips on how to resolve this issue?
And also I tried switching camera render path from 'Forward' to 'Deferred' and that actually worked, but now I have another camera that is Orthographic so I can't switch to 'Deferred' path anymore, so I don't know what to do. And I don't even sure if that's the reason the issue was gone in the first place, I just assume that the problem went away because of the different render path.
So if someone could share some knowledge about this I would really appreciate it! Thank you!
P.S. Sorry if my English is bad.
Error 1:
Shader error in 'Standard': Too many math instructions for SM2.0 (65 needed, max is 64). Try #pragma target 3.0 at /Program Files/Unity/Editor/Data/CGIncludes/UnityStandardCore.cginc(444) (on d3d9)
Compiling Fragment program with DIRECTIONAL LIGHTMAP_ON FOG_EXP _NORMALMAP
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
Error 2:
Shader error in 'Standard': Too many math instructions for SM2.0 (66 needed, max is 64). Try #pragma target 3.0 at /Program Files/Unity/Editor/Data/CGIncludes/UnityStandardCore.cginc(444) (on d3d9)
Compiling Fragment program with DIRECTIONAL LIGHTMAP_ON FOG_EXP _EMISSION _NORMALMAP
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