Instead of "if {} else {}" better to use them in vertex shader to change vertices of quad, while ach pass in technique with own vertex shader will be used as "if else". Something like this:
Quote:
VS_OUTPUT_POST VS_PostProcess2(VS_INPUT_POST IN)
{
VS_OUTPUT_POST OUT;
float4 pos=float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0);
//move outside of screen all vertices:
if (ShaderType!=2) pos=10000.0;//v1 as int
//if (EnableSomething2==false) pos=10000.0;//v2 as bool
OUT.vpos=pos;
OUT.txcoord.xy=IN.txcoord.xy;
return OUT;
}
technique PostProcess
{
//only drawed when some parameter 1 set true
pass P0
{
VertexShader=compile vs_3_0 VS_PostProcess1();
PixelShader =compile ps_3_0 PS_PostProcess1();
}
//only drawed when some parameter 2 set true
pass P1
{
VertexShader=compile vs_3_0 VS_PostProcess2();
PixelShader =compile ps_3_0 PS_PostProcess2();
}
}