Jump to content
  • Advertisement
Sign in to follow this  
lipsryme

DX11 Including a hlsl file inside a hlsl file (shader includes)

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

Edit: Wait a sec, it works without doing anything...? That's odd because I remember trying it before and it didn't....

 

I've been trying to figure out how I can simply include a shader file inside another shader file in Direct3D11. In XNA I could just do

#include "test.fx"
and it worked. I know there's a parameter of a type ID3DInclude* that I can put in during D3DX11CompileFromFile but I am clueless on how this works. And there's almost no documentation on this. Why is it so complicated biggrin.png Does anybody know how to do this ? I'm not using the effect framework btw.

 

 

Edited by lipsryme

Share this post


Link to post
Share on other sites
Advertisement

Yes, it just works as long as the file path is relative to the path of the file in which you placed the include. So if you had a file "effect.fx" that included "test.fx", it will work if "test.fx" is in the same directory as "effect.fx". The ID3DInclude interface is there for situations where the included file is in a different location, and you want to use custom logic for finding an included file.

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!