public static RenderTexture CreateTemporyRenderTexture(RTSettings setting) { if (setting == null) { throw new NullReferenceException("RTSettings is null"); } if (!SystemInfo.supportsRenderTextures) { throw new InvalidOperationException("This system does not support render textures"); } RenderTextureFormat format = RTUtility.CheckFormat(setting); RenderTexture temporary = RenderTexture.GetTemporary(setting.width, setting.height, setting.depth, format, setting.readWrite); temporary.name = setting.name; temporary.wrapMode = setting.wrap; temporary.filterMode = setting.filer; temporary.anisoLevel = setting.ansioLevel; return(temporary); }
public static RenderTexture CreateRenderTexture(RTSettings setting) { if (setting == null) { throw new NullReferenceException("RTSettings is null"); } if (!SystemInfo.supportsRenderTextures) { throw new InvalidOperationException("This system does not support render textures"); } RenderTextureFormat format = RTUtility.CheckFormat(setting); return(new RenderTexture(setting.width, setting.height, setting.depth, format, setting.readWrite) { name = setting.name, wrapMode = setting.wrap, filterMode = setting.filer, useMipMap = setting.mipmaps, anisoLevel = setting.ansioLevel, enableRandomWrite = setting.randomWrite }); }