Search Unity

Question Undeclared Identifier getLightinginformation_float

Discussion in 'Shader Graph' started by rbarreto3, Mar 3, 2020.

  1. rbarreto3

    rbarreto3

    Joined:
    Feb 29, 2020
    Posts:
    3
    Code (CSharp):
    1. void GetLightingInformation_float(out float3 Direction, out float3 Color,out float Attenuation)
    2. {
    3.     #ifdef SHADERGRAPH_PREVIEW
    4.         Direction = float3(-0.5,0.5,-0.5);
    5.         Color = float3(1,1,1);
    6.         Attenuation = 0.4;
    7.     #else
    8.         Light light = GetMainLight();
    9.         Direction = light.direction;
    10.         Attenuation = light.distanceAttenuation;
    11.         Color = light.color;
    12.     #endif
    13. }
    This code in an hlsl file is being loaded into my custom function but for some reason it gives me these messages now for the shader and im trying to follow this tutorial on how to create a cel shading toon shader by the youtube account gamesplusjames and im stuck at this point and idk how its gone so wrong upload_2020-3-3_13-19-8.png
     
  2. alexandral_unity

    alexandral_unity

    Unity Technologies

    Joined:
    Jun 18, 2018
    Posts:
    163
    Your function reference on the node is using a lowercase "g" for "getLighting" but the function in the file uses an uppercase "G". I'm pretty sure it's case sensitive, try making sure it matches exactly. :)
     
  3. FelixPias2010

    FelixPias2010

    Joined:
    Mar 12, 2021
    Posts:
    4
    The Naming must be the same,... that helped me. Thanks ;)