MidTerm Flashcards
What does the GLSL discard flow-control statement do?
discards the current fragment and ceases shader execution
When is the discard statement available to use?
in fragment programs
What line of code, used in debugging, will impose invariance on all varying variables in a shader?
pragma STDGL invariant (all)
What 3 things can a precise qualifier be applied to?
built-in variable user variable function return value
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?
- Create a shader object.
- Compile your shader source into the object.
- Verify that your shader compiled successfully.
What types of variables are considered to be opaque types?
sampler types, image types, and atomic counter types
What component accessors are associated with texture coordinates?
(s, t, p, q)
No matter what shading stage you are programming for you will always start the structure with what line of code?
version
According to the book, the recommended way to share a large buffer with the application is through use of a_________variable.
buffer
What operator comes last in the GLSL order of operations?
comma
___________variable types have their internal form exposed so the shader code assumes what they look like internally.
transparent
Which type modifier specifies that the value is passed to the shader from the application and is constant across a given primitive?
uniform
True or False
The real work in a shader is done by computing values and making decisions.
True
True or False
Data is copied into shaders from OpenGL through the “in” data type variables.
True
True or False
GLSL is a typed language, meaning every variable must be declared and have an associated type.
True
True or False
Type conversions apply to everything, including arrays and structures.
False
True or False
GLSL supports 2D and 3D vectors only.
False
In OpenGL, you usually do all your drawing to the
_________buffer
color
There is a set of 7 tests that a fragment has to pass prior to going into the framebuffer. List these tests in order.
- Scissor test
- Multisample fragment operations
- Stencil test
- Depth test
- Blending
- Dithering
- Logical operations
True or False
Multisampling and antialiasing are the same thing.
True
How often should you clear out buffers in OpenGL?
At lease once per frame.
True or False
The color buffer is the only buffer that holds information about a pixel.
False