Homework 4 Overview
In this project you will add more realism to your rendered PLY files by adding simple texturing, shadows, toon shading and also making the mesh vertices pulse.
- Floor with checkerboard texturing: Add a floor plane with checkerboard texturing under your meshes. Example 7.1 from the book's website shows how to generate a checkerboard pattern. Study this example [ HERE ] . Render checkerboards on a floor below your mesh models.
- Shadows: Section 4.10 of your textbook describes a simple technique to render shadows using projection. Implement this shadow algorithm such that the shadow of the mesh models is projected onto the checkerboard floor.
- Toon shading: Toon shading is a non-photorealistic shading technique where a few discrete shades of the object color are used to shade a given object. Section 5.10.1 of your text describes a very simple toon shader. Other good sources of information about toon shading (also called cel shading) are [ Toon description ] and [ Lighthouse toon shader description ] . Implement toon shading on your models. (It will be a toggled option that will be controlled with the keyboard below).
- Pulsing Meshes One simple yet visually interesting way to animate a mesh is to make it "pulse" by translating each vertex some fixed amount in its normal direction. By linearly interpolating each vertex position between v-cn and v+cn (where c is a constant) and then interpolating back in the opposite direction, we can make the mesh bulge outward and then recede in on itself in a smooth fashion. This operation should make the meshes look like they are "breathing" back and forth. This pulsing should occur continuously whenever this effect is toggled on using keystrokes (see below)
Summary of Your program behavior
All previous keystrokes should still work. Only two additional key strokes should be implemented.Notes: No OpenGL fixed function commands (glBegin, glVertex, etc) or immediate mode drawing commands should be used in your program. All drawing should be done using shaders, retained mode, Vertex Buffer Objects, and glDrawArrays similar to the code in your textbook (and in the starter code)
- key T: Toggle Toon shading ON/OFF. When ON, it replaces Cook-Torrance shading. When OFF, simply render Cook-Torrance shading.
- Key B: Toggle pulsing meshes ON/OFF. When ON, the meshes pulse back and forth as described above. When OFF the meshes do not pulse.
Submitting Your Work
Make sure to double-check that everything works before submitting. Submit all your executable and source files. Put all your work files (Visual Studio solution, OpenGL program, shaders, executable and input files into a folder and zip it. Essentially, after your project is complete, just zip the project directory created by Visual Studio. If the filesize is less than 10MB, you can email me the file. If the final zip file is larger than 10MB, put it in a webspace and email me its URL.
Create documentation for your program and submit it along with the project inside the zip file. Your documentation can be either a pure ASCII text or Microsoft Word file. The documentation does not have to be long. Briefly describe the structure of your program, what each file turned in contains. Explain briefly what each module does and tie in your filenames. Most importantly, give clear instructions on how to compile and run your program. MAKE SURE IT RUNS before submission. Name your zip file according to the convention FirstName_lastName_hw4.zip Also specify which machine where you implemented your solution (e.g. home machine vs which WPI lab, laptop or desktop, graphics card and OpenGL version supported