Table of Contents

Overview


The lighting analysis workflows with V-Ray are based around two components: the VRayLightMeter helper object, and the VRayLightingAnalysis Render Element. While the VRayLightMeter object has been included in V-Ray since version 2.0, it is updated and improved for V-Ray Next and later to ensure better precision of the results. The VRayLightingAnalysis Render Element is newer than the VRayLightMeter workflow in V-Ray.


VRayLightMeter Helper


The VRayLightMeter helper is a rectangular grid that can be added to the scene to show illuminance values at the vertices of the grid. It enables showing total illuminance, direct illuminance, indirect illuminance and daylight factor. The predominant direction from which the respective lighting component comes can also be shown.




The VRayLightMeter in the 3ds Max viewport, with pseudo colors, orientation and textual illuminance values displayed.

The interface of the VRayLightMeter in the 3ds Max command panel.




 

Before results can be displayed in the viewport, the values for the light meter grid must be calculated either by pressing the Calculate button, or by calling the MaxScript calculate() method of the light meter (V-Ray does not automatically recalculate scene light meters during regular image rendering). The precision of the result can be controlled with the Error tolerance parameter. Higher values will be faster to calculate but may appear noisy.

Internally, the light meter values are calculated in several passes using the texture baking mechanism of V-Ray. There are four baking passes - one to collect the main illuminance data, two more to determine the predominant direction of the lighting, and a fourth pass for the daylight factor. To ensure correctness of the results, the light meter creates its own internal instance of the V-Ray renderer to perform the calculations and any settings of the current 3ds Max production renderer are ignored. The Brute force + Light cache combination is used for GI, which should produce results comparable to radiosity methods (i.e. with a sufficiently high number of light bounces).

A progress window is displayed during the calculations, which shows the current pass and provides the option to cancel the calculations:



V-Ray does not yet have a Lighting Analysis control panel so if you need to set the min/max values for all VRayLightMeter’s in the scene, you can use the following MaxScript function:


fn setVRayLightMetersScale fmin fmax logarithmic = (
  local lightMeters=getClassInstances VRayLightMeter
  for lightMeter in lightMeters do (
    lightMeter.min=fmin
    lightMeter.max=fmax
    lightMeter.log=logarithmic
  )
)



 To recalculate all VRayLightMeter helpers in the scene, you can use the following MaxScript function:


fn calcAllVRayLightMeters = (
  local lightMeters=getClassInstances VRayLightMeter
  for lightMeter in lightMeters do (
    if lightMeter.active then lightMeter.calculate()
  )
)



VRayLightingAnalysis Render Element


The VRayLightingAnalysis Render Element is a special element that can be added from the Render Settings.

Adding this render element internally adds two other render elements to the V-Ray frame buffer called Illuminance and Luminance which are filled with the absolute unscaled lux and candela values for the respective quantity.




The V-Ray frame buffer showing the VRayLightingAnalysis render element in “false colors” mode after a render is complete. The additional Illuminance and Luminance render elements can be seen in the VFB as well.


The interface of the VRayLightingAnalysis Render Element.








The VRayLightingAnalysis overlay with illuminance values overlaid on a grid over the original image.


The original RGB rendering.



The VRayLightingAnalysis Render Element is a post-effect and is only updated once the rendering is complete. During the render, the VRayLightingAnalysis may display some approximation to the false-color image, but it should not be interpreted as being the final result.

After a render is complete, most settings of the VRayLightingAnalysis can be dynamically adjusted and the result can be displayed without re-rendering by pressing the Update button.

When using the same settings (min/max and scale type) as the VRayLightMeter, the results should be the same for the total illuminance.

Illuminance values shown over glass and mirror objects represent illuminance of the glass or mirror surface (and not on the surfaces seen through the glass or mirror) and may be quite noisy or with a zero value. This is because these materials do not reflect light diffusely and V-Ray computes the illuminance values with very low precision or may skip illuminance calculations completely. To ensure correct results, it is recommended to use the default V-Ray GI settings, with optionally increased light cache subdivs (e.g. 2000) and higher light cache retrace threshold (e.g. 4.0).

 

