Modeling Core – Part 4

Written December 30th, 2008
Categories: Modeling, Videos
No Comments »

Hey Everyone!

This week’s Monday Movie is part 4 of 4. I’m hoping to make one movie each week discussing what I think are the core modeling methods: primitives modeling, Boolean modeling, spline modeling, and poly Modeling. I’m very sorry this movie was delayed; the holidays snuck up on me, and then my display adapter went nuts literally as I was about to upload the video file.

In this video I’m talking about how you can create fully arbitrary meshes using the turbosmooth modifier.  Remember that this is just an introduction to a branch of poly modeling, so it shouldn’t be taken as the full enumeration of all possibilities.  I go over a few of the most important methods of mesh control; adding edges, chamfering, discontinuous mesh flow, and creasing.

An Introduction to World Machine

Written December 26th, 2008
Categories: Articles
4 comments

Hello, and welcome to my World-Machine 2 Primer.  During this tutorial, you’ll learn about how the World-Machine interface works, how you can manipulate the node-graph, and how you can export the resultant terrain to 3dsMax or Vue d’Esprit.  My goal is to get you up and running with the program as quickly as possible, so I’ll be showing you the very core fundamentals so that you can get output from the program.  More advanced features and techniques will be discussed in the next few sections of this primer.  If you don’t already have World-Machine, consider downloading the trial version so that you can follow along!

The World Machine Startup Screen

World-Machine Start Screen

The startup screen shows you the node graph; the diagram representation of how your terrain will be built.  The left group is the terrain creation group.  It contains a single terrain generator.  Notice beneath the node, it reads “Advanced Perlin”.  This means that this node is generating advanced Perlin noise.  Similarly, you’ll notice the other nodes read “Terrace” and “Height Output”.  The terrace filter creates a stair-stepped look in the terrain, while the height output node allows you to save the resultant terrain to a file.  You don’t have to put your nodes inside these groups; they’re optional.  They are included in the startup screen to help you visualize what’s going on in this simple graph.

Terrain Preview

World-Machine Terrain Preview

Notice on the top left of your screen, there’s a small terrain preview.  This shows you what your terrain looks like at a given part of the node graph.  Try selecting the “Advanced Perlin” node, and look at the preview.  Then select the “Terrace” node and notice the difference.  You should see something similar to the image on the right.  When you select a node, World-Machine displays the terrain you would get if you exported from that node in the graph.  This is very useful when you’re inserting new nodes into the graph to achieve certain effects.

This also has an impact on rendering or “building” your terrain.  Notice the green and yellow round buttons along the top toolbar.

Build Control

These control the build.

The green button, when clicked, builds all nodes, regardless of whether they’re before or after of the node you’ve selected.  The yellow button, however, builds only the nodes up to (and including) the node you currently have selected.  For example, if you select the “Advanced Perlin” node and click the yellow button, World-Machine will only render the heightfield generator, and ignore the “Terrace” node.  You’ll realize the value of this button when you start working with terrains so complex that they bog down your machine if you try to render the entire solution every time.

Let’s try that now.  Click the green button to render the entire hieghtfield.  You’ll notice a window appear that displays the build process.  This progress window is miles above what it used to be now that it includes a device breakdown.  When the build is complete, you can click “OK” to close the dialog.  If you find it annoying for smaller builds, you can choose to have it auto-hide in the dialog found in World Commands >> Preferences.

Now that the build is complete, you can preview the landscape in the 3d view!

Terrain Preview

See your terrain in the 3d preview.

Notice that instead of the node graph highlighted in the button bar, I now have the 3d view button highlighted.  Give it a click, and you’ll see the high resolution version of the terrain.  This view is useful for getting a bird’s eye view of your landscape.  Note that if you’ve made changes to your terrain after building, and then try to use this view, you’ll only get a super-low resolution preview image.

Controls

Key World-Machine Controls.

The 3d view is controlled by the left mouse button (rotate), the right mouse button (zoom), and the Up/Down/Left/Right arrows (move the camera on the X/Z plane).  You’ll want to inspect your landscape like this before exporting it to your favorite rendering program.

Alright!  We’ve covered the default scene, as well as building and viewing terrains.  Now we’ll have a quick look at how you can modify the terrain, and then we’ll export the scene.
First, let’s try editing an existing node.  Go back to the node graph by clicking on the graph icon in the button toolbar.  Double click on the “Terrace” node to open a dialog that will alter its properties.  I encourage you to play around with these settings.  For now, I’ll reduce “Terrace Layering” down to 1, which will drastically lower the number of ‘steps’ in the terrain.

Fewer Steps

There are fewer steps now.

I’ve included an example of what my terrain now looks like on the right.  It’s looking pretty good, but it’s still got that fresh terrain feel.  We need to weather the landscape procedurally in order to make it appear more natural.  In addition, we’ll want a more sweeping vista in order to get a good image after the terrain is rendered.

Let’s get to it. Go ahead and click on the “Natural” tab, and click on the very first button on the left called “Erosion”. Click next to the terrace to create a new “Erosion” node. You’ll notice that the color below the new node is red; that is because it is not connected to any other nodes, and will not be included next time you build the terrain. In order for it to have any effect, you’ll need to connect an input to the left side, and an output to the right side of the node.

To do this, just click on the little dark box on the right side of the “Terrace” node and then click on the lighter box on the left of the “Erosion” node. This will link the two together. Now do the same for the output of the Erosion node to the input of the “Height Output” node. It’ll look like the image below when you’re done.

Erosion

Erosion takes place after the terrace effect.

You should also notice a change in the preview on the upper right of the user interface. It looks like it’s undergoing a kind of melting process. That’s the erosion in action. Because the Erosion and Height Output nodes haven’t been built yet (and have a yellow status icon), you’ll want to click the green “Build All” button and have a look at the full-resolution terrain in the 3d view again. You’ll probably notice at this point that the build takes longer this time. That’s because erosion is an intense process and should be used carefully. If you use too many erosion nodes, you’ll start running into trouble!

