コード例 #1
0
        private static RenderTextureFormat GetLutFormat()
        {
            RenderTextureFormat renderTextureFormat = RenderTextureFormat.ARGBHalf;

            if (!renderTextureFormat.IsSupported())
            {
                renderTextureFormat = RenderTextureFormat.ARGB2101010;
                if (!renderTextureFormat.IsSupported())
                {
                    renderTextureFormat = RenderTextureFormat.ARGB32;
                }
            }
            return(renderTextureFormat);
        }
コード例 #2
0
 static bool IsRenderTextureFormatSupportedForLinearFiltering(RenderTextureFormat format)
 {
         #if UNITY_2019_1_OR_NEWER
     GraphicsFormat graphicFormat = GraphicsFormatUtility.GetGraphicsFormat(format, RenderTextureReadWrite.Linear);
     return(SystemInfo.IsFormatSupported(graphicFormat, FormatUsage.Linear));
         #else
     return(format.IsSupported());
         #endif
 }
コード例 #3
0
        static bool IsRenderTextureFormatSupportedForLinearFiltering(RenderTextureFormat format)
        {
#if UNITY_2019_1_OR_NEWER
            var gFormat = GraphicsFormatUtility.GetGraphicsFormat(format, RenderTextureReadWrite.Linear);
            return(SystemInfo.IsFormatSupported(gFormat, FormatUsage.Linear));
#else
            // No good/fast way to test it on pre-2019.1
            return(format.IsSupported());
#endif
        }
コード例 #4
0
ファイル: DepthOfField.cs プロジェクト: ankur25140/DirtRacing
        RenderTextureFormat SelectFormat(RenderTextureFormat primary, RenderTextureFormat secondary)
        {
            if (primary.IsSupported())
                return primary;

            if (secondary.IsSupported())
                return secondary;

            return RenderTextureFormat.Default;
        }
コード例 #5
0
 private RenderTextureFormat SelectFormat(RenderTextureFormat primary, RenderTextureFormat secondary)
 {
     if (primary.IsSupported())
     {
         return(primary);
     }
     if (secondary.IsSupported())
     {
         return(secondary);
     }
     return(RenderTextureFormat.Default);
 }