Converting Light Meters and Lighting Analysis Image Overlay Render Effects


There are two ways to convert existing scenes and lighting analysis components to V-Ray equivalents. One method is using the 3ds Max Scene Converter tool. The other method is to use the V-Ray scene converter script included with V-Ray. Both tools can convert Light Meter objects and Lighting Analysis Overlay render effects (as well as other scene components) into the respective V-Ray equivalents. The V-Ray scene converter can be invoked from the V-Ray menu > Converters and selecting the V-Ray scene converter option (note that this option is only available if V-Ray is selected as the current renderer). Note that for versions earlier than V-Ray 6, this option can be accessed by right-clicking in any 3ds Max viewport and selecting the V-Ray scene converter option.



V-Ray menu with V-Ray scene converter tool

 

The V-Ray scene converter dialog




Comparisons With Mental Ray


To verify the validity of the results from the V-Ray calculations, we compare them to the results from the previously available mental ray (in 3ds Max 2017).


Scene setup

For comparison tests to be valid, the components should be compared on scenes that have the same geometry, material and lighting setups for both renderers.


Scene

The scene used in the examples below is from Evermotion ArchInteriors 39 (scene 5).


Materials

Generally we advise users to set up their scenes using V-Ray materials. However V-Ray materials didn’t render with mental ray. For the purposes of this comparison, we used the mental ray Arch&Design material, which V-Ray translates internally to a VRayMtl equivalent and allows the same scene to be rendered with both engines without modification.


Lighting

Generally we advise users to set up their scenes using the VRaySun and VRaySky components for daylight analysis. However mental ray did not render these components and only supported the mr Sky environment texture and the mr Sun light. When rendering with mental ray, we used a 3ds Max Daylight system with mr Sun and mr Sky. When rendering with V-Ray, we used the Physical Sun & Sky Environment texture included in 3ds Max 2017, which is very similar to the mr Sky texture and renders with any 3ds Max-compliant renderer including V-Ray. Since this texture includes the sun disk, it needs to be used through a V-Ray dome light to make sampling efficient. We also used the new adaptive dome light in V-Ray to additionally speed up the rendering process. There is no need for a separate sunlight, as the texture already includes the sun. This setup allows us to render the same scene in both engines.


Render settings

To estimate the correct lighting distribution in a scene, it is crucial that we calculate enough light bounces. With mental ray, we used the Final Gather global illumination method with 50 diffuse bounces and 500 FG rays. With V-Ray, we used the Brute force + Light cache combination, which produces results similar to radiosity methods (hundreds of diffuse light bounces). The Light cache subdivs were set to 2000 and the Light cache retrace threshold was set to 4.0.


VRayLightMeter

The mental ray version of the light meter does not seem to produce correct directionality data for the lighting (at least we could not get it to show proper directions), so we can only compare the numerical values.  

Here is a comparison of the viewport for the Light Meter with mental ray compared to the VRayLightMeter. For the VRayLightMeter, the error tolerance was set to 0.001:



Light meter with mental ray

VRayLightMeter



Light meter with mental ray - numbers

 
VRayLightMeter with numbers



VRayLightingAnalysis


The mental ray version of the lighting analysis overlay does not produce legible results in 3ds Max 2017 and later. Therefore we had to resort to rendering the lighting analysis overlay with 3ds Max 2016.




mental ray rendering

V-Ray rendering



Lighting analysis overlay with mental ray

VRayLightingAnalysis render element



Conclusion


V-Ray provides tools for accurate lighting analysis that can be successfully used as a replacement of the tools provided by earlier versions of 3ds Max. The two basic components, the VRayLightMeter and the VRayLightingAnalysis render element, provide adequate replacements for the Light Meter and the Lighting Analysis Image Overlay render effect respectively.

At this point, V-Ray does not provide an equivalent of the Lighting Analysis Assistant dialog. The Assistant allowed the user to control various aspects of the scene, including all light meters and lighting analysis image overlays, from one central location. It also allowed analyzing the scene for various aspects that could interfere with accurate lighting analysis (lights, materials, render settings).