I’m going to double click on my Erosion node, and, Under the “Presets” group, I’m going to select ‘A Flood of Slurry’. This step is, of course, optional.

The last step in this tutorial is to increase the size of the terrain and get a broader landscape represented. World-Machine is excellent, in part, because it can create vast landscapes that all adhere to the same procedural rules.

Click the world extents and resolution button.

The “World Extents and Resolution” button is pretty self explanatory. You use this dialogue to alter the resolution of the terrain and how large the single terrain should be when it’s built. If you are using the trial version of the software, you will be unable to select a terrain size larger than 512×512. However, if you’ve already bought the software, go ahead and use 1024×1024 for this demonstration. Under the “Render Extents” group, change the “Width” and “Height” parameters to read 16.00 km each. This will make World-Machine render a larger area over the same amount of pixels. Note that this reduces the resolution per square meter, so keep in mind how big you want your scene when finished.

One final note. The terrain altitude scaling in the upper right corner of the dialogue allows you to set the overall height of the terrain in the preview and 3d view. If you find your terrain looking vertically stretched or squashed, this is the parameter you’re looking for.

That said, let’s take one more full build using the green button, and this terrain should be ready for export.

In order to export the heightfield, we just have to set the right parameters in the “Height Output” node at the end of the graph. Double click on that last, red node, and pick a file format. Generally speaking, you’ll want to use TIFF unless you’re using Terragen in which case .ter is what you need. The other types are for convenience, and if they fit your situation (i.e. BMP/TGA for dame engines) feel free to select those. Once you’ve picked a format, click the “set” button at the top of the dialogue and select an output directory. This directory will be saved, and you can even elect to have World-Machine automatically save the map every time you build. This is a real timesaver!

Our final heightfield!

And that’s it! You now have the very basics you need to understand, manipulate, and save a terrain in World-Machine. There are tons of features to this program, and you’ll discover them most effectively through playing around with parameters and filters. I’ll be writing more tutorials in the future (and maybe even doing a Monday Movie) discussing techniques in World-Machine and how you can use this handy program to boost your pipeline.

Free Procedural Texture Map

Written December 25th, 2008
Categories: Blog
2 comments

Jeremy Ylilammi released a new version of his noise map.  In case you’re not familiar with it, Bercon’s noise implementation is a fresh new procedural map for 3dsMax.  You can get a nearly limitless variety of noise shapes using this one texture. Best of all, it’s free!

Site Optimization Now Underway

Written December 24th, 2008
Categories: Blog
No Comments »

Well, I’ve begun to optimize the page a bit.  There’s pleanty of awesome tutorials and videos on the site, but I’m getting the impression that people are having trouble finding it.  So to alleviate the problem, I’ve started cleaning up the site a little with UI items like multi-page navigation at the bottom and moving some of my larger posts into pages that are listed on the right.

This is really going to spruce things up a little, but if you get dead links please sit tight.  They usually go away in a few minutes because I don’t leave the site in limbo for more than a 10 minute stretch.

Modeling Core – Part 3

Written December 21st, 2008
Categories: Modeling, Videos
1 Comment »

Hey Everyone!

This week’s Monday Movie is part 3 of 4. I’m hoping to make one movie each week discussing what I think are the core modeling methods: primitives modeling, Boolean modeling, spline modeling, and poly Modeling.

In this video I’m talking about how you can create semi-procedural shapes using splines and spline modifiers like Extrude and Lathe. Remember that splines bring us even closer to arbitrary modeling by allowing us to abstract away certain aspects of modeling, while keeping only what’s necessary to be modeled by hand.

Intermediate mental ray Lighting

Written December 21st, 2008
Categories: Articles, Lighting, Rendering / Compositing
23 comments

Hello everyone!

Welcome to the second mental ray lighting tutorial.  In this feature, I’ll be walking you through a typical lighting project for a scene I built for one of my Monday Movies.  Remember that this isn’t the only way to illuminate a scene, and your render times could get pretty high.  We’ll be using mental ray Sun&Sky to get the base lighting, followed by a few area lights to illuminate the hallway section of the render.  I’ll show you some common settings you’ll need to set up along the way, and by the time we’re done you should have a well lit scene!

You can download the starter 3dsMax Scene Here.

Our final render.

Note that some of these images will have light leaks above the center divider wall.  I didn’t notice these until I was done writing the tutorial, so please excuse the error.  The scene I uploaded for you to start with has been fixed. In addition, at the end I changed the floor to carpet instead of hardwood, so don’t be surprised when you start rendering and notice there’s carpeting.

Our starting point.

Where the magic begins.

Go ahead and load up the file  You’ll notice that there isn’t any lighting, but the materials work together pretty well.  I’ve gone ahead and included some little details such as the coffee maker and the tree.  However, you’re free to add anything you’d like!  Throw in a conference table for good measure, or some blinds on the windows if you’d like to be extra classy.

Our unlit render.

If you take a quick render, you’ll notice that the lighting is unimpressive, but the materials are right and the modeling is diverse enough to give us a good outcome once we’ve started lighting.

mr Sun & Sky Light Source

Create a mental ray Sun & Sky light.

The first thing we need to do is create a daylight system in 3dsMax.  Day-time renders are a piece of cake because most of the lighting comes from outside.  Under the “Systems” tab of the modify panel, you’ll see “Daylight”.  Create a daylight system by clicking and dragging to create the compass rose, followed by another drag and a click to create the light.  If you get a dialogue asking if you’d like to use photographic exposure control, click “Yes”.  It will yield good results and is vital for this tutorial.  The direction of the light doesn’t matter.  Click on “Manual” under the “Position” group in the modify panel, and you can then drag the sunlight light wherever you want.  I recommend a glancing angle that bounces the light off the floor and wall.

