Graphics Reference
In-Depth Information
3. Use GLSL operators to write three different ways to calculate the distance
between two points.
4. Diagram the data flow that describes how geometric data gets from an
application, through the OpenGL API, to the graphics card, to a vertex
shader, to a fragment shader, and finally to a single pixel that is output to
the graphics color buffer.
5. Write constructors to create new variables from old ones, using either the
scalar, vector, or matrix constructors described in this chapter.
a. Construct an integer I from a float F .
b. Construct a vec3 from three ints.
c. Construct a vec2 as the middle two components of a vec4 .
d. Construct a mat4 with the first row a set of four floats and with the
remaining part of each column given by a vec3 .
6. Write statements you could use in a GLSL shader to convert a vec4 color
to a grayscale color with the same alpha value. Is there a difference in
how you would do this for a vertex shader and for a fragment shader?
Search WWH ::




Custom Search