Homework 4 Overview
In this project you will add more realism to your rendered mesh hierarchy by adding simple texturing, shadows and toon shading.
- Floor with checkerboard texturing: Add a floor plane with checkerboard texturing under your mesh hierarchy. The following example from the textbook shows how to generate a checkerboard pattern. Study this example [ checkerboard_example.cpp ] and its vertex and fragment shaders, [ vshader71.glsl ] and [ fshader71.glsl ]. Render checkerboards on a floor below your mesh hierarchy.
- 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 hierarchy is projected onto the checkerboard floor. The shadow of the entire hierarchy should be updated as it moves. i.e. as the entire hierarchy is animated, its shadow moves too.
- 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. Toon shading was described in class and 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 meshes in your hierarchy. (It will be a toggled option that will be controlled with the keyboard below).
Summary of Your program behaviorAll previous keystrokes should still work. Only three 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 O: Toggle Toon shading ON/OFF. When ON, toon shading replaces your previously implemented per-vertex lighting with gouraud shading. When OFF, render your hierarchy using per-vertex lighting with gouraud shading.
- Key D: Toggle shadows ON/OFF. When ON, the shadows show up and when OFF the shadows do not show up.
- Key C: Toggle floor checkerboard pattern ON/OFF. When ON, the floor is a checkerboard pattern and when OFF the floor should be an opaque green color.
Submitting Your WorkMake 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 file size 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 of the 6 designated labs your submission compiles and runs in.