Enable Color Temperature Mode in Unity

Color Temperature Mode allows us to set the colors of the lights in the scene with Kelvin values instead of RGB values. For example White is 6500 Kelvin according to the D65 standard. Candle light is 1800 Kelvin.

Gradient between different color temperatures
By Bhutajata [CC BY-SA 4.0 ], from Wikimedia Commons

Using color temperatures is a more convenient way to set realistic light colors so here is how to do it!

How-to

Somehow the settings to enable color temperature mode are hidden at the time of writing. So here are the steps to make them visible and enable them:

  1. Open Project Settings > Graphics
  2. Enable Debug Mode in Inspector
  3. Check Lights Use Linear Intensity
  4. Check Lights Use Color Temperature
  5. Disable Debug Mode in Inspector
  6. Select a light in the scene or create a new one
  7. Check Use color temperature mode
  8. Repeat for each light you want to use with color temperature mode

Issues with Baking / Lightmapping

Unfortunately the Lightmapper seems to ignore the color temperatures on the lights when baking by the time of writing. So when you would like to use baked or mixed lighting you can not use the Kelvin values. Instead you can use the normal filter value of the light to change its color. Therefore I created a set of color swatches with the help of the Kelvin to RGB calculator from Academo.org. It includes the following colors:

Kelvin
Red
Green
Blue
Hex
1500
255
108
0
#FF6C00
3200
255
184
123
#FFB87B
4000
255
206
166
#FFCEA6
5600
255
239
225
#FFEFE1
6500
255
254
250
#FFFEFA
8000
221
230
255
#DDE6FF
10000
202
218
255
#CADAFF
12000
191
211
255
#BFD3FF
15000
181
205
255
#B5CDFF

You can download the set here. Follow these steps to install the set:

  1. Open a color window in Unity
  2. Under Swatches click the option icon
  3. Select Reveal Current Library Location
  4. Extract the ZIP-file to that location
  5. In Unity open the color window again
  6. Click the option icon again under Swatches
  7. Select the new entry Temperature Colors

Of course you can use these swatches also without using color temperature mode at all. In that case you could skip the whole activation process from the beginning and just set the light colors directly with the swatches. But it might be necessary to switch on Lights Use Linear Intensity in the Graphics settings anyway. I am not sure about that.

If you know more about that topic or if there is something I can improve, please let me know in the comments!

More information

https://en.wikipedia.org/wiki/Color_temperature

Published by

Chris

Christian Kauppert is CTO & Head of XR Engineering at MSM.digital AR / VR Labs. Before he worked as a freelance Unity developer and VFX compositor for over 9 years. He uses this blog to show and write about selected works. Occasionally Chris also writes about issues and solutions he stumbles upon while developing interactive experiences and XR applications.

2 thoughts on “Enable Color Temperature Mode in Unity”

  1. I cannot find a way to enable Debug for Project Settings > Graphics. For me in unity 2021.3.4f1 there is no option to enable debugging for the Graphics window. I’m using URP 12.7. Is this option only available for the old built-in render pipeline?

    1. Hi Chris, you can enable Debug mode for the Inspector by right clicking on the Inspector tab, but I’m not sure if that still works with newer versions of Unity and URP. The post is quite old.

Leave a Reply

Your email address will not be published. Required fields are marked *