You don't have to call CommitChanges, SetTexture and SetStreamSource for each pass. They don't change between passes, so calling the methods with the same arguments is just slowing your program.
Now to the main problem - you are not doing what people were telling you to do ;)
You need to create an empty texture using D3DXCreateTexture with D3DUSAGE_RENDERTARGET and the same width and height as your backbuffer. I'll refer to this texture as to <RTtexture>.
Then, when rendering, you set this <RTtexture> texture as your render target (this step doesn't have to do anything with effect) using device->SetRenderTarget. Now you render the quad with the first effect.
Then you set your backbuffer as the render target again using device->SetRenderTarget. And you also set your <RTtexture> texture as an input (resource) texture for your effect. And you render the quad using the second effect.
What happens is this:
- <RTtexture> texture starts as empty.
- you render the result of the first effect to it
- you use the result of the first effect, which now is in <RTtexture>, as input for the second effect
- you render the result of the second effect to the backbuffer and display it
Because you render the second effect using a texture which already has the first effect in it, you'll get combined effects.
I can't resolve this problem !
when i create a texture as empty , i set it to effect1 and i input it in effect 2 then i use it randertarget .
the problem here is , the RTtexture after first frame is become a randertarget , in this case i can't see the first effect because it overwrite by the second effect.