Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

HDRP: Namespace missing

Discussion in 'Graphics Experimental Previews' started by UnexpectedEOF, Aug 15, 2019.

  1. UnexpectedEOF

    UnexpectedEOF

    Joined:
    Feb 20, 2019
    Posts:
    2
    I'm currently trying to assign material properties (textures, shaders) to different fields based on whether a project is using the Built-In Pipeline or the HDRP. I'm attempting to do this by checking the current object in GraphicsSettings.renderPipelineAsset.

    When I have Unity output the current pipeline asset to the console, it's given as a "UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipelineAsset". However, when I attempt to verify that a given rendering asset is an HDRenderPipelineAsset, which involves the HDPipeline namespace, I get the error "The type or namespace 'HDPipeline' does not exist in the namespace 'UnityEngine.Experimental.Rendering'."

    Looking into the namespaces with Visual Studio, it seems that both it and Unity agree that the HDPipeline namespace doesn't exist, but I can see it in the documentation, and the HDRenderPipelineAsset object seems to belong to it. Is this a bug, or am I doing something wrong? Additionally, if it is a bug, how should I best verify that a project is an HDRP one inside of a script?
     
  2. UnexpectedEOF

    UnexpectedEOF

    Joined:
    Feb 20, 2019
    Posts:
    2
    I've decided to check the object's name rather than its type - it's not a perfect solution, considering that the name can be changed, but it's at least not a likely circumstance. In case anyone else has run into this problem, what I'm using to check is

    GraphicsSettings.renderPipelineAsset.name == "HDRenderPipelineAsset"
     
  3. Kris_HDRP

    Kris_HDRP

    Joined:
    Jan 11, 2020
    Posts:
    1
    For older project in newer Unity version simply switch to:
    Code (CSharp):
    1. using UnityEngine.Rendering.HighDefinition;
     
    Shazimus likes this.