Photobucket

related link

Thursday, February 7, 2008

BACK ONLINE

Ted Boardman tedb@tbmax.com http://www.tbmax.com

Perhaps some of you have wondered where I've been over the last few months (and some haven't I'm sure, but that's fine, too) and why I haven't been writing the column. While there are always ample excuses that I could be using, it's been primarily because of a very heavy travel schedule through the end of December and my 3ds max 7 Fundamentals book.

Any time I've had available for writing so far in 2005 had to be dedicated to getting the book finished. I'm pleased to them announced that I'm pretty much on schedule and only have a couple proofreading chores before it's ready to head off to the printers. I'm not entirely sure how long that process will take, but the book should be on the shelves in the US during the last two weeks in March.


The book, as indicated by its title, focuses on fundamental topics that will help new users of 3ds max 7 accomplish 75% of their work quickly and efficiently while leaving an editing trail that allows easy changes to be made in both modeling and materials.

There are 20 chapters with all new exercises in which the reader builds a small airstrip. The exercises range from exterior scenes with outbuildings, including a control tower, roadways, and, of course, an airplane, to interior scenes with photometric lighting and a couple of chapters on particle systems and special effects. Some new features of 3ds max 7, such as vertex paint as a modeling tool, Projection mapping, and Normal mapping with Render to Texture are introduced, as well.

One thing I'd like to mention that is off-topic, but may be of some interest to those of you who do any writing is that I'm now using Dragon Naturally Speaking www.ScanSoft.com

software to dictate much of what I had previously typed. While I'm a reasonably fast and accurate typist, I find that after two or three days of intense time on the keyboard, I'm just plain worn out. With the Dragon software, I can sit back in a much more relaxed position and just chatter away, something I'm reasonably good at, too. The software has performed very well, learning my manner of speaking and my New England accent quite quickly and handling the 3ds max 7 terminologies rather well. I can even do simple things in 3ds max 7 by voice commands, although I wouldn't want to have to make a living with those new skills.
A Production Checklist

There are a few default settings in both max and VIZ to do not always lend themselves to high productivity and are settings that in "the heat of battle" we don't often get around to changing, even though they could be slowing us down significantly.

I'll post a little bit of a checklist that everyone should go through in the early stages of each project. It would also be wise to apply these changes to current projects, or even recently completed projects, so that you have a good “before and after” comparison to judge their effectiveness.

Shadow optimization

Max quadtree depth.

I would have to say that if there is any single "trick" that I can introduce users to that will increase production the most it's the Raytraced shadow Max Quadtree Depth setting. A quadtree is the subdivision setting of a scene from a light's viewpoint used to test at the intersection of a light's rays with the scene's objects. If there are too many objects in the current quad it is subdivided until there are only a few objects per quad or until a maximum mathematical depth has been reached. The fewer objects per quad, the faster the shadow calculations are, at the expense of memory.

If you select a light in your scene with Raytraced shadows, and go to the Modify panel, Ray Traced Shadow Params rollout, you will see the Max Quadtree Depth setting is set to 7 by default, and this is seldom an ideal value for this setting. See Figure 1. The maximum setting amount is 10 and some users will say that you should use only 10. However, I recommend that you try both 8 and 9 to find the optimum value for your particular scene. Max Quadtree Depth must be sent individually for each light in your scene with Ray traced shadows, but is always worth the small amount of time it takes to test and change the values.



Figure 1: Setting the Max Quadtree Depth for Ray traced shadows greater than 7 can significantly decrease render time.

Attenuation

Lights in max and VIZ will shine to infinity by default and will try to calculate shadows for all objects within the beam of light. Lights that shine forever are not convincing, for one thing, but perhaps more importantly, they can waste computer resources. Lights in the real world attenuate, or decay, based on the Inverse Square law of physics; the strength of the light diminishes by 1/ distance squared from the light source.