Scene Overview

An overview of the scene and setup.

Ignore the box you see on the open face of the building.  It’s a little hack that lets you see inside a wall while keeping it inpermiable to light.  That box is renderable and only casts shadows.  The rest of the walls have a shell modifier on them.

The next step is to set the daylight object to mr Sun and mr Sky.  I know it seems like this should be on by default, but there are times when you’ll need to use IES.  This isn’t one of them though.  By setting the daylight to mental ray Sun and Sky, you’ll be tapping into a powerful natural lighting engine that can make just about anything look awesome.  If you get a dialogue asking if you’d like to set the background to the mr Sky map, click “Yes”.  It’s just a good idea if you’ve got nothing else for a background.

Sun & Sky Parameters

Setting up mental ray Sun & Sky.

Go ahead and take a quick render.  You’ll see that our scene’s lighting has changed dramatically, and Final Gather is now giving us a little more depth.

First Architectural Render

Our first render with only the outdoor light.

Comparable to a real-life photograph, the exposure is adjusted to make the outdoors look reasonable at the expense of making the indoors too dark. We’ll increase the exposure shortly. First, we’ll help mental ray understand that these windows boarder the outside world, and should therefore bring in a little more light.

Under the “Create” tab, under the “Lights” section, you’ll find mr Sky Portal under the “Photometric” group. The mr Sky Portal can be put in the window frames to boost the lighting, and basically earn us an additional Final Gather bounce for free.

Create area lights.

It’s important that they reasonably approximate the window frame. It’ll take some guessing and checking, but it’s worth it. You’ll also want to enable the “From ‘Outdoors’” checkbox, if available.

Setting up sky portals.

Set up your mental ray Sky Portals.

Now that the sky portals are set up, take another render.  Notice the difference between this and what you had before.  The additional light is clearest on the ceiling and the blueish glow on the wall.

Render

Render with your new Sky Portals.

But the image is still too dark!  Like I mentioned earlier, our exposure is set to make the outdoors look normal at the expense of how the indoors looks.  Let’s increase our exposure such that the indoors looks normal and the outdoors looks blown out.  Open your Environment and Effects window (hotkey ’8′) and set the exposure value to 11.  Don’t hesitate to try other values and see what you think.  This is a very powerful mechanism for altering the brightness of your renders.

Turn your exposure values up to 11.

Here’s what my render looks like with a value of 11.

Render at an exposure value of 11.

We’re looking good!  But the hallway still doesn’t have any light.  The client won’t like that one bit!  Let’s add some lights to the lamps hanging from the ceiling.  Select a “Free Light” from the photometric group in the lighting section of the create panel, and place it in the light trough of one of the lamps.

Place the light in the light trough.

In this case, we want to use long cylindrical lights like fluorescent tubes.  We’ll need to select “Cylinder” under the “Emit Light From (Shape)” group.  We’ll also need to alter the length and radius of the light to fit nicely in the trough.  Finally, be sure to enable “Light Shape Visible in Rendering” so that it actually appears as a tube!  It’ll look great with the semi-transparent material I used.  Finally, we need to set up the shadow casting.  Select “Raytraced” from the pulldown under the “Shadows” group, and then click the exclude button.  You want to exclude the light troughs because otherwise they’ll create abnormal shadows on the walls.  From the list that appears, select Cylinder02, Cylinder 03, Cylinder09, and Cylinder10.  Sorry for the lousy naming conventions- these are the troughs.  Finally, select Exclude from shadow casting only; we still want the troughs to light up!

Set the area light parameters.

Here’s a render showing where we are so far. The hallway is starting to light up nicely, and the conference room looks like it might actually make meetings fun. This is really going to blow away that client, but we’ve still got a little ways to go before it’s perfect.

The render's starting to come together.

From here, let’s bump up the mental ray settings a little.  The Final Gather bounces are still on zero and very low precision.  The bounces value can be changed to 1 and the Final Gather Precision slider can be moved to “Low”.  The renders will take longer, so don’t hesitate to lower these back down until the very end.  I’m just increasing these to get closer to my final render.

Increase the Final Gather bounces for more light.

Here’s what the render looks like after the increases.  There’s a little more light in the corners as the Final Gather bounce pushes the lighting into recessed corners.  It’s a subtle, but important difference.

A render after increasing bounces.

We’re almost done!  I just want to add two more things.

The first is a light around the corner in the hallway to show that it’s a corner and to imply that the building is larger than just what’s in the field of view.  I accomplished this by using a “Free Light” (like in the lamps), only this time I’ll be using a rectangular area light.  This will create better shadowing by the door, and make it look like there’s more natural light (like from the other side of the office building).  Be sure to increase the brightness a little (I used 2000 cd).

Add another area light for depth.

The last thing we want to do is boost up the lighting in the hallway.  Right now we’re only seeing what the four florescent lights are generating with the help of the Final Gather bounces.  Unfortunately, it’s a little rough between the two lamp units so we’ll want to throw in an ambient-only, standard omni light to brighten it up a bit.  Notice that you’ll need to use an abnormally high intensity in order to compete in the photographic exposure control solution.  If you didn’t have the exposure control on, the image would be pretty much all white.  You can use my setting of 200 intensity, or experiment to see what works for you.

Include an ambient-only light.

And that’s all there is to it!  Take a look at the render below to see the final outcome. Just for kicks, I changed out the floor material for a carpet because that suits the “office” theme a little closer.

Our final render.

I hope you enjoyed this tutorial, and learned a little more about lighting a scene using mental ray.  Stay tuned for my weekly Monday Movies, and, until next time, happy lighting.

Keep Watching, I Might Do A Trick

Written December 18th, 2008
Categories: Blog
No Comments »

Hey everyone,

