Search Unity

ShaderGraph Generates alot useless code

Discussion in 'Editor & General Support' started by marcozakaria, Jun 26, 2020.

  1. marcozakaria

    marcozakaria

    Joined:
    Sep 17, 2017
    Posts:
    23
    Code (CSharp):
    1. SurfaceDescription SurfaceDescriptionFunction(SurfaceDescriptionInputs IN)
    2.  {
    3.       SurfaceDescription surface = (SurfaceDescription)0;
    4.       float4 _SampleTexture2D_7F1DA238_RGBA_0 = SAMPLE_TEXTURE2D(Texture2D_5BF777A0, samplerTexture2D_5BF777A0, IN.uv0.xy);
    5.       float _SampleTexture2D_7F1DA238_R_4 = _SampleTexture2D_7F1DA238_RGBA_0.r;
    6.       float _SampleTexture2D_7F1DA238_G_5 = _SampleTexture2D_7F1DA238_RGBA_0.g;
    7.       float _SampleTexture2D_7F1DA238_B_6 = _SampleTexture2D_7F1DA238_RGBA_0.b;
    8.       float _SampleTexture2D_7F1DA238_A_7 = _SampleTexture2D_7F1DA238_RGBA_0.a;
    9.       float _Split_4DEFA547_R_1 = _SampleTexture2D_7F1DA238_RGBA_0[0];
    10.       float _Split_4DEFA547_G_2 = _SampleTexture2D_7F1DA238_RGBA_0[1];
    11.       float _Split_4DEFA547_B_3 = _SampleTexture2D_7F1DA238_RGBA_0[2];
    12.       float _Split_4DEFA547_A_4 = _SampleTexture2D_7F1DA238_RGBA_0[3];
    13.      surface.Color = (_Split_4DEFA547_R_1.xxx);
    14.      surface.Alpha = 1;
    15.      surface.AlphaClipThreshold = 0;
    16.      return surface;
    17.  }
    In a simple graph shaderGraph generates 7 unsed float variables
    and i wish you add button for making shadow pass or not.
    thanks.
     

    Attached Files: