Search Unity

Question does casting RenderTexutreFormat into TextureFormat work?

Discussion in 'General Graphics' started by laurentlavigne, May 19, 2023.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,322
    always wondered if we can do something like this var texture2D = new Texture2D(renderTexture.width, renderTexture.height, (TextureFormat) renderTexture.format, false);
    shouldn't be since the numerations are different but who knows with unity magic.
     
  2. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    665
    Last edited: May 20, 2023