In the Modify panel, Intensity/Color/Attenuation rollout, you can set the Decay to Inverse or Inverse Square and then adjust the Start range, a distance from the light source where the attenuation begins. This, of course, is not realistic, because in nature the decay always starts from the light source, not an arbitrary distance from it. As an alternative, I recommend using Far Attenuation where you set a Start range and an End range. The light has full intensity from the source to the Start range, attenuates in linear fashion from the Start range (tan lens) to the End range (brown lens), and has no affect beyond the End range. Figure 2.



Figure 2: Far Attenuation should be used for most lights in your scene.


This attenuation makes lighting look more convincing, but the big advantage lies in the fact that no shadows are calculated beyond the End range, resulting in potential productivity increases.

Raytrace Reflections Optimizations

Raytrace Reflection Attenuation

Raytrace reflections are another mathematical drain on computer resource that can often be optimized and, in some cases, enhance the quality of the reflections at the same time. In the real world reflections are simply light bouncing off surfaces and, as such, they must obey the same laws of physics that affects the behavior of any light. Raytrace reflections in 3ds max 7 also have attenuation setting similar to those in the lights.

The method I use for controlling Raytrace reflections is to leave the Raytrace map amount set to 100, then go to the Raytrace map level in the Material Editor and open the Attenuation rollout. There you will see a Falloff Type drop-down list, with options for Linear, Inverse Square, Exponential, and Custom attenuation types. While for Inverse Square option fits the real world physics model the best it is also mathematically intensive and won't decrease render time much, if any. I recommend using the Exponential type and setting the Ranges to get the look you want in your reflections. The Start range is where the reflection starts to attenuate from the reflecting surfaces in system units, usually inches in the US. Beyond the End range setting there is no reflection, thus saving computer resources and speeding rendering in many cases. The Exponent setting controls how quickly the reflection cut off occurs between the range settings. Figure 3.



Figure 3: Raytrace reflections can also have attenuation and the Exponential type is usually the most efficient.


Pixels beyond the End range will be replaced with the Background color or image by default, but you can also choose the Specify radio button and select a color that you want. For example, I often choose blue for metal materials to cause the reflections to fade out to a cool tone to make the metals seem harder. Finally, when the attenuation appears the way I want it in my rendered image, I go back and adjust the Reflection Amount to tone the reflections down where they are too bright, for example, where a wall meets a floor.

Global Maximum Depth Setting

There is also a global Raytrace reflection optimization in scenes that have a significant number of Raytrace reflection materials. If you go to the Rendering poll-down menu and choose Raytracer Settings to access the Raytracer tab of the Render Scene dialog, you will see a setting called Ray Depth Control, Maximum Depth. This sets the number of reflections within reflections in the default setting of 9 is usually much too high for most scenes. I recommend you set the Maximum Depth to 3. Figure 4.


Figure 4: A Maximum Depth setting of 3 is sufficient for most scenes


A specific case where the setting may need to be higher would be something like an elevator car with mirrored walls where you can see the reflections of the opposite walls reflections for many iterations, however, this is the exception rather than the rule. Again, if you set the Maximum Depth to 3 pixels beyond the third reflection will be replaced by the Background color, but you may also specify a color of your choosing.

Maxscript Optimizations

Garbage Collection.
Scenes will often take weeks to fully develop and are open and closed by several people may make many edits along the way. All this activity has a tendency to leave remnants of commands and objects in the file, which can slow production.

Entering gc() in the Maxscript listener window at the bottom left of the display, and pressing Enter can often purge the current file from much of this unnecessary data. Figure 5.


Figure 5: Garbage collection with Maxscript can reduce file sizes and make scenes more efficient.


Summary

By going through this short checklist of optimizations for each of your scenes you can often realize significant gains in performance and productivity. The attenuation settings for both lights and reflections also have the side benefit of potentially making your scenes more convincing.

With any luck I should be back on my regular schedule of writing, addressing issues that I find to be common denominators that hinder production in any 3ds max or Autodesk VIZ houses, regardless of the discipline; architectural, games, product design, or TV studios.

Good luck and have fun.

Ted





No comments: