Script (スクリプト)ノード

Hair (ヘアー) BSDF

Script ノード。

The Script Node allows you to load and use custom shaders written in Open Shading Language (OSL) within the Cycles renderer. This node acts as a bridge between OSL shader code and the node-based material system in Blender.

Each Script node represents a single OSL shader, with its inputs and outputs defined by the parameters in the shader script. These shaders can be stored directly within the blend-file or referenced externally.

This feature is ideal for technical artists and shader developers who need fine-grained control over shading behavior beyond what the standard shader nodes provide.

注釈

The Script node is only available when Open Shading Language is enabled in the Cycles render settings. This feature requires rendering with the CPU or OptiX backend.

Tip

プロダクション環境での利用のため、シェーダーの Script ノードを分類するノードグループを利用し、他の blend ファイルにリンクさせる事を推奨します。この方法では全てのファイルの Script ノードを更新する事無く、入出力ソケットが追加もしくは削除された後もノードに対する変更を容易なものにします。

Properties(プロパティ)

Mode(モード)

How to link to OSL shaders.

Internal (内部):

A text data-block is used to store the OSL shader, and the OSO bytecode is stored in the node itself. This is useful for distributing a blend-file with everything packed into it.

Script Node Update

Reloads the text file data-block, creating new inputs and outputs if needed.

External (外部):

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.

シェーダーの探索対象パスは記述したスクリプトと同じ場所および、以下のあらかじめ設定されたパスとなります:

Linux:

$HOME/.config/blender/4.5/shaders/

Windows:

C:\Users\$user\AppData\Roaming\Blender Foundation\Blender\4.5\shaders\

macOS:

/Users/$USER/Library/Application Support/Blender/4.5/shaders/