MidTerm Flashcards

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
Q

Data in OpenGL must be in
_________
color space to be processed.

A

RGB

26
Q

Explain the term dithering.

A

It is like half-toning in newspapers where you can show shades of gray with combinations of black and white dots.

27
Q

True or False

The stencil buffer keeps track of the distance between the viewpoint and the object occupying a pixel.

A

False

28
Q

In the OpenGL pipeline, what is located between the vertex and fragment shading stages?

A

rasterization

29
Q

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.

A

framebuffer

30
Q

_________transformations are composable.

A

Linear

31
Q

With __________projection, the viewing volume is a box

A

orthographic

32
Q

True or False

Skewing is a linear transformation.

A

True

33
Q

True or False

OpenGL does not have the commands to support rendering a scene through multiple viewports.

A

False

34
Q

True or False

OpenGL automatically clips geometry against the near and far planes as well as the viewport.

A

True

35
Q

What is a shadow map?

A

A texture map that contains information relating to the locations of shadows within a scene.

36
Q

What is image-based lighting?

A

An illumination technique that uses an image of the light falling on an object to illuminate the object.

37
Q

The property of light that describes how a light’s intensity diminishes over distance is referred to as ___________.

A

attenuation

38
Q

__________light is light not coming from any specific direction.

A

ambient

39
Q

__________light is light scattered by the surface equally in all directions for a particular light source.

A

diffuse

40
Q

__________ highlighting is light reflected directly by the surface.

A

specular

41
Q

A ____________light is far, far away, it can be approximated as having the same direction from every point on our surface.

A

directional

42
Q

Lamps, street lights and ceiling lights that are near the scene or within the scene are________ lights.

A

point

43
Q

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.

A

True

44
Q

What are 2 disadvantage of using procedural shaders over stared textures?

A

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
Q

What does the book say is a good reason to use stored textures over procedural textures?

A

Things that would be artwork in the real world

46
Q

What is a binormal?

A

A vector perpendicular to both a surface tangent vector and the surface normal vector.

47
Q

A sequence of pulses—usually equally spaced—used in procedural shading techniques is sometimes referred to as a(n)_______

A

pulse train

48
Q

What is the key to procedurally defining all sorts of texture patterns?

A

programmability

49
Q

A vector directed along the directional-derivative of a function is referred to as a(n) __________
Correct vector.

A

gradient

50
Q

_________mapping involves modulating the surface normal before lighting is applied.

A

Bump

51
Q

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________

A

supersampling

52
Q

True or False

Point sampling and area sampling are the same thing.

A

False

53
Q

True or False

Textures generated procedurally have very high memory requirements compared with stored textures.

A

False

54
Q

True or False

Textures generated by stored texture shaders have no fixed area or resolution.

A

False

55
Q

True or False

A texture that contains normal perturbation values for the purpose of bump mapping is called a perturbed map.

A

False