CSE 5542 Lab 1

lab1 result

Lab Assignment #1

Due: October 10, 2017.

Lab overview: Modify the application for viewing a 3D model using GLSL shaders.

Objective: Upon finishing this lab, you will understand GLSL shaders used for diffuse and specular lighting and how they interact with the OpenGL API. You will also have a greater appreciation for vertex versus fragment lighting. Finally, you will have a baseline application that will be enhanced in future labs during the quarter.

Tasks:

  1. (80%) Write an application that creates polygonal models procedurally and displays them model using materials and GLSL shaders. Download the DemoFramework from the course web site as a starting point. It will need to be changed to remove the old fixed functionality (i.e., no glNormal, glVertex, glLight, glRotate, etc.) The renderer should contain the following features:
    1. (10%) Finish the Examiner / Trackball viewer code to pan (actually crab) and dolly the camera / world. (see ExaminerComeraNode). Understand the layout and the trackball class.
    2. (10%) Modify the DrawableSphere to use a tesselation of dual pyramids as discussed in class (estimated less than 2 hours). Extra Cedit (5%) Perform the tesselation in a set of tesselation shaders. Compute normals either on the CPU or in the shaders.
    3. (10%) Modify the DrawableCube to use either a a vertex buffer object, indexed drawing and optinally, a vertex array. Specify normals for each face as well as colors for each face (estimated about 1 hour).
    4. (10%) Modify the existing shaders to make them OpenGL 3.3 core compliant (bind and pass in the matrices, etc.) (estimated less than 1.5 hours).
    5. (10%) Modify the framework to remove all matrix state changes, push / pop, etc. and handle this in the Visitor with the help of an additional class to keep track of this yourself (estimated less than 1.5 hours).
    6. (10%) Implement ambient, point and directional lights and a light manager. Create a struct in GLSL for the light and material properties. Your shaders should take in a list of lights and the number of lights. (about 2 hours). Extra credit (5%) Add a spotlight.
    7. (10%) Develop at least three additional shaders for: 1) Silloutte shading 2) fragment-based lighting; 3) Two-color hemisphere-based lighting (estimated less than 1 hours). Extra credit (5%) Additional shadings: 1) Faceted shading; 2) Silloutte shading; 3) Your choice.
    8. (10%) Create a scene (2 identical ones in the same scene) with per-vertex lighting on one set of objects and per-fragment lighting on another. Experiment with the tesselation to see the different effects.
  2. (5%) Improve upon and / or use your backgrounds from Homework #1.
  3. (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 glutBitmapCharacter (see DrawableRenderState for exampe), or GIMP). 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.
  4. (10%) Write-up a 2-5 page report on your program, including some sample results, how to build and how to run your program. Analyze the difference between vertex lighting and fragment lighting as a function of your mesh resolution.

Key Classes / Implementation Notes (Suggestions - not required)

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 lab1 Lastname.zip

Notes about the submit program

The 'submit' program submits all of the files at once,  not  one at a time, previous submissions for a given lab are completely removed.  Or put another way; each time the  submit command is issued for a given lab, ALL of the previously submitted files are clobbered.

That means that

          > submit c5542aa lab1 lab1.c

          > submit c5542aa lab1 readme

will result in ONLY 'readme' remaining in the lab1 submission

You should do the following:

          > submit c5542aa lab1 lab1.c lab1.h .... readme

          or

          > submit c5542aa lab1 lab1_dir

Where 'lab1_dir' is a directory containing all of  the  lab1 files to be submitted, or best of all (for both student and grader) is:

          > cd lab1_dir

          > submit c5542aa lab1 .

Submit will immediately print submission information to  the submitter. Use 'man submit' if you have any other questions.

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

Grading of the labs will be based on the following:

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.