What is the difference between ambient and skylight lighting? Please give me a detailed description of the differences.
2 Answers
Ambient lighting is just a constant term modulated by surface color.
Sky light can mean many different things, it might depend a bit on engine/library/app:
- Directional light casting shadows. This gives you the direct illumination from a sun
- Multi directional ambient light, where incoming is sampled along world normal from some kind of data structure, usually a 4x4x6 cubemap or just an equation. This will give you an overall ambient term that is brighter in the suns direction, blue in the sky and brown/green from the ground.
Usually it is just the latter, or a combination of the two.
-
\$\begingroup\$ Can you be more specific about how ambient light can be multi directional? I mean, to my knowledge ambient light does not have a direction, it has constant intensity in every point, how can it be multidirectional? Actually I think I understand what's that supposed to be, but still,
Multi directional ambient light
is confusing. \$\endgroup\$ Commented Jun 1, 2011 at 18:04 -
\$\begingroup\$ @Daniel Szalay It is quite common to fake environment lighting by having different ambient lighting in different directions. The Source Engine does this by storing 6 color values (one for each positive and negative axis) and then blends a color along the surface normal from them. This color is then applied as an ambient term. You can look at it as a very lowres cubemap. \$\endgroup\$– voidCommented Jun 1, 2011 at 18:13
Ambient light is an abstract concept. Typical computer light simulations divide light into 4 categories: specular (light from a specific source reflecting directly off an object), diffuse (light from a specific source reflecting indirectly off the object), emissive (light being created by the object itself), and ambient (light from all other sources being reflected off the object). You blend these 4 (although emissive is rarely used) to simulate the effects of the various lights in the scene. A material or part of a material will have different reflectivity values for these 4 light types to determine how it appears - eg. a shiny surface will favour the specular, whereas a rough or fuzzy surface will favour the diffuse.
As such, you might use the ambient lighting to simulate some light from the sky, but you will probably simulate more of that light by a directional light that is seen as specular and diffuse reflections. The ambient light helps to simulate the daylight that hits the object from random angles due to bouncing off other objects. However there are a variety of different ways to achieve this, all more realistic than simply setting a simple ambient light level.