1. Enter the Microsoft Developer Challenge for a chance to win prizes. Read more about it here.
  2. Enter the Google Play Indie Games Contest in Europe. Read more about it here.
  3. Unity 5.5 is now released.
  4. Become a closed-alpha partner on the new Facebook games platform. Read more about it here.
  5. Get early access to our Google Daydream Technical preview. Click here for more details!

Shaders error - bug

Discussion in 'PSM' started by xixgames, Apr 9, 2014.

  1. xixgames

    xixgames

    Joined:
    Jan 20, 2014
    Messages:
    31
    There is a bug in the shader process...
    When you use Vertex or Unlit with Cut Offset these errors are non-stoppable and drops fps to 1-10:

    Unlit/Transparent Cutout:
    Code (csharp):
    1.  
    2. [173.408224] Shader : Unlit/Transparent Cutout
    3. [173.408742] Entrypoint : main
    4. [173.409130] ERROR (24,94):
    5.         unexpected undeclared identifier 'glstate_lightmodel_ambient'
    6. [173.409882] WARN (19,7):
    7.         local variable '_glesNormal' is unreferenced
    8. [173.410665] WARN (22,12):
    9.         local variable 'vertexColor' is unreferenced
    10. [173.411397] --
    11. [173.412054] ** FF Vertexprogram =
    12.         uniform float4x4 glstate_matrix_mvp;
    13.         struct In {  float4 vertex : POSITION; half3 normal : NORMAL; fixed4 col
    14. or : COLOR; half4 texcoord0 : TEXCOORD0; };
    15.         out varying fixed4 v_color : COLOR;
    16.         uniform half4 _glesFFColor;
    17.         out varying half2 v_texCoord0 : TEXCOORD0;
    18.         struct LightModelParameters {
    19.         float4 ambient;
    20.         };
    21.         uniform float4 _glesFrontMaterial_emission;
    22.         uniform float4 _glesFrontMaterial_ambient;
    23.         uniform float4 _glesFrontMaterial_diffuse;
    24.         uniform float4 _glesFrontMaterial_specular;
    25.         uniform float  _glesFrontMaterial_shininess;
    26.         out varying float4 _ffpPosition : POSITION;
    27.         void main(In input)
    28.         {
    29.         float4 _glesVertex  = input.vertex;
    30.         half3 _glesNormal = input.normal;
    31.         half4 _glesMultiTexCoord0 = input.texcoord0;
    32.         _ffpPosition = mul(glstate_matrix_mvp, _glesVertex);
    33.         float4 vertexColor = _glesFFColor;
    34.         v_texCoord0 = _glesMultiTexCoord0.xy;
    35.         float3 color        = _glesFrontMaterial_emission.rgb + _glesFrontMateri
    36. al_ambient.rgb * glstate_lightmodel_ambient.rgb;
    37.         float alpha = _glesFrontMaterial_diffuse.a;
    38.         v_color = float4(color, alpha);
    39.         }
    40.  
    41.  
    Transparent/Cutout/VertexLit:
    Code (csharp):
    1.  
    2. [230.517456] Shader : Transparent/Cutout/VertexLit
    3. [230.517925] Entrypoint : main
    4. [230.518303] ERROR (24,94):
    5.         unexpected undeclared identifier 'glstate_lightmodel_ambient'
    6. [230.519034] WARN (19,7):
    7.         local variable '_glesNormal' is unreferenced
    8. [230.519731] WARN (22,12):
    9.         local variable 'vertexColor' is unreferenced
    10. [230.520434] --
    11. [230.521082] ** FF Vertexprogram =
    12.         uniform float4x4 glstate_matrix_mvp;
    13.         struct In {  float4 vertex : POSITION; half3 normal : NORMAL; fixed4 col
    14. or : COLOR; half4 texcoord0 : TEXCOORD0; };
    15.         out varying fixed4 v_color : COLOR;
    16.         uniform half4 _glesFFColor;
    17.         out varying half2 v_texCoord0 : TEXCOORD0;
    18.         struct LightModelParameters {
    19.         float4 ambient;
    20.         };
    21.         uniform float4 _glesFrontMaterial_emission;
    22.         uniform float4 _glesFrontMaterial_ambient;
    23.         uniform float4 _glesFrontMaterial_diffuse;
    24.         uniform float4 _glesFrontMaterial_specular;
    25.         uniform float  _glesFrontMaterial_shininess;
    26.         out varying float4 _ffpPosition : POSITION;
    27.         void main(In input)
    28.         {
    29.         float4 _glesVertex  = input.vertex;
    30.         half3 _glesNormal = input.normal;
    31.         half4 _glesMultiTexCoord0 = input.texcoord0;
    32.         _ffpPosition = mul(glstate_matrix_mvp, _glesVertex);
    33.         float4 vertexColor = _glesFFColor;
    34.         v_texCoord0 = _glesMultiTexCoord0.xy;
    35.         float3 color        = _glesFrontMaterial_emission.rgb + _glesFrontMateri
    36. al_ambient.rgb * glstate_lightmodel_ambient.rgb;
    37.         float alpha = _glesFrontMaterial_diffuse.a;
    38.         v_color = float4(color, alpha);
    39.         }
    40. [230.536286] 34275: fps 2.35  ms/f 425.65 [kernel avail main 158MB, cdram 0MB, p
    41. hycont 26MB]
    42.  
    43.  
    any idea of what is going on?
     
  2. gigolo

    gigolo

    Joined:
    Sep 27, 2012
    Messages:
    59
    Getting this as well

    [323.639087] Compiling VERTEX shader "Mobile/Particles/Additive Culled" variation with entrypoint 'main' (md5:a2221e11a557067e52901a055743d956)
    [323.779380] Shader : Mobile/Particles/Additive Culled
    [323.779891] Entrypoint : main
    [323.780273] ERROR (30,94):
    unexpected undeclared identifier 'glstate_lightmodel_ambient'
     
  3. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Messages:
    590