diff --git a/cocos/renderer/ccShader_3D_ColorNormal.frag b/cocos/renderer/ccShader_3D_ColorNormal.frag index bec8b94dfe..abc40d5904 100644 --- a/cocos/renderer/ccShader_3D_ColorNormal.frag +++ b/cocos/renderer/ccShader_3D_ColorNormal.frag @@ -10,7 +10,9 @@ varying mediump vec3 v_vertexToPointLightDirection[CC_MAX_POINT_LIGHT_NUM]; \n#if CC_MAX_SPOT_LIGHT_NUM\n varying mediump vec3 v_vertexToSpotLightDirection[CC_MAX_SPOT_LIGHT_NUM]; \n#endif\n +\n#if ((CC_MAX_DIRECTIONAL_LIGHT_NUM > 0) || (CC_MAX_POINT_LIGHT_NUM > 0) || (CC_MAX_SPOT_LIGHT_NUM > 0))\n varying mediump vec3 v_normal; +\n#endif\n \n#else\n @@ -21,7 +23,9 @@ varying vec3 v_vertexToPointLightDirection[CC_MAX_POINT_LIGHT_NUM]; \n#if CC_MAX_SPOT_LIGHT_NUM\n varying vec3 v_vertexToSpotLightDirection[CC_MAX_SPOT_LIGHT_NUM]; \n#endif\n +\n#if ((CC_MAX_DIRECTIONAL_LIGHT_NUM > 0) || (CC_MAX_POINT_LIGHT_NUM > 0) || (CC_MAX_SPOT_LIGHT_NUM > 0))\n varying vec3 v_normal; +\n#endif\n \n#endif\n diff --git a/cocos/renderer/ccShader_3D_ColorNormalTex.frag b/cocos/renderer/ccShader_3D_ColorNormalTex.frag index a614905d13..80010b35b2 100644 --- a/cocos/renderer/ccShader_3D_ColorNormalTex.frag +++ b/cocos/renderer/ccShader_3D_ColorNormalTex.frag @@ -10,7 +10,9 @@ varying mediump vec3 v_vertexToPointLightDirection[CC_MAX_POINT_LIGHT_NUM]; \n#if CC_MAX_SPOT_LIGHT_NUM\n varying mediump vec3 v_vertexToSpotLightDirection[CC_MAX_SPOT_LIGHT_NUM]; \n#endif\n +\n#if ((CC_MAX_DIRECTIONAL_LIGHT_NUM > 0) || (CC_MAX_POINT_LIGHT_NUM > 0) || (CC_MAX_SPOT_LIGHT_NUM > 0))\n varying mediump vec3 v_normal; +\n#endif\n \n#else\n @@ -21,7 +23,9 @@ varying vec3 v_vertexToPointLightDirection[CC_MAX_POINT_LIGHT_NUM]; \n#if CC_MAX_SPOT_LIGHT_NUM\n varying vec3 v_vertexToSpotLightDirection[CC_MAX_SPOT_LIGHT_NUM]; \n#endif\n +\n#if ((CC_MAX_DIRECTIONAL_LIGHT_NUM > 0) || (CC_MAX_POINT_LIGHT_NUM > 0) || (CC_MAX_SPOT_LIGHT_NUM > 0))\n varying vec3 v_normal; +\n#endif\n \n#endif\n diff --git a/cocos/renderer/ccShader_3D_PositionNormalTex.vert b/cocos/renderer/ccShader_3D_PositionNormalTex.vert index 80bce316ea..ef043abc32 100644 --- a/cocos/renderer/ccShader_3D_PositionNormalTex.vert +++ b/cocos/renderer/ccShader_3D_PositionNormalTex.vert @@ -12,7 +12,9 @@ varying vec3 v_vertexToPointLightDirection[CC_MAX_POINT_LIGHT_NUM]; \n#if CC_MAX_SPOT_LIGHT_NUM\n varying vec3 v_vertexToSpotLightDirection[CC_MAX_SPOT_LIGHT_NUM]; \n#endif\n +\n#if ((CC_MAX_DIRECTIONAL_LIGHT_NUM > 0) || (CC_MAX_POINT_LIGHT_NUM > 0) || (CC_MAX_SPOT_LIGHT_NUM > 0))\n varying vec3 v_normal; +\n#endif\n void main(void) {