Tag Archives: shading algorithm

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.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