[ShaderIncludePath]
public static string[] GetPaths()
{
var srpMarker = Directory.GetFiles(Application.dataPath, "SRPMARKER", SearchOption.AllDirectories).FirstOrDefault();
var paths = new string[srpMarker == null ? 1 : 2];
var index = 0;
if (srpMarker != null)
var rootPath = Directory.GetParent(srpMarker).ToString();
paths[index] = Path.Combine(rootPath, "ScriptableRenderPipeline/Core");
index++;
}
paths[index] = Path.GetFullPath("Packages/com.unity.render-pipelines.core");
var paths = new string[1];
paths[0] = Path.GetFullPath("Packages/com.unity.render-pipelines.core");
return paths;
{ "HDRenderPipeline/Decal", DecalUI.SetupMaterialKeywordsAndPass }
};
// Note: This function returns null if used with a package setup.
static string GetScriptableRenderPipelinePath()
// User can create their own directory for SRP, so we need to find the current path that they use.
// We do that using the SRPMARKER file.
var srpMarkerPath = Directory.GetFiles(Application.dataPath, "SRPMARKER", SearchOption.AllDirectories).FirstOrDefault();
if (srpMarkerPath != null)
return new Uri(Application.dataPath).MakeRelativeUri(new Uri(Directory.GetParent(srpMarkerPath).ToString())).ToString();
return null;
var srpPath = GetScriptableRenderPipelinePath();
if (srpPath != null)
return Path.Combine(srpPath, "ScriptableRenderPipeline/HDRenderPipeline/HDRP/");
// If the SRPMARKER is not found, we assume that a package setup is used.
return Path.Combine(srpPath, "PostProcessing/PostProcessing/");
return Path.Combine(srpPath, "ScriptableRenderPipeline/Core/CoreRP/");
return "Packages/com.unity.render-pipelines.core/CoreRP/";
paths[index] = Path.Combine(rootPath, "ScriptableRenderPipeline/HDRenderPipeline");
paths[index] = Path.GetFullPath("Packages/com.unity.render-pipelines.high-definition");
paths[0] = Path.GetFullPath("Packages/com.unity.render-pipelines.high-definition");
paths[index] = Path.Combine(rootPath, "ScriptableRenderPipeline/LightweightPipeline");
paths[index] = Path.GetFullPath("Packages/com.unity.render-pipelines.lightweight");
paths[0] = Path.GetFullPath("Packages/com.unity.render-pipelines.lightweight");