View Full Version : MAYA MENTAL RAY:Volumetric lights
Profane
11-05-2004, 10:40 AM
(Please do not post anything before the tut would be completed,thanks)
Fog effect with lights in Mental Ray -Masciotti Matteo aka Profane
Hi everybody!
Creating volumetric lights into maya is a pretty simple task ,but when it comes to render them into Mental Ray many people found themselves 'swearing',because MR need some more 'things' to be set and of course its own shaders.Thanks to many maya users located on diffrent communities(highend3d.com and cgtalk.com) I decided to 'write' an easy step by step tutorial wich will guide you through the easiest way to create a volumetric light.i found this approach quite simple and more intuitive than others....but it's obviously up to you!
Profane
11-05-2004, 10:41 AM
first of all you need to arrange a scene,a couple of spheres would be enough.
If you want to achieve the shiny reflective effect as in the final render you saw at the beginning of this tutorial, just assign a blinn shader to your spheres and increase the reflectivity from 0.5 to 0.84 or 0.9...but this does not really matter at all.
Profane
11-05-2004, 10:43 AM
Assign the blin shader to your spheres:
Profane
11-05-2004, 10:45 AM
Every time you want volumetric lights in mental ray,you need to create a geometry that sorrounds the lights you want with the fog-effect visible;therefore create a poly cube sorrounding all of the lights you wish to work with and of course the rest of the scene (in this case your spheres).This is perhaps one the most important task of the whole tutorial.We need to assign to this cube a PARTI_VOLUME shader(just follow the pics) The PARTI_VOLUME is a Volume shader,a volume shader can be attached either to a material or a camera,but for our purpose we need to attach it to a lambert material,wich will be the shader of the cube (we were talking just before).DO AS FOLLOWS
Profane
11-05-2004, 10:47 AM
in order to attach a volume shader to the big cube,we need firt to assign it a simple lambert shader.follow the pic:
Profane
11-05-2004, 10:53 AM
this is basically what i was talking about.just follow the pic:
Profane
11-05-2004, 10:59 AM
and now let's tweak a little bit with the PARTI_VOLUME shader we've just created:
Just as a rudimental and basic settings follow mine:
and here are the better explanation given by the MENTAL RAY guide:
'Fog, clouds, silty water, and similar media scatter some of the light that travels through it. In other words, these media participate in the light transport .A volume shader is needed to simulate participating media. '
mode: in mode 0, the participating medium fills the entire volume. In mode 1, there is only participation medium below the given height, and there is clear air or vacuum above.
scatter is the color of the scattering medium. This determines the color of the light that is scattered by the medium.
extinction is the extinction coefficient of the medium. It determines how much light is absorbed or scattered in the medium. 0 means clear air or vacuum. The higher the coefficient, the denser the medium (and the more photon scattering).
r, g1, and g2 control scattering. If both g1 and g2 are zero (the default), isotropic scattering is modeled: all scattering directions have equal probability. This is sometimes also called diffuse scattering. Anisotropic reflection is modeled by a two-lobed scattering model. Each lobe can be either backscattering (-1 < g < 0), diffuse (isotropic, g = 0), or forward scattering (0 < g < 1). The first lobe is weighted by r, the second lobe by 1 - r.
nonuniform determines if the medium is homogeneous (uniform density) or nonhomogeneous (cloud-like density variation). It is a number between 0 and 1. A value of 0 makes the medium is completely homogeneous and depends only on the extinction parameter. A value of 1 creates a cloud-like Blinn density variation. Values between 0 and 1 give a mix between the two extremes.
height determines the height above which there is clear air or vacuum if the mode parameter is 1.
min_step_len and max_step_len are used to determine the step length for ray marching in a nonhomogeneous medium, or if the mode is 1.
light_dist is used for optimization of the sampling of area light sources. It is used if the area light source has the optional lower sampling, as in for example[I]
Profane
11-05-2004, 11:03 AM
...now in oreder to have a fog effect created by a light we need a light...a spotlight!Tweak a little bit the cone angle and the shadow as you prefer....and put it like in this way...
Profane
11-05-2004, 11:10 AM
as we did for the lambert of the cube,we now need to assign to this spotlight a mental ray shader,this time a 'light shader' called:Physical Light.it's pretty simple,just open up the spotlightshape tab and choose underneath Mental ray/Export options the little checker from the LIGHT SHADER slot (I think it's much more intuitive to work looking at the picture):
Profane
11-05-2004, 11:11 AM
and choose PHYSICAL LIGHT from the MR tab:
Profane
11-05-2004, 11:15 AM
as usual,follow my settings
cone:50 (or more,this will set the angle of the cone of the fog....)
cos_exp: 1.0
TAKE CARE OF THE V VALUE of the color you choose (whether the color would be)it must be set to at least 80000 if you wish to see something!!!...
Profane
11-05-2004, 11:24 AM
Now as usual,Mental Ray need,in order to produce the effect we are attending for,a connection between the message node of the spotlight and the parti_volume lights list.This is perhaps the most detestable task maya users have to work with,I have noticed that many people on internet had troubles to make this connection with the 'connection editor'....so i'll explain you how to do this with a very simple mel script:
open up the script editor and write this down:
connectAttr -f spotLight1.message parti_volume1.lights[0]
hit enter and voilą!!!that's it!!...
Profane
11-05-2004, 11:28 AM
...the mel script you've written was quite simple...here is what we did with that:
we Connected(connectAttr -f) the Message node of our light (in this case spotLight1 ----->spotLight1.message) to the parti volume lights list (parti_volume1 is the name of our parti_volume shader ----------->parti_volume1.lights[0])
this was possible also in an other way,but I thought this was the fastest one.
Profane
11-05-2004, 11:30 AM
...tutorial written by Masciotti Matteo
m.masciotti@tiscali.it
for forums.3dtotal.com
...now i'd like some feedback!! :) :) cheers!!!
geoMan
12-05-2004, 11:32 PM
ur are good profane....i like u....keep writing tutorial and helping others....
lets talk on msn.... fahadyarkhan@hotmail.com :D
Daniel
13-05-2004, 11:33 AM
another good tutorial, cooll stuff man, bookmarked to work on it later, keep writing them man. If you take requests, why not how to do a good car paint material and render next time? :D
Profane
14-05-2004, 12:15 AM
Originally posted by DanielB
another good tutorial, cooll stuff man, bookmarked to work on it later, keep writing them man. If you take requests, why not how to do a good car paint material and render next time? :D ...i have to think on....
but never say never .... :)
thanks for the reply.
akirathompson
23-02-2010, 03:18 PM
The link is dead, where are the pictures you keep mentioning?
Thanks!
vBulletin® v3.7.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.