Including files in HLSL

Posted By: Uhrwerk

Including files in HLSL - 03/09/11 17:41

Hello everybody,

I've got several .fx files in my project. These .fx files all have the same lighting algorithm in common, so that I wanted to extract that algorithm to another file and include that one in the others.

The MS HLSL documentation said that I could use a simple #include "file.fx" command to do this or alternatively #include <file.fx> when the file is on a path passed as a command line argument to the HLSL compiler. As I don't have influence on the command line arguments I simply placed two files in the same directory and included one into the other with #include "file2.fx". However, the compiler throws an error message he cannot find the included file.

Is there anything specific I have to take care of in GameStudio?
Posted By: TheShooter

Re: Including files in HLSL - 03/09/11 17:56

I guess with the newest A8 version can you write more than one shader in one .fx file. Or was it the 8.11 beta? Dont know, sry. took a look on the forecast.
Posted By: Uhrwerk

Re: Including files in HLSL - 03/09/11 18:05

I know, but I'd prefer different files in terms of clarity.
© 2024 lite-C Forums