Category Archives: Uncategorized

Example 02.02: Texture filtering & MIP mapping

I must say that I had a lot of fun reading up on this. I had come across most of the terms in this post before when glancing over option screens for games, but I never really deeply understood the … Continue reading

Posted in Uncategorized | Tagged | 1 Comment

Example 02.01: Diffuse Color Mapping

In the previous examples we had an object without a color of it’s own, we just used the color of the light to make it blue. So one of the first things I wanted to investigate next was how to … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Example 01.04: Phong reflection model – specular lighting

It’s finally time to implement the specular lighting part of the shader and hopefully get something resembling the wikipedia article. Figure 1. The different components of the Phong equation Specular reflection is the mirror-like reflection you get on shiny surfaces, … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Example 01.03: Phong reflection model – diffuse lighting

After the basic ambient lighting factor from the previous example, we are now actually going to apply some shading to our model. The diffuse lighting component we will implement assumes we are describing a perfect matte surface that scatters the incoming … Continue reading

Posted in Uncategorized | Leave a comment

Example 01.02: Phong reflection model – ambient lighting

We’ll start of with what I call an arbitrary ‘smudge’ factor: Ambient lighting.  This represents the light in the scene that is scattered of nearby objects and uniformly lits our object.  We just assume that the light has bounced around … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Example 01.01: Implementing a shading algorithm

When looking around for examples on writing a shader program in HLSL I stumbled upon various ways of writing a basic shader. At the core of all this, for rendering opaque surfaces, is the Bidirectional Reflectance Distribution Function (BRDF)  that you … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Example 00.02: Using a custom shader

Allright, in the first example I have skipped over the cannonical example of rendering a single triangle for something more complex like rendering a fully shaded and textured spaceship.  And now I’m sorry and I want to scale back down … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Example 00.01: Hello World

As a first example I just wanted to make a classic ‘Hello world’ example. This gives me a basic ’empty’ project to do the other examples in. One of the things I really wanted to do is writing custom shaders … Continue reading

Posted in Uncategorized | Tagged | Leave a comment