2009-10-07

Never under estimate the powers of SketchUp!

This isn't a tip or trick, but I had to post on this one. I know that I always talk about modeling in SketchUp and rendering in Max. Well Jacques from Cape Town, South Africa has proved that SketchUp can compete as a high-end 3D modeling contender. His stunning care for detail has been shown in his latest model of the HMCS Snowberry. The slideshow is also a good documentation of just how he managed to model organics in an XYZ world.




The images were modeled in SketchUp and rendered with Vray.

He has also been gracious enough to provide his models here for SU enthusiasts.

2009-10-02

Attaching & Detaching Meshes

I just wanted to point out some very useful buttons. These may be two of the most useful tools in the mesh modifier rollouts. The attach button is used for attaching several meshes into one mesh. The detach button is used for detaching a selected portion of a mesh into a new mesh. I’ve found these useful for managing large scenes so I don’t have to group objects. You will notice that you see Attach and Attach List, but if you click Polygon or Element, Attach List will switch to Detach.



In this first example you will see that there is just one object in the scene. I chose select by Element, which will select all connected faces. So when I select a face on the tire, the whole tire is selected.






When you click on Detach it will give you several options. If Detach to Element is checked then the faces will stay in the same mesh. If Detach to Element is unchecked then you can name the mesh that it will convert it to.




When you click ok, now you will see two meshes in your scene. The original mesh (AudiTT) and the new mesh (tire01). The new meshes that are created from an existing mesh will always share the same material.



In this next example you can see that there are 9 different meshes for this model. To attach them together you must have one of them selected. I chose the mesh BMW5_FLWHEEL. Now you can either click on Attach or Attach List. When Attach is selected, anytime you click on another mesh it will attach it to your current mesh.



When you click on Attach List, it will pull up the scene selector, and allow you to select other meshes by list. This is useful if you have too many objects to select in the 3D viewport.




If the new mesh you are attaching to the old mesh has a different material, this dialogue pops up. It is giving you several options for what to do with merging meshes with different materials. I usually just leave it as is, and hit ok. These settings will create a new Multi/Sub Object Material (MSOM) with instances of the existing materials. When the meshes are attached their faces will have corresponding IDs to their material ID.



Now you will see that there is just one mesh in the scene, and that the only root material is an MSOM for the car. You will also notice that the name of the mesh is based on the first mesh you select to attach other meshes to.

2009-08-17

3ds Max 2010 can now import SketchUp!

Yes folks. If you have a subscription to max, the new update has a feature called the Connection Extension for Max 2010. Along with other interop features, Max can now import *.skp files.


I was fortunate enough to be able to put my two cents into this particular feature of Max, and have to say that it is a very powerful feature for SketchUp/Max users. It is also very strategic for Autodesk because now if you have Max 2010, you don't even need to purchase SketchUp Pro to export the 3D model to a universal file format. Max can import the plain .skp file.

To see a video walkthrough of the importer check out this video

2009-07-10

Alt+W woes


If you use the Alt+W (Maximize Viewport toggle) as much as I do, you'll know that it's the greatest keyboard shortcut for Max. You'll also find that it's very frustrating when you have an Editable Mesh selected. This scenario happens often because I like to select my mesh in one view, then toggle viewports and hit Z so I don't have to "find" the mesh again in the new view. This was bugging me for a long time, and took me a while to figure out what the deal was. Alt+W always works unless you have an Editable Mesh selected and you have the Modify tab selected (which is the tab that I have selected most of the time when working in max). If you have any other tab selected (Create, Hierarchy, Motion, Display, Utilities) it works fine. So if you are wanting to quickly toggle your viewport with a Mesh selected, just remember to select a different tab before you Alt+W.




As someone pointed out, the Keyboard Override button will toggle between using the same shortcuts for Max global commands and using them for objects as Meshes, Track View, NURBS and some other shortcuts. Alt+W just happens to be a very important global shortcut that is also used for weld target mode for Edit/Editable Mesh.

2009-06-11

Multi/Sub-Object instancing trick

