Skip to content

Instantly share code, notes, and snippets.

@andreiagmu
Created November 24, 2020 03:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save andreiagmu/b862ae47ef91be05f61ae2da26627a01 to your computer and use it in GitHub Desktop.
Save andreiagmu/b862ae47ef91be05f61ae2da26627a01 to your computer and use it in GitHub Desktop.
RenderPipeline helper class
// RenderPipelineHelper
// by Andy Miira (Andrei Müller), November 2020
using UnityEngine;
using UnityEngine.Rendering;
namespace MirrorMirai.Helpers
{
public enum RenderPipelines
{
BuiltIn,
URP,
HDRP
}
public static class RenderPipelineHelper
{
public static RenderPipelines CheckRenderPipeline()
{
if (GraphicsSettings.renderPipelineAsset)
{
if (GraphicsSettings.renderPipelineAsset.GetType().ToString().Contains("HDRenderPipelineAsset"))
{
// HDRP active
Debug.Log("HDRP active");
return RenderPipelines.HDRP;
}
else
{
// URP active
Debug.Log("URP active");
return RenderPipelines.URP;
}
}
else
{
// Built-in RP active
Debug.Log("Built-in RP active");
return RenderPipelines.BuiltIn;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment