59 lines
1.6 KiB
C#
59 lines
1.6 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace UnityStandardAssets.CinematicEffects
|
|
{
|
|
// Token: 0x0200001C RID: 28
|
|
public static class ImageEffectHelper
|
|
{
|
|
// Token: 0x0600005C RID: 92 RVA: 0x00003C70 File Offset: 0x00002070
|
|
public static bool IsSupported(Shader s, bool needDepth, bool needHdr, MonoBehaviour effect)
|
|
{
|
|
if (s == null || !s.isSupported)
|
|
{
|
|
Debug.LogWarningFormat("Missing shader for image effect {0}", new object[] { effect });
|
|
return false;
|
|
}
|
|
if (!SystemInfo.supportsImageEffects)
|
|
{
|
|
Debug.LogWarningFormat("Image effects aren't supported on this device ({0})", new object[] { effect });
|
|
return false;
|
|
}
|
|
if (needDepth && !SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.Depth))
|
|
{
|
|
Debug.LogWarningFormat("Depth textures aren't supported on this device ({0})", new object[] { effect });
|
|
return false;
|
|
}
|
|
if (needHdr && !SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.ARGBHalf))
|
|
{
|
|
Debug.LogWarningFormat("Floating point textures aren't supported on this device ({0})", new object[] { effect });
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
// Token: 0x0600005D RID: 93 RVA: 0x00003D1C File Offset: 0x0000211C
|
|
public static Material CheckShaderAndCreateMaterial(Shader s)
|
|
{
|
|
if (s == null || !s.isSupported)
|
|
{
|
|
return null;
|
|
}
|
|
return new Material(s)
|
|
{
|
|
hideFlags = HideFlags.DontSave
|
|
};
|
|
}
|
|
|
|
// Token: 0x17000028 RID: 40
|
|
// (get) Token: 0x0600005E RID: 94 RVA: 0x00003D52 File Offset: 0x00002152
|
|
public static bool supportsDX11
|
|
{
|
|
get
|
|
{
|
|
return SystemInfo.graphicsShaderLevel >= 50 && SystemInfo.supportsComputeShaders;
|
|
}
|
|
}
|
|
}
|
|
}
|