This really isn't a trick. It's just understanding how materials in max work, but it can sometimes still feel like a trick. This "trick" may resolve some of your Multi/Sub-Object (MSOM) woes. There is often the scenario that you import a .3ds file into max, and it contains several meshes each with a MSOM but with instanced sub-Standard materials. The next thing you want to do is to change them from Standard to A&D or V-ray materials, once without having to do any copy then paste (instance).






Having too many MSOM's in the Material Editor, especially with sub instanced materials can make max sluggish and perform slowly. I will show you an efficient way to do this that doesn't slow max down, and makes it a quick and easy job.

On the right is a similar scenario where I imported a .3ds file, to find that it created 3 meshes each with 3 MSOM's. I wanted to change all of the materials from Standard to A&D without going through the list of the MSOM's and seeing which one had (Standard) and which one had (Arch & Design(mi)) next to them.

Firstly in the material editor, click on the Get Material button on the left or go to Rendering->Material/Map Browser.









On the left in the Browse From section, if you click on Scene, it will potentially show you all of the materials and maps you have in your scene. So just because your material editor is empty, doesn't mean you don't have materials in your scene.

You will also notice that on the right side of the material, it will have a list of geometry that the material is actually applied to. If the material is a MSOM, I find it helpful to name material after the mesh its applied to...just to keep things straight in my head.

Now if you have Root Only checked, you will only see the MSOM and not the other materials inside the MSOM. If you un-check Root Only, then you will see all of the other materials show up. This is very handy, because you can go one more step and tweak the individual material.











So for example, the image on the left: I clicked on an empty slot (bottom-left) in the material editor, then went to the Material/Map Browser and I double clicked on FrontCol (Standard). This places it in the empty slot in the Material Editor. Because I have FrontCol in all 3 MSOM, and it's instanced it doesn't matter which MSOM I grabbed it from.

Now because it's standing by itself I can do whatever I want to it, and it will change it in all 3 MSOM's! So I clicked on Standard and changed it to A&D, and you'll notice that it changed the FrontCol in all 3 MSOM's to (Arch & Design (mi)) in the Material/Map Browser.

Voila, the easy way to change materials in MSOM's!

2009-04-26

Understanding Cameras for Renderings

Last week I gave a presentation on photography for architecture, and thought this information would also be useful for exposure settings in 3D for renderings. With mental ray, the values are almost identical to a real cameras settings. Understanding these settings can make it much easier to get the rendering quality that you want...and can also help you take better pictures with your camera!

I believe there are only 4 criteria to know when it comes to cameras / exposure settings:

•Shutter Speed (exposure)
•Aperture (f-stop)
•Film speed (ISO)
•Whitepoint (color temperature)

In 3dsMax they all do the same thing (except whitepoint), make your image brighter or darker. But they all react a little different to each other and have some interesting characteristics.


Shutter Speed

The shutter speed value determines how long the shutter is open in a camera. The longer it's open, the brighter the image. Acceptable values are 500, 250, 30. The important thing to remember is these numbers are fractions of a second. So when you see 500, it's really 1/500th's of a second. So the smaller the number, the longer the exposure only up until you get to full second values. So it's important to know your camera. If you see 30 it could be 1/30 of a second or it could be 30 seconds. Just play with the setting to see where you are. I've found that speeds slower than 1/30th of a second on my camera tend to cause blurring if I'm not using a tripod. The shutter speed is also what determines blurry people. If you want a crisp photo with blurry moving objects, use a tripod and leave your exposure open for 1 full second.
Common values: ISO (100), f-stop(4), whitepoint (6500K)

Aperture (f-stop)

The aperture is how wide the lens is open. This value is called f-stop, and the lower the value, the wider the aperture, the brighter the image. In reality the f-stop is a factor of the focal length. For example if you are using a zoom lens at 17mm, you could get your f-stop to be as low as 3.4...but with the same lens if you are zoomed in at 100mm, your f-stop value can only go so far to maybe 4.0. Depth-of-field (DOF) is also a factor of the f-stop number. Typically the lower the f-stop number, the more of a DOF effect you can get.

