Hey everyone, simple question/discussion. Right now I am using gamma color space but am wondering if I should switch to linear. I believe this does not affect your final game and it is only for the scene view space but I just wanted to know. Let me know what you guys use. Thanks.
What’s your target platform?
You are wrong. It has effect on every part of your visuals. In a nutshell:
- computers usually store lighting information in a srgb (gamma corrected) fashion
- cameras get the information in a linear fashion (the more light hit the sensor of the camera the higher the number it stores, linearly)
- human perception is closer to a logarithmic curve, we see smaller changes in the darker areas and less in the brighter ones (evolutionary advantages: we saw the predators move in the dark so they didn’t eat us)
- the gamma you see in unity settings means that the settings and the textures you’re using was prepared in this gamma-corrected colorspace, every change was made in it
- the linear colorspace setting roughly means that you store the lighting information as is, you make your changes in physically closer to the realistic colors, so you can apply realistic effects and you convert the results once before you show to the viewers
more information and more explanation here (they are not Unity tutorials)
Alright, so basically computers can’t display all the colors that we can see so it uses a little trick called gamma correction to make it look right. So my one question is how this relates to unity. Does unity automatically use gamma color space or do I have to change something to make it do that whether it’s the lighting or the materials. Thanks for the help btw that first video was really good.

You choose if you want Unity to store your lightning already in gamme corrected (Gamma). Or you can choose to store in Linear (Linear). Some devices don’t support Linear (usually older or some mobiles).
If you choose Gamma, you get more “plastic”-like colors at the end, because everything is happening in gamma-correcter color space. All your changes, effects, etc. Basically Unity store everything in srgb and just shovel it out to the GPU.
If you choose Linear, everything will happen in physically more correct fashion (this is why the screenshot in Linear color space are more “natural”), so we can apply effects on more realistic lighting values. And the gamma correction will happen at the end, when everything is set (so the monitor can display the image).
It’s not perfect, so you can’t apply everything physically real (like for example sun light), but it’s close enough.
Obviously Linear is a little bit more resource-hungry, so better mobiles or better desktops usually support this or higher.
Also obviously my explanations are simplistic so it’s just vague approximation what’s happening really.
You can find a ton of resources online and in books usually related to lighting.
Wait so then what is the point of using gamma if linear is just what we see as is. I understand that gamma corrects the color to make it easier for us to see and understand the colors but is that just it? The linear looks more like the actual real life thing however, it’s hard to distinct the colors and values so computers change it to gamma? Like for example what do good games use and what do you personally use as a color space and why do you use it?
Gamma is how we used to do things. All older games use Gamma.
Gamma is also usually faster than Linear.
Alright so you suggest I use linear? Why would unity default to gamma though?
Ok, please explain this to me like I am an idiot. What is linear color space and what is gamma. I am soooo confused right now. I’m sorry I don’t get it I just really do not understand this at all.
Woah hold on I think I got it. Gamma color space is how are eyes see things in the real world because our eyes do not perceive light in a linear fashion. So that’s why gamma is so commonly used, however, linear is what the world actually SHOULD look like to our eyes so when you enable that color space everything looks the way that it naturally would. The game is in linear and then gamma correction is used to make it look like how the real world looks like to us and corrects it. Please tell me that’s right
So for example this image right here… the gradient on the left is linear and how the world should look(aka linear) and then the image to the right is how are eyes perceive that gradient(aka gamma). So what happens is that the computer receives the image as linear(aka as it is) and then changes it to gamma(aka the image on the right) so that it looks correct to our eyes… just like how we see the real world.
So if I use linear and then publish my game will it correct to gamma? Also what about my textures, will those be displayed in linear or gamma.
The final colors (and textures) you see on screen are always gamma-corrected. Choosing gamma or linear space does not affect this.
The only difference is that, when choosing linear, all colors are handled in linear space during lighting calculations (so more physically accurate). When the calculations are done, the result is converted to gamma space for displaying on screen.
So when I am making my game in linear, the final product isn’t any different than what it would be if I was working in gamma. It’s just easier to see lighting calculations during the making of the game. So why would you use that then? It doesn’t really make sense if the final product is going to be gamma anyway. And what exactly does physically accurate mean?
Think of it as like rounding errors. Converting to gamma reduces the precision/accuracy of the information. So as part of the rendering and lighting calculations you are getting further and further from the “correct” result each time those inaccurate values are used. It’s a destructive process.
By working in linear space you keep as much accuracy as possible right up to the end.
You should always pick linear. There is no longer any sane reason to use gamma IMHO. You can argue that some crappy old mobile might need gamma, but it’s not worth the hassle. Performance difference is too small to worry about as well.
Easiest analogy is for me: Linear is like recording/shooting in raw. You’ll get more dynamic range and more control over the endresult. If you got an over or underexposed spot in a scene you can’t get any more detail out of it no matter how much you post process.
100% incorrect. Working in linear means the full range of colour is able to be converted. Working in gamma is like saving over the same jpg over and over, it’s lossy. you clip half the colours and it looks like retro butt, and you get all this banding and lack of colour. I hope that makes it clearer.
In addition your post effects will also suck due to lack of colour information. All AAA games use linear.
TLDR: it’s dumb to go with gamma if your project has the option of using linear.
There are some situations like mobile VR on the GearVR/Go where quite recently Oculus was still recommending Gamma due to driver issues on some chipsets, but yeah for the most part Linear should just be a switch it on at the start of development by default kind of thing.
There’s still driver issues? ugh, just they need to fix that nonsense.
