Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question Shader error: Undeclared Identifier "_BlendMode" after upgrading to HDRP 10.1.0

Discussion in 'High Definition Render Pipeline' started by olavrv, Oct 22, 2020.

  1. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    502
    Got this error in a custom shader after upgrading from HDRP 10.0.0 preview.27 to HDRP 10.1.0 (Unity 2020.2.0b8).

    Appreciate any help resolving this error.
     
  2. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    Magic-Thor and olavrv like this.
  3. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    502
  4. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    502
    @francescoc_unity I am getting another shader error after upgrading;

    Shader error in: unrecognized identifier 'HDShadowContext' at line 60 (on d3d11)

    Do you have any pointers on how to address this also, much appreciated!
     
  5. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    Without knowing your shader is hard to tell, but be sure "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowContext.hlsl" is included somewhere before the shadow context is referenced.

    AFAIK nothing changed between 10.0.0 preview.27 and 10.1.0 regarding that, but I might have missed something.
     
    olavrv likes this.
  6. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    502
    After upgrading to latest HDRP 10.2.0 on git (release branch), I get the following shader error:

    undeclared identifier 'ComputeScreenPos' at line 4663 (on d3d11)

    Is this something you would be willing to help me sort out (I know I am using git, but trying to keep up :))
     
    nehvaleem likes this.
  7. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    396
    Having exact same error. It would be awesome if someone could help us with that a bit.
     
    olavrv likes this.
  8. Allen-Chou

    Allen-Chou

    Joined:
    May 20, 2013
    Posts:
    54
    Same. Shaders that uses the built-in ComputeScreenPos function are no complaining about it being an undeclared identifier in HDRP 10.2.2 in Unity 2020.2.1f1.
     
  9. UnicornsRock420

    UnicornsRock420

    Joined:
    Dec 16, 2021
    Posts:
    2
    Add: #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl"
     
    DragonTein and GeriB like this.