Shaders
*Fragment Shaders* are also known as...?
*Pixel Shaders*
The 2 most common/popular Shaders are...?
1. Vertex Shaders 2. Fragment Shaders
What is GLSL?
Graphics Library Shading Language
The primary job of the Vertex Shader is to tell OpenGL...?
Where you want the Vertex to be in your screen space.
Lighting depends on an object's...?
*Surface Normals*
What are the major stages of the Graphics Pipeline?
1. Application 2. Vertex Processing 3. Rasterization 4. Fragment Processing 5. Display
How does the Normal Map Texture work?
A Normal Map is a texture which specifies the surface normal that should be used for every single point on the object's surface.
What is the *Graphics Pipeline*?
A sequence of processing stages that efficiently transforms a set of 3D primitives into a shaded rendering from a particular camera viewpoint.
What is a *Uniform*?
A uniform is a GLSL global variable declared with the "uniform" variable name. These act as parameters that the user of a shader program can pass to the shader program. They are stored in a program object. Uniforms are so named because they do not change from one execution of a shader program to the next within a particular rendering call. This makes them unlike shader stage inputs and outputs, which are often different for each invocation of a program stage.
What is a *Fragment Shader*?
Decides which color each pixel is supposed to be.
What is the *Application Stage*?
Holds the scene being rendered in some appropriate data structure, and sends a series of primitives to the pipeline for rendering.
What is a *Normal Map Shader*?
It provides a way to make your objects look more detailed and realistic, without having to actually increase the complexity of the models.
What is a *Layout* qualifier?
Layout Qualifiers affect where the storage for a variable comes from, as well as other user-facing properties of a particular definition. For instance: layout (location=0) in vec3 position; means that no matter what "position" is called, it is still the same variable.
The *Fragment Shader* runs once for every...?
Pixel that needs to get Rasterized.
We can think of *Fragments* as ...?
Pixels
What is the *Fragment Processing Stage*?
Processes the fragments to determine the final color of each pixel. It performs z-buffering for hidden surface removal and writes the results into the *frame buffer*.
What is the *Display Stage*?
Shows the contents of the frame buffer so the user can see them.
What are Shaders?
Small scripts that let you configure the how the graphics hardware is set up for rendering
What is the *Rasterization Stage*?
Takes the screen-space triangles resulted from vertex processing and generates a fragment for every pixel that's covered by each triangle. It also interpolates parameter values, such as colors, normals, and texture coordinates, given by the vertex processing stage, to create smoothly varying parameter values for the fragments. Depending on the design of the Rasterizer, it may clip the primitives to the view volume.
In a Normal Map, how are the Normals stored?
The Normals are stored as Colors in the texture, so to get the Normal at a certain point on the object, we would sample the normal map at the relevant point and that will give us an RGB color where each value is between 0 and 1. However, the XYZ components in a Normal vector can be between -1 and 1. So a conversion is to multiple them by 2 and subtract 1. We now have 3 values between -1 and 1.
What does *Attenuation* mean?
The reduction of the force, effect, or value of something.
What is the *Vertex Processing Stage*?
Transforms the primitives into screen space, optionally doing other processing, such as vertex color computation, along the way. The specific operations can be customized by vertex shaders.
For each Vertex that we want to draw, the ___ Shader is used. So if we wanted to draw a triangle, it would be called ___ times.
Vertex Shader 3 times, one for each Vertex.