This is a very short question. I want to implement ambient light in the color of daylight from the sun. What is the color value of sun light?

  • \$\begingroup\$ when you say "ambient" are you referring to a global light value, or will the light from the sun be directed from a source (the sun)? \$\endgroup\$
    – Eric B
    Jan 7, 2013 at 17:32
  • \$\begingroup\$ It will be applied as global light value multiplied by a number smaller than one. \$\endgroup\$
    – danijar
    Jan 7, 2013 at 17:43
  • 3
    \$\begingroup\$ Why would game developers know what color daylight is? \$\endgroup\$
    – House
    Jan 7, 2013 at 18:10

2 Answers 2


That depends. Our perceived color of the sun depends on a variety of factors -- the color we observe is due primarily to the scattering of the light in the atmosphere, so the content and quality of the atmosphere has an impact along with the sun's relative position in the sky.

Wikipedia's article on color temperature has some reference values for the sun, but does note that they may vary wildly. However if all you're after is a quick-and-dirty color value, one of them may suffice.

Practically speaking, the formula you use to apply this color in your lighting calculations will have a large impact on the resulting scene as well. Simply modulating the color into your lighting calculations as an ambient term might result in overly orange or tinted renders -- in many cases, you'll probably want to either use something more complex to make the impact of the sunlight color subtle, or you'll want to do nothing at all (if your scenes are always in "broad daylight" you don't really need to involve simulation of the sunlight).

Especially if you're going to have the sunlight color vary based on the time of day (or weather conditions) you'll also want to consider rendering your skybox appropriately. Papers such as Preetham/Shirley/Smit's's Practical Analytical Model for Daylight are a good place to look at for reference and inspiration. You can also check out this repository of sky-rendering-related links.


At midday, RGB of (1,1,1) or plain white light.

At sunrise, a little more blue looks pretty good. Tweak until you have good results.

At sunset, a lot more red looks good. Tweak as above.

At evening or night, go with a dark blue. This isn't really based in reality but it's common enough.

  • \$\begingroup\$ Why would sunrise be different from sunset? \$\endgroup\$ Apr 11, 2020 at 3:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .