Jump to content
  • Advertisement
Sign in to follow this  
RetroBilly

Multipass shaders in CG?

This topic is 2509 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

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!