I tried to make a little script to switch between linear/gamma mode programatically. It’s useful as a debug tool to be able to switch between these easily.
I tried making a few Editor scripts and successfully change PlayerSettings.colorSpace, however it doesn’t actually change anything in the scene… Seems like a bug…any ideas?
Here’s my script:
using UnityEngine;
using UnityEditor;
using System.Collections;
public static class LinearGammaSwitch
{
[MenuItem(“RenderHeads/Switch to Linear”)]
public static void SwitchToLinear()
{
PlayerSettings.colorSpace = ColorSpace.Linear;
Debug.Log("Set to " + PlayerSettings.colorSpace);
Debug.Log("Set to " + QualitySettings.activeColorSpace);
Debug.Log("Set to " + QualitySettings.desiredColorSpace);
}
[MenuItem(“RenderHeads/Switch to Gamma”)]
public static void SwitchToGamma()
{
PlayerSettings.colorSpace = ColorSpace.Gamma;
Debug.Log("Set to " + PlayerSettings.colorSpace);
Debug.Log("Set to " + QualitySettings.activeColorSpace);
Debug.Log("Set to " + QualitySettings.desiredColorSpace);
}
}