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

Question Shader error in 'Hidden/camShader': undeclared identifier '_Intensity' at line 48 (on glcore)

Discussion in 'Shaders' started by Svante2000, Feb 24, 2021.

  1. Svante2000

    Svante2000

    Joined:
    Jan 3, 2021
    Posts:
    3
    Unity says that Shader error in 'Hidden/camShader': undeclared identifier '_Intensity' at line 48 (on glcore).

    Heres my code:
     

    Attached Files:

  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    You need to declare a global
    _Intensity
    variable in addition to the property.
    Properties are for exposing variables in the UI, not for declaring them.
     
  3. Svante2000

    Svante2000

    Joined:
    Jan 3, 2021
    Posts:
    3
    how do i do that?
     
  4. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    you add
    float _Intensity;
    on the line right after
    sampler2D _MainTex;