The V-Ray OSL Material can be used to load OSL shader code files (.osl) or OSL object code files (.oso) and render them directly with V-Ray. The V-Ray OSL Material node can be used with shaders that have simple color and float output parameters. These parameters are considered respectively as texture RGB and alpha outputs.
If the shader file describes a material (rather than a texture) and writes its result in an output closure color parameter, it is advised to use the V-Ray OSL Material. Otherwise the texture map would not evaluate the materials and would be rendered black.
V-Ray OSL Material
Shader File – specifies the .glsl, .frag, or .pfrag file which contains the shader code.
Edit Shader with External Editor – opens external editor to edit shader.
Recreate attributes – reloads the shader and recreate its parameters.
Select Closure Output – specifies the closure color source for the materials’s output. The built-in output closure color parameter Ci is selected by default.
Viewport color – Specifies the diffuse component of the material used in the viewport shading.
Color output – Specifies the color source for the texture’s RGB output. If “None” is selected the texture renders black.
Alpha output – Specifies the float source for the texture’s alpha output. If “None” is selected the texture is considered fully opaque.
Show preview – Determines whether to render a shader preview in the material editor.
Clamp shader result – Determines whether to force the result in the [0, Clamping limit ] range or not.
Clamping limit – Specifies the upper clamp limit if Clamp shader result is enabled.
Wrap texture coordinates – Automatically wraps the texture coordinates for the OSL shader passing only values in the [0.0, 1.0] range.
Save oso shader – Enabled only if an .osl shader is loaded this button control allows the user to save it as an object code shader (.oso).