Sorry I’ve been out of contact lately.  It’s been a crazy week of work and dealing with real-life stuff..  The weather here in San Francisco has gotten much colder, so I can’t ride my bike to work anymore; I have to carpool.  And that means getting up earlier and coming home later.  I’m also sick of sleeping on two inches of foam, so I’m buying a real mattress which is a hassle all by itself.  Finally, I’m working on two awesome new websites, which I’ll announce when they’re closer to being finished.

In the meantime, stay tuned. This weekend’s looking pretty free for me. Some of my bigger side projects are taking a breather (except for the 2 new websites), meaning I should have time for another written tutorial.  I also feel guilty for not making any posts this week except for my (late) Monday Movie.  The tutorial will probably be a “part 2″ to the first mental ray lighting tutorial I did.  That one was a little on the “walkthrough” side and didn’t cover as much material as I’d wanted, so this next one will be a little more abstract and talk about light types.

Cheers!

Modeling Core – Part 2

Written December 15th, 2008
Categories: Modeling, Videos
3 comments

Hey Everyone!

This week’s Monday Movie is part 2 of 4. I’m hoping to make one movie each week discussing what I think are the core modeling methods: primitives modeling, Boolean modeling, spline modeling, and poly Modeling.

In this video I’m talking about how you can create elaborate machined parts much faster than poly modeling through the clever use of Boolean operations on primitives. I show you how I can bring together a few dozen basic shapes and create something that might’ve taken three times longer if I had jumped in with an editable poly. Remember to think hard about what you want the final shape to look like, and you can manipulate the Boolean structure to fit that.

World Machine 2 Review

Written December 13th, 2008
Categories: Blog
1 Comment »

Hey Everyone, I’ve been playing around with World-Machine 2 for the last few days, and I’m impressed with a lot of the changes that have been made. I had the pleasure of using the beta product, and when version 1 came out I bought it because it turned out to be a good pipeline addition. Now that version 2 has been released, I think it’s time to write a quick review!

The World Machine Node Graph

High Resolution, Photo-Realistic Terrain Generation

For those who have never heard of it, World-Machine is a program that lets you generate procedural terrains. Hand painting heightfields in Photoshop or a level editor (barf) is tedious and usually doesn’t yield realistic results. Several programs include some procedural landscape generation ability like Vue 7 Infinite, by e-on software, and Terragen, by Planetside. The goal of World-Machine is to build the heightfield and save it to a .ter (for terragen) or .tif (for anything else), and then import it when needed. All of the images in this post are from World-Machine; imagine how good these look when they’re rendered! World-Machine is, hands down, the most robust program for generating landscapes.

  • There are almost a dozen different noise generating algorithms to choose from. Most are exotic delicacies like Voronoi and custom generators, but there are several variations of classic Perlin, too.
  • There are now four different flavors of natural effects; thermal weathering, coastal erosion, regular erosion, and snow capping. Each of these gives you an unusual level of control (like changing how far sediment travels during erosion). Every other program I’ve ever used gives you one erosion tool and it’s usually ugly.
  • There are now native drawing tools for roads, rivers, and custom landscape features.
  • Native texture generation support has been added, too. Finally! We can use information from within World-Machine to generate textures based on height, slope, erosion deposition, and more.
  • There are now 5 view modes instead of 3. Device view (the graph editor), layout view, explorer view, 3d view, and 2d view.
  • There are several smaller UI changes like creating device groups and setting the water level.

Overall, I like World-Machine because many parts of the program have tooltips, popups, and text notes built in the UI. These are actually less obtrusive than you might think, and they keep you from having to refer to the documentation constantly. You can actually get pretty handy with World-Machine without ever opening the help file.

The World Machine Node Graph

The World Machine Node Graph

The recent upgrade brings in a completely new level of terrain control now that it allows you to paint heightfields directly in the program to tweak the landscape to your needs. It beats having to draw up a new map in Photoshop and bring it over via a custom input node. Unfortunately, while this is a welcome feature, the integration into the UI is a little awkward. You have to create a special input node and go to the layout view to draw your shapes. The available options are boxes, circles, polygons (like in Photoshop), and Bezier lines. That’s fair enough. But editing these shapes afterward is non-obvious, and the internal UI hints fall apart at about this point. This doesn’t make the feature entirely useless, but it does mean that you’ll have to wade through the help file looking for guidance. And no one likes that. I think version 3 of World-Machine will have this interface cleaned up and better understandable at a glance.

Am I complaining that an advanced feature of an advanced program is hard to use? Yes.  And, astonishingly, this is pretty much my only gripe.

For everything else, It’s really surprising how easy it is to accomplish some very difficult techniques. Node graphs are usually pretty scary, but Stephen has made this one pretty user friendly. The default document explains it all; create a noise generator, run it through a modifier node, and then dump it into an output node to save it to a file. From this basic idea, all awesome things are born.

Overall the learning curve for using World-Machine isn’t steep.

Concerning performance, I’m satisfied. Not blown away- but well satisfied. I know that generating heightfields is a tough process, and eroding them so gently is nothing short of a miracle. However, keep in mind that it’s a lot like rendering; it’s going to take 2 minutes for a medium heightfield and 10 minutes for a big one. The greater the complexity, the longer it takes.

Whining aside, at the end of the day what matters is preview performance, and World-Machine delivers on that front.

At about $60 USD this program’s well priced. It does one thing and does it very well making it (in my opinion) a bargain. There’s also a pro version that has multi-threading capabilities and a few other features that cater to high-end needs. I purchased the standard version since I don’t need to be on the bleeding edge and I still get to render 8192×8192 with the standard version.

I encourage you to check out the website and download the demo version. I verify that the install is clean, and easy to remove. The only limitation is that you cannot create terrains over 512×512 in size. While you could side-step this limitation by just creating tiled terrains and stitching them together in another program, it’s actually more of a pain in the ass than you’d think.

Go download the trial and test it out. You won’t be disappointed.

The World Machine Node Graph

Simply Amazing

ConceptArt.org: For All Your Inspirational Needs

