**CS371: Computational Graphics**
*Fall 2016* - [Williams College](http://www.williams.edu) - [Computer Science Department](http://cs.williams.edu) - [Film and Media Studies](http://catalog.williams.edu/catalog.php?&strm=1171&subj=&sbattr=FMST_FMSTCORE)
Prof. [Morgan McGuire](http://cs.williams.edu/~morgan), `svn://graphics-svn.cs.williams.edu/cs371/students/`_lab_`/`_team_
where the lab names are `0-cubes`, `1-meshes`, `2-rays`, `3-paths`, `4-midterm`,
`5-raymarch`, `6-isosurface`, and `7-final`. Your SVN username is your short-form email address from
OIT, for example, "`brk3`" if your email address is "`brk3@williams.edu`". You will receive
your SVN password on the first day of class.
For a solo project, the team name is your username. For a group project, the team name is
everyone's username sorted alphabetically and joined with plus signs, for example,
"`brk3+msm1`".
SVN doesn't care what your directory is called, so I recommend that you name your directory
after the lab instead of the default of the team name. For example, for the first lab, user
`brk3` would check out `svn://graphics-svn.cs.williams.edu/cs371/students/0-cubes/brk3` to
local directory `0-cubes`.
" by
Frankenburgh](image/ocean.jpg width="30%" border="2")
Set up your *project framework in SVN and read the assignment thoroughly
before you arrive in lab* on Thursday afternoons, so that we can immediately begin
workshopping your design and implementation plan. Assignments are designed so that if you
arrive prepared, you will then hit the crux while we're together in lab.
Check in code early and often, and keep your build well-documented from the beginning.
If you need help with something on your project, just email me your project's team name and
tell me what the problem is. I can remotely check out your code, and even check in fixes. The
SVN logs are your proof of which lines of code you wrote and when you wrote them. I will check
them to verify claims of good workflow and scheduling, and fairness on group projects.
I will occasionally tell you to "update your G3D" so that you can access the latest
API features and data for the project. This means that you should SVN update the
`c:\g3d` directory on your computer and then run `buildg3d lib` at the command line in the
`c:\g3d\G3D10` directory.
Schedule
=====================================================================
Monday | Tuesday | Thursday | Friday
------------------------------|-----------------------------------------|-----------------------------------------|-------------------------------
|Lecture TCL206
*9:55-11:10am* |Lecture TCL206
*9:55-11:10am* |
Office Hrs TCL308
1-2:30pm| |Lab Jesup 203
*1-4pm* | Office Hrs TCL308
1-2:30pm
Jamie Lesser's TA office hours 7-10pm on Sundays in Jesup 203.
Additional faculty office hours are available by appointment. I'm usually free 9am-5pm except
for my other courses (see my [web page](http://cs.williams.edu/~morgan)), but tend to get booked with
ad-hoc meetings about two days ahead. So, if you can't come to office hours, please propose
three times in the coming week by email and I'll choose the first for which I'm available.
The full semester schedule follows. Read the assigned *texts before lectures* that they are
associated with. In general, the course shifts emphasis from a lot of reading at the beginning
to a lot of software development by the end.
Thu 8 Sep 2016: Welcome
- *Read*:
- "*Preface*" in _GC_
- "*C++*" in _GC_
- The [*Developer Tools*](http://g3d.cs.williams.edu/g3d/G3D10/build/manual/devtools.html)
chapter in the G3D documentation
- ["*Configure the Editor*"](http://graphicscodex.com/projects/tools/#toc4) section of Recommended Toolset
- Skim the [G3D Build System Instructions](http://g3d.cs.williams.edu/g3d/G3D10/readme.md.html), which describe how I configured your USB disk
-  Class policies (this syllabus!)
- 3D coordinates
- Euler angles
- Hadamard vector operations
- Working with specifications
- Modeling 3D Graphics
- Watch "Burning Safari" (France 2006, 2 minutes, English) by Aupetit, Maleo, Predal, La Taille,
Trebutien, and Irzenski at Goeblins L'Ecole de L'Image
+ Lab this afternoon in Jesup 203. Get a USB disk before lab.
Thu 8 Sep 2016: Lab 0: Cubes
- *Read* the [*Cubes project*](http://graphicscodex.com/projects/cubes/) document before class
- Complete the project before the following Monday night, at 11pm
+ First time setup
+ Shut down the computer
+ Plug into the USB3 ("SS" icon) port
+ Boot the computer
+ Log in as cs371/cs371
+ SVN update G3D
+ Start G3D build
+ Windows Check for Updates
+ Install NVIDIA GeForce Experience
+ Update driver
+ Shut down (DO NOT UNPLUG the USB disk until shutdown)
+ Unplug your disk
+ Boot the computer again
+ Normal login
+ Shut down the computer
+ Plug in your disk
+ Boot
+ ...
+ Walkthrough
- Subversion
- Visual Studio
- G3D Starter project
- Basic C++
- Writing to files
- Scene file format
- Markdeep and Doxygen
- Writing a report
Tue 13 Sep 2016: Modeling with Triangles
- *Read*:
- This *syllabus*
- "*Introduction*" in _GC_
- "*Version Control Basics*" in _GC_
- "*Surface Geometry*" in _GC_
- *Ch. 14*, "Standard Approximations and Representations" in _P&P_
- Indexed triangle meshes
Thu 15 Sep 2016: Transformations
- *Read*:
- *Ch. 14.1-14.3* on number representations in _P&P_
- "*Floating Point Formats*" in _GC_
- *Ch. 10*, "Transformations in Two Dimensions" in _P&P_
- *Ch. 11.1-11.2*, "Transformations in Three Dimensions" in _P&P_
-  Linear algebra primer
- Translation
- Scale
- Rotation
- Composition
- Dot product
- Homogeneous coordinates
- Object, World, and Camera space
- Inversion (general + special cases)
- Raymond (France 2006, 5 min, French) by bif, produced by The Mill
Thu 15 Sep 2016: Lab 1: Meshes
- *Read* and begin the [*Meshes project*](http://graphicscodex.com/projects/meshes/) document before class
+ Indexed triangle meshes
+ Generate cube, cylinder, torus, and heightfield files
+ Cite erosion etc. papers
Tue 20 Sep 2016: Ray Tracing
- *Read*:
- "*A Model of Light*" in _GC_
- "*The Rendering Equation*" in _GC_
- *Ch. 7.6* on coordinates in _P&P_
-  Transmission
- Rudimentary scattering functions
- Geometric intersection
- Shadowing
+ Build pseudocode for the whole ray-tracing algorithm
Thu 22 Sep 2016: Ray Intersection
- *Read*:
- "*A Camera Model*" in _GC_
- "*Ray Casting*" in _GC_
- "*Direct Illumination*" in _GC_
-  Ray generation
- Ray-sphere intersection
- Ray-plane intersection
- Ray-triangle intersection
- "Minamitama District", (Japan, 2008, English, 2 min)
- "Exodus", (Sweden, 2013, English, 3 min)
Thu 22 Sep 2016: Lab 2: Rays
- *Read* and begin the [*Rays project*](http://graphicscodex.com/projects/rays/) document before class
Tue 27 Sep 2016: Microfacet Models
- *Read*:
- "*Materials*" in _GC_
- *Ch. 27*, "Materials and Scattering" in _P&P_
- *Ch. 37*, "Spatial Data Structures" in _P&P_
- Spatial data structures
- Full BSDF sampling
- Scattering functions
Thu 29 Sep 2016: Monte Carlo Methods
- *Read*:
- "*Rendering Algorithms*" in _GC_
- *Ch. 30*, "Probability and Monte Carlo Integration" in _P&P_
- *Ch. 31.16-31.18.3*, of "Computing Solutions to the Rendering Equation: Theoretical Approaches." in _P&P_
- *Ch. 32.1-32.5* of "Rendering in Practice" in _P&P_
- Optional: [Lecture notes](path-tracing-lecture-notes.pdf)
- Monte Carlo integration
- The path tracing algorithm
- Importance sampling
- Pixel integration
- Direct light integration
- Indirect light integration
- Parallel SIMD batch processing
Thu 29 Sep 2016: Lab 3: Path Tracing
- *Read* and begin the [*Paths project*](http://graphicscodex.com/projects/paths/) before class
- Meet at [WCMA](http://wcma.williams.edu/) at 1pm for the [_Both Sides Now_](http://wcma.williams.edu/exhibit/both-sides-now-lexa-and-dan-walsh/) show
- Work in lab from 1:30pm-4:00pm
+ Incremental rendering
+ Switching to fully threaded model
Tue 4 Oct 2016: Exam 1
Thu 6 Oct 2016: Project Launch
-  *Meet in Jesup 203*
- ["5 faces"](https://www.youtube.com/watch?v=i8hSZGTXTx8) demoscene production (2013, 5min)
- ["Home Sweet Home"](https://www.youtube.com/watch?v=aKRZn0uS6eA) Supinfocom Arles (France, 2013, 9:55)
- Brief noise overview
- Start Design Project #1
- Choose either the [Geometry](http://graphicscodex.com/projects/geo-design/index.html) or [Renderer](http://graphicscodex.com/projects/render-design/index.html) design project
- Team of three students
- Feature/spec size should be less than 1/2 of a regular project
- Note intermediate deadline on October 13, 9:55am
-  Schedule:
1. Visualize final presentation images
2. Race to code completion by Tuesday (plan to implement and reject many prototype designs)
3. Evolve specification as code and design solidify
4. Write MVP report
5. Polish for eight days
Thu 6 Oct 2016: Lab 4: Design Project #1
-  ["Loom"](https://vimeo.com/24069938) Filmakademie BW (Germany, 2010, 5:20)
Fri 7 Oct 2016: Mountain Day
(Mon 10 Oct 2016): Reading Period
(Tue 11 Oct 2016): Reading Period
Thu 13 Oct 2016: Design Project #1
-  ["Turtles All The Way Down"](https://www.youtube.com/watch?v=z48t2R2hEJM) Subdream (Germany, 2013, 4:55)
- ["Rupture"](https://www.youtube.com/watch?v=sWYU5Xvphwg) ASD (Greece, 2009, 6:42)
- Morning session meets in Jesup 203
- Specification due
- MVP report due
- MVP code due
Thu 13 Oct 2016: Design Project #1
Tue 18 Oct 2016: Design Project #1
-  Morning session meets in Jesup 203
(Thu 20 Oct 2016): No Morning Class
Thu 20 Oct 2016: Design Project #1 Presentations
- Format:
- Eight minutes, focused on results
- Title slide with your names and project name
- Full-screen images and diagrams from your report
- Optionally, equations from your report
- Optionally, video from your report
- Citations/bibliography as needed
- No other text or diagrams!
- AirTame from your seat
- Ungraded
Tue 25 Oct 2016: GPU
- *Read* "*Ray Marching*" in _GC_
- Parallel Architectures
- CPU SIMD
+ (explaining why we threaded strangely)
- GPU programming model
- Driver + OpenGL as OS
- Rasterizer
- GLSL
- Invoking a full-screen shader
- `G3D::Args`
- `LAUNCH_SHADER`
- Camera and textures
- F5 to reload shaders
- Camera:
- Generating eye rays yourself
- Materials:
- A simple Blinn-Phong BSDF
- Lights:
- Implementing biradiance yourself
- Environment lighting
- [GPU Architecture Lecture Notes](gpu-architecture-notes.pdf)
Thu 27 Oct 2016: ~~Sphere tracing~~
- *Read*
- ["Making maps with noise functions"](http://www.redblobgames.com/maps/terrain-from-noise/) by Amit Patel
- ["Menger Fractal"](http://www.iquilezles.org/www/articles/menger/menger.htm) by Inigo Quilez
- ["SDF Modeling"](http://www.iquilezles.org/www/articles/sdfmodeling/sdfmodeling.htm) video by Inigo Quilez
- *Cancelled due to illness*
- Signed distance functions
- Ray marching
- Sphere tracing
- Procedural texture
Thu 27 Oct 2016: ~~Lab 5: GPU~~
- *Read* and begin the [*GPU project*](http://graphicscodex.com/projects/gpu/) before class
- *Cancelled due to illness*
- GLSL
- Ray marching
- CSG
- Procedural texture
Tue 1 Nov 2016: Sphere Tracing
Thu 3 Nov 2016: Advanced Sphere Tracing
- *Read* *Ch. 24*, "Implicit Representations of Shape" in _P&P_
- Intersection operations
+ Cube as intersections
- Being conservative
- Bounding spheres
- Working with triangle meshes
+ A triangle
+ Union of triangles: problematic for inside/outside
+ Ray casting solution
+ Grid of triangles
+ Grid of triangles for inside/outside
Thu 3 Nov 2016: Lab 5: GPU
- Complete the [*GPU project*](http://graphicscodex.com/projects/gpu/) begun independently last week
- (was Lab 6: Isosurfaces; that lab is cancelled due to rescheduling)
Tue 8 Nov 2016: Marching Cubes
+ Marching cubes and variants
+ Using spatial queries
+ More isosurface work
Thu 10 Nov 2016: Parameteric Curves
-  *Read*:
- *Ch. 22*, "Splines and Subdivision Curves" in _P&P_
- *Ch. 23*, "Splines and Subdivision Surfaces" in _P&P_
- "The Race", Autour de Minuit, 15 min, France 2015
- Polylines
- Splines
- Spline patches
- Subdivision surfaces
Thu 10 Nov 2016: Lab 7: Final Project
- *Read* [Final Project Notes](final-project-notes.pdf)
- Due Wed Dec. 7 10 pm
- Recommended project topics:
- *dragon's hoard*: pile up random coins, gems, goblets, swords, helmets, etc.
- surface-level *alien planet* view generator, ala _No Man's Sky_, _Fermi Paradox_, and Musgrave via implicit surfaces and noise functions
- *grow ivy* on architectural surfaces
- modeling tool ==> implicit surface GLSL code or CPU + marching cubes or point clouds, ala _Dreams PS4_
- procedural city, castle, space ships, foliage, forests, buildings, mazes, terrain, etc.
- procedural texture generation
- mesh melder: marching cubes ==> polygons + texture
- data-driven GPU CSG renderer
- real-time GPU ocean, clouds, fire, etc.
- *Due at 2pm*: McGuire approval of placeholder report "quality" images
- Show at least ten images, potentially from different projects
- Photoshop mockups and 3rd party images strongly encouraged
- I'll greenlight the subset that are compelling and possible
Tue 15 Nov 2016: Final Project
- Morning session meet in Jesup 203
- *Due at 10am*: Full draft of Report
Thu 17 Nov 2016: CGI Art History I
- Pixar art-history lectures/screenings
Thu 17 Nov 2016: Large Models
- *MVP Code Due*
- Journal must have enough information to present to our guest
- Guest lecture by [Patrick Cozzi](http://www.seas.upenn.edu/~pcozzi/) of U. Penn and Analytical Graphics
Tue 22 Nov 2016: CGI Art History II
- Pixar art-history lectures/screenings
(Tue 23 Nov 2016): Thanksgiving Break
(Tue 24 Nov 2016): Thanksgiving Break
(Tue 25 Nov 2016): Thanksgiving Break
Tue 29 Nov 2016: Final Project
- Morning session meet in Jesup 203
Thu 1 Dec 2016: Rasterization
- *MVP Report Due in SVN*
- *Read* *Ch. 15*, "Ray Casting and Rasterization" in _P&P_
- Rasterization algorithm
- Projection matrices
- Shadow maps
Thu 1 Dec 2016: Final Project
Tue 6 Dec 2016: Final Project
- Morning session meet in Jesup 203
(Thu 8 Dec 2016): No Morning Class
Thu 8 Dec 2016: Final Presentations
- Guests welcome
- Same rules as for midterm
- Course Evaluations
Wed 14 Dec 2016: Exam 2
- 1:30pm TCL 206
Ethics
=====================================================================
*Plagiarism* is an academic offense of misrepresenting authorship
that can result in penalties up to expulsion for an undergraduate. It
is dishonorable but not illegal. Note that it is possible to
plagiarise _your own work_, for example, by resubmitting work from
another course without attribution.
*Copyright* violation is an independent concept based on the legal right to use material,
which is enforced by civil courts.
Honor Code
---------------------------------------------------------------------
Students in this course are expected to obey all provisions of the
[Williams College Honor Code](http://sites.williams.edu/honor-system/academic-honesty/) and the
[Computer Science Honor Code and Computer Usage Policy](http://www.cs.williams.edu/the-cs-honor-code-and-computer-usage-policy/).
To avoid plagiarism, all contributors, including third party material (e.g., music, video
footage, 3D models, source code), must be acknowledged in submitted work. Because we share
code between projects but change partners, by the end of the course, you'll likely have some
long attribution lists, for example: _based on Jon Cohen's and Jose Bolivar's shadow code from
Project 5, which is based on Eliza Washington's recursive ray code from Project 4, ..._.
I encourage you to discuss the projects and reading on the course mailing list