Outline for Today
Lighting and Shading
Administration
Today
- Reminder that our next meeting is Wednesday, November 13 (Monday is Remembrance Day)
- Opportunities for Feedback (open until 13 November at 1 minute to midnight)
- I neglected to mention that I will be using gradescope.com for marking the exam – you likely received a strange email from them – it has a lot of nice features that protect you from having to read my handwritten comments. When I am finished marking next week, you will be able to ask questions about the marks you received using the platform
- shadedCube
- shadedCube2
For Next Meeting
Wiki
Link to the UR Courses wiki page for this meeting
Media
Transcript
Audio Transcript
-
So what kind of shading
have we used so far? What's the
-
way to describe it?
-
Would You like a vowel?
-
Wow, yes. I
-
So what other information Can we
Add?
-
Models and
-
light. Yeah, We can add Lights.
We're
-
when can we add to describe how
the light is going interact with
-
a cube? Let's say I
-
so we can add
-
material descriptions, or we
have the model of the surface
-
so we can get different effects
when we Apply the
-
when that Surface is lit. I
-
so We can think about
-
describing The
-
so we have a
-
plate that comes back from
interacting with the surface. We
-
can describe in terms of
ambient, diffuse and specular
-
components and
-
so shading, a proper shading,
gives us a sense of three
-
dimensional quality jumping out
of the computer screen. So we're
-
talk about the types of lights
we can use and interaction with
-
materials, and
-
then we'll talk about how that
can be implemented on graphics
-
hardware.
-
So the first one looks like a
circle. Does the second one look
-
like a sphere? I
-
It's not terribly convincing to
me. I
-
so we agree with this assessment
that the light material
-
interactions on each point have
a different color or shade, so
-
we don't see a flat color.
That's the variation of the
-
surface.
-
So in addition to light sources
and material properties, we can
-
also take into account the
location of the viewer and the
-
regulation of the surface so
-
We can think about scattering
light in the scene and
-
light strike surface A. Sun is
scattered. Sun is absorbed. Some
-
of that scattered light strikes
B, some scattered Sun absorbed,
-
some of the scattered light
strikes a and
-
So that's keeping track of A lot
of interactions and
-
so we
-
we have a description of
scattering and absorption, but
-
it doesn't have a general
solution, and we can ray trace
-
using ray tracing With perfectly
reflective services and again,
-
an accurate model.
-
So you can see there's a lot to
keep track of. If we're
-
going to do an accurate
rendering, we're it.
-
So in this picture of global
effects, we see the light
-
source,
-
Shadow, multiple reflections,
and here's A translucent
-
surface. So in that case, some
length reflects and sun passes
-
through the object The
-
so global illumination isn't
suited to graphics hardware. So
-
to the graphics hardware
pipeline.
-
But we're happy if we can make
it look reasonably good. So
-
there are some techniques to be
used to simulate global
-
illumination effects. Light
strikes an object is partially
-
absorbed, length of strikes an
object is partially absorbed,
-
partially scattered, reflected.
The amount reflected terms of
-
color and brightness of the
object. The surface appears red
-
under white light, because the
red component of the light is
-
reflected and the rest is
absorbed. The
-
reflected light is scattering
back, and depends on The smooth,
-
smoothness and orientation of
The surface You
-
So what kinds of legs are
available for computer graphics?
-
I
-
Are you talking about like
directional and positional
-
or Yeah, so I
-
so
-
if we specify This a position of
a light in the scene and
-
so it's, we have the leg Coming
from a point, so it doesn't have
-
any I need. Geometry is just a
point, and light is emitted in
-
every direction, if
-
we specify direction
-
it's like when we move
-
object off to infinity, whereas
if we're looking at something
-
close,
-
the directions are quite
different from the eye to
-
different parts of the scene. If
you move that off to infinity,
-
then the projectors become
parallel and
-
so when We think of a
directional light, the light has
-
a
-
so what's a directional light
source that we see most days?
-
Yeah,
-
so if we take a white light
source and restrict the
-
if we restrict the directions in
which it is emitting, If
-
so then we have a Spot like I
-
so we talked. We've talked about
These ambient Light. I
-
so we can Cover up. We can we
make stuff look good or look
-
better by adding some ambient
light to account for i
-
to account for
-
terms that are too hard to
compute in your graphics
-
pipeline And
-
so
-
if we have a smooth surface and
-
the more it reflects like A
mirror. So we get the light
-
bouncing off of
-
if The surface is rough, we get
more scattering. If
-
so we have diffuse, the
specular, the ambient
-
components, And we have four
vectors.
-
So L is the direction of is the
location of the light source to
-
the viewer. That's V then we
have a normal to the surface,
-
and we have the perfect
reflector. So this is that's the
-
direction in which light would
be. If the surface was a perfect
-
reflector, the light would
bounce in that direction. I
-
So the normal is defined
determined by local orientation
-
of the model. The angle of
incidence equals the angle of
-
reflection. The three vectors
must be co planar. So we have L
-
to the light source,
-
and the perfect reflector is the
angle of incidence, which we
-
find by looking at the angle
between l and n, and
-
then the reflection is that same
angle. And
-
it so we can think about another
type of surface, inversion
-
surface, perfectly diffused
reflector, so it scatters. It
-
doesn't have
-
it's the opposite of the perfect
reflector that we saw.
-
None of light reflect is
proportional to the vertical
-
component of the incoming light.
The Yeah.
-
So we're taking the cosine
between the light vector and the
-
normal vector.
-
So most of the surfaces are
neither ideal diffusers or ideal
-
reflectors. Smooth surfaces show
specular highlights due to
-
incoming light being reflected
in directions concentrated close
-
to the direction of a perfect
reflection and
-
so we're interested so we can
see specular highlights in the
-
region Around the reflected, the
perfect The perfect reflection
-
reflector you
-
so fun proposed
-
a term that makes the highlight
stronger when the viewer is at
-
or near the perfect reflector,
-
and it's a
-
so that highlight is going to be
much less apparent If the viewer
-
is not looking in that direction
-
So we can
-
try different values To get
-
the effect we want you.
-
So to handle ambient light,
-
we have an intensity term for
The ambient light
-
and the reflection coefficient
light from the
-
so the Light from a point source
is proportional to the distance
-
of the source from the surface,
and then we can add A term like
-
this to attenuate and soften The
effects of the light.
-
So we have in the farm model
nine coefficients for each point
-
source,
-
nine absorption coefficients and
the shininess coefficient.
-
So for each color component, we
add the contributions across the
-
sources and
-
so This is where the halfway
vector becomes more efficient
-
and
-
so here's An array of teapots
with different parameters In the
-
blend faux model.
-
So we have the light vector and
the Uber vector specified in our
-
scene, so we can compute R from
L and N. But how do we determine
-
n for simple surfaces and
-
so how do we deal with the
-
Timing In the
-
again, suspension, disbelief,
that's a cube. I
-
so On the surface of the queue
and that
-
Normal is
-
easy to define
-
what happens when a group,
-
then we
-
have a bunch of triangles to
make up a surface. So the marble
-
on the surface of the triangle
is clear, but What about where
-
it meets up with other
triangles? So
-
like, what about that edge or
This corner?
-
So we can interpolate the
-
so the normal to the sphere. So,
-
at a point on the sphere, we
have a 10, the tangent plane,
-
and that allows us to do the
cross pride, to get the normal
-
so Here are some details about
competing normals For triangles
-
you
-
so
-
we can this is a little bit
about calling Back faces. You.
-
So when we
-
do the vertex per vertex,
shading calculations are done
-
for each vertex, which makes
sense.
-
So We Could we
-
so we could use that
-
attribute approach Changing
-
the color, or we could do The
shading and
-
in The vertex shader and
-
so we have the normal for the
triangle, but in the case of a
-
sphere that we can see here, we
want different normals at Each
-
vertex, even though it's not
quite correct mathematically, We
-
so if we set the normals
-
at each vertex, then we get
smooth shading, But we see the
-
edge of the sphere Model and
-
so what's called Grow shading
involves averaging
-
The normals of the triangles
around The vertex and
-
so with corrosion, we want to
have that normal vector for each
-
vertex so we can apply The
modify the limb form model at
-
each vertex And the interpolate
vertex comes across each
-
polygon, the
-
So where can we get Highlights
if we're doing garosha,
-
Because what we're doing is
we're doing
-
the whole calculation for
-
the vertex so if the light The
sprinkler highlights correspond
-
with the vertices of our wall,
then we'll see the highlights
-
come out, because in the vertex
shade, we're computing vertex
-
color that gets interpolated by
the fragment shader.
-
So
-
in Grow shading, it all depends
on the intensity values at the
-
vertices, because those values
are interpolated.
-
So Fauci says find the vertex
normals and
-
like we've done before, but
interpolate the vertex normals
-
Across edges, and interpolate
edge normals across The polygon
-
And
-
so what's the advantage of Fauci
compared to grow shade? I
-
What's An advantage and what's a
disadvantage. I
-
let's say
-
that's the point where the
specular highlight would Be most
-
pronounced.
-
So in Grow
-
shading, we're calculating
intensities at the vertices, and
-
we're interpolating the value so
we don't get the highlight and
-
but in Phong shading, we're
interpolating the normals. So in
-
the fragment shader, we're doing
the calculation with an
-
approximation to the surface
normal. So we can get we can
-
capture these highlights and
-
Okay, so that's an advantage.
What's a disadvantage
-
is this a little bit more work
-
or a lot more? I
-
because instead of doing the
four vertices of a quad and or a
-
triangle strip, we're doing the
calculation not four times, but
-
once, for each fragment, for
each pixel. Does That make
-
sense? I
-
that's a bit more complicated. I
so
-
it's
-
not clear where the light is
going either. Well, it is
-
because you can see the surface.
The
-
it. So anyway, in the shaded
cube, oh, we're out of time. I
-
knew that because of the
-
so we're doing the lighting and
the faux calculation in the
-
vertex shader, and then fragment
shader. We're just assigning the
-
color to the fragment color.
Thank you for today. Have a good
-
rest. Of your Wednesday.
-
Good weekend, a
-
good long weekend.
Responses
What important concept or perspective did you encounter today?
- I thought the discussion on Phoung and Guroud Shading (Sorry for spelling I couldnt see the board great) Was very interesting along with the different pros and cons of each and how they both look and are calcuated
- We discussed the Phong model of lighting in computer graphics. One important perspective is that we are trying to find a balance between realistic lighting and computational efficiency. We want results that look good while still being fast to compute.
- Shading and materials - the different properties, specular, metallic, and diffuse.
- Diffuse and Ambient, Normals
- Gouraud and Phong shading as well as specular surfaces and reflections
- We discussed the lighting, types of surface, Gouraud shading, and Phong shading.
- Lights, Shading and types of lights, Steps to incorporate lights in a scene. Goroud and Phong Shading
- we learned about lighting, and compared the gouraud model to the phong model
- Today, I learned the concept of lighting in 3D. The halfway vector is an efficient method for computation. Specular surfaces reflect light in a narrow angle, creating a shiny effect, while diffuse surfaces scatter light in all directions. In Gouraud shading, a normal vector is calculated for each vertex, while Phong shading computes lighting at the pixel level for more detailed results.
Was there anything today that was difficult to understand?
Was there anything today about which you would like to know more?