Shader Programming

  1. Discuss the following terms
  2. Explain the effect of the modifiers "varying", "attribute" and "uniform" in GLSL.
  3. Why does per-pixel lighting give better results for specular reflection that per-vertex lighting?
  4. What is swizzling in HLSL?
  5. Describe how a vetex shader and a fragment shader work together to achieve "per-pixel-lighting".
  6. In shader lighting programming, why do we transform vertex normals using the (GL_MODELVIEW-1)T instead of just GL_MODELVIEW? Illustrate your answer with a diagram
  7. What is a sampler in GLSL programming
  8. What is the difference between a "fragment" and a"pixel" in GLSL programming?
  9. Outline, in pseudo-code, a shader program which will render a transformed, textured object, with diffuse lighting.
  10. What is the primary responsibility of the vertex shader
  11. What is the primary responsibility of the fragment shader
  12. Explain the mechanisim by which data can be passed form the vertex shader to the fragment shader. In particular explain how the data might be modified by the GPU before it gets to the framgment shader.