New Music: ANI
As some of my friends know, I write songs time to time. After a long artist's block, I finally finished this song…
Why do different objects have different colors? It is because they absorb and reflect different spectrums of incoming light. For example, a black surface looks black because it absorbs all the spectrums, and a white surface is white because it reflects everything. Likewise, a red surface reflects red spectrum while absorbing the others.
I have been posting the English version of my Intro to Shader Programming book in this blog. I intended to publish it some years ago, but I had more important things to occupy myself. I thought it was a bit too late to publish this book, but I got lucky this time.
New HLSL in this chapter NORMAL: a shader semantic used to retrieve normal data from a vertex buffer normalize(): normalizes a vector dot(): dot product function saturate(): clamps a value to [0, 1] range reflect(): vector reflection function pow(): raises base to the power of exponent