Written December 10th, 2008
Categories: Blog
No Comments »

A friend at work turned me over to this website recently, and I was pretty blown away. It’s got a deep collection of concept art that is sure to give you that little boost of inspiration whenever you need it. Of course, don’t copy any one concept precisely or you risk copyright issues. But it’s always nice to find that “perfect robot arm example” to work off of. Don’t forget to check out their forums section, which has over a million posts. From my exploration, I gather that this is a vibrant 2d drawing and digital painting community.

Have a look when you get a chance!
Click Here to Check It Out…

Modeling Core – Part 1

Written December 7th, 2008
Categories: Modeling, Videos
1 Comment »

This week’s Monday Movie is part 1 of 4. I’m hoping to make one movie each week discussing what I think are the core modeling methods: primitives modeling, Boolean modeling, Spline modeling, and Poly Modeling.

Here I give a quick demonstration on what primitives modeling is, and what kind of thoughts go into modeling in this way. It’s a fluid process based mostly on replicating primitives already in the scene by using Shift + Click or Shift + Drag. By piling up lots of objects, and making heavy use of repetition, you can create intriguing models using only basic shapes.

Introduction to Depth of Field

Written December 6th, 2008
Categories: Articles, Effects, Rendering / Compositing
2 comments

Hello everyone!

Today is a Friday. And on Friday I usually think about what I’m going to do for the Monday Movie that I promise to deliver in a few days. This week, however, I realized that Depth of Field is a topic that a) wouldn’t compress very well in YouTube, and b) deserves more than 10 minutes. Depth of field is one of the many things you can use in your renders to add realism, meaning, and style. Like a lot of other features of 3ds Max, depth of field (DOF) requires tact and care to make a convincing and elegant result.

New: Take a look at my Depth of Field Monday Movie!

The final render.

The final render of the scene.

If you’ve ever done a lot of cooking you can relate to this. Everything tastes great with butter, salt, and pepper. I could serve you a fried brick and it would taste awesome! What separates the good chefs from the great ones is knowing when and how much fat to use to keep everything in balance.

Let’s start with this image below.

No DOF

Beginning image with no depth of field.

Depth of Field Scene Download

You’ll notice that I didn’t use any depth of field at all. However, there are already a lot of visual clues that tip you off that these teapots aren’t huge. The scale of the materials (such as the wood on the floor) are reasonable for ordinary sized objects. The baseboards along the bottom of the wall in the background gives you another clue since those are rarely taller than a few inches. I’m not relying on depth of field to be my scale queue, but instead to be a part of the greater image.

Mental Ray

Let’s add depth of field to this scene. The first thing to consider is what should be in focus. In most cases, it’ll depend on what’s most important. Below you’ll see two examples of renders with different focal points. In the left image, we’re focusing on the boy teapot and the heart, while in the right image we’re focusing on the girl teapot and what she sees.

Image with far focus.

Focus is on the distant teapot.

Image with near focus.

Focus is on the nearest teapot.


I accomplished this effect quite easily. Instead of rendering with the perspective viewport, I hit Ctrl + C which is the default hotkey to create a camera in the active viewport. The camera thus created has a group called “Multi-Pass Effect” in the modify panel. When enabled, and set to “Depth of Field (mental ray)”, this setting will give you the depth-of-field effect. The way I shifted the focus of the shot was by changing the target range of the camera. This spinner is found just below the “Multi-Pass Effect” group. Try twiddling this spinner a bit, and you’ll see the camera’s “target” moving, indicating the distance at which objects will be in focus.

Now you’ll notice that the effect is pretty strong in both images. This is because the f-stop is set to only 2.0 by default in 3d Studio Max. If you’ve taken photography classes or done photography tutorials, you can skip this paragraph. A camera’s f-stop is a measure of how large the camera’s aperture is, where smaller numbers mean a larger aperture. The aperture of a camera is how big the ‘eye’ of the camera is and it determines how much light to let in. Without going into the details, know that a smaller aperture (larger f-stop value) means more of the image will be in focus.

As a visual demonstration, the three images below show differing f-stop values for the camera in this scene. To be explicit, each teapot is about 6″ in diameter.

A low f-stop.

A moderate f-stop.

A high f-stop.

These show varying degrees of blurring. The first image is so blurry we can’t see much of anything. The second image gives us an idea, but it’s still too muddy to make out what the scene is about. The final image makes gentle use of depth of field to convey scale and still make the scene’s objects clear.

Below is a larger render of that third image. The effect is still a little too high for my taste, but I think you get the idea about using Depth of Field in 3ds Max with subtlety.

The final render.

The final render of the scene.

Scanline

Scanline Settings

Scanline Depth of Field Settings

Now that you know how to create depth of field in mental ray, learning it in the scanline renderer is a breeze. Unfortunately, all of my materials were mental ray materials and my light was a mental ray light so I won’t be including quite as many pictures in this last section.

There are several ways of setting up depth of field in the scanline renderer in 3d Studio Max. On the one hand, you could use a similar method as we used in the mental ray renderer version. You’ll create a camera using the Ctrl + C method or by creating one manually, and under the “Multi-Pass Effect” group you’ll enable the “Depth of Field” effect. When you render, however, you’ll notice that it uses a very primitive method for creating depth of field, and this is generally not recommended.

In scanline your best bet is to use the render effect found in the environment and effects panel (hotkey ’8′ and shown on the right with final values). Open this panel and click on the “Effects” tab. Under the “Effects” rollout, you can click “Add…” and select “Depth of Field” from the menu. You will now have to select your camera using the “Pick Cam.” button, as well as select the object you want to be in focus with the “Pick Node” button.

If you render, you will now see that you have the depth of field effect, but it probably won’t be properly adjusted. You can alter the severity of the blurring effect by altering the focal parameters at the bottom of the Effects window. I’ve found that using the “Use Camera” mode and keeping horizontal and vertical losses equal works best (as shown).