Because we deal with exposure in 3D there is no limitation to the f-stop value. In mental ray, f-stop doesn't affect DOF, whereas in v-ray, if you are using a v-ray camera, DOF is affected by f-stop.
Common values: shutter speed (1/32), ISO (100), whitepoint (6500K)


ISO / Film Speed

Traditionally before digital cameras, you had to choose what film to put in your camera and it had a fixed film speed (ISO) value. Higher values are more sensitive to light, but noisier; whereas lower speeds of film are less sensitive to light, but are sharper. Because a digital camera doesn't use film, this value is purely fictitious and simply imitates what ISO used to be. The advantage to a digital camera, and renderings is that on the fly we can change the ISO value without having to change film. The difference between your digital camera and rendering though is that when you increase your ISO values in 3D, the rendering does not become more noisy.
Common values: shutter speed (1/32), f-stop (16), whitepoint (6500K)


Whitepoint
/ Color Temperature

Whitepoint is a way to determine the color temperature of lighting in a room. Every light emits different color values measured in Kelvin. Just some examples:

Incandescent light bulb (2700–3300 K)
Candle flame (1850 K)
Studio lamps, photofloods, (3400 K)

So when a photo is taken at these different values, the images can turn out to be red or blue depending on the lights in the space. Whitepoint actually counter-acts the colors of the lights to even out the color in the image/rendering. So lower values of K will result in a bluer image while higher values result in more red images.
Common values: shutter speed (1/32), ISO (100), f-stop (6)

This should help you begin to understand the art of light, and help you to start seeing things in terms of these values. They each affect the other. So play with them and know how one will make the other value work. When you master this, it should definitely give you a leg up when you are working on lighting those renderings.

Happy testing!

2009-03-10

Parti Volume Shader

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.


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.






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.

Mode:
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.

Scatter:
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.

Extinction:
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.

Height:
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.

Lights:
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

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

This is achieved by creating a sphere that encompasses your entire scene, cameras and lights. Then apply an A&D material with Transparency=1.0 and an IOR=1.0 to the sphere. Then go to object properties, and uncheck Visible to Reflections/Refraction, Receive Shadows, and Cast Shadows. Also under the mentar ray tab, turn off Receive Illumination from Final Gather and check Exclude from Caustics and Exclude from GI.)

2009-02-26

What are good general render settings?

You have no idea how often I see this question in forums. The truth is there is no good general settings. But, I have listed here GI (global illumination) and FG (final gather) settings that I use often and work for almost any interior scene. I’m focusing on interior scenes because they are much more difficult to achieve than exterior. These settings give generally good results with fast render times, and I’m only mentioning the settings that I change from the default.

GI:
I set the Maximum Num. Photons per Sample to 100. This is so low because I also use a low number of photons per light. There is no need to shoot so many photons per sample when I am using such low photons per light. The important thing to consider when calculating GI is being able to light the scene evenly, and get a consistently lit space.

I also turn on Maximum Sampling Radius. I start with something small like 1’ and increase the amount by 5’ until I get a generally smooth result without seeing any discs in the rendering. Often I will go up to a value like 30’ before I get a smooth result. This is not a typical use for GI, and in a way it’s cheating your photons to get bright values with such low numbers so the render times are fast.

FG:
I slide the FG Precision Presets all the way to the left to Draft setting. I’ve found that I can get away with low FG settings if I add an occlusion pass later in post.

For Diffuse Bounces I set it to 2 typically, just to I can get enough bounce and increase my light values. Changing the bounce number significantly reduces rendering speed so be careful with this one.

I didn’t change this setting, but I’ll mention it. I sometimes change the Noise Filtering from Standard to None, if I can get away with it. When set to None, the render is much brighter because you are taking into consideration all of the FG points, but at times will have noise. When you set it to Standard the scene is much darker, but smoother generally. So if you can set it to None and still get smooth results, then you just got more light into your scene for free.

That’s it. Those are my “standard” settings. Of course I will use the Read/Write options for both GI and FG, and typically calculate them at half the resolution of my final render. These settings don’t work for every scene, but they were used for this rendering:



