Skip to main content
gamedev.net
🔒 Locked

Shading question

Started by Mike Lue 0 replies 250+ views
Original Post
Mike Lue
Mike Lue
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?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.