Jump to content
  • Advertisement
Sign in to follow this  
Velik

how to tell directx to use a shader A instead of shader B

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

using VC++ & Dx10 & HLSL If I have 2 shader files loaded which are very similar, how do i tell Directx to render using one shader instead of another? Thanks for any assistance! -Velik

Share this post


Link to post
Share on other sites
Advertisement
I haven't used DX10, but I imagine this applies there as well. You don't set it with the device directly, when using Effects. Instead, when you activate your effect, the required constants are set, and the shaders are set.
int pass, passes;
pFX->Begin(&passes);
for (pass = 0; pass < passes; pass++)
{
pFX->BeginPass(pass); // At this point the shaders will be set
...Draw...
pFX->EndPass();
}
pFX->End();

Share this post


Link to post
Share on other sites
If you are using Effect framework then you want to do what Namethatnobodyelsetook has posted. If you arent using the Effect framework then you will want to use the method that you mentioned in your last post.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!