CSE 5542 - Realtime Rendering

Lab Assignment #2 - 3D Painting

painted bunny

Due: November 14, 2017 11:59 PM (Postponed until 11-16-2017)

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. (10%) Write a shader that converts the geometry to texture space and displays the model in texture space. Use a wireframe rendering for this.
  2. (10%) 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). Very similar to HW #3.
  3. (5%) Write a shader that colors the object according to its texture coordinates.
  4. (10%) Add Frame Buffer Object support to your system such that you can render to a texture.
  5. (5%) Modify your lighting shader such that the diffuse color comes from a texture map.
  6. (15%) Read in and display models files (such as OBJ files) which have normal maps included. You can find some OBJ models in this link and this link.  Besides the models, on the web site you will also download normal maps. Use Vertex Arrays and Vertex Buffers for your models. Note, you want to use the decimated (polygon reduced) models.
  7. (10%) Rather than try to calculate normals (which requires searching for adjacency), the normals are provided from a high-res model in an image known as a normal map. Read in the PNG files as texture maps in OpenGL. Create a fragment shader that samples the normal map using the provided texture coordinates and uses the result as a normal for your lighting calculations. This implies that lighting will be done in the fragment shader.
  8. (15%) 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.
  9. (5%) 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.
  10. (5%) Add a viewport at the bottom left or right edge of the display of size 128 by 128. Display the result of Step 1 above in this viewport.
  11. (5%) Add a viewport to the right (or below) of the one above and display the output of step 3 above (the uvMap).
  12. (5%) Add a viewport to the right (or below) of the one above and display the diffuse texture map.
  13. Provide a readme.txt file for the grader that explains how to use your program.
  14. Extra Credit(5% each)

  15. 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.
  16. Add a way to change color and the brush size.
  17. Add 5 different brush textures.
  18. Add an ambient occlusion map
  19. Add ability to load a model and use tangent-space normals.
  20. Paint to a gloss map at the same time you paint to a diffuse map (apply rust or dirt to a shiny object).
  21. Add controls to be able to use the examiner when pressing and holding the R key and then painting when it is released.

Hints

Lab submission

Submit your source code (.cpp and .h, .cs files),  and Visual Studio project and solution files. Do not submit any executable files. Submit an html or pdf file specifying what is being submitted and how to run your program. Zip your source and project files into an archive. Double check that your zip file does not have extraneous junk in it, including the hidden .vs folder.

Use the following command on stdsun to submit your lab1

> submit c5542aa lab2 Lastname.zip

Late Penalty

You should submit your lab on time. We are on a quarter schedule, which is pretty tight. Being late for one lab could affect the time left for you to complete subsequent labs. All labs are due at 11:59 pm. of the specified due data, and there is a 10% penalty each day (including weekends) for up to 60%. After that, you get zero.

Grading Criteria

The grader will grade the labs. If you have problems with the grade you received on your lab, see the grader first. If you can't resolve the dispute with the grader, then see me. However, in order to maintain consistent grading for everyone in the class, I am not very inclined to alter grades that are assigned by the grader.

Don't copy labs. Discussion of lab assignments is allowed and encouraged. However, you need to complete the lab all by yourself. Labs which are too similar will be given a zero.