SLIDE 1
Week 6 -Wednesday What did we talk about last time? Light Material - - PowerPoint PPT Presentation
Week 6 -Wednesday What did we talk about last time? Light Material - - PowerPoint PPT Presentation
Week 6 -Wednesday What did we talk about last time? Light Material Sensors In general, sensors are made up of many tiny sensors Rods and cones in the eye Photodiodes attached to a CCD in a digital camera Dye
SLIDE 2
SLIDE 3
SLIDE 4
SLIDE 5
SLIDE 6
SLIDE 7
In general, sensors are made up of
many tiny sensors
- Rods and cones in the eye
- Photodiodes attached to a CCD in a
digital camera
- Dye particles in traditional film
Typically, an aperture restricts the
directions from which the light can come
Then, a lens focuses the light onto
the sensor elements
SLIDE 8
Irradiance sensors can't produce an image because they
average over all directions
Lens + aperture = directionally specific Consequently, the sensors measure radiance (L), the density
- f light per flow area AND incoming direction
SLIDE 9
In a rendering system, radiance is
computed rather than measured
A radiance sample for each imaginary
sensor element is made along a ray that goes through the point representing the sensor and point p, the center of projection for the perspective transform
The sample is computed by using a
shading equation along the view ray v
SLIDE 10
SLIDE 11
SLIDE 12
After all this hoopla is done, we need a mathematical
equation to say what the color (radiance) at a particular pixel is
There are many equations to use and people still do research
- n how to make them better
Remember, these are all rule of thumb approximations and
are only distantly related to physical law
SLIDE 13
Diffuse exitance Mdiff = cdiff ⊗ EL cos θ Lambertian (diffuse) shading assumes that outgoing radiance
is (linearly) proportional to irradiance
Because diffuse radiance is assumed to be the same in all
directions, we divide by π (explained later)
Final Lambertian radiance Ldiff =
θ cos
diff L
E π ⊗ c
SLIDE 14
Specular shading is dependent on the angles between the
surface normal to the light vector and to the view vector
For the calculation, we compute h, the half vector half
between v and l
v l v l h + + =
SLIDE 15
The total specular exitance is almost exactly the same as the total
diffuse exitance:
- Mspec = cspec ⊗ EL cos θ
What is seen by the viewer is a fraction of Mspec dependent on the
half vector h
Final specular radiance
- Lspec =
Where does m come from? It's the smoothness parameter
θ cos cos 8 8
spec L h m
E φ π m ⊗ + c
SLIDE 16
Final lighting is: We want to implement this in shaders The book goes into detail about how often it is computed
- Note that many terms can be precomputed, only the ones with
angles in them change
∑
=
⊗ + + =
n i L h m
E m L
i
1 i spec diff
θ cos cos 8 8 ) ( c c v φ π π
SLIDE 17
Computing the shading equation more often gives better visual results but
takes more time
Flat shading
- Computes shading equation once per primitive
Gouraud shading
- Computes shading equation once per vertex, linearly interpolates color for pixel values
Phong shading
- Computes color per pixel
SLIDE 18
SLIDE 19
When sampling any continuous thing (image, sound, wave)
into a discrete environment (like the computer), multiple samples can end up being indistinguishable from each other
This is called aliasing We can reduce aliasing by carefully considering how sampling
and reconstruction of the signal is done
SLIDE 20
Ever seen wheels of a car spinning the wrong way? Without enough samples, it may be impossible to tell which way it's
spinning
You need a sampling frequency twice as high as the maximum frequency
- f the events to reconstruct the original signal
Called the Nyquist limit
SLIDE 21
SLIDE 22
SLIDE 23
Review for Exam 1 Review all material covered so far Exam 1 is next Monday in class
SLIDE 24