CHAPTER 2 ■ SETTING UP DIFFERENT CAMERA MODES IN YOUR 3D WORLD
155
float4 colorFromTexture = tex2D(textureSampler, PSIn.TexCoord);
Output.Color = 1-colorFromTexture;
return Output;
}
technique Invert
{
pass Pass0
{
VertexShader = compile vs_1_1 PassThroughVertexShader();
PixelShader = compile ps_1_1 InvertPS();
}
}
//------- PP Technique: TimeChange --------
PPPixelToFrame TimeChangePS(PPVertexToPixel PSIn) : COLOR0
{
PPPixelToFrame Output = (PPPixelToFrame)0;
Output.Color = tex2D(textureSampler, PSIn.TexCoord);
Output.Color.b *= sin(xTime);
Output.Color.rg *= cos(xTime);
Output.Color += 0.2f;
return Output;
}
technique TimeChange
{
pass Pass0
{
VertexShader = compile vs_1_1 PassThroughVertexShader();
PixelShader = compile ps_2_0 TimeChangePS(); ...