Search Unity

Temporary render texture resolution affects performance or not (Graphics.Blit)

Discussion in 'Image Effects' started by mahdiii, Mar 8, 2020.

  1. mahdiii

    mahdiii

    Joined:
    Oct 30, 2014
    Posts:
    856
    Hi. When we use smaller temporary render textures than the source, it can gain performance or not?
    How does Graphics.Blit work when source and temporary render textures do not have the same resolution? interpolation or etc.
    And do we need to write GL.Clear like below?

    Code (CSharp):
    1.  tempTexture = RenderTexture.GetTemporary(currentWidth, currentHeight, 0, RenderTextureFormat.Default);
    2.             Graphics.SetRenderTarget(tempTexture);
    3.            // GL.Clear(true, true, Color.black);
    4.             Graphics.Blit(src, tempTexture, Materials[0]);
    5.             Graphics.SetRenderTarget(src);
    6.             //GL.Clear(true, true, Color.black);
     
    Last edited: Mar 8, 2020