<s>
Shading	B-General_Concept
refers	O
to	O
the	O
depiction	O
of	O
depth	O
perception	O
in	O
3D	O
models	O
(	O
within	O
the	O
field	O
of	O
3D	O
computer	O
graphics	O
)	O
or	O
illustrations	O
(	O
in	O
visual	O
art	O
)	O
by	O
varying	O
the	O
level	O
of	O
darkness	O
.	O
</s>
<s>
Shading	B-General_Concept
tries	O
to	O
approximate	O
local	O
behavior	O
of	O
light	O
on	O
the	O
object	O
's	O
surface	O
and	O
is	O
not	O
to	O
be	O
confused	O
with	O
techniques	O
of	O
adding	O
shadows	O
,	O
such	O
as	O
shadow	O
mapping	O
or	O
shadow	O
volumes	O
,	O
which	O
fall	O
under	O
global	O
behavior	O
of	O
light	O
.	O
</s>
<s>
Shading	B-General_Concept
is	O
used	O
traditionally	O
in	O
drawing	O
for	O
depicting	O
a	O
range	O
of	O
darkness	O
by	O
applying	O
media	O
more	O
densely	O
or	O
with	O
a	O
darker	O
shade	O
for	O
darker	O
areas	O
,	O
and	O
less	O
densely	O
or	O
with	O
a	O
lighter	O
shade	O
for	O
lighter	O
areas	O
.	O
</s>
<s>
Light	O
patterns	O
,	O
such	O
as	O
objects	O
having	O
light	O
and	O
shaded	B-General_Concept
areas	O
,	O
help	O
when	O
creating	O
the	O
illusion	O
of	O
depth	O
on	O
paper	O
.	O
</s>
<s>
There	O
are	O
various	O
techniques	O
of	O
shading	B-General_Concept
,	O
including	O
cross	B-Application
hatching	I-Application
,	O
where	O
perpendicular	O
lines	O
of	O
varying	O
closeness	O
are	O
drawn	O
in	O
a	O
grid	O
pattern	O
to	O
shade	O
an	O
area	O
.	O
</s>
<s>
Powder	O
shading	B-General_Concept
is	O
a	O
sketching	O
shading	B-General_Concept
method	O
.	O
</s>
<s>
In	O
computer	O
graphics	O
,	O
shading	B-General_Concept
refers	O
to	O
the	O
process	O
of	O
altering	O
the	O
color	O
of	O
an	O
object/surface/polygon	O
in	O
the	O
3D	O
scene	O
,	O
based	O
on	O
things	O
like	O
(	O
but	O
not	O
limited	O
to	O
)	O
the	O
surface	O
's	O
angle	O
to	O
lights	O
,	O
its	O
distance	O
from	O
lights	O
,	O
its	O
angle	O
to	O
the	O
camera	O
and	O
material	O
properties	O
(	O
e.g.	O
</s>
<s>
bidirectional	O
reflectance	O
distribution	O
function	O
)	O
to	O
create	O
a	O
photorealistic	B-Application
effect	O
.	O
</s>
<s>
Shading	B-General_Concept
is	O
performed	O
during	O
the	O
rendering	O
process	O
by	O
a	O
program	O
called	O
a	O
shader	O
.	O
</s>
<s>
Shading	B-General_Concept
alters	O
the	O
colors	O
of	O
faces	O
in	O
a	O
3D	O
model	O
based	O
on	O
the	O
angle	O
of	O
the	O
surface	O
to	O
a	O
light	O
source	O
or	O
light	O
sources	O
.	O
</s>
<s>
The	O
third	O
image	O
has	O
shading	B-General_Concept
enabled	O
,	O
which	O
makes	O
the	O
image	O
more	O
realistic	O
and	O
makes	O
it	O
easier	O
to	O
see	O
which	O
face	O
is	O
which	O
.	O
</s>
<s>
When	O
a	O
shader	O
computes	O
the	O
result	O
color	O
,	O
it	O
uses	O
a	O
lighting	B-General_Concept
model	I-General_Concept
to	O
determine	O
the	O
amount	O
of	O
light	O
reflected	O
at	O
specific	O
points	O
on	O
the	O
surface	O
.	O
</s>
<s>
Different	O
lighting	B-General_Concept
models	I-General_Concept
can	O
be	O
combined	O
with	O
different	O
shading	B-General_Concept
techniques	O
—	O
while	O
lighting	O
says	O
how	O
much	O
light	O
is	O
reflected	O
,	O
shading	B-General_Concept
determines	O
how	O
this	O
information	O
is	O
used	O
in	O
order	O
to	O
compute	O
the	O
final	O
result	O
.	O
</s>
<s>
It	O
may	O
for	O
example	O
compute	O
lighting	O
only	O
at	O
specific	O
points	O
and	O
use	O
interpolation	B-Algorithm
to	O
fill	O
in	O
the	O
rest	O
.	O
</s>
<s>
A	O
directional	O
light	O
source	O
illuminates	O
all	O
objects	O
equally	O
from	O
a	O
given	O
direction	O
,	O
like	O
an	O
area	O
light	O
of	O
infinite	O
size	O
and	O
infinite	O
distance	O
from	O
the	O
scene	O
;	O
there	O
is	O
shading	B-General_Concept
,	O
but	O
cannot	O
be	O
any	O
distance	O
falloff	O
.	O
</s>
<s>
The	O
distance	O
falloff	O
effect	O
produces	O
images	O
which	O
have	O
more	O
shading	B-General_Concept
and	O
so	O
would	O
be	O
realistic	O
for	O
proximal	O
light	O
sources	O
.	O
</s>
<s>
During	O
shading	B-General_Concept
a	O
surface	O
normal	O
is	O
often	O
needed	O
for	O
lighting	O
computation	O
.	O
</s>
<s>
This	O
is	O
usually	O
used	O
when	O
more	O
advanced	O
shading	B-General_Concept
techniques	O
are	O
too	O
computationally	O
expensive	O
.	O
</s>
<s>
Specular	O
highlights	O
are	O
rendered	O
poorly	O
with	O
flat	O
shading	B-General_Concept
:	O
If	O
there	O
happens	O
to	O
be	O
a	O
large	O
specular	O
component	O
at	O
the	O
representative	O
vertex	O
,	O
that	O
brightness	O
is	O
drawn	O
uniformly	O
over	O
the	O
entire	O
face	O
.	O
</s>
<s>
Consequently	O
,	O
the	O
specular	O
reflection	O
component	O
is	O
usually	O
not	O
included	O
in	O
flat	O
shading	B-General_Concept
computation	O
.	O
</s>
<s>
In	O
contrast	O
to	O
flat	O
shading	B-General_Concept
where	O
the	O
colors	O
change	O
discontinuously	O
at	O
polygon	O
borders	O
,	O
with	O
smooth	B-General_Concept
shading	I-General_Concept
the	O
color	O
changes	O
from	O
pixel	O
to	O
pixel	O
,	O
resulting	O
in	O
a	O
smooth	O
color	O
transition	O
between	O
two	O
adjacent	O
polygons	O
.	O
</s>
<s>
Usually	O
,	O
values	O
are	O
first	O
calculated	O
in	O
the	O
vertices	O
and	O
bilinear	O
interpolation	B-Algorithm
is	O
used	O
to	O
calculate	O
the	O
values	O
of	O
pixels	O
between	O
the	O
vertices	O
of	O
the	O
polygons	O
.	O
</s>
<s>
Types	O
of	O
smooth	B-General_Concept
shading	I-General_Concept
include	O
Gouraud	B-Algorithm
shading	I-Algorithm
and	O
Phong	O
shading	B-General_Concept
.	O
</s>
<s>
Interpolate	O
the	O
vertex	O
intensities	O
using	O
bilinear	O
interpolation	B-Algorithm
over	O
the	O
surface	O
polygon	O
.	O
</s>
<s>
Phong	O
shading	B-General_Concept
is	O
similar	O
to	O
Gouraud	B-Algorithm
shading	I-Algorithm
,	O
except	O
that	O
instead	O
of	O
interpolating	O
the	O
light	O
intensities	O
the	O
normals	O
are	O
interpolated	O
between	O
the	O
vertices	O
and	O
the	O
lighting	O
is	O
evaluated	O
per-pixel	O
.	O
</s>
<s>
Thus	O
,	O
the	O
specular	O
highlights	O
are	O
computed	O
much	O
more	O
precisely	O
than	O
in	O
the	O
Gouraud	B-Algorithm
shading	I-Algorithm
model	O
.	O
</s>
<s>
Using	O
bilinear	O
interpolation	B-Algorithm
compute	O
a	O
normal	O
,	O
Ni	O
for	O
each	O
pixel	O
.	O
</s>
<s>
Deferred	O
shading	B-General_Concept
is	O
a	O
shading	B-General_Concept
technique	O
by	O
which	O
computation	O
of	O
shading	B-General_Concept
is	O
deferred	O
to	O
later	O
stage	O
by	O
rendering	O
in	O
two	O
passes	O
,	O
potentially	O
increasing	O
performance	O
by	O
not	O
discarding	O
expensively	O
shaded	B-General_Concept
pixels	O
.	O
</s>
<s>
The	O
first	O
pass	O
only	O
captures	O
surface	O
parameters	O
(	O
such	O
as	O
depth	O
,	O
normals	O
and	O
material	O
parameters	O
)	O
,	O
the	O
second	O
one	O
performs	O
the	O
actual	O
shading	B-General_Concept
and	O
computes	O
the	O
final	O
colors	O
.	O
</s>
<s>
Both	O
Gouraud	B-Algorithm
shading	I-Algorithm
and	O
Phong	O
shading	B-General_Concept
can	O
be	O
implemented	O
using	O
bilinear	O
interpolation	B-Algorithm
.	O
</s>
<s>
Bishop	O
and	O
Weimer	O
proposed	O
to	O
use	O
a	O
Taylor	O
series	O
expansion	O
of	O
the	O
resulting	O
expression	O
from	O
applying	O
an	O
illumination	O
model	O
and	O
bilinear	O
interpolation	B-Algorithm
of	O
the	O
normals	O
.	O
</s>
<s>
Hence	O
,	O
second-degree	O
polynomial	O
interpolation	B-Algorithm
was	O
used	O
.	O
</s>
<s>
This	O
type	O
of	O
biquadratic	O
interpolation	B-Algorithm
was	O
further	O
elaborated	O
by	O
Barrera	O
et	O
al.	O
,	O
where	O
one	O
second-order	O
polynomial	O
was	O
used	O
to	O
interpolate	O
the	O
diffuse	O
light	O
of	O
the	O
Phong	O
reflection	O
model	O
and	O
another	O
second-order	O
polynomial	O
was	O
used	O
for	O
the	O
specular	O
light	O
.	O
</s>
<s>
Spherical	O
linear	O
interpolation	B-Algorithm
(	O
Slerp	O
)	O
was	O
used	O
by	O
Kuij	O
and	O
Blake	O
for	O
computing	O
both	O
the	O
normal	O
over	O
the	O
polygon	O
,	O
as	O
well	O
as	O
the	O
vector	O
in	O
the	O
direction	O
to	O
the	O
light	O
source	O
.	O
</s>
<s>
A	O
similar	O
approach	O
was	O
proposed	O
by	O
Hast	O
,	O
which	O
uses	O
quaternion	O
interpolation	B-Algorithm
of	O
the	O
normals	O
with	O
the	O
advantage	O
that	O
the	O
normal	O
will	O
always	O
have	O
unit	O
length	O
and	O
the	O
computationally	O
heavy	O
normalization	O
is	O
avoided	O
.	O
</s>
<s>
In	O
computer	B-Application
vision	I-Application
,	O
some	O
methods	O
for	O
3D	B-Algorithm
reconstruction	I-Algorithm
are	O
based	O
on	O
shading	B-General_Concept
,	O
or	O
shape-from-shading	O
.	O
</s>
<s>
Based	O
on	O
an	O
image	O
's	O
shading	B-General_Concept
,	O
a	O
three-dimensional	O
model	O
can	O
be	O
reconstructed	O
from	O
a	O
single	O
photograph	O
.	O
</s>
