Write code to create a 3D surface of revolution mesh in the SurfaceOfRevolution::CreateMesh method in scene/components/surfaceofrevolution.cpp. Your shape must:
have appropriate positions for each vertex
have appropriate per-vertex normals
have appropriate texture coordinates for each vertex
have appropriate vertex connectivity (triangle faces)
use the "subdivisions" argument to determine how many bands your surface is sliced into.
Add functionality, including a simple data structure, for filtering a mesh. In particular, for each vertex of a mesh, take a weighted sum of the vertex and its neighbors to produce a new mesh with the same connectivity as the original mesh, but with updated vertex positions. Vertices are neighbors if they share an edge. Your filter weights around a given vertex will be 1 for the vertex and a/N for each neighboring vertex, followed by dividing every filter weight by the sum of all the weights; "a" is a parameter that controls smoothing or sharpening (typically in the range (-1/2,1/2)), and N is the number of neighboring vertices (N is also called the "valence"), and will vary from vertex to vertex. As with image processing, you should not filter in place on the input mesh, but instead read vertex positions from the input mesh and compute new positions to put in the output mesh. You'll add this functionality in MeshProcessing::FilterMesh in the file meshprocessing.cpp.
Note that you'll need to recalculate the per-vertex normals!
Your artifact for this assignment will involve creating a hierarchical model. This model must have at least two levels of branching.
There are two parts to this requirement; they will not be intensive and are mostly to help you with your artifact!
The tree diagram is to help you figure out what your model will be early, and to practice thinking about empty nodes, centers of rotation, and so on. Your initial diagram will not be graded for correctness, but will be graded for effort. You should submit an updated diagram with your final artifact that reflects the actual implementation of your model.
The UI requirement gives you an easy way to show off your model and makes it much easier to animate. It also will help you learn how to add UI elements to the application.
Add support for the scene's point lights, by editing the files assets/blinn-phong.vert and assets/blinn-phong.vert. You need to include quadratic distance attenuation. Hint: you may not have to edit one of these files. We also include a few extra shaders including assets/texture.frag and assets/texture.vert to provide some basic examples for how to do things like sample from textures. You do not need to worry about these unless you're doing bells and whistles.
ShaderProgram::BuiltinUniforms in the file resource/shaderprogram.h contain a list of uniforms supplied by default to your shader as long as you declare them properly in your shader. GLRenderer::SetUniforms in the file opengl/glrenderer.cpp is where they are actually being passed in.
Extend your Blinn-Phong shader to handle shadow mapping for point lights. This will involve two steps:
Write a shader that will generate your shadow map.
Modify your Blinn-Phong shader to look up the appropriate location in the shadow map to compute your shadowing term.
Shadow mapping can cause several artifacts such as "shadow acne" and "Peter-panning". You should add in a shadow bias term to reduce the effects of shadow acne, but fixing other artifacts will be extra credit.
Create another shader(s) from the list below that is worth at least 3 whistles (or 1.5 bells). This is required and will not count as extra credit. However, any additional bells or whistles will be considered extra credit. You must keep your point light Blinn-Phong shader separate, so we can grade it separately, and you must exhibit this shader in your Modeler binary. Consult OpenGL Shading Language, "the orange book" for some excellent tips on shaders. Ask your TA's if you would like to implement a shader that isn't listed below. Credit for any shader may be adjusted depending on the quality of the implementation, but any reasonable effort should at least earn you one of the required whistles.