- Home /
Overly bright textures in linear color space, how to solve? [Solved]
Hello guys,
today we realized that we still had our project in gamma color space, and following the suggestion of our 3d guy we switched to linear color space. As expected indeed (i had already done it in other smaller projects) colors got brighter, particles started superposing much better (the smoke effect when from zero to hero), etc.
But a lot of recently made UI elements got a very weird effect. When the editor is not playing, they look perfect. When I hit play they brighten up a lot. I checked and the sRGB is ticked in the import (ticked or unticked does look the same anyway). When i stop playing they return to normal color (the change doesn't only happen in the camera, but also in the scene view). I also tested the same textures as sprites and they have the same problem. To make it even stranger, some textures produced quite recently (after some and before some of those that have the problem with brightness) instead keep on working like a charm.
We made some experiments, and indeed, when exporting from photoshop purely linear textures (that look very dark in inspector and editor) when we hit play mode, those become normal.
As additional hints i figured out. Those same textures that get that bright in the main project, work well in a small simple project in linear space, and also, we tried to process one of them through NUKE (just loading it and exporting it from there as PNG) and it works.
Here's an example of how they look (it almost looks like no sRGB is applied, but it is) in scene (with no play mode active) and in play mode (looks the same in scene) once play mode is active.
I am quite confused on what to look at now given this overall strange behaviors, any idea if it's a bug of any sort, if there is something weird that i might be doing or if anyone had any similar experiences?
Working in Windows 10 with Unity2017.2.0f3
Cheers and thanks in advance,
H
Answer by drHogan · Oct 23, 2017 at 02:53 PM
So, it looks like in the end i solved it. Whenever you use unity Sprite Atlases, remember that by default they have the sRGB unticked, and therefore will have issues in linear space if you don't set it true. Also remember that if you set one of those to fish its textures from a folder, when you upload pictures on that folder, they will get loaded right away into the atlas (and therefore, in case, having their sRGB value overwritten.
Can you elaborate on how you solved this? I am encountering the same issue, however I don't see a way to make the Sprite Atlas use sRGB. We are using a slightly older version of Unity, however even the 2017.2 manual page ( https://docs.unity3d.com/$$anonymous$$anual/SpriteAtlas.html ) doesn't show this as a setting. All of the individual assets added to the Sprite Atlas have sRGB checked.
Thank you for your time
Hi @funnersoft,
Here you see how I did setup my sprite atlases, with the ticked sRGB.
I am using 2017.2 so I can't really say about older versions.
Hi,
I have the same issue.
Effectivement, this option is not avalaible in 2017.1.1f1.
Thank you for sharing this information.