Jump to content
Sign in to follow this  
Stremik

#include

Recommended Posts

To compile my shader I needed to include rmannotes.sl file in it.

So, I've put this line at the beginning of the shader code #include "rmannotes.sl" and then I placed rmannotes.sl file in prman's include directory. When I tried to compile shader,... shader.exe didn't find it there and I had to move it to the directory where the shader I was working on resided. Than it worked. Why so?

Share this post


Link to post
Share on other sites
When I tried to compile shader,... shader.exe didn't find it there and I had to move it to the directory where the shader I was working on resided. Than it worked. Why so?

The "current working directory" is part of prman's shader path by default, that's why it could find it after you moved it to your shader's location.

You *can* put the include files anywhere, though. You just have to tell prman where to look, and for that you have a couple of options:

1. You can make sure that the location of your include is in prman's shader path.

Do this by editing the "/shaderpath" entry in your "rendermn.ini" file, or by adding it to the environment variable RMAN_SHADERPATH.

2. Since it's not unusual to have include files in several different places, it's probably more convenient to just tell the compiler where to find them, using the "-I" option, like this:

shader -I/my/include/directory kewl.sl

Include files are only necessary during compilation, not at runtime, so I use option #2 most of the time as it gives me the most flexibility.

The examples above are obviously for a *nix system. I'm afraid I don't know what their equivalents are for windoze, sorry :(

Share this post


Link to post
Share on other sites

Big thanks Mario!!!

I realise that I could find all this info in PRMan's help files but for some reason I get confused and eventually lost every time I try to read it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×