Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Gamma vs linear color space perfomance issue.

Discussion in 'General Graphics' started by thorham3011, Jul 31, 2020.

  1. thorham3011

    thorham3011

    Joined:
    Sep 7, 2017
    Posts:
    25
    Why is it that when I use linear color space instead of gamma, the frame rate halves?

    Seems very strange that gamma color space performs at twice the speed, especially so seeing how I managed to modify the standard lighting code to approximate linear color space without this massive performance penalty (it's not noticeable).

    Graphics card is an Amd Radeon HD 6450 (DirectX 11.2). Cpu is an Amd A4-3400 Apu.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,238
    Because it's a nearly 10 year old entry-level GPU? Not even sure why that system has a dedicated GPU since the APU's built in graphics are almost identical in performance. No, really. The HD 6450 is only slightly faster than the HD 6410D in the APU.

    Older DX11 GPUs may have had support for linear space color, but it doesn't mean they could do it well. Most likely the hardware didn't actually support it directly and the GPU is doing a lot of extra work behind the scenes to support linear space render targets. Modern GPUs on the other hand have support for linear space built into the hardware. Some modern mobile GPUs may actually be excluding some hardware support for gamma space rendering! But linear space rendering wasn't as common in 2010 when that GPU was being made, and again, it's the entry-level GPU, so they may have skimped on a lot of hardware features the high end versions might have had.
     
  3. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    It's old, but it's not that old that it wouldn't support sRGB rendering. I remember playing Super Street Fighter IV at 720p 60fps back in the day with one of those. It's basically the Wii U GPU, give or take a few things. And I remember using sRGB rendering (but not with Unity) in a much older AMD GPU (HD 4850, RIP).

    But it's old enough that it might have driver issues or some such and internally Unity kicks in some sort of workaround for it when linear is enabled based on some compatibility list.

    Also, are you sure you just changed the color space? If you enabled HDR as well, that might explain the massive drop.
     
  4. thorham3011

    thorham3011

    Joined:
    Sep 7, 2017
    Posts:
    25
    It has it's own RAM which is much better than shared RAM.

    Absolutely.

    So it's probably crappy support for linear color space on my card. Guess I'll just use a custom shader.

    Thanks.
     
    Last edited: Aug 2, 2020