In the end, the scanline renderer is actually more complicated to use than the mental ray depth of field settings. I hope this primer has been of use to you, and helped to demystify depth of field in 3d Studio Max. Just remember; subtlety, rather than know how, is the key to using this tool to great effect!

Until next time, happy rendering.

Scripted Clay Renders

I was thinking hard about the 3d Studio Max clay rendering tutorial I wrote a few days ago, and was pondering about what an extension might be. Then it struck me! “Gosh, wouldn’t it be cool to have a button in the 3dsMax interface that you could click, and have it automatically turn out a clean render while you go make a sandwich?”

The answer is “of course”!

The Final Step

Adding the button to your tool bar.

So let’s have a look at that. What kind of 3d Studio knowledge would we need to take that on? Well, first we need our trusty Maxscript help file (Help > Maxscript help…) and a then a healthy dose of patience. Note: While I was writing and coding for this tutorial, I hit a few snags myself, so don’t think that it’s always a piece of cake. I’ll clue you in to some of my difficulties along the way so that you can learn from my mistakes!

Step 1: Copy the basic macroscript code.

Now this is a good step 1 for any project you take on in Maxscript. For this case, you can either copy my code below or you can go into the document and search for it yourself. I’d recommend finding it yourself (or better yet, typing it in manually) because it’s a better learning experience. However, I won’t hold it against you if you want to copy it- just this once.

macroScript Clay_Renderer
category:"Custom"
tooltip:"Take a clay render"
buttontext:"Clay Render"
(
)

Let’s run through the lines of code so we get a good grip on what it means. The first line declares everything inside as a macroscript, and gives it an internal name. The category string lets 3d Studio Max easily group it with other user interface items so you can put it in the toolbar or in a modular toolbar later. The tooltip is what appears when you hover over the macroscript button when it’s in the user interface, and the button text is what the button says on it.

Step 2: Think.

Inside this codeblock, we need to put what will happen when a user clicks on it. What’re some things we want it to do? Well, hopefully you’ve read my last tutorial, so you have a good grip on the ins and outs of clay rendering. We know we want to a) apply a white material to everything in the scene, b) have the scanline renderer in charge, and c) use a skylight.

I’d like to take a theoretical aside here and talk about a major hang-up on this particular script. You’ll notice that we’re messing with the materials in the scene and the lights. These changes need to be undoable or they’ll ruin everything. Can you imagine if you took a clay render and it took all your materials off your objects? Or if your lights disappeared? I’ll be including bits of code from here on out that help make this script more applicable and safer for scenes with materials and lights already in them!

Step 3: Lay down the foundations.

macroScript Clay_Renderer
category:"Custom"
tooltip:"Take a clay render"
buttontext:"Clay Render"
(
	undo on
	(
	  -- Create a white material and assign it to everything.

	  -- Delete all the lights and create a skylight instead.

	  -- Store the current render settings, and set to scanline.

	  -- Render

	  -- Revert to the old renderer
	)
	-- Undo everything we did, leaving only the render.
)

So I’ve only made a single structural change here, which is adding the “undo on” wrapping. This makes it so that the entire macroscript takes up only a single block in 3d Studio Max’s undo history. This way any changes made within this codeblock can be undone with a single command. Neat huh?

The remaining stuff is all comments. I usually start my scripts off by hammering out comments that say what needs to get done. I recommend that you consider doing the same; it helps you stay organized and think things through. In this case, you see we need to create a white material and apply it to all the objects in the scene. Then we need to delete all the lights, which is easier than turning them off and back on again. We also have to create the shadowing skylight so that we get the smooth shading effect. After that, we can store the current render settings, and switch over to scanline. Finally, we render and then revert back to the old Renderer.

Step 4: Fill code.

macroScript Clay_Renderer
category:"Custom"
tooltip:"Take a clay render"
buttontext:"Clay Render"
(
	undo on
	(
		-- Create a white material and assign it to everything.
		WhiteMat = standard diffuse:(color 220 220 220) twosided:true
		for obj in objects do obj.material = WhiteMat

		-- Delete all the lights and create a skylight instead.
		for lux in lights do delete lux
		ThisSkylight = skylight castShadows:true rays_per_sample:12

		-- Store the current render settings, and set to scanline.

		-- Render

		-- Revert to the old renderer
	)
	-- Undo everything we did, leaving only the render.
)

So we’ve added the information regarding the material. In this case we’re creating a material called “WhiteMat” which is a standard material with a diffuse color of 220 grey and it’s two-sided. Why? Because if you think about it, a clay render doesn’t show off all the geometry if it can’t render backfacing polygons. Worse yet, even though backfacing polygons wouldn’t show up in the render, they’ll still affect the lighting solution which would create some unpleasant artifacts. It’s best to just set this parameter to true.

Next I’ve added in the code for deleting the lights and creating the skylight. What we’re basically saying in the first line is “For each light ‘lux’, delete it”. This can always be undone at the end of the script. In the next line, we create a new skylight called “ThisSkylight”, which is casting shadows at a rate of 12 rays per sample.

macroScript Clay_Renderer
category:"Custom"
tooltip:"Take a clay render"
buttontext:"Clay Render"
(
	undo on
	(
		-- Create a white material and assign it to everything.
		WhiteMat = standard diffuse:(color 220 220 220) twosided:true
		for obj in objects do obj.material = WhiteMat

		-- Delete all the lights and create a skylight instead.
		for lux in lights do delete lux
		ThisSkylight = skylight castShadows:true rays_per_sample:12

		-- Store the current render settings, and set to scanline.
		ExistingRenderSettings = renderers.production
		renderers.production = default_scanline_renderer()

		-- Render
		render()

		-- Revert to the old renderer
		renderers.production = ExistingRenderSettings
	)
	-- Undo everything we did, leaving only the render.
	max undo
)

