Sunday, August 9, 2015

OpenTK Tutorial 8 Part 1: Normals, Materials, and Loading More From Files

In the previous tutorial, we loaded a simple object in from a file. Right now, it's hard to see the detail in the models because they're all one color (or have a texture applied wrong). By the end of this tutorial (that is, after the second part), we'll have diffuse lighting with specular highlights on our models, making them look much nicer.

This part will cover loading texture coordinates and normals from a file, calculating normals for geometry that doesn't come with them (such as shapes we're generating through code) and loading basic materials from a file.

(UPDATED 2015-11-24 to fix some issues with loading normals from a file)

(UPDATED 2015-12-16 to make the MTL file have materials that look nicer under lighting)

(UPDATED 2018-11-06 to make compatible with input handling changes in Tutorial 5)