Jump to content
  • Advertisement
Sign in to follow this  
RobMaddison

Gausian Blur in 2 passes

This topic is 2570 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all

I'm just trying to do a simple Guassian blur, splitting it into 2 effect file passes, 1 horizontal and 1 vertical. I'm using DirectX 9.0c.

My framework allows that my filters have a source texture and a destination surface - it appears that when I do

U32 passes;

filterEffect->Begin(&passes, 0);

for (int i = 0; i < passes; i++)

{

filterEffect->BeginPass(i);

renderable->Render();

filterEffect->EndPass();

}

filterEffect->End();


... it only does the second pass. If I flip the passes around, it only does either horizontal or vertical depending on which one is second. Do I need to do any kind of texture binding in between passes or something like that? Here is my effect:



pass P0

{

vertexShader = compile vs_3_0 VS();

pixelShader = compile ps_3_0 PSBlurV();



FillMode = Solid;

CullMode = CCW;

}

pass P1

{

vertexShader = compile vs_3_0 VS();

pixelShader = compile ps_3_0 PSBlurH();



FillMode = Solid;

CullMode = CCW;

}


Thanks

Share this post


Link to post
Share on other sites
Advertisement
Yes, the input texture for the 2nd pass is the surface that was rendered to by the 1st pass - so in between passes, you need to switch your inputs/outputs around somewhat.

Share this post


Link to post
Share on other sites

Yes, the input texture for the 2nd pass is the surface that was rendered to by the 1st pass - so in between passes, you need to switch your inputs/outputs around somewhat.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!