由于未编译着色器,Unity应用程序在iOS上崩溃

Sam*_*ami 6 xcode shader unity-game-engine ios

我正在尝试为iOS构建我的Unity 5.4.2f2应用程序.它没有编译错误.但是当我尝试使用Xcode 8.0运行应用程序时,它立即崩溃,调试器报告以下错误.

Initialize engine version: 5.4.2f2 (b7e030c65c9b)
-------- Shader compilation failed
#version 100
#extension GL_EXT_frag_depth : enable
precision highp float;
uniform highp vec4 _ProjectionParams;
uniform highp vec4 _ZBufferParams;
uniform highp mat4 unity_CameraToWorld;
uniform highp mat4 _NonJitteredVP;
uniform highp mat4 _PreviousVP;
uniform highp sampler2D _CameraDepthTexture;
varying highp vec2 xlv_TEXCOORD0;
varying highp vec3 xlv_TEXCOORD1;
void main ()
{
    highp vec4 tmpvar_1;
    tmpvar_1 = texture2D (_CameraDepthTexture, xlv_TEXCOORD0);
    mediump vec2 tmpvar_2;
    highp vec4 tmpvar_3;
    tmpvar_3.w = 1.0;
    tmpvar_3.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/((
                   (_ZBufferParams.x * tmpvar_1.x)
                   + _ZBufferParams.y))));

    highp vec4 tmpvar_4;
    tmpvar_4 = (unity_CameraToWorld * tmpvar_3);

    highp vec4 tmpvar_5;
    tmpvar_5 = (_PreviousVP * tmpvar_4);

    highp vec4 tmpvar_6;
    tmpvar_6 = (_NonJitteredVP * tmpvar_4);

    highp vec2 tmpvar_7;
    tmpvar_7 = (((tmpvar_5.xy / tmpvar_5.w) + 1.0) / 2.0);

    highp vec2 tmpvar_8;
    tmpvar_8 = (((tmpvar_6.xy / tmpvar_6.w) + 1.0) / 2.0);
    tmpvar_2 = (tmpvar_8 - tmpvar_7);

    mediump vec4 tmpvar_9;
    tmpvar_9.zw = vec2(0.0, 1.0);
    tmpvar_9.xy = tmpvar_2;
    gl_FragDepthEXT = tmpvar_1.x;
    gl_FragData[0] = tmpvar_9;
}
Run Code Online (Sandbox Code Playgroud)

编译失败:片段评估着色器警告:0:4:不支持扩展'GL_EXT_frag_depth'错误:0:38:使用未声明的标识符'gl_FragDepthEXT'

注意:创建着色器"Hidden/Internal-MotionVectors"的内部变体失败.警告:Shader Unsupported:'Hidden/Internal-MotionVectors' - Pass''没有顶点着色器警告:Shader Unsupported:'Hidden/Internal-MotionVectors' - 设置为默认着色器.

Xcode 8.0包含OPenGL 2.0.

Unity论坛上,人们告诉我们Unity 5.4应该没问题.但这对我不起作用.在Android设备上,我的应用程序运行良好.

小智 5

打开Unity - >编辑 - >项目设置 - >图形

然后在内置着色器设置下选择Depth Normals并选择选项no support

这是截图告诉上面的内容