CG Class 10, Mon 2019-09-23
Table of contents
1 Today's iclicker questions
- Bump mapping is
- more realistic than actually 3D modeling each bump
- faster than actually 3D modeling each bump
- both
- neither
- unrelated to modeling bumps; the name is coincidental.
- How do you draw a pentagon in WebGL?
- Split it into triangles.
- Split it into triangles if it is concave, otherwise draw it directly.
- Split it into triangles if it is convex, otherwise draw it directly.
- Draw it directly.
- Split it into hexagons.
- How do you draw a pentagon in WebGL?
- Split it into triangles.
- Split it into triangles if it is concave, otherwise draw it directly.
- Split it into triangles if it is convex, otherwise draw it directly.
- Draw it directly.
- Split it into hexagons.
- In the WebGL pipeline, the Primitive Assembler does what?
- fits together pieces of ancient Sumerian pottery.
- rotates vertices as their coordinate systems change.
- creates lines and polygons from vertices.
- finds the pixels for each polygon.
- reports whether the keyboard and mouse are plugged in correctly.
- To draw into only part of the graphics window you would call:
- gl.drawpart
- gl_Position
- gl.viewport
- gl.window
- There's no builtin routine; you have to scale your graphics yourself to achieve this.
- What buffer is used by WebGl to do hidden surface removal?
- Closest object buffer
- Color buffer
- Depth or Z buffer
- Hidden-surface buffer
- Ray-trace buffer
- If you do not tell WebGL to do hidden surface removal, and two objects overlap the same pixel, then what color is that pixel?
- WebGL throws an error.
- the closer object
- the farther object
- the first object to be drawn there
- the last object to be drawn there
- gasket2 has this code: var points=[ ]; ... points.push(a,b,c); What does push do here?
- Appends new entries to the end of points.
- Inserts new entries at the start of points.
- Overwrites the first entries of points.
- Overwrites the last entries of points.
- Throws an error because we didn't specify a size for points.
- Why would you want to send a variable to a vertex shader that has the same value for every vertex?
- the vertex's coordinates
- the vertex's color
- the object's global orientation
- the location of the global light source
- C and D.
- How would you send that variable to the vertex shader?
- as a varying variable.
- as a uniform variable.
- in another array similar to the vertex array.
- with a bindBuffer call.
- with a bufferData call.
- You call gl.BufferSubData to do what?
- to add or replace part of the buffer in the GPU.
- to define a submarine object.
- to subtract some data in the buffer.
- to tell the GPU to look for a pattern and substitute any occurrences,
- to tell the GPU to use a subroutine instead of the main program.