Square Enix © Goodbye Kansas

Table of Contents

This page provides information about the Surface Luminance extra attributes in V-Ray for Maya.

 

Overview


V-Ray's extra attributes for the Surface Luminance node allow control of luminance calculation.

The most common workflow for the Surface Luminance node attributes is to connect the node to a floating texture input slot of an ExtraTex render element. This way you can control the Luminance mode showing in the ExtraTex channel. 

 

UI Path: ||Select Surface Luminance node|| > Attribute Editor > Attributes menu > VRay > Luminance options

 

 

 

Parameters


Luminance Mode – Controls how luminance is calculated. 

Disabled – No luminance is calculated.
Direct Only – Calculates luminance from direct lighting. It creates a grayscale mask over the points of objects lit by direct lighting.
Diffuse Only – Calculates luminance from indirect lighting (GI). It creates a grayscale mask over the points of objects lit by indirect lighting. 
Direct+Diffuse – Calculates luminance from direct and indirect lighting. This creates a grayscale mask over the points of objects by direct and indirect lighting.
Matte Shadow – Creates a grayscale mask over all shadowed points of objects. Unlike the standard Matte Shadow render element, this mode creates a two-sided mask covering both the lit and unlit points of the objects.

Subdivs – Controls the subdivisions for the diffuse lighting, when the Luminance Mode is set to Diffuse only or Direct+Diffuse.

Contribute to GI – When enabled, the direct light contributes to the GI calculations. The effect is visible only when the texture is used for diffuse calculation with either the Diffuse Only or the Direct+Diffuse mode.

 

 

Setup


The Luminance Options are most commonly used to generate an extra render element with masks for the lit and unlit points of objects in the scene. The common setup is to use the surfaceLuminance node as a texture connected to an ExtraTex render element.

 

 

 

 

 

Steps:

  1. Create a surfaceLuminance node in Maya.
  2. With the node selected, from the Attribute Editor, add Attributes > VRay > Luminance Options.
  3. From the Extra VRay Attributes, choose the desired Luminance Mode.
  4. Create an ExtraTex render element.
  5. Set the Type to Float Texture.
  6. Connect the surfaceLuminance node to the Float Texture input plug of the ExtraTex render element.

 

Scripting Example (MEL)
// The connection is made from the outValue output of the surfaceLuminance node to the vray_float_texture_extratex input of the ExtraTex render element.
connectAttr -f surfaceLuminance1.outValue vrayRE_Extra_Tex.vray_float_texture_extratex;

 

 

Scripting


This group of extra V-Ray attributes can be added and removed from the surfaceLuminance node with script commands. This section also outlines the names of the attributes that are added and their value types.

 

Add / Remove attributes (MEL)
// Add Luminance Options attributes to surfaceLuminance1
vray addAttributesFromGroup surfaceLuminance1 vray_surface_luminance 1;
 
// Remove Luminance Options attributes to surfaceLuminance1
vray addAttributesFromGroup surfaceLuminance1 vray_surface_luminance 0;


AttributeTypeRangeExample (MEL)
vrayLuminanceMode
integer0-4 (where 0 - Disabled | 1 - Direct Only | 2 - Diffuse Only | 3 - Direct+Diffuse | 4 - Matte Shadow)

setAttr surfaceLuminance1.vrayLuminanceMode 4;

vrayLuminanceSamples
integer0-1000setAttr surfaceLuminance1.vrayLuminanceSamples 16;
vrayLuminanceGIContrib
booleantrue | falsesetAttr surfaceLuminance1.vrayLuminanceGIContrib false;