VLT Tutorial

Thanks for using VLT! I hope that the following tutorial will help answer any questions you might have about using this tool.

I’ve technically been working on this tool for about a year. It took me a week to get the first version of it done back in 2011 when I was first learning how to script. Much thanks to my friend Josh Mccollom who helped me get started with my first script. Now, after nearly a year, I’ve revisited it in an attempt to make a useful tool for anyone to use. The workflow is relatively straightforward and is based on the parti_volume workflow. If you’re familiar with the parti_volume workflow, you’ll find this tool greatly increases the speed at which you can create volumetric shading networks. If you’re completely new, it should be relatively straightforward and easy to pick up.

First thing’s first, if you don’t yet have VLT, you can get it here. You’ll need something like winrar to unpack the files.

In your documents, there should be a folder called maya. Inside it will be the version(s) that you have installed. Go to your version of Maya and find the “scripts” folder (For me, it’s C:\Users\Andrew\Documents\maya\2013-x64\scripts). Place the vlt.mel file here.

Go back one level and there should be a folder called “prefs” with a folder inside that called “icons”. Drop the contents of the icons folder in your download there.

Loading it in Maya

Open Maya (or relaunch it if you already had it open). Copy and paste the following into the script editor.

shelfButton -i "vlt.jpeg" -parent "Custom" -c VLT -annotation "Volumetric Lighting Tool"

It will create a nice little button on your Custom shelf. If you do not wish to add this button, you can always launch the tool using the command VLT in the script editor.

Using the script
Alright, go ahead and click that button you just made. If you’re already familiar with Maya’s Parti_Volume workflow, you probably don’t need to read this tutorial.

This tool assumes that you already have a scene in which you want to add the volumetric lighting effect. If not, you’ll need to create something that will cast a shadow (a cube will do) and a light (I recommend a directional light, they’re the easiest to work with.)

I’ve got a simple indoor scene set up with strong sunlight coming in from the window.

Step 1: Create a bounding box
The volumetric light setup works by shading the interior volume of a polygon as light travels through it. The simplest way to do this is to create a cube or a sphere that engulfs your entire scene. If you know that you only want the volumetric light in part of your scene, you can just put the polygon around this area of the scene.

I want the light to be inside the room, so I place the cube around the building.

Next you’ll want to create the volumetric material. Go ahead and click “Create Volumetric Shader” on VLT. You can assign it to the cube you just created by selecting the cube and then clicking “Assign to selected object” in VLT.

Note: At this point, it isn’t necessary to have the cube visible anymore. You can use the “Toggle Volume Visibility” button to hide it. It will still show up in the render.

Step 2: Link the shader to the light

By default, the shader won’t interact with any of the lights in your scene, they must be linked to to the shader. Select the light you want to interact with the volumetric effect and click the “Link selected light(s)” button. I strongly recommend that you only choose one unless you need multiple light sources interacting with the participating media and casting shadows. With the light still selected click the “Update Light Settings” button. This will make sure that your light settings meet the minimum required settings to render volumetric effects.

I’ve want the sunlight to be the light causing the effect, so I’ll select that.

Likewise, click the “Update Render Settings” button. It will make sure Mental Ray is loaded and can render volumetric effects.

Step 3: Create the look of your volumetric effect

I wrote a rather extensive post about some of this the other day, so if you want a further explanation about tweaking the volumetric shader, give it a read.

First, if you render right now, you won’t see anything. By default, the volumetric shader is black, so it’s not showing up. Click the “Change Volumetric Color” button and set it to the color of your choice.

Next, you’ll notice a few sliders with some weird values next to them. Again, check the aforementioned blog post if you want an in-depth explanation as to what they mean. If you want quick results, you can use some of the preset values “Rayleigh”, “Hazy Mie”, or “Murky Mie’. Use Rayleigh scattering to simulate smoke or dust. Mie scattering simulates things like fog. Hazy is for a thin effect, and murky gives you a denser effect. The extinction slider controls how much light is absorbed by the volume. 0 lets all light through, and nothing will show up. I recommend tweaking this value in very small increments as this control is really touchy. It is also recommended that you do not go outside the 0 to 1 or -1 to 1 range of the sliders, as you may get unexpected results.

Step 4: Render!

Warning: Increasing the volume samples in Maya will cause the render to take longer, as will enabling effects like final gathering. I recommend making a separate render pass for your volumetric effect.

That should be all you need! If you’d like to customize the shader even further, you can check out the “Parti_Volume_VM” node. It’s got all the controls you need to further customize the look of your volumetric effect. If you want to learn more about the parti_volume shader, I’m going to write a more in-depth tutorial about it at a later time. For now, CG Notebook has a pretty good explanation of the different controls.

I hope this has answered any questions you might have. If you find problems or need help, please email me at andrewkennedy3d@gmail.com.