Phong Lighting

• The first two lighting sections on the Learn OpenGL tutorial on Colors and Basic Lighting are helpful review of class material. The other sections are a good read, but are not covered in class.
• Take a peek at the Rendering Equation. The Phong lighting model we described is a basic approximation of this equation, but advanced lighting methods try to do a better job approximating this while keeping computational complexity manageable. You should know the Rendering Equation exists, but you do not need to be familiar with all the terms and you do not need to solve it.

Let's fetch this week's upstream changes.

$cd ~/cs40/examples$ git fetch upstream
$git merge -X ours upstream/master  After this step, you will need to manually edit the top level CMakeLists.txt to add the new subdirectories. $ tail ~/cs40/examples/CMakeLists.txt



No texture symlink is required this week.

If everything went well, you should be able to go into your build directory and run make -j8 to compile the week 06 examples.

cd build
make -j8
cd w06-lighting
./lights


The L key toggles between per vertex and per framgent lighting. This uses two separate shader programs. The geometry is in a separate common folder and the Drawable base class has been modified slightly to support specular colors, drawing with multiple programs, and loading geometry data in a generic way. The Square and Sphere classes have been modified to add normal and tangent information per vertex. The tangent information is not used at the moment. A Cylinder class has also been added, but is relatively untested. Let me know if you experience problems with it.

Friday Examples

Let's fetch more upstream changes.

$cd ~/cs40/examples$ git fetch upstream
$git merge -X ours upstream/master  After this step, you will need to manually edit the top level CMakeLists.txt to add the new subdirectories. $ tail ~/cs40/examples/CMakeLists.txt



Before compiling, you will need to add a symlink in your w06-nmap source folder.

cd ~/cs40/examples/w05-nmap
ln -s /usr/local/doc/textures data
cd ..


If everything went well, you should be able to go into your build directory and run make -j8 to compile the week 06 examples.

cd build
make -j8
cd w06-nmap
./nmap

We didn't get a chance to talk much about normal mapping in class. The learn openGL tutorial has a good summary of the primary methods on normal mapping used in the demo.