1/19
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
When do you actually see an object and distinguish its colour?
When light bounces off an object, reflected by its surface, and into your eyes.
What is shading?
The process of altering the colour of an object based on the type of light source that is emitting light, and how light is reflected from object surfaces to create a realistic effect.
What are the three types of shading?
flat shading
gourand (smooth) shading
phong shading
What is flat shading?
when each face of an object is assigned a colour.
What is gourand (smooth) shading?
We apply lighting against a normal vector at each vertex to calculate the colour of each vertex in the vertex shader. Colours across a face are generated by interpolating colours obtained at the edge vertices of the face during rasterization.
What is phong shading?
We apply lighting against normal vectors at each point over an object surface by interpolating normal vectors at the corner vertices during rasterisation. Then we colour the surface based on the interpolated normal vector at each point in the fragment shader.
All this talk about normal vectors - what are they?
The orientation of a surface is specified by the normal vector, the direction perpendicular to that surface. This is expressed with (x, y, z) points in a matrix.
When do we set up the normal matrix in WebGl?
After the transformation pipeline in main().
What are the three different types of light in computer graphics?
directional light
point light
ambient light
What is directional light?
Parallel light rays that shine down on an object from a far-away source, like the sun. Produces diffuse reflection.
What is point light?
Light rays are produced in all directions from a point, like a light bulb. Produces diffuse reflection.
What is ambient light?
Indirect light produced from all light sources and reflected light from objects. Produces ambient reflection.
With lighting, what does the surface colour end up as? (calculation)
surface colour = diffuse reflection + ambient reflection
So, what is diffuse reflection?
The reflection of light from a directional/point light source. Light is reflected equally in all directions from where it hits.
How do you find the surface colour after diffuse reflection?
surface colour = light colour x base surface colour x cosθ
Where θ = light direction * orientation of surface
And what is ambient reflection?
The reflection of light from all indirect sources, illuminating an object equally from all directions with the same intensity.
How do you calculate ambient reflection?
surface colour = light colour * base surface colour.
What WebGl is required for a directional light source?
in main(): light colour, light direction
in vector shader: normalised normals, diffuse calculations.
What WebGL is required for a point light source?
The same as directional, just with ambient added.
How do you set up Phong Lighting:
All the calculations go in fragment shader, and the lightDirection is calculated by:
vec3 lightDirection = normalise(u_LightPosition – v_Position);