UnityEngine.Graphics.Blit C# (CSharp) Method

Blit() public static method

Copies source texture into destination render texture with a shader.

public static Blit ( Texture source, Material mat, [ pass ) : void
source Texture Source texture.
mat Material Material to use. Material's shader could do some post-processing effect, for example.
pass [ If -1 (default), draws all passes in the material. Otherwise, draws given pass only.
return void
        public static void Blit(Texture source, Material mat, [UnityEngine.Internal.DefaultValue("-1")] int pass)
        {
            Internal_BlitMaterial(source, null, mat, pass, false);
        }

Same methods

Graphics::Blit ( Texture source, Material mat ) : void
Graphics::Blit ( Texture source, RenderTexture dest ) : void
Graphics::Blit ( Texture source, RenderTexture dest, Material mat ) : void
Graphics::Blit ( Texture source, RenderTexture dest, Material mat, [ pass ) : void

Usage Example

        public void CacheAppIcon(string appKey, Texture2D tex, bool force = false)
        {
            RenderTexture rt = new RenderTexture(32, 32, 24, RenderTextureFormat.ARGB32);

            Graphics.Blit(tex, rt);

            Directory.CreateDirectory(iconCacheFolder);

            string path = Path.Combine(iconCacheFolder, appKey + ".png");

            DumpRenderTexture(rt, path);
        }
All Usage Examples Of UnityEngine.Graphics::Blit