Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

RenderTexture format missing RGB

Discussion in 'General Graphics' started by SJones88, Jan 30, 2021.

  1. SJones88

    SJones88

    Joined:
    May 22, 2017
    Posts:
    5
    When creating a RenderTexture asset you can set the color format like with other textures, however It doesnt have any option for RGB, only has R, RG & RGBA (8, 16, 32, signed, unsigned etc) only time I can see just RGB is the packed formats.
    Is this a bug or is it by design - if by design could someone explain why?

    P.S. using unity 2021.1 beta

    RTT.jpg
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,376
    GPUs generally don't support RGB render targets, apart from R5G6B5 and R11G11B10, which are on the list. GPUs like render targets that are aligned to powers of 2 byte sizes. Specifically 8, 16, 32, 64, or 128 bit (1, 2, 4, 8, or 16 bytes). And mismatched channel precision tends to be something of a last resort as it causes color shifting, hence why R5G5B6A1 and R10G10B10A2 both exist. R5G6B5 used to be popular in the past, a lot of early GPUs used that is the default render format back when rendering to a 16 bit color vs 24 bit color was the difference between playable framerates and a slide show. And R11G11B10 saw some use in early HDR rendering when there weren't really any other options, and deferred rendering for the normal buffer. But today those are almost always using RGBA half or R10G10B10A2. The precision is uniform, at least for the RGB channels, and you get an extra channel to pack a little more data for free.
     
  3. SJones88

    SJones88

    Joined:
    May 22, 2017
    Posts:
    5
    Great answer, thank you!
     
    futurlab_xbox likes this.