Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

YUV420 color space via Shaders

Discussion in '2D' started by dimatsiak, Apr 20, 2021.

  1. dimatsiak

    dimatsiak

    Joined:
    Jan 29, 2020
    Posts:
    4
    Hello,

    I am trying to render a YUV420 image color space into a Texture2D object. I relied on this link from StackOverflow and I set the shader as it is. Afterward, I load the data and I try to feed the tex as
    Texture2D(dimension.width, dimension.height, TextureFormat.RGB24, false);


    through the
    tex.LoadRawTextureData(pImage, pImageSize);
    which the pImage is a pointer.

    Although, I know the fact that a YUV420 image has half-size than RGB but I can't set the Texture2D with the appropriate TextureFormat.

    Do you have any suggestions?
     
  2. kennyy_

    kennyy_

    Unity Technologies

    Joined:
    Apr 7, 2021
    Posts:
    6
unityunity