Multipass shaders in CG?

Started by
3 comments, last by JackOfAllTrades 12 years, 8 months ago
I'm trying to improve my blur shader and I found out that I'm going to need to use two passes one for the horizontal axis and one for the vertical axis. This would be very easy in HLSL but I'm not sure how to do passes on the fragment shader in CG. Is there a way I can do it without having to render to my full screen quad twice?
Advertisement
Cg and HLSL are essentially the same thing... What makes it easy in HLSL but hard in Cg?

If I was using either of them (or even GL+GLSL) I would render the quad twice -- if this is for a separable blur, then each pass needs different texture inputs and a different render-target anyway, which means you have to render the quad twice.

Cg and HLSL are essentially the same thing... What makes it easy in HLSL but hard in Cg?

If I was using either of them (or even GL+GLSL) I would render the quad twice -- if this is for a separable blur, then each pass needs different texture inputs and a different render-target anyway, which means you have to render the quad twice.


I suppose you are right. I was thinking of the technique class but I guess in the end it's the same thing.
If you do need them, [font="'Courier New"]technique[/font]s and [font="'Courier New"]pass[/font]es aren't part of HLSL or Cg --- they're part of the DirectX FX format and the CGFX format, which means you can use them either via DirectX or via the Cg runtime.

If you do need them, [font="Courier New"]technique[/font]s and [font="Courier New"]pass[/font]es aren't part of HLSL or Cg --- they're part of the DirectX FX format and the CGFX format, which means you can use them either via DirectX or via the Cg runtime.


Really there is a CGFX format?! Awesome I didn't even know that! laugh.gif

This topic is closed to new replies.

Advertisement