1. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  2. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  3. Unity 2017.1 is now released.
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  6. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

Shaders error - bug

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

  1. xixgames

    xixgames

    Joined:
    Jan 20, 2014
    Posts:
    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
    Posts:
    63
    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
    Posts:
    590