|
|||||
|
|
|
|
#1 |
|
Matteo Masciotti
Join Date: Nov 2003
Location: Italy
Posts: 697
Thanks: 0
Thanked 0 Times in 0 Posts
|
MAYA MENTAL RAY:Volumetric lights
(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!
__________________
www.3dtotal.com>free stuff>tutorials>maya...there you'll find my tutorial. CLICK BELOWE http://www.threedy.com/site/forum/sh...threadid=28147 |
|
|
|
|
|
#2 |
|
Matteo Masciotti
Join Date: Nov 2003
Location: Italy
Posts: 697
Thanks: 0
Thanked 0 Times in 0 Posts
|
Arranging the stuff of your scene
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.
__________________
www.3dtotal.com>free stuff>tutorials>maya...there you'll find my tutorial. CLICK BELOWE http://www.threedy.com/site/forum/sh...threadid=28147 |
|
|
|
|
|
#3 |
|
Matteo Masciotti
Join Date: Nov 2003
Location: Italy
Posts: 697
Thanks: 0
Thanked 0 Times in 0 Posts
|
keep working on your scene
Assign the blin shader to your spheres:
__________________
www.3dtotal.com>free stuff>tutorials>maya...there you'll find my tutorial. CLICK BELOWE http://www.threedy.com/site/forum/sh...threadid=28147 |
|
|
|
|
|
#4 |
|
Matteo Masciotti
Join Date: Nov 2003
Location: Italy
Posts: 697
Thanks: 0
Thanked 0 Times in 0 Posts
|
The Shaders:
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
__________________
www.3dtotal.com>free stuff>tutorials>maya...there you'll find my tutorial. CLICK BELOWE http://www.threedy.com/site/forum/sh...threadid=28147 |
|
|
|
|
|
#5 |
|
Matteo Masciotti
Join Date: Nov 2003
Location: Italy
Posts: 697
Thanks: 0
Thanked 0 Times in 0 Posts
|
Assign to the cube a Lambert
in order to attach a volume shader to the big cube,we need firt to assign it a simple lambert shader.follow the pic:
__________________
www.3dtotal.com>free stuff>tutorials>maya...there you'll find my tutorial. CLICK BELOWE http://www.threedy.com/site/forum/sh...threadid=28147 |
|
|
|
|
|
#6 |
|
Matteo Masciotti
Join Date: Nov 2003
Location: Italy
Posts: 697
Thanks: 0
Thanked 0 Times in 0 Posts
|
Assign to the Lambert material the PARTI_VOLUME shader
this is basically what i was talking about.just follow the pic:
__________________
www.3dtotal.com>free stuff>tutorials>maya...there you'll find my tutorial. CLICK BELOWE http://www.threedy.com/site/forum/sh...threadid=28147 |
|
|
|
|
|
#7 |
|
Matteo Masciotti
Join Date: Nov 2003
Location: Italy
Posts: 697
Thanks: 0
Thanked 0 Times in 0 Posts
|
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]
__________________
www.3dtotal.com>free stuff>tutorials>maya...there you'll find my tutorial. CLICK BELOWE http://www.threedy.com/site/forum/sh...threadid=28147 |
|
|
|
|
|
#8 |
|
Matteo Masciotti
Join Date: Nov 2003
Location: Italy
Posts: 697
Thanks: 0
Thanked 0 Times in 0 Posts
|
The Spotlight
...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...
__________________
www.3dtotal.com>free stuff>tutorials>maya...there you'll find my tutorial. CLICK BELOWE http://www.threedy.com/site/forum/sh...threadid=28147 |
|
|
|
|
|
#9 |
|
Matteo Masciotti
Join Date: Nov 2003
Location: Italy
Posts: 697
Thanks: 0
Thanked 0 Times in 0 Posts
|
ALMOST DONE
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):
__________________
www.3dtotal.com>free stuff>tutorials>maya...there you'll find my tutorial. CLICK BELOWE http://www.threedy.com/site/forum/sh...threadid=28147 |
|
|
|
|
|
#10 |
|
Matteo Masciotti
Join Date: Nov 2003
Location: Italy
Posts: 697
Thanks: 0
Thanked 0 Times in 0 Posts
|
and choose PHYSICAL LIGHT from the MR tab:
__________________
www.3dtotal.com>free stuff>tutorials>maya...there you'll find my tutorial. CLICK BELOWE http://www.threedy.com/site/forum/sh...threadid=28147 |
|
|
|
|
|
#11 |
|
Matteo Masciotti
Join Date: Nov 2003
Location: Italy
Posts: 697
Thanks: 0
Thanked 0 Times in 0 Posts
|
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!!!...
__________________
www.3dtotal.com>free stuff>tutorials>maya...there you'll find my tutorial. CLICK BELOWE http://www.threedy.com/site/forum/sh...threadid=28147 |
|
|
|
|
|
#12 |
|
Matteo Masciotti
Join Date: Nov 2003
Location: Italy
Posts: 697
Thanks: 0
Thanked 0 Times in 0 Posts
|
the little mel script line
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!!...
__________________
www.3dtotal.com>free stuff>tutorials>maya...there you'll find my tutorial. CLICK BELOWE http://www.threedy.com/site/forum/sh...threadid=28147 |
|
|
|
|
|
#13 |
|
Matteo Masciotti
Join Date: Nov 2003
Location: Italy
Posts: 697
Thanks: 0
Thanked 0 Times in 0 Posts
|
...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.
__________________
www.3dtotal.com>free stuff>tutorials>maya...there you'll find my tutorial. CLICK BELOWE http://www.threedy.com/site/forum/sh...threadid=28147 |
|
|
|
|
|
#14 |
|
Matteo Masciotti
Join Date: Nov 2003
Location: Italy
Posts: 697
Thanks: 0
Thanked 0 Times in 0 Posts
|
...That's all folks!! :)
...tutorial written by Masciotti Matteo
m.masciotti@tiscali.it for forums.3dtotal.com ...now i'd like some feedback!! cheers!!!
__________________
www.3dtotal.com>free stuff>tutorials>maya...there you'll find my tutorial. CLICK BELOWE http://www.threedy.com/site/forum/sh...threadid=28147 |
|
|
|
|
|
#15 |
|
is studying.
Join Date: Jul 2003
Location: Pakistan
Posts: 829
Thanks: 0
Thanked 0 Times in 0 Posts
|
good work...
ur are good profane....i like u....keep writing tutorial and helping others....
lets talk on msn.... fahadyarkhan@hotmail.com ![]()
__________________
But in the end, no matter what i pretend, the journey is more important than the end or the start, and what it meant to me will eventually be a memory of the time WHEN I TRIED SO HARD! Mental Ray Rendering And shader Discussion thread |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|