Sorry if this is a "duh" question, but I'd like to use a custom OSL shader, but I'd like it to be sourced from an objective location on my hard drive. How exactly would I go about this in the most efficient manner?
-
2Possible duplicate of Understanding the Cycles 'Script' node – Duarte Farrajota Ramos Jul 25 '18 at 19:05
-
@DuarteFarrajotaRamos Remember, close when finding duplicate questions, not when finding duplicate answers. Though, in this case I'm not even sure that answer has an answer to "how to use an OSL script from an external file"? – gandalf3 Jul 26 '18 at 00:21
-
Well on the "Using an OSL Shader" section it does specify it can be used with an internal or external file, though to be fair it doesn't thoroughly go into details explaining it step by step – Duarte Farrajota Ramos Jul 26 '18 at 00:29
1 Answers
Select the External mode on the script node and set the filepath to your .osl source file or a compiled .oso file. Or, if you put your shaders under the shader search path (see below), you can simply specify the filename.
From the documentation:
The External mode can be used to specify a .osl file from a drive, and this will then be automatically compiled into a .oso file in the same directory. It is also possible to specify a path to a .oso file, which will then be used directly, with compilation done manually by the user. The third option is to specify just the module name, which will be looked up in the shader search path.
The shader search path is located in the same place as the scripts or configuration path, under:
Linux
$HOME/.config/blender/2.79/shaders/MS-Windows
C:\Users\$user\AppData\Roaming\Blender Foundation\Blender\2.79\shaders\macOS
/Users/$USER/Library/Application Support/Blender/2.79/shaders/
- 157,169
- 58
- 601
- 1,133
