Multiple passes

Hi guys,

Is it possible to write a shader with multiple passes? How does it works?

hi thiv!

just specify another pass within your technique.

technique TSimpleShader
{
pass P0
{
VertexShader = compile vs_1_1 VS();
PixelShader = compile ps_2_a PS();
}
pass P1
{
VertexShader = compile vs_1_1 VS();
PixelShader = compile ps_2_a PS_extra();
}
}

if the effect node there is a pin “Technique Pass” with which you can specify the pass(es) which should be drawn. default is -1, which means all passes are drawn.

Is this new? I thought we could only do 1 pass…

ow, i am confused now, i thought multipass shaders don’t work…

how are the passes rendered? just ontop of each other?

but if i want to use the result from one pass in the next pass, i have to use a Renderer -> DXTexture -> second shader instance… ? like in this patch:

multipass.zip (3.6 kB)

no this is not new.
but is only for overdrawing. what we still can’t do is to render into a texture and use it in the same technique again.
for stuff like that we still have to go over the DX9Texture…

what a beautiful patch btw.!

yea, somtimes it looks like a painting…

Thank you all for your answer!!