Math 155B – Geometric Computer Graphics – Winter 2020
Instructor: 
Sam Buss,  University of California, San Diego

Project #0 – Get restarted using Visual C++ with OpenGL, GLFW and GLEW in the New World of Remote Instruction

Goals:  In this assignment, you will get your computer setup for using OpenGL with GLFW and GLEW. You will also compile and run the GammaCorrectTest program.  See the "Summary of Work" at the bottom of this document for a summary of what is to be turned in.

DUE DATE: April 3, by 9:00pm. (Extension possible if you have troubles installing on your computer.)

What to hand in:  When you successfully complete this assignment, you write a PDF document for handin on gradescope.  You may in addition post related questions and answers to the piazza bulletin board. If you rely on external websites or assistance from other students or other people not in the class, please keep a record of this for Step III.

Step I. Get C++ and OpenGL working on your computer.  If these are already working, and you have used your home computer for projects in 155A, go onto Step II.
Otherwise:

1.     Install the C++ compiler of your choice on your computer. Usually this is Visual Studio on Windows, or Xcode on Macintosh, less usually it is gcc. Get a “Hello World” program working.  See Project #0 of Math 155A for more information on this (esp. if using Visual Studio).

2.     Install GLFW and GLEW header files and .lib files. Again, for Windows see Project #0 of Math 155A.  And, download the instructions and the files from the web page for Math 155A.

3.     Download all needed source code for SolarModern, from the textbook’s software page at https://www.math.ucsd.edu/~sbuss/MathCG2/OpenGLsoft/.

4.     Compile and run SolarModern. You may run into problems here. If so, don’t panic. Instead please post to piazza, preferably immediately, and we will get you working again.

5.     Important: If you are not using Visual Studio on Windows, and have to change the source code in any way to get it to work on your system, please let Professor Buss know, so this can be corrected for other students, and for future programming assignments.

6.     (Engagement/Participation). Post to piazza that you have successfully done 1.-5. Also post any problems you ran into, and how you fixed them.

Step II. Compile, run and understand the GammaCorrectTest program.

1.     Compile and run GammaCorrectTest (also available at the textbook’s software web page. If you have problems compiling, please let us know by posting to piazza. If you have problems with running the program, start by checking the stdout text window for error messages (e.g., unable to open the .GLSL file).

2.     Try out the commands, and dragging the mouse to change the gamma value. What gamma value works best for you. (For me, something around 0.49 works well, but you may find a different value is better. At any rate, it is somewhat subjective.)

3.     Understand what the program is doing. Understand the gamma function and the sRGB function. Understand what “dithering” means in graphics. (Dithering is used for rectangles on the left hand side of the image.)

4.     Examine the shader code in the .GLSL file. Understand how gl_FragCoord is used by the fragment shader.

Step III. Write a PDF file reporting on your results. This will include acknowledgement of assistance and external resources. For most people, the report can be quite brief, well under one page.

1.     Describe any particular problems you encountered, and what was needed to fix them.

2.     Report what gamma value worked best for you with white/gray colors. (Item II.2 above.)

3.     If you have remaining questions about what GammaCorrectTest does, you may include them in your PDF report. (Or just post them to piazza.)

4.     Acknowledgement of assistance. Give acknowledgement of any assistance received. This could include websites, or other students, or people from outside the class. If piazza discussions or the TA or Professor where extra useful, please mention that too. Conversely if you assisted another student, you should list that. If, on the other hand, everything worked fine without any assistance, you may just state that instead.

Upload your PDF report to gradescope by the due date if possible. Please email the instructor and TA if you are not able to meet the due date.