123456789101112131415161718192021222324252627282930313233 |
-
- namespace NRKernal
- {
- using UnityEngine;
- public class UnityExtendedUtility
- {
- public static RenderTexture CreateRenderTexture(int width, int height, int depth = 24, RenderTextureFormat format = RenderTextureFormat.ARGB32, bool usequaAnti = true)
- {
-
- #if UNITY_2018_2 && UNITY_EDITOR
- var rt = new RenderTexture(width, height, depth, format, NRRenderer.isLinearColorSpace ? RenderTextureReadWrite.Linear : RenderTextureReadWrite.Default);
- #else
- var rt = new RenderTexture(width, height, depth, format, NRRenderer.isLinearColorSpace ? RenderTextureReadWrite.sRGB : RenderTextureReadWrite.Default);
- #endif
- rt.wrapMode = TextureWrapMode.Clamp;
- if (QualitySettings.antiAliasing > 0 && usequaAnti)
- {
- rt.antiAliasing = QualitySettings.antiAliasing;
- }
- rt.Create();
- return rt;
- }
- }
- }
|