The lights I had for this scene were a sun/system, and 33 photometric lights at the default settings. The only thing for the photometric lights that I adjusted was the intensity. I change it by checking the % and increasing it, that way I can always go back to the standard 1500 cd. All of these lights were on when calculating GI and FG. Once my lighting is calculated, and I’m reasonably happy with it, then I get to my exposure settings.

2009-01-29

Glass Reflections - it's all about the bump

Today I'm discussing using bump maps for reflections in glass. I usually see glass reflections in 3D having perfect reflections. You never really see this in reality though. There is always some bend and distortion in the glass. There are others that do use a bump map to have the reflection act more realistic. Often though, a noise map is used in the bump slot, and I haven't seen this done properly.





In reality each pane of glass has air pressure on it, forcing it to bow in or out. The frames or mullions keep the edges in place though. There is nothing wrong with using a noise map for the bump, it's how it's distributed throughout the glass between the glass frames. Often I see the same noise map passing from one pane of glass to another. That is incorrect.

The trick to getting the same map on every face is using the UVW modifier on your glass and selecting Face for the Mapping type.

2009-01-19

Dynamic Animations in mental ray (without the flicker)!

Ok. This one was a long time coming. There are posts everywhere on how to do an "animation" of a camera going through a static scene. I've got one on this website. The truth is, this is just static animation. The big question is: how do you achieve this with moving objects in the scene? This technique can be done in V-ray using the VRaySphereFade, but mental-ray has a different way to do this trick. I'm going to go through the magic steps to create a dynamic animation without flicker, without super high FG and GI settings, and without the outrageous render times.



This animation (200 frames @640x480)took 27 min to render with the following technique, even with my poor animation skills

It's not uncommon to think that because you have objects moving in your scene, you have to calculate FG/GI for every frame. This is true and untrue. With this technique here, we will only have to calculate FG/GI for every frame only for those objects that are moving. This is done in two render passes.



I rendered my background scene (with my animated objects hidden), with the freeze GI/FG technique

Once you have the background animation rendered, go back to your scene and hide everything that was rendered in your background pass, and unhide your animated characters.

Then place a box to replace the scene. This box will project your background animation, and create a plate for the characters reflections and shadows to fall onto. Think of this box as an actors green screen room...it can be as detailed as you want it to be. If the characters are moving behind other foreground objects like a chair or shelf, these objects should be considered.

We will use the Matte/Shadow/Reflection material. Apply this material to your box. Under the Camera Mapped Background slot, click on the button next to the color swatch and choose Environment/Background Camera Map. Now under the Map slot, this is where we will place our already created background animation as our background plate. Choose Bitmap, then locate to the first image sequence. Be sure you have Sequence checked, then click Open. This will create an .ifl file for your sequence.





We will need an instance of the Environment/Background Camera Map so right click on the map and choose Copy. Now open the environment window by hitting 8. Click the Environment Map button and choose Environment/Background Switcher. To access the parameters drag an instance of this shader into an empty slot in the material editor.





On the Background button, right click and paste instance of the Environment/Background Camera Map. For the Environment/Reflections button apply the Environment Probe/Chrome Ball shader. Where it says Chrome/Mirror, you will need to place an image of a chrome ball of the scene...so of course I had to render a ball with a chrome shader in this scene. But this slot is where this image is placed, and is what determines the reflections in your character. I cranked up the multiplier to 5 to get a decent reflection.

Lastly we will create a Skylight in our scene. In the create tab, go to lights->Standard->Skylight. Place it anywhere. In the modifier settings choose Use Scene Environment.



Other things to note: The lights for your character should closely match the lights in your background. So for this particular scene I created a rectangular directional light to match the light from the windows, so when the teapot was in sunlight it cast shadows to match the background. You can change the exposure of your scene too to get the most accurate match. I would suggest to turn off GI, but keep FG on for your characters. In your Matte/Shadow/Reflection material, be sure that Receive Shadows, AO, and Receive Reflections are all checked to get the best results.



Whew! That's it. This should get you a basic set-up for your dynamic animation to render. Unfortunately refractions aren't supported, and doing scenes with glass can be tricky. But now you can render dynamic animations super fast.

Here's the scene file to make sense of what I'm talking about: dynamicAnimations.zip

Happy testing!