Lightning &
Shading
What’s the difference?
Lighting - computing the luminous intensity for a specified 3D
point, given a viewpoint
- The goal is to simulate light sources and the way that the
light that they emit interacts with objects in the scene.
Shading - assigning colors to pixels.
Illumination - the transport of light from a source to a point via
direct and indirect paths
Illumination Models:
– Empirical - approximations to observed light properties
– Physically based - applying physics properties of light and its
interactions with matter
Two components
• Light Source Properties
• Color (Wavelength(s) of light)
• Shape
• Direction
• Object Properties
• Material
• Geometry
• Absorption
Light Source Properties
• Color
• We usually assume the light has one
wavelength
• Shape
• point light source - approximate the
light source as a 3D point in space.
Light rays emanate in all directions.
• good for small light sources (compared to
the scene)
• far away light sources
Light & Matter
The Interaction of Light & Matter
Light & Matter can interact in a number of different
ways:
• Matter can transmit light (glass, water).
• Matter can reflect light.
• Matter can gain energy by absorbing light.
• Matter can lose energy by emitting light.
The last two (absorption and emission) bear on
the internal energy of the matter.
Type of Materials
• In OpenGL, the material property that determines the size and
sharpness of specular highlights is called shininess. Shininess in
OpenGL is a number in the range 0 to 128. As the number increases,
specular highlights get smaller. This image shows eight spheres that
differ only in the value of the shininess material property:
• For the sphere on the left, the shininess is 0, which leads to an ugly
specular "highlight" that almost covers an entire hemisphere. Going
from left to right, the shininess increases by 16 from one sphere to
the ne
• When light strikes a surface, some of the light can be
absorbed, some can be reflected diffusely, and some
can be reflected specularly. The amount of reflection
can be different for different wavelengths. The
degree to which a material reflects light of various
wavelengths is what constitutes the color of the
material.
• See the materials different color:
1. Diffuse Color A material property that represents the proportion
of incident light that is reflected diffusely from a surface.
2. Specular Color A material property that represents the
proportion of incident light that is reflected specularly by a surface.
3. Ambient Color A material property that represents the
proportion of ambient light in the environment that is reflected by a
surface.
4. Emission Color A material property that represents color that is
intrinsic to a surface, rather than coming from light from other
sources that is reflected by the surface. Emission color can make the
object look like it is glowing, but it does not illuminate other
objects. Emission color is often called "emissive color."
Bidirectional Reflection
Distribution Function
(BRDF)
• The reflectance of an object can be represented by a function of the
incident and reflected angles
What affects the BRDF?
• The way light reflecting over the surface
• The smoothness/roughness of the surface
• Single reflection : if smooth, specular
• Multiple reflections : diffusive
• The shadowing effect
Isotropic and Anisotropic BRDFs
• Isotropic:
• Can model by diffuse +
specular reflection
• Anisotripic
• Brushed metal
• Cannot model by
diffuse + specular
reflection
How to get the
BRDF?
• Measure Data
• Use Analytical models
• Empirical models
• Microfacet
Measuring the BRDF
• Measured using a device called gonioreflectometer
• Casting light from various directions to the object, and
capturing the light reflected back
Problems with Measured BRDF
• Includes a lot of error
• Huge amount of time to capture
• The data size is enormous
• 18 hours acquisition time, 30GB raw data
• Ngan et al. EGSR ’05
-> Fitting the acquired data into analytical models
Analytical models
• Empirical models
• Gouraud, Phong models or more complex models
• Microfacet models
• Assuming the surface is composed of a large number of
micro mirrors
• Each reflect light back to the specular direction
Microfacet Theory
• [Torrance & Sparrow 1967]
• Surface modeled by tiny mirrors
• Value of BRDF at
• # of mirrors oriented halfway between and
where is the incoming direction, is the out going
direction
• Modulated by Fresnel, shadowing/masking
Examples : Satin
Examples : velvet
Light sources
• Ambient light – uniform lighting
• Point source – emits light equally in all directions
• Spotlight – characterized by a narrow range of angles
through which light is emitted
• Distance light sources – parallel rays of light
Ambient light
• A surface that is not exposed to direct light
may still be lit up by reflections from other
nearby objects.
• A much simpler way to model all of the
background reflected light is to assume that it
is just some constant color shining from every
direction equally ,This is referred to as
ambient
Point Sources
•Point Sources intensity depends
on the distance from the light
source
•Light is spreading steadily and
with equal intensity in all
directions.
•It is emitting light in all
directions equally.
Spotlight
• To turn a point light source into a spotlight we simply add a vector
direction and an angular limit.
• The spot light is the most expensive light source to compute.
• It is similar to a point light in that it has colors, attenuation and a
position, but spot lights have an additional direction and angle which
will define the area that is lit.
Distance light sources