November 2008
Beginner
510 pages
16h 24m
English
Now that you have an effect file using a texture, there are any number of things you can do to your HLSL file to get some really interesting and cool effects. For instance, changing the code in the pixel shader to the following will result in a negative image being drawn:
float4 PixelShader(VertexOut input) : COLOR0
{
float4 output = 1−tex2D(ColoredTextureSampler, input.textureCoordinates);
return output;
}The effect is shown in Figure 13-7.

Figure 13-7. Negative image drawn using HLSL