MidTerm Flashcards

(55 cards)

1
Q

What does the GLSL discard flow-control statement do?

A

discards the current fragment and ceases shader execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When is the discard statement available to use?

A

in fragment programs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What line of code, used in debugging, will impose invariance on all varying variables in a shader?

A

pragma STDGL invariant (all)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What 3 things can a precise qualifier be applied to?

A
built-in variable
user variable
function return value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Every shader program in your application will have to follow a certain sequence of steps for each shader object. What are the 3 steps in order?

A
  1. Create a shader object.
  2. Compile your shader source into the object.
  3. Verify that your shader compiled successfully.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What types of variables are considered to be opaque types?

A

sampler types, image types, and atomic counter types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What component accessors are associated with texture coordinates?

A

(s, t, p, q)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

No matter what shading stage you are programming for you will always start the structure with what line of code?

A

version

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

According to the book, the recommended way to share a large buffer with the application is through use of a_________variable.

A

buffer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What operator comes last in the GLSL order of operations?

A

comma

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

___________variable types have their internal form exposed so the shader code assumes what they look like internally.

A

transparent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which type modifier specifies that the value is passed to the shader from the application and is constant across a given primitive?

A

uniform

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

True or False

The real work in a shader is done by computing values and making decisions.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

True or False

Data is copied into shaders from OpenGL through the “in” data type variables.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

True or False

GLSL is a typed language, meaning every variable must be declared and have an associated type.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

True or False

Type conversions apply to everything, including arrays and structures.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

True or False

GLSL supports 2D and 3D vectors only.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

In OpenGL, you usually do all your drawing to the

_________buffer

A

color

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

There is a set of 7 tests that a fragment has to pass prior to going into the framebuffer. List these tests in order.

A
  1. Scissor test
  2. Multisample fragment operations
  3. Stencil test
  4. Depth test
  5. Blending
  6. Dithering
  7. Logical operations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

True or False

Multisampling and antialiasing are the same thing.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How often should you clear out buffers in OpenGL?

A

At lease once per frame.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

True or False

The color buffer is the only buffer that holds information about a pixel.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What 3 types of buffers are available with OpenGL?

A

color, depth and stencil

24
Q

When you make the main color buffer have a front buffer that’s displayed in your window; and a back buffer that is used to render the new image, this is referred to as what?

A

double buffering

25
Data in OpenGL must be in _________ color space to be processed.
RGB
26
Explain the term dithering.
It  is like half-toning in newspapers where you can show shades of gray with combinations of black and white dots.
27
True or False The stencil buffer keeps track of the distance between the viewpoint and the object occupying a pixel.
False
28
In the OpenGL pipeline, what is located between the vertex and fragment shading stages?
rasterization
29
The __________is composed of a rectangular array of pixels that are capable of displaying a tiny square of color at that point in the image.
framebuffer
30
_________transformations are composable.
Linear
31
With __________projection, the viewing volume is a box
orthographic
32
True or False Skewing is a linear transformation.
True
33
True or False OpenGL does not have the commands to support rendering a scene through multiple viewports.
False
34
True or False OpenGL automatically clips geometry against the near and far planes as well as the viewport.
True
35
What is a shadow map?
A texture map that contains information relating to the locations of shadows within a scene.
36
What is image-based lighting?
An illumination technique that uses an image of the light falling on an object to illuminate the object.
37
The property of light that describes how a light’s intensity diminishes over distance is referred to as ___________.
attenuation
38
__________light is light not coming from any specific direction.
ambient
39
__________light is light scattered by the surface equally in all directions for a particular light source.
diffuse
40
__________ highlighting is light reflected directly by the surface.
specular
41
A ____________light is far, far away, it can be approximated as having the same direction from every point on our surface.
directional
42
Lamps, street lights and ceiling lights that are near the scene or within the scene are________ lights.
point
43
True or False The classic lighting model adds up a set of independently computed lighting components to get a total lighting effect for a particular spot on a material surface.
True
44
What are 2 disadvantage of using procedural shaders over stared textures?
Procedural texture shaders require the algorithm to be encoded in a program. Not everyone has the technical skills needed to write such a program, whereas it is fairly straightforward to create a 2D or 3D texture with limited technical skills. * Performing the algorithm embodied by a procedural texture shader at each location on an object can take longer than accessing a stored texture. * Procedural texture shaders can have serious aliasing artifacts that can be difficult to overcome. Today’s graphics hardware has built-in capabilities for antialiasing stored textures (e.g., filtering methods and mipmaps). * Because of differences in arithmetic precision and differences in implementations of built-in functions such as noise, procedural texture shaders could produce somewhat different results on different platforms.
45
What does the book say is a good reason to use stored textures over procedural textures?
Things that would be artwork in the real world
46
What is a binormal?
A vector perpendicular to both a surface tangent vector and the surface normal vector.
47
A sequence of pulses—usually equally spaced—used in procedural shading techniques is sometimes referred to as a(n)_______
pulse train
48
What is the key to procedurally defining all sorts of texture patterns?
programmability
49
A vector directed along the directional-derivative of a function is referred to as a(n) __________ Correct vector.
gradient
50
_________mapping involves modulating the surface normal before lighting is applied.
Bump
51
Performing full per-sample rendering for multiple samples per pixel, and then coloring the pixel based on the average of the colors found for each sample in the pixel is referred to as________
supersampling
52
True or False Point sampling and area sampling are the same thing.
False
53
True or False Textures generated procedurally have very high memory requirements compared with stored textures.
False
54
True or False Textures generated by stored texture shaders have no fixed area or resolution.
False
55
True or False A texture that contains normal perturbation values for the purpose of bump mapping is called a perturbed map.
False