Search Issue Tracker
By Design
Votes
0
Found in
2018.3.0a1
2018.3.0f2
2019.1.0a1
2019.2.0a1
2019.3.0a1
Issue ID
1147622
Regression
Yes
Everything is too bright when using Linear Color Space with IMGUI (onGUI)
How to reproduce:
1. Open attached project
2. Open UnityLinearLightingBug scene
3. Go to Player Settings
4. Change Player>Rendering>Color Space to Linear and later to Gamma
5. Enter Play Mode to see differences
Reproducible with: 2018.3.0a1, 2018.3.14f1, 2019.1.0f2, 2019.2.0a13, 2019.3.0a1
Not reproducible with: 2017.4.26f1, 2018.2.21f1
Actual results: Linear mode is way lighter
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note (2019.3.X):
Starting from 2018.3, GL.sRGBWrite is always set to true when the project's Color Space is set to Linear. This affects OnGUI drawing. Using the Linear Color Space project setting requires matching of GL.sRGBWrite and input texture formats and render target formats. If any of those three is off, the colors will end up affected (washed out or burned). The provided example uses a certain plug-in for drawing dialogs based on the OnGUI technique. Upon inspection, it doesn't seem to be aware of Gamma/Linear color space projects. The easiest fix is to wrap the drawing code after the call to StartRenderTextures() with GL.sRGBWrite = false and restore the value back before calling EndRenderTextures(). However, please note that at run-time this causes a render-target rebind which might be slow on some platforms.
My first recommendation is to avoid using OnGUI for drawing content in production altogether, as this system is built for debugging support, not production. Second, the plug-in authors should adjust their system to be "Linear color-space projects" friendly by ensuring the right choice of texture formats and render textures when under GL.sRGBWrite=true.