© Square Enix © Goodbye Kansas


Table of Contents

This page provides details on how to use the V-Ray MtlGLSL node.

Overview


The V-Ray GLSL material and V-Ray GLSL texture nodes can be used to load GLSL shaders (.frag, .glsl files) or V-Ray precompiled fragment shaders (.pfrag files) and render them directly with V-Ray. If the shader file describes a material (rather than a texture), it can be rendered with a V-Ray GLSL material or by assigning a V-Ray TexGLSL map to the color slot of a V-Ray Light material.

Note that both V-Ray MtlGLSL and V-Ray TexGLSL share the same user interface.

This material and the V-Ray TexGLSL map are part of the first stage of V-Ray implementation of GLSL support. In this version of V-Ray, the shaders are compiled to byte code for a software virtual machine, which is then interpreted. Due to this run-time interpretation, GLSL shaders can be somewhat slower to render than V-Ray shaders written in C++. In future builds of V-Ray, shaders will be directly compiled to machine code for faster rendering.



GLSL Code


GLSL Source – Specifies whether the GLSL shader code is inserted inline or loaded through a file.

Inline GLSL – The GLSL shader code is inserted inline.
File path (.oso/.osl) – The GLSL shader code is loaded through a file.

Path to .glsl/.frag/pfrag file – Specifies the path to the GLSL shader code file.



GLSL Params


Transparency – Overrides the alpha if Use Shader Alpha is off.

Transparency Tex – Uses a texture for the transparency.

Transparency Tex Mult – A multiplier for the transparency texture.

Use Shader Alpha – Uses the alpha calculated in the shader.

Max Ray Depth – Specifies the maximum reflection/refraction depth for the shader.

Clamp Result – Determines whether to force the result into the [0, Clamping Value] range.

Clamp Value – Specifies the upper clamp limit if Clamp Result is enabled.





UVW Generators Count – Specifies the number of UVW Generators provided for the GLSL shader.





Example: Transparency Texture


In this example, we show you how a texture can be used to control the transparency of a V-Ray GLSL material. We use a V-Ray Bercon Noise texture.



without
with