Here we see the storage and changing of the renderer. We take this extra step because if you’re working on a scene in mental ray, but want a clay render, you shouldn’t have to go through the trouble of a) writing a totally different clay render script or b) storing your settings manually. We store the production renderer to a variable, and then set it to a fresh instance of the default scanline renderer. A fresh instance has all the default values, so we know there won’t be any kind of crazy settings getting in the way of the clay render.

Finally, we can take the render. Once that is complete, the script resets the production renderer back to what it should be, and undoes any weird changes (like deleted lights) that the script executed. We’re back to where we started except now we have an awesome clay render in the render window!

The best part of this is that now we have a button that we can place anywhere in the 3dsMax user interface that will create a clay render on command!

Hit the hotkey Ctrl+E to run the script so that it will appear as a macroscript. You can save the file to your <3dsMax Root>/UI/Macroscripts directory, and it’ll be loaded automatically every time you start 3d Studio Max. To add your new “Clay Render” button to the main toolbar, just click on the menu “Customize > Customize User Interface”. Go to the “Toolbars” tab, and from the category pulldown select “Custom”, and you’ll see your clay render button. Just drag and drop it from the “Action” window to the main toolbar, and the button will appear.

The Final Step

Adding the button to your tool bar.

And there you have it! Now you can get a clean clay render no matter what your material, lighting, or rendering setup is!

Until next time, happy rendering!

Easy Clay Rendering

Written December 4th, 2008
Categories: Articles, Effects, Rendering / Compositing
1 Comment »

I realize that there are about a million clay render tutorials out there, and thousands for 3d Studio Max. Unfortunately, many people are still hung up on how to do them as evidenced by the questions we get in the 3dTotal forums. To resolve this, I’ve decided to write my own that I can reference whenever the question comes up.

The final render.

Our final clay render.

In the same spirit as my toaster tutorial (which will eventually get copied to this blog), I’d like to clearly outline every step in the process so as to leave no questions.

To begin, you see your typical 3dsMax ui. You’ve probably created an object that’s super cool, and you want to show it on a website or in class for critique. But how to make it smooth and crisp so that your modeling can be critiqued? Let’s go through the 3 easy steps to creating a clay render.

Step 1: Assign all the objects a single, white material.

Our starting model.

A basic starting model.

So the first step in this process is the hardest. We need to assign an all white material to the objects in the scene.

We’ll start by using the select all command (Hotkey Ctrl + A), so that we have all our objects highlighted. This way instead of applying materials one-by-one, we can do it all at once.

Next, we’ll need to open the material browser (Hotkey ‘M’).

The material editor.

Get a grey material.

After that, we’ll need to apply the material to everything in the scene. “But wait, why would we do that before we change the color?” Because this is a great opportunity to illustrate material instantiation! When you apply the material to the object, you can keep working on it in the material browser and the changes will replicate to the copies of the material that have been applied to the objects. Nifty, huh?

Our change will be to alter the color of the “Diffuse” swatch. You’ll want to click on the color block next to the word “Diffuse”, as shown highlighted in red in the image above.

After that, you’ll see the color-picker dialog like below. For my example, I’ve chosen a light grey; about 220.

Select a color.

Step 2: Create a skylight to remove the default lighting.

Super! All the objects are now a single color; white-gray. This is half of the process to a clay render. If you render now, you’ll see that the colors look a little less sickening, but it’s still not crisp. Remember, your render hotkey is Shift+Q!

At this point, go back to your create panel on the right-hand side, and click on lights.

From there, select “Standard” from the pulldown. In 3d studio max 2009, this is defaulted to “Photometric”, and the “Skylight” we want isn’t in that group.

Allow me for a moment to talk about the skylight. If you are in a hurry, go on to the next paragraph. Skylights are lights that are like inverse-omni-directional lights. They don’t emmit light from a single point, but instead cast light from all over. Any part of your scene that has exposure to the “background” will get some exposure to light cast from the skylight. You can experiment with this later by creating a skylight and trying to illuminate an object that is under another object, or entirely enclosed in one.

When you create your skylight, it doesn’t matter where you put it. It’s more of a concept than a literal object, so the skylight object is kind of just a manifestation of the idea.

The Skylight Object

Create a skylight object.

Step 3: Force the skylight to cast shadows and render.

You’re so close to the clay render you want, you wouldn’t believe it if I told you!

Now all you have to do is click on “Cast Shadows” under the render group in the skylight in order to have it make those luscious soft shadows underneath objects.

Note: If it looks like the “Cast Shadows” group is greyed out, it’s because you’re using the mental ray renderer, or some other 3rd party renderer. You can fix this by hitting F10, going to the bottom of the “Common” tab, and setting your renderer back to the default “Scanline”.

Notice where it says “Samples”? This determines how soft or grainy the shadows are under your objects. The higher this number, the softer and more smooth the shadows will be, and the longer it takes to render. On the flip-side, if you turn this number down to 8 or 5, the render process will go faster but the shadows will be grainy and rough. Feel free to experiment with this and get a feel for the difference.

Apply Shadows

Click "Cast Shadows".

Finally, go ahead and render your image (Hotkey Shift + Q)

The final render.

Our final clay render.

And you’ve done it! You’ve created an easy clay render! It’s really a pretty breezy operation once you’ve done it a few times. In the future, I plan to make some tutorials about making clay renders with mental ray, the sunlight object, and with ambient occlusion (though probably not all at once).

Until next time, happy rendering!

Introductory mental ray Lighting

Written December 4th, 2008
Categories: Articles, Lighting, Modeling, Rendering / Compositing
8 comments

For this tutorial, we’re going to explore mental ray by making a simple room and lighting setup. I’ll be using 3dsMax 9 but you can follow along with any version. I’m also including my finished file so you can pick it apart if it suits you.

Final Render

Our final render, after some materials and direct light.

Mental Ray Room

Now I’m assuming a low, but non-zero level of previous knowledge during this tutorial. Specifically, that you’ve been using scanline for a few days or weeks and would like to extend your knowledge to include mental ray. While I’ll include images and try to go step-by-step, Remember that mental ray isn’t for those just starting the program for the first time.

Step 1: Build a box and flip its normals.

I’ll start off by making a box that’s 200x100x70 that’s the basis of my room.

Convert it to an editable poly object by right clicking and selecting editable poly.

Select all the polygons and in the Edit Polygons rollout, select “Flip”.

Box with Flipped Normals

Create a box with flipped normals.

Step 2: Make some windows and details.

Feel free to deviate slightly from the tutorial at this point if you’re feeling confident. I’m going to create a single window at one end of the long-ish room. However, you could do some pretty ambitious stuff with the roof, creating a long skylight and then putting up rafters and plants. Oh my! But for me, and for the sake of some beginners out there, I’m going to keep it easy and direct for now.

Select the polygon at the end of the hall and inset it, then extrude it with a negative value. If you want to resize the window you can. I’ve selected the bottom polygon of the window sill and moved it up a bit.

Delete this polygon. This will form our window!

A box with a window cut out

Cut out a window for the room.

Select the floor polygon. Inset it a little bit, and then extrude it down to form a baseboard. This is a minor stylistic thing that always adds a little realism to the room! I’ve also taken the artistic liberty of raising the base of the window a little higher.

Create a floor boarder

Create a border for the floor.

Now we have the makings of a basic room. Go ahead and save your work. Always a good practice.

Step 3: Switch to mental ray and create some lights.

We need to enable the mental ray renderer, since the scanline is being used by default. Hit F10 for your render settings panel and under the “Common” tab in the “Assign Renderer” rollout, hit the “…” next to production and select t the mental ray renderer. For a shortcut, in the little pink box in the lower left corner you can type

    renderers.production = mental_ray_renderer()

Super! Let’s get some lights in here. Under your create panel, go to the lights group, and select an “mr area omni”. Place it at the base of your window sill in the perspective viewport. Move it up so that it’s just outside your window.

Now for some lights.

Now for some lights!

Step 4: Scene adjustment.

Take a render (Shift-Q). Hmm…not quite what we want yet, is it? That’s ok, I know just the trick!

The first render

Not quite what we expected.

For starters, we need the polygons of the room to be double sided so that light doesn’t leak in from the walls. Hit your hotkey “M” and open the material browser. Drag and drop any grey material from the browser onto your room object and the material will be applied. Select the “2-sided” checkbox in the material you just dragged over.

Use a 2 sided material

Create and use a 2 sided material.

If you render again, you’ll realize that now we can’t see inside the room! That’s because the walls are now impenetrable. We need a camera on the inside of the room. Under your create tab, go to the cameras group and create a target camera inside the room by clicking and dragging.

You can switch to this camera by pressing the “C” key. Reposition the camera if you feel the need to. It was likely created at ground level, and that’s not quite right.

Now if you render you get a much better perspective on things. If you’re having trouble, it could be because the camera is not entirely inside the room, or it’s not pointed in the right direction.

Next, go ahead and hit your “8” key or go to the tool bar “Rendering”>”Environment” and click the black swatch under background color. Pick a very light blue color. That will make it look a little more like the light coming in the room is real.

Pick a Color

Pick an outdoors-y color.

Step 5: Use Final Gather.

Re-render the image, and you’ll see that it’s looking even better now!

Our second render

Our second render's looking good.

But something is still off with the light. I bet if we enable final gather it’ll look twice as good! Final gather is a light bouncing solution in mental ray similar to 3d Studio Max’s native radiosity. If we turn it on, the light will cast around the room in a much more realistic way. If you’re using 3dsMax 2009, final gather is probably on by default so you can effectively skip this step.

In your render settings window (F10) you’ll see an “Indirect Illumination” tab. Click on the checkbox that says “final gather”, select “Draft” from the quality preset pulldown, and change your bounces from 0 to 1.

Re-render your image. Now we’re cooking!

The render with Final Gather

Final Gather makes all the difference.

Step 6: Make the spherical light project properly.

What do you say we make that light source look like it’s really from outside? Select the mental ray light, and under the modify panel, click on the “area light parameters” rollout. We want to change the height and width of the area light to fit the window better. The window is the lightsource. Increase the radius of the light such that it can reach the left and right sides of the window, even if it starts protruding into the room. Use the scale tool to scale it such that it becomes a big flat disk right outside the window. You’ll have to twiddle the radius spinner to see the size of the disk, so don’t hesitate to do a guess-and-check kind of approach. Don’t worry too much, this isn’t that critical.

Proper Spherical Light Use

The spherical light is softer.

Re-render, and you’ll see the lighting solution really coming to life. It’s a little graining and dark, so we’ll have to increase the intensity of the light. In addition, change the samples on the light from 5 and 5 to 8 and 8. This will increase the sampling of the shadows and remove some of that grainy texture. Note that this change will increase render times, so if it becomes difficult for your system to handle, leave it low until you’re ready for a final render!

Render with more light.

We're getting more light now.

Cool beans! Now I’m going to let you try out whatever you want on this scene. Put some materials around the room and see how they render. Maybe make more windows or direct lights and let the light sources interact and brilliantly light up the place. It’s your call! I encourage you not to skip this step. Playing around is what really teaches you how to use this program, tutorials like this are supposed to get you to that stage.

Final Render

Our final render, after some materials and direct light.

I’ve done a few things to my scene, and you can check them out at your leisure. The biggest changes are the extra light sources, a few lighting tweaks like intensity, and the materials.

If you have any questions, you can always find me on the 3dTotal Forums and PM me (Bluesummers-3dt).

Until next time, happy rendering!

Designed by Alejo "Mr. Bluesummers" Grigera"
©2012 MrBluesummers.com