Video: Creating light beams with participating media

Participating Media refers to the effect of light streaming through a medium such as dust, or fog, or some kind of cloud that's creating that wonderful effect of streaming rays of light coming in through a window. mental ray has a special setup that can allow you to create a very realistic volumetric light effect or Participating Media effect, and I am going to show you the basics of how to set that up. So we have our scene here which is our dining room, and we have a little skylight here.

Watch the Online Video Course Lighting and Rendering with mental ray in Maya

4h 56mIntermediateJul 22, 2010

Viewers:
in countries
Watching now:

Lighting and Rendering with mental ray in Maya with Eric Keller shows how to master practical mental ray techniques for rendering models created in Maya. This course walks through the most efficient and innovative mental ray techniques, including direct versus indirect lighting methods, creating different types of shadows, using the new ShadowMap camera, and reusing shadow and final gathering maps. A chapter on optimizing render times and enhancing render quality is also included. Exercise files are included with the course.

Creating light beams with participating media

Participating Media refers to the effect of light streaming through a medium suchas dust, or fog, or some kind of cloud that's creating that wonderful effect ofstreaming rays of light coming in through a window.mental ray has a special setup that can allow you to create a very realisticvolumetric light effect or Participating Media effect, and I am going to showyou the basics of how to set that up.So we have our scene here which is our dining room, and we have a little skylight here.

I have added a simple directional light that is going to have the light comingthrough this window right here.I have also blocked off the windows.So I just have added some geometry here and applied just a regular Lambertshader to the geometry, because I just want to focus right now on the lightcoming through the skylight.I am not going to worry about these lights right now.I just want to focus on that.So there are number of steps that you will need to take in order to set up this effect.So I'd like to go through those steps one-by-one.The first thing I need to do is select the light that is going to be casting theParticipating Media, and I am going to add a Physical Light shader to it.

So here I have the directionalLight selected, and I have the Attribute Editoropen to the directionalLightShape 1 tab, and I will scroll down to the LightShader section and under Custom Shaders, I am going to click on littlechecker box here and under mental ray, switch over to MentalRay Lights andclick on physical_light.Now, by default, when I click on the color channel that controls the intensity ofthe physical_light Shader, this is set to, if I look at the value, I can setthis HSV so that Hue, Saturation and Value.

So I can see the value is set to 1000.That's a bit strong for a directionalLight.That value works very well for point lights and spot lights, but fordirectionalLight, it's very strong.So I am going to set this down to 20.This is also going to take care of things like the shadows, and so on and so forth.So I have the light set up.The next thing I need to do is create the volume,the volume that creates the sort of dusty effect that the beams of light aregoing to stream through.

To do this, I am going to create a polygon cube.So Create > Polygon Primitives > Cube.It's going to ask me to drag it on the grid.So I am creating my Polygon Cube.I am going to use the Scale tool.I just want to basically scale this up so it encompasses the entire room.Switch to a Side view and press 4 to switch to wireframe, and I can easily seewhat's going on here, and I am just roughly positioning this area.

Switch to a Top view, just to take a look and scale it.I am zooming out, and now I can see that this volume is encompassing the entire room.Then I switch back to the renderCam camera and press 5 to switch back to Shaded view.The next thing I need to do is make sure that my cube is not casting anyshadows, so that the light cast by the directionalLight is not being blocked by this cube.So I am going to select the cube and open this Attribute Editor to thepCubeShape 1 tab and turn off Casts Shadows, and I might as well go ahead andturn off Receive Shadows as well.

Now I am going to go into the Hypershade window, and I am going to create aspecial shader to apply to this cube.In the mental ray section, under Materials, I am going to scroll over to the bottomhere, and you will find the transmat material.So I am going to create this transmat material, select the cube in the Outliner,and I am going to right-click over the material in the Hypershade and do AssignMaterial To Selection.

So that assigns this material.If I switch to the Perspective view, you will see that the cube has now turned red.This is just indicating that the transmat material has been applied to the cube.So, the next thing I am going to do is apply the Volumetric effect to the Shader.To do that, I will select transmat1 Shader in the Work Area of the hypershade,and I will do Graph > Input and Output Connections.So we can see that I have the transmat1SG node here.

This is the Shading Group node.This is the node that acts as an intermediate between the shader, the transmatshader, and the geometry that it's applied to.I am going to select this transmat1SG node,SG stands for Shading Group, and open this Attribute Editor.I will make sure I am on the transmat1SG tab, and I am going to scroll down, Iam at the top of the attributes here, I will scroll down to the Custom Shadersection and click on the checker box next to Volume Shader.

This will pull up the Create Render Node window again.Under here, under mental ray, I am going to select Volumetric Materials andclick on the parti_volume button.This applies the shader.You can see in the Hypershade, if I scroll out here, that I have thetransmat1 node, connected to transmat1SG, and I have parti_volume alsoconnected to transmat1SG.Now, I am going to switch to the renderCam camera, and I will close the Hypershadeso we can see what's going on here, and I am going to create a test render, andsee how it looks so far from the renderCam.

So we can see the light coming in here, but I am not seeing any effect of theVolumetric Material, and this is a common mistake.This is a mistake I actually make almost every time I do this.So I am kind of glad that it's happening here.This is something that can drive you crazy very quickly.Let me minimize this, and I'll show you what's going on.If I go into the Render Settings, there is a very sneaky little setting that youhave to remember to turn on; otherwise, the effect won't work.And this is a kind of thing that will definitely drive you crazy.I am going to switch to the Features tab in the Render Settings window, and Iam going to scroll down to Extra Features right here, and there is an Auto Volume setting.

If this is not turned on, then no matter what you do in the Maya scene, you willnever see that effect.So make sure that this is turned on now, and I will minimize this and createanother test render.Now, we can see the effect is starting to appear in our render.Now, I have the Quality Preset set to Preview.So this is why you can see that the quality of the geometry in this scene is quite low.Now, I am just doing that to save a little bit of time when I am creating therender, because right now I am just interested in tuning the effect, so I cansee how this is going to look.

But you can see how the light is coming through here.The bars here in the skylight are creating some detail in the Volumetric andsame with the legs of the chairs.So this already starts to look pretty nice.A couple of things that I'd like to do to improve the look of this effect.I mean, for one thing, we have a dark sky casting lights in here, which looksa little bit strange.So I can very easily change that effect.I am going to select the renderCam camera, and just as a quick way to fix that,switch to the renderCamShape, and here in the Environment, I am going to set theBackground Color to White.

This will end up looking like a black- and-white image, because I don't have anyShaders applied to the objects in the scene. That's fine.And you get the basic idea of how this is going to look.So that starts to look a little bit more natural.This effect is quite expensive, meaning that it's going to add an awful lot to render time.So you want to be careful in how you use it.If I start to add things like Global Illumination and Final Gather, and ComplexTextures, and increase the Render Quality, I am going to very quickly increasemy render time to something that's going to be difficult to work with.

So, you want to be careful how you use this effect, and there are strategies foroptimizing the way this effect can be applied,especially strategies for compositing just the rays of light separately fromthe rest of the objects in the scene.That's usually the best way to go when using this effect, rather than trying toapply everything in a single render, which can turn into a very difficultscene to work with.The other setting that I'd like to show, if I select the Cube here, and I amgoing to click on the parti_volume1 tab that's connected to transmat, and thereis a number of settings here that effect the way that light looks.

As you increase the Extinction setting, that will start to turn off the effect sooner.So higher values are basically say, the light coming through the mediumbecomes extinct sooner.So it doesn't reach quite as far.You can also adjust the color of the medium.The Scatter setting has a large effect on overall brightness.The value, as you can see right here, is very low.So this is an extremely sensitive setting.You set this to HSV and start to adjust the value that's going to change thebrightness of the effect.

And there are number of other settings in here which are going to relate tothe look of the effect.Some of these actually get quite complex, and there is a lot of physicsinvolved in how they work.So you will want to consult the mental ray manual that's in thedocumentation for more information on how these settings work, but they doget quite technical.But that's basic overview of how to set up the effect and add it to a scene.

There are currently no FAQs about Lighting and Rendering with mental ray in Maya.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.

Already a member ?

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships.
Learn more

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.

Sign up and receive emails about lynda.com and our online training library:

new course releases

newsletter

general communications

special notices

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

new course releases

newsletter

general communications

special notices

Here’s our privacy policy with more details about how we handle your information.