Jump to content

#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?

Link to comment
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 :(

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...