Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

ERROR: 0:21: Use of undeclared identifier 'gl_FragData'

Discussion in 'Tizen' started by hienbui3112, Feb 9, 2017.

  1. hienbui3112

    hienbui3112

    Joined:
    Nov 23, 2016
    Posts:
    9
    I cannot run a simple example on tizen emulator. My example is just a sprite in a scene. After I installed the example to emulator and opened it, it kept crashing and shown an error:

    ERROR: 0:21: Use of undeclared identifier 'gl_FragData'

    Anyone can help ?
    I'm using Unity 5.5.1 on macOS Sierra 10.12, the tizen os is 2.4.

    Here is the full crash log:

    I/Unity ( 4401): -------- Shader compilation failed
    I/Unity ( 4401): #version 100
    I/Unity ( 4401): precision highp float;
    I/Unity ( 4401): uniform highp float _EnableExternalAlpha;
    I/Unity ( 4401): uniform sampler2D _MainTex;
    I/Unity ( 4401): uniform sampler2D _AlphaTex;
    I/Unity ( 4401): varying lowp vec4 xlv_COLOR;
    I/Unity ( 4401): varying highp vec2 xlv_TEXCOORD0;
    I/Unity ( 4401): void main ()
    I/Unity ( 4401): {
    I/Unity ( 4401): lowp vec4 c_1;
    I/Unity ( 4401): lowp vec4 color_2;
    I/Unity ( 4401): lowp vec4 tmpvar_3;
    I/Unity ( 4401): tmpvar_3 = texture2D (_MainTex, xlv_TEXCOORD0);
    I/Unity ( 4401): color_2.xyz = tmpvar_3.xyz;
    I/Unity ( 4401): lowp vec4 tmpvar_4;
    I/Unity ( 4401): tmpvar_4 = texture2D (_AlphaTex, xlv_TEXCOORD0);
    I/Unity ( 4401): highp float tmpvar_5;
    I/Unity ( 4401): tmpvar_5 = mix (tmpvar_3.w, tmpvar_4.x, _EnableExternalAlpha);
    I/Unity ( 4401): color_2.w = tmpvar_5;
    I/Unity ( 4401): lowp vec4 tmpvar_6;
    I/Unity ( 4401): tmpvar_6 = (color_2 * xlv_COLOR);
    I/Unity ( 4401): c_1.w = tmpvar_6.w;
    I/Unity ( 4401): c_1.xyz = (tmpvar_6.xyz * tmpvar_6.w);
    I/Unity ( 4401): gl_FragData[0] = c_1;
    I/Unity ( 4401): }
    I/Unity ( 4401): -------- failed compiling:
    I/Unity ( 4401): fragment evaluation shader
    I/Unity ( 4401): ERROR: 0:32: Use of undeclared identifier 'gl_FragData'
    I/Unity ( 4401):
    I/Unity ( 4401): Note: Creation of internal variant of shader 'Sprites/Default' failed.
    I/Unity ( 4401): -------- Shader compilation failed
    I/Unity ( 4401): #version 100
    I/Unity ( 4401): precision highp float;
    I/Unity ( 4401): uniform sampler2D _MainTex;
    I/Unity ( 4401): varying lowp vec4 xlv_COLOR;
    I/Unity ( 4401): varying highp vec2 xlv_TEXCOORD0;
    I/Unity ( 4401): void main ()
    I/Unity ( 4401): {
    I/Unity ( 4401): lowp vec4 c_1;
    I/Unity ( 4401): lowp vec4 tmpvar_2;
    I/Unity ( 4401): tmpvar_2 = (texture2D (_MainTex, xlv_TEXCOORD0) * xlv_COLOR);
    I/Unity ( 4401): c_1.w = tmpvar_2.w;
    I/Unity ( 4401): c_1.xyz = (tmpvar_2.xyz * tmpvar_2.w);
    I/Unity ( 4401): gl_FragData[0] = c_1;
    I/Unity ( 4401): }
    I/Unity ( 4401): -------- failed compiling:
    I/Unity ( 4401): fragment evaluation shader
    I/Unity ( 4401): ERROR: 0:21: Use of undeclared identifier 'gl_FragData'
    I/Unity ( 4401):
    I/Unity ( 4401): Note: Creation of internal variant of shader 'Sprites/Default' failed.
     
    oriolmanya likes this.
  2. Masterfalcon

    Masterfalcon

    Unity Technologies

    Joined:
    Dec 29, 2014
    Posts:
    364
    Seems like the emulator is trying to use GLES 3. I believe the emulator has known issues with ES 3 on OS X. Change the configuration of the emulator to use GLES 1.1 and 2.0 rather than 2.0 and 3.0 and you should have better luck.
     
    oriolmanya likes this.
  3. hienbui3112

    hienbui3112

    Joined:
    Nov 23, 2016
    Posts:
    9
    oriolmanya likes this.
  4. oriolmanya

    oriolmanya

    Joined:
    Jul 4, 2012
    Posts:
    50
    I was searching for hours... So simple at the end. Thanks for sharing!