CSE 781 - Realtime Rendering

Lab Assignment #2 - 3D Painting

painted bunny

Due: February 15, 2012 11:59 PM

Lab overview: Extend your simple viewing application from Lab1 to view and paint a 3D model using GLSL shaders.

Objective: Upon finishing this lab, you will understand frame buffer objects and the power and flexibility that OpenGL and programmable shaders give you. Also will give you a cool demo to show off.

Tasks:

  1. Write a shader that converts the geometry to texture space and displays the model in texture space. Use a wireframe rendering for this.
  2. Add a small billboard (brush) object. Add a brush to your scene based on the mouse position (and other state of your system, such as currently painting).
  3. Write a shader that colors the object according to its texture coordinates.
  4. Add Frame Buffer Object support to your system such that you can render to a texture.
  5. Modify your lighting shader such that the diffuse color comes from a texture map.
  6. Move your normal mappings over to the fragment shader to provide true normal mapping.
  7. Piece all of the above components together to provide a 3D paint program that can paint into the diffuse texture map as discussed in class.
  8. Create 2 images show casing your work for the course web site. These images must have a pleasant backdrop and your name on them (use GIMP or photoshop). You will get zero credit for an image with a pure saturated color, black or white background. Points will be docked if your models use a pure saturated color.
  9. Add a viewport at the bottom left of the display of size 128 by 128. Display the result of Step 1 above in this viewport.
  10. Add a viewport to the right of the one above and display the output of step 3 above (the uvMap).
  11. Add a viewport to the right of the one above and display the diffuse texture map.
  12. Provide a readme.txt file for the grader that explains how to use your program.
  13. (extra credit) Provide the ability to write out a texture to a file.
  14. (extra credit) Make the uvMap avoid the background color (set the background to blue or shift the map away from (0,0). In the geometry shader, if the brush location is not on the object, kill the primitive.