So, we now have 2 textures in effect.txt, Original and one that will change with each pass. If I get this right this means that for blurring and blending techniques I first have to run an "empty" pass like:
SamplerColor2 is <texColor> SamplerColor is <texOriginal>
Code: Select all
float4 PS_ProcessOriginal(VS_OUTPUT_POST IN) : COLOR
{
float4 color = tex2D(SamplerColor2, IN.txcoord.xy);
color.xyz = saturate(color.xyz);
color.w = 1.0f;
return color;
}
...other stuff
technique PostProcess
{
pass P0
{
VertexShader = compile vs_3_0 VS_PostProcess();
PixelShader = compile ps_3_0 PS_ProcessOriginal();
DitherEnable=FALSE;
ZEnable=FALSE;
CullMode=NONE;
ALPHATESTENABLE=FALSE;
SEPARATEALPHABLENDENABLE=FALSE;
AlphaBlendEnable=FALSE;
StencilEnable=FALSE;
FogEnable=FALSE;
SRGBWRITEENABLE=FALSE;
}
}
Another question... at one point between the passes, is there a way to write again to texOriginal or is it a one time only on the first pass? Does it change anywhere between techniques, eg; I have 1 technique with 8 passes, and another with 4 passes. The first technique first pass will fill texOriginal and any of the other passes can use it to do effects against... now I have another technique with 4 passes, will the first pass of that technique change texOriginal again? (will texOriginal be the result of the first technique if I do so?)
And last question; how many techniques/passes can the file have? I believe it was 8, but can't recall clearly.
I already have the whole file working, just checking for optimizations and/or if I can expand what it does...