Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 lipsryme   Members   -  Reputation: 1031

Like
0Likes
Like

Posted 01 February 2013 - 11:58 AM

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, 01 February 2013 - 12:12 PM.


Sponsor:

#2 MJP   Moderators   -  Reputation: 11590

Like
2Likes
Like

Posted 01 February 2013 - 04:56 PM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS