Search Keywords:GLSL, shading language
The VRayGLSLTex texture map can be used to load GLSL shaders (.frag, .glsl files), V-Ray precompiled fragment shaders (.pfrag files) or Mental Mill projects (.xmsl files) and render them directly with V-Ray. If the shader file describes a material (rather than a texture), it can be rendered by either assigning the texture map to the color slot of a VRayLightMtl material or just by using the VRayGLSLMtl material.
If the Mental Mill project file contains material definition nodes or if the GLSL shader file describes a shader that has attached BRDFs the VRayGLSLTex texture map would not evaluate the materials and would be rendered black. In such cases the VRayGLSLMtl material should be used. Both VRayGLSLMtl and VRayGLSLTex share the same user interface.
This texture map and material is the first stage of the V-Ray implementation of GLSL support. In this version, 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.
The general parameters of the VRayGLSLTex texture control the general characteristics of the shader. Any additional shader-specific parameters are listed in additional rollouts.
Shader file - specifies the .glsl, .frag, .pfrag or .xmsl file which contains the shader code. This button control also supports context menu with Clear, Reload and Open Folder Location options. See the V-Ray GLSL page for more detailed description and examples.
Shader node - When loading a Mental Mill project (.xmsl file) this list will contain all renderable target nodes. When a single project file holds multiple shader definitions this allows the user to easily switch between several shaders. Currently this list would appear empty for GLSL shaders as only a single shader is allowed to be defined in a .glsl, .frag or .pfrag file.
Refraction IOR - the refraction IOR of the shader.
Incident IOR - the incident IOR value for the shader.
Max ray depth - specifies the maximum reflection/refraction depth for the shader.
Animation time - specifies the animation time for the shader.
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.
Viewport color - specifies the diffuse component of the material used in the viewport shading.
Save compiled shader - Allows the user to save his shader file as a binary precompiled fragment shader file (.pfrag ).