I am trying to understand creating more than one technique in enbeffect.fx I have a simple file shown below with only the essentials, 2 pixel shaders that return red and blue, and 2 techniques. I thought I would be able to switch techniques in the shader window and see either the red or blue color, but I can only see the red shader whether red or blue is selected. Did I misunderstand how this is supposed to work?
Thanks for any help!
Here's my enbeffect.fx file:
Code: Select all
struct VS_OUTPUT_POST
{
float4 vpos : POSITION;
float2 txcoord0 : TEXCOORD0;
};
struct VS_INPUT_POST
{
float3 pos : POSITION;
float2 txcoord0 : TEXCOORD0;
};
VS_OUTPUT_POST VS_Quad(VS_INPUT_POST IN)
{
VS_OUTPUT_POST OUT;
OUT.vpos=float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0);
OUT.txcoord0.xy=IN.txcoord0.xy;
return OUT;
}
float4 PS_red(VS_OUTPUT_POST IN, float2 vPos : VPOS) : COLOR
{
return float4(1,0,0,1);
}
float4 PS_blue(VS_OUTPUT_POST IN, float2 vPos : VPOS) : COLOR
{
return float4(0,0,1,1);
}
technique Shader_red <string UIName="Red";>
{
pass p0
{
VertexShader = compile vs_3_0 VS_Quad();
PixelShader = compile ps_3_0 PS_red();
ColorWriteEnable=ALPHA|RED|GREEN|BLUE;
ZEnable=FALSE;
ZWriteEnable=FALSE;
CullMode=NONE;
AlphaTestEnable=FALSE;
AlphaBlendEnable=FALSE;
SRGBWRITEENABLE=FALSE;
}
}
technique Shader_blue<string UIName="Blue";>
{
pass p0
{
VertexShader = compile vs_3_0 VS_Quad();
PixelShader = compile ps_3_0 PS_blue();
ColorWriteEnable=ALPHA|RED|GREEN|BLUE;
ZEnable=FALSE;
ZWriteEnable=FALSE;
CullMode=NONE;
AlphaTestEnable=FALSE;
AlphaBlendEnable=FALSE;
SRGBWRITEENABLE=FALSE;
}
}