CSCI 444/544 - Advanced Computer Graphics

Spring 2019 - Assignment 2 - Tessellate Your Teapotahedron



|   Home |  Syllabus |  Assignments |  Schedule |  Resources   |
This assignment is due by February 25, 2019 by 11:59pm.

Please Note: For this and all future assignments, you are free to choose which OpenGL implementation you would prefer to use. This assignment can only be accomplished in OpenGL 4.0+ or OpenGL ES 3.2.

HOWEVER - if you choose to use a version or framework that we are not covering in class, then you must ensure your submission builds out of the box on the machines in the Computer Commons. Be sure to note any special instructions in your README.

If the grader (i.e. instructor) cannot compile your code, you will be contacted once to solve the problem.


Part I - Create the Geometry & Fragment Shaders


Hopefully everyone will be starting with a cube to begin this assignment. We'll stil be using UBOs to pass the uniform data to our programs. If you like, you can keep the subroutines and keep expanding upon your prior submission.

The first step we want to do is to create our single pass wireframe renderer. Specifics are given in Ch. 7 of SLC. Your program should generate an image similar to below:

Wireframe Rendering

Part II - Read In Model Control Points


Once your wireframe renderer is working, let's change what we're drawing to something a step more interesting. Select one or all of the following model files to load. You will need to open and parse the file to create your GL_ARRAY_BUFFER VBO and GL_ELEMENT_ARRAY_BUFFER VBO. Once those values are read in and passed to the buffers, delete your code that draws the cube. In it's place render your VAO using points to see all the control points. You should be at this step:

Control Points
Hint: You can make the points bigger using glPointSize().


Part III - Create the Tessellation Shaders


Now it's time to add in the Tessellation Shaders. You will need to create both the Tessellation Control Shader (TCS) and Tessellation Evaluation Shader (TES) for this step. Note: you will need to be using the existing wireframe shader on your ground and this new Tessellation + Wireframe Shader on your teapot. Create your files and shader programs accordingly.

Your TCS will need to set the Outer and Inner Tessellation Levels appropriately. Decide if you want to hardcode these values in and fix the Tessellation Level or allow the user to interact with the program modify these parameters in real time.

Your TES will need to perform the actual Bézier Patch calculation. Again, refer to SLC Ch. 7 for these equations.

Be sure your Geometry and Fragment shaders follow the Tessellation Stage so we still are drawing the wireframe. You do not need to worry about the two coloring for patch and triangle edges. It is fine for all edges to be the same color. With the wireframe on, you should have the following:

Teapot Mesh
And if you hide the control points and wireframe, we get a nice shiny round teapot! Notice the ground does not have the wireframe either.

Teapotahedron!

Part IV - Use Shader Pipelines


We now have two different shader sets that are being applied to different components of our scene:
  1. A Vertex + Geometry + Fragment Shader Program: Applies the wireframe and Phong Shading to the ground plane.
  2. A Vertex + Tessellation + Geometry + Fragment Shader Program: Applies the tessellation and wireframe and Phong Shading to the control points.
For these two programs, the Geometry + Fragment Shader are the same for both. The difference is the V and V + T steps. We'll turn these in to seperable programs and make pipelines out of them.

The seperable programs are:
  1. The Vertex Shader used with the ground plane.
  2. The Vertex + Tessellation Shaders used with the control points.
  3. The Geometry + Fragment Shaders used with the wireframe and Phong shading.
We'll then make two pipelines consisting of seperable programs:
  1. 1 + 3
  2. 2 + 3


Part V - Create Your Website


In addition to creating this awesome looking teapot, modify your webpage from A1 to include several screenshots of your teaset. Feel free to position everything so the spoon lies in the cup next to the pot!


Documentation


With this and all future assignments, you are expeced to appropriately document your code. This includes writing comments in your source code - remember that your comments should explain what a piece of code is supposed to do and why; don't just re-write what the code says in plain English. Comments serve the dual purpose of explaining your code to someone unfamiliar with it and assisting in debugging. If you know what a piece of code is supposed to be doing, you can figure out where it's going awry more easily. (Interestingly enough, this code review of Doom 3's source code says the exact opposite - well written code should require no comments. Well, we don't work at id so we're going to comment.)

Proper documentation also means including a README.txt file with your submission. In your submission folder, always include a file called README.txt that lists:
  • Your Name / HeroName
  • Homework Number / Project Title
  • A brief, high level description of what the program is / does
  • A usage section, explaining how to run the program, which keys perform which actions, etc.
  • Instructions on compiling your code
  • Notes about bugs, implementation details, etc. if necessary
  • How long did this assignment take you?
  • How fun was this assignment? 1-10 (1 - discontinue this assignment, 10 - I wish I had more time to make it even better!)


Grading Rubric


Your submission will be graded according to the following rubric.

Percentage Requirement Description
20% Vertex Shaders Created
20% Wireframe Geometry & Fragment Shaders Created
20% TCS & TES Created
15% Shader Pipelines created
5% Model read into VAO & VBOs
5% Model drawn with correct Tessellation Primitives
5% Teapot drawn with Wireframe!
5% Wireframe can be toggled off of teapot
5% Phong Shading shading applied to teapot & ground


Submission


Please update your project so it produces an executable with the name userName_A2. When you are completed with the assignment, zip together your source code, README.txt, and www/ folder. Name the zip file, userName_A2.zip. Upload this file to Canvas under A2.

This assignment is due by February 25, 2019 by 11:59pm.

Last Updated: 02/27/19 15:03


Valid HTML 4.01 Strict Valid CSS! Level Triple-A conformance, W3C WAI Web Content Accessibility Guidelines 2.0