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)

Sunday, July 5, 2015

Progress Update

It's been a while, and I want to fill everyone in on what/when the next tutorial will be. This weekend is the first time I haven't had a million other projects I should be doing, so I was able to make some real progress.

The next tutorial is going to be broken into two parts (for length's sake, but Part 1 will be useful on its own). 

The first part will handle loading more complex OBJ files, and loading materials from MTL files. The OBJ loader we already had only works on really, really simple OBJ files, and it won't cut it for loading most models with texture maps.

The second part will put this to better use by adding some simple lighting to the project.

Expect the whole thing before the end of the month. After the next tutorial, I plan on making a model viewer example to show what can be done.

Tuesday, April 14, 2015

OpenTK Tutorial 7: Simple Objects from OBJ files

This tutorial is going to be rather short. What we'll do is add a new class that can open very simple OBJ files and add some sample models to the project.

Wednesday, March 25, 2015

Inside the Sprite Example

Last time I posted a new example that uses OpenTK for a 2D view with sprites. Let's go into a bit more detail about how it works:

Tuesday, March 10, 2015

OpenTK Sprites Example

A new example is available on the GitHub repository:

This example features 2D drawing of textures, with motion and alpha blending. 30,000 sprites are added by default, but you can add more by hitting the + key. Most of the sprites are off-screen (and not drawn to help keep things running smoothly), but you can move the view with the arrow keys (and speed up with the shift key) to pan around the world. Clicking on one of the sprites will change its texture! 

UPDATE 3-11-15: New feature: multiple shaders! Hit V to change which shader is used, or hit M to toggle a mode where the shader is chosen based on the texture.

Wednesday, February 25, 2015

OpenTK Tutorial 6 Project File now on GitHub

Missed having OpenTK content? Good news, I'm working on making more of it soon! Up next is a demo on using orthographic projection with what we've covered in previous tutorials to make sprites (as requested by an anonymous commenter a while back).

While you all wait for that, the basic textures tutorial project is now up on GitHub:

Tuesday, February 24, 2015