Original Post
I have met the following code somewhere in a directx book.
/*
This example uses a dot product to square the vertex diffuse color components.
*/
// The shader is shown below.
ps.1.0 // Version instruction.
tex t0 // Declare texture.
dp3 r0, v0, v0 // Dot product squares the vertex color values,
// color(v0) * color(v0).
// Bright colors max out at white.
// Dimmer colors yield gray.
in this code, the square of the vertex color values are achieved by dot product. Isn''t that tedious comparing to just go v0 * v0; is there any special purpose of doing in that way?