View Full Version : [Tutorial] Parti Volume Shader Rendering

August 3rd, 2009, 09:55 PM
Volumetric lighting can be a mysterious thing in mental ray. I'm going to go through the Parti Volume Shader, and hopefully you will be able to know how to use it after understanding it.

http://1.bp.blogspot.com/_xx8nItOX5Ic/SbZ0v8rpnUI/AAAAAAAADW8/OGQuAdFdp9E/s400/partiVolume01.jpg (http://1.bp.blogspot.com/_xx8nItOX5Ic/SbZ0v8rpnUI/AAAAAAAADW8/OGQuAdFdp9E/s1600-h/partiVolume01.jpg)

http://3.bp.blogspot.com/_xx8nItOX5Ic/SbZ1UYHRNvI/AAAAAAAADXE/N1R87e9IxT0/s400/partiVolume02.jpg (http://3.bp.blogspot.com/_xx8nItOX5Ic/SbZ1UYHRNvI/AAAAAAAADXE/N1R87e9IxT0/s1600-h/partiVolume02.jpg)

Firstly, how do you apply it? Go to your render settings, and click on the Renderer tab. Scroll down until you see the Camera Shaders section. Click on the button that says None to the right of the Volume option. Here you will see a list of various volume shaders, choose Parti Volume. Now you have it applied, but like alot of shaders in max, to access click on the Parti Volume button and drag an instance of it to the material editor.

__________________________________________________ __________________________________________________ _____

http://2.bp.blogspot.com/_xx8nItOX5Ic/SbZ1iYE4HQI/AAAAAAAADXM/MIWZQgKC57Y/s400/partiVolume03.jpg (http://2.bp.blogspot.com/_xx8nItOX5Ic/SbZ1iYE4HQI/AAAAAAAADXM/MIWZQgKC57Y/s1600-h/partiVolume03.jpg)

The default settings:

Right away if you were to render your scene, assuming it has lights, you will a very slow rendering that looks blown out with too much volume. After I discuss each setting, hopefully you can tweak it to optimize your rendering and speeds.

__________________________________________________ __________________________________________________ __________

there are really two settings for this. 0 and 1. Anything else will give you strange results. Mode 0 is usually what you want. when Mode is set to 1 creates ground fog, and activates the Height function.

This color swatch is what gives the power behind your volume light. The lighter it is, the more volume effect you will get. The darker it is the less effect you will get. By default the value is set to 50% white, which is way too strong. I would suggest to keep gray-scale values for the best effect. Of course you can color the volume, but this is unnatural. Usually the closer you can get to black the better.

This controls how quickly light is absorbed by the particulate. The higher the value, the more volume you get. But it will choke your light. I try to keep this value as low as possible.

r, g2, and g2:
These values tend to act strange if you don't know what they're doing. Basically the three of them control scattering of the volume. The values g1 and g2 control the distance of the scattering between each other. The r value controls the favoring between g1 and g2. r=0 will favor g2 and r=1 will favor g1. Rule of thumb: r value should only be between 0 and 1, and g1 and g2 should only be between -1 and 1. You will get strange artifacts with other values. Keeping these at the default aren't a bad idea. But if you want to control the spreading, you can change these values.

Non Uniform:
this creates a non-uniform volume, and adds noise to the effect. I usually leave this at 0.

Only works when Mode=1. It controls the height of the volume from the ground for fog effects.

Minimum, Maximum Step Length:
Simply put these control the sampling for the volume light. The larger the values the less samples are taken, and the faster the render. For quick and dirty test renders you can set these to min=4' and max=4'. Work your way down, trying to keep the min value smaller than the max value so that the solution is adaptive. Eventually something like min=1" and max=2' should give you more than enough sampling. For the render above I used min=2' and max=3'.

Light Distance:
This is a control for a falloff of sampling quality. It defines high sampling to take place within the specified distance.

No GI where direct:
If checked, when GI is calculated it ignores the volumetric light. Produces much faster GI solution of course.

This is a very important option and should not be ignored if you have more than 1 light in your scene. It is off by default, meaning every light in the scene will emmit volume, which can cause very very slow render times; especially if you have like 40+ lights in your scene. When checked, it will only cast volume from the lights added to its list.

That's it for the Parti Volume Shader!

Other notes of weirdness for this shader...it only works with geometry behind the rays. So if your light which should be casting volume is against empty space, you will not see the volume. Solutions to this:

-put glass in your windows for interior scenes

-add an invisible sphere around your scene for volume passing over open air

__________________________________________________ __________________________________________________ ___________

http://3.bp.blogspot.com/_xx8nItOX5Ic/SbZ1qFiufpI/AAAAAAAADXU/GoptlIE5-XU/s400/partiVolume06.jpg (http://3.bp.blogspot.com/_xx8nItOX5Ic/SbZ1qFiufpI/AAAAAAAADXU/GoptlIE5-XU/s1600-h/partiVolume06.jpg)

On left: plane behind volume light. On right: invisible sphere around scene

(copyright http://3dsmaxrendering.blogspot.com/ (http://3dsmaxrendering.blogspot.com/))
Thanks Ramy for the tutorial

August 3rd, 2009, 10:00 PM
very cool, nice tutorial!

August 17th, 2009, 03:49 AM
That's nice, I'll remember this one