Semi-Transparent Layer Rendering in 3dsMax

Written March 3rd, 2011
Categories: Articles, Rendering / Compositing
3 comments

In this tutorial, I’ll be sharing a quick technique for removing the glows, halos, or other anti-aliasing artifacts from your matte/shadow renders or Render Elements renders.  The key here is getting the alpha map to apply to the object before the anti-aliasing effect blends the edges of your object with the background.  See the examples below.

Black halo around the object.

Notice the black halo around the green areas. This is where the transparency is failing.

These black halos are caused by anti-aliasing and attempting to render at transparent image out of 3dsMax.  When the image is smoothed during the render it blends colors together.  If our color map is anti-aliased separately from the alpha map, we get color bleeding.  In the image above, I’ve replaced the back background

Summary

I detail the following steps below, but for people looking for the quick answer, here it is.

  1. Under Customize > Preferences… > Rendering tab, select “Use Environment Alpha”.
  2. Render against a flat, black background – this isn’t optional.
  3. Save to 32-bit .tga with “Pre-Multiplied Alpha” turned off.
  4. Load the image in Photoshop and select the alpha channel via Select > “Load Selection…”
  5. Create a layer mask for the background layer.

Render with a Black Background & Transparency

Now I won’t tell you how to set a black background since it’s the default and, if you’ve changed the background from the default, you know how to change it back.

3dsMax-customize-preferences

Go to the Customize menu and select "Preferences…"

Engage "Use environment alpha"

Select the "Use environment alpha" option.

Save the Render to .tga with Pre-Multiplied Alpha Disengaged

Disengage Pre-Multiplied Alpha

Disengage the pre-multiplied alpha setting

Now you’re ready to open the file in Photoshop.  Just open your new .tga file, and re-apply the alpha map that has been saved separately embedded within the image file.

photoshop-select-load-selection

Once you've opened the new .tga file, go to Select and pick "Load Selection…"

Load the alpha channel.

Load the image's alpha channel. It should be the default.

Create new layer mask

With your alpha channel as your selection, create a layer mask.

And here’s our final result without any halos.  I’ve added an image of clouds to the areas where the background was black.  The areas in purple were a purple background that was anti-aliased into the image.

Our final render without halos.

Halos are gone- the object can be anti-aliased against any background.

That’s a wrap.  Enjoy!

Depth of Field Quality Adjustment in mental ray

Written December 6th, 2010
Categories: Articles, Rendering / Compositing
4 comments

In this quick article, we’ll be visually exploring how to adjust the quality of the depth of field effect in 3d Studio Max with mental ray.  The process is closely tied with how you increase the quality of your render (sampling).  All you have to do is increase your render sampling to smoothen the depth of field effect. Once you’ve had some practice, you’ll know just how to adjust your render to get great results every time.

Let’s begin with my warehouse sample scene.  There are several aspects of the scene that make it perfect for testing depth of field.

  1. There are numbers around the scene that represent a distance from the camera in feet.  ”2″ is 2 feet from the camera, “4″ is 4 feet from the camera, etc.
  2. There are lots of detail around like girders and windows that will accentuate any blurring effects.
  3. The floor and wall have a checker pattern that is 1-foot by 1-foot squares.  They also help us understand the blurring effect.
basic render of the warehouse

This is a basic render of the warehouse scene. Not great.

We can do better than this, but let’s set up our depth of field effect first.  Once we get an effect we like, we can improve the quality.

Select the camera, and engage the depth of field (mental ray) effect.

engage-depth-of-field-mental-ray-camera

Engage the effect.

When we take another render, we can see that some elements have gotten blurry.  With a target distance of 32 feet, we can see the number “32″ clearly, but the number “2″ is blurrier.

warehouse-render-dof

Warehouse render with default depth of field.

Notice that the image is still pretty grainy, and we’re even getting sampling artifacts on the tile flooring and garage doors.  Let’s improve our render sampling and get a comparison to see how we can improve the quality.  The most direct way to improve the quality is to increase our sampling from {1/4 and 4} to 1 and 16.  We’ll also want to use a better filter type.

increased-render-sampling

Increased render sampling and using a better filter.

Below you can see the new render plus a comparison of key areas before and after the Samples per Pixel change.

warehouse-fine-render

A finer render of the warehouse.

A clear improvement in details.

The depth of field effect improved, too.

Now there’s a catch to all of this.  The original render only took 2:41 while the finer render took 6:53.   Remember not to turn up your depth of field quality settings until you’re ready to take a final render!

Arch & Design Material: Tips and Tricks

Written October 5th, 2010
Categories: Articles, Rendering / Compositing, Textures / Materials
2 comments

This is a duplicate of the Arch & Design Overview document by Autodesk and not written by Mr. Bluesummers.

Final Gather Performance

The final gather algorithm in mental ray 3.5 is vastly improved from earlier versions, especially in its adaptiveness. This means you can often use much lower ray counts and much lower densities than in previous versions of mental ray.

In many cases, you can render still images with such extreme settings as 50 rays and a density of 0.1. If this causes “oversmoothing” artifacts, you can use the built-in ambient occlusion to solve those problems.

When using final gather together with GI (photons), make sure the photon solution is fairly smooth by first rendering with Final Gather disabled first. If the photon solution is noisy, increase the photon search radius until it “calms down,” and then enable Final Gather.

Quick Guide to Some Common Materials

Following are some quick rules of thumb for creating various materials. Each assumes the basic default settings as a starting point.

General Rules of Thumb for Glossy Wood, Flooring, and So On

These are the kind of “hybrid” materials you might require for architectural renderings; lacquered wood, linoleum, etc.

For these materials, set BRDF to Custom Reflectivity Function; that is, you’ll define a custom BRDF curve. Start out with 0 degree reflectivity of 0.2, 90 degree reflectivity of 1.0, and apply a suitable texture map to the Diffuse Color. Set Reflectivity between 0.6 and 1.0.

How glossy is the material? Are reflections clear or blurry? Are they strong or weak?

  • For clear, fairly strong reflections, keep Reflection Glossiness at 1.0.
  • For slightly blurry but strong reflections, set a lower Reflection Glossiness value. If performance becomes an issue try turning on Fast (interpolate).
  • For slightly blurry but also very weak reflections, you can “cheat” by applying a lower Reflection Glossiness value for broader highlights while setting Reflection Glossy Samples to 0. This shoots only one mirror ray for reflections, but if they are very weak, the viewer can often not really tell.
  • For moderately blurry surfaces, set an even lower Reflection Glossiness value and maybe increase the Reflection Glossy Samples value. Again, for improved performance turn on Fast (interpolate).
  • For extremely blurry surfaces or surfaces with very weak reflections, try turning on Highlights+FG Only.

A typical wooden floor could use Reflection Glossiness of 0.5, Reflection Glossy Samples of 16, Reflectivity of 0.75, a nice wood texture for Diffuse Color, perhaps a slight bump map. If bumpiness should appear only in the lacquer layer, turn on Special Purpose Maps rollout > Do Not Apply Bumps To The Diffuse Shading.

Linoleum flooring could use the same settings but with a different texture and bump map, and probably with slightly lower Reflectivity and Reflection Glossiness values.

Ceramics

Ceramic materials are glazed; that is, they’re covered by a thin layer of transparent material. They follow rules similar to the general materials mentioned above, but set the BRDF method to By IOR (fresnel reflections) and set IOR to about 1.4 and Reflectivity to 1.0.

Set the Diffuse Color to a suitable texture or color, such as white for white bathroom tiles.

Stone Materials

A stone object usually has a fairly matte finish, or has reflections that are so blurry they are nearly diffuse. You can simulate the “powdery” character of stone with the Diffuse Roughness parameter; try 0.5 as a starting point. Porous stone such as brick would have a higher value.

Stone would have a very low Reflection Glossiness (lower than 0.25) and one can most likely use Highlights+FG Only to good effect for very good performance. Use a nice stone texture for Diffuse Color, some kind of bump map, and perhaps a map that varies the Reflection Glossiness value.

The Reflectivity would be around 0.5-0.6 with By IOR (fresnel reflections) off and 0 degree reflectivity at 0.2 and 90 degree reflectivity at 1.0

Glass

Glass is a dielectric, so By IOR (fresnel reflections) should definitely be on. The IOR of standard glass is 1.5. Set Diffuse Level to 0.0, Reflectivity to 1.0 and Transparency to 1.0. This is enough to create basic, completely clear refractive glass.

If this glass is for a window pane, turn Thin-walled on. If this is a solid glass block, turn Thin-walled off and consider if caustics are necessary or not, and set Refractive Caustics accordingly.

If the glass is frosted, set Refraction Glossiness to a suitable value. Tune the Refraction Samples for good quality or turn on Fast (interpolate) for performance.

Colored Glass

For clear glass, use the tips in the preceding section. Colored glass, however, is a different story.

Many shaders set the transparency at the surface of the glass. And indeed this is what happens if one simply sets a Refractive Color to some value, such as blue. For glass with Thin-walled turned on this works perfectly. But for solid glass objects this is not an accurate representation of reality.

The scene in following illustration contains two glass blocks of different sizes, a sphere with a spherical hole inside it, and a glass horse.


Note: The spherical hole was created by inserting a second sphere with its normals flipped inside the outer sphere. Don’t forget to flip the normals of such surfaces or they will not render correctly.

With a blue refraction color: Glass with color changes at the surface

The problems are evident:

  • The two glass blocks are of different thicknesses, yet they are exactly the same level of blue.
  • The inner sphere is darker than the outer one.

Why does this happen?

Consider a light ray that enters a glass object. If the color is located at the surface, the ray is colored somewhat as it enters the object, retains this color through the object, and receives a second coloration (attenuation) when it exits the object:

Diagram for glass with color changes at the surface

In the above illustration the ray enters from the left, and at the entry surface it drops in level and gets slightly darker (the graph illustrates the level schematically). It retains this color throughout its travel through the medium and then drops in level again at the exit surface.

For simple glass objects this is quite sufficient. For any glass using Thin-walledit is by definition the correct thing to do, but for any complex solid it is not. It is especially wrong for negative spaces inside the glass (like the sphere in our example) because the light rays have to travel through four surfaces instead of two, getting two extra steps of attenuation at the surface.

In real colored glass, light travels through the medium and is attenuated as it goes. In the Arch & Design material this is accomplished by turning on Advanced Rendering Options > Refraction > Max Distance, setting the Color At Max Distance, and setting the Refraction Color to white. This is the result:

Glass with color changes within the medium

The result is clearly much more satisfactory: The thick glass block is a deeper blue than the thin one, and the hollow sphere now looks correct. In diagram form it looks as follows:

d=Max Distance where attenuation is Color at Max Distance

The ray enters the medium and is attenuated throughout its travel. The strength of the attenuation is such that precisely the Max Distance (d in the figure) the attenuation matches that of Color At Max Distance. In other words, at this depth the attenuation is the same as was received immediately at the surface with the previous scene. The falloff is exponential, so at double the Max Distance value the effect is that of Color At Max Distance squared, and so on.

There is one minor tradeoff:

To render the shadows of a material correctly using this method, you must either use caustics or make sure mental ray is rendering shadows in Segments mode (see Shadows & Displacement Rollout (mental ray Renderer)).

Using caustics naturally gives the most correct-looking shadows (the above image was rendered without caustics), but requires that the scene has caustic photons enabled and contains a physical light source that shoots caustic photons.

On the other hand, the mental ray Segments shadows have a slightly lower performance than the more widely used Simple shadow mode. But if it is not used, the shadow intensity will not take the attenuation through the media into account properly. However, the image might still look pleasing.

Water and Liquids

Water, like glass, is a dielectric with an IOR of 1.33. Hence, the same principles as for glass (above) apply to bodies of water, which truly need to refract their environment. An example is water running from a tap. Colored liquids use the same principles as colored glass.

Water into wine

To create a liquid in a container, as in the preceding image, it is important to understand how the Arch & Design material handles refraction through multiple surfaces vs. the real-world behavior of light in such circumstances.

What is important for refraction is the transition from one medium to another with a different IOR. Such a transition is known as an interface.

For lemonade in a glass, imagine a ray of light travelling through the air (IOR=1.0). When it enters the glass, it is refracted by the IOR of the glass (1.5). The ray then leaves the glass and enters the liquid; that is, it passes through an interface from a medium of IOR 1.5 to another medium of IOR 1.33.

One way to model this in computer graphics is to make the glass one separate closed surface, with the normals pointing outward from the surface of the glass and an IOR of 1.5, and a second, closed surface for the liquid, with the normals pointing outward and an IOR of 1.33, leaving a small air gap between the container and the liquid.

This approach works, but can cause a problem: When light goes from a higher IOR to a lower there is a chance of an effect known as total internal reflection (TIR). This is the effect you see when diving into a swimming pool and then looking up: You can see the objects above the surface only in a small circle straight above. Anything below a certain angle shows only a reflection of the pool and things below the surface. The larger the difference in the IOR of the two media, the greater the chance of TIR.

So in our example, as the ray goes from glass (IOR=1.5) to air, there is a large chance of TIR. But in reality the ray would move from a medium of IOR=1.5 to one of IOR=1.33, which is a much smaller step with a much smaller chance of TIR. This looks different:

Left: Correct refraction; Right: the “air gap” method

The result on the left is the correct one, but how it is obtained?

The solution is to rethink the modeling, and not to think in terms of media, but in terms of interfaces. In our example, we have three different interfaces, where we can consider the IOR as the ratio between the IORs of the outside and inside media:

  • air-glass interface (IOR=1.5/1.0=1.5)
  • air-liquid interface (IOR=1.33/1.0=1.33)
  • glass-liquid interface (IOR=1.33/1.5=0.8)

In the most common case of an interface with air, the IOR to use is the IOR of the media (because the IOR of air is 1.0), whereas in an interface between two different media, the situation is different.

To correctly model this scenario, then, we need three surfaces, each with a different Arch & Design material applied:

  • the air-glass surface (blue), with normals pointing out of the glass, covering the area where air directly touches the glass, having an IOR of 1.5
  • the air-liquid surface (green), with normals pointing out of the liquid, covering the area where air directly touches the liquid, having an IOR of 1.33
  • the glass-liquid surface (red), with normals pointing out of the liquid, covering the area where the glass touches the liquid, having an IOR of 0.8

The three interfaces for a liquid in a glass

By setting suitable Max Distance and Color At Max Distance values for the two liquid materials (to get a colored liquid), we obtain the glass on the left in the preceding rendered image.

Ocean and Water Surfaces

A water surface is a slightly different matter than a visibly transparent liquid.

The ocean isn’t blue; it is reflective. Not much of the light that penetrates the surface of the ocean gets anywhere of interest. A small amount of light is scattered back up again, doing a bit of literal subsurface scattering.

To make an ocean surface with the Arch & Design material, follow these steps:

  1. Set Diffuse Level to 0.0, Reflectivity to 1.0, and Transparency to 0.0. That’s right: No refraction is necessary.
  2. Set IOR to 1.33 and turn on By IOR (fresnel reflections). Apply an interesting wobbly shader to Bump (Ocean (lume) works well here) and your ocean is basically done.

This ocean has reflections guided only by the IOR. But this might work fine; try it. Just make sure there is something there for it to reflect. Add a sky map, objects, or a just a blue gradient background. There must be something or it will be completely black.

The ocean isn’t blue; the sky is.

For a more tropical look, try setting Diffuse Color to a slightly blue-green color, set the Diffuse Level to a fairly low number such as 0.1, and turn on Do Not Apply Bumps To The Diffuse Shading.

Now you have a base color in the water that emulates the small amount of scattering that occurs in the top level of the ocean.

Enjoy the tropics.

Metal

Metals are reflective, which means they need something to reflect. The best looking metals come from having a true HDRI environment, either from a spherically mapped HDRI photo, or something like the mental ray physical sky.

To create classic chrome, turn off By IOR (fresnel reflections), set Reflectivity to 1.0, 0 degree reflectivity to 0.9 and 90 degree reflectivity to 1.0. Set Diffuse Color to white, and turn on Metal Reflections.

This creates an almost completely reflective material. Tweak the Reflection Glossiness parameter for various levels of blurry reflections. Also consider using the Round Corners effect, which tends to work very well with metallic objects.

Metals also influence the color of their reflections. Because you turned on Metal Reflections, this is already happening; try setting the Diffuse Color to a golden color to create gold.

Try various levels of Reflection Glossiness (with the help of Fast (interpolate) for performance, when necessary).

You can also change the Reflectivity value. This has a slightly different meaning when Metal Material is on; it blends between the reflections (colored by the Diffuse Color) and normal diffuse shading. This allows a blend between the glossy reflections and the diffuse shading, both driven by the same color. For example, an aluminum material would need a bit of diffuse blended in, whereas chrome would not.

Gold, silver, and copper

Brushed Metal

Brushed metal is an interesting special case. In some cases, creating a brushed metal requires only turning down the Reflection Glossiness to a level where you obtain a very blurred reflection. This is sufficient when the brushing direction is random or the brushes are too small to be visible even as an aggregate effect.

For materials that have a clear brushing direction and/or where the actual brush strokes are visible, creating a convincing look is slightly more involved.

The tiny grooves in a brushed metal surface all work together to cause anisotropic reflections. This can be illustrated by the following schematic, which simulates the brush grooves by modeling many tiny adjacent cylinders, shaded with a simple Phong shader:

Many small adjacent cylinders

As you can see, the specular highlights in the cylinders work together to create an aggregate effect which is the anisotropic highlight.

Also note that the highlight isn’t continuous; it is actually broken up into small, adjacent segments. So the primary visual cues that a material is brushed metal are:

  • Anisotropic highlights that stretch out in a direction perpendicular to the brushing direction
  • A discontinuous highlight with breaks in the brushing direction

Many attempts to simulate brushed metals have looked only at the first effect: the anisotropy. Another common mistake is to think that the highlight stretches in the brushing direction. Neither is true.

Hence, to portray brushed metals, it is necessary to simulate these two visual cues. The first is simple: Use Anisotropy and Anisotropy Rotation to make anisotropic highlights. The second can be done in several ways:

  • with a bump map
  • with a map that varies the Anisotropy or Reflection Glossiness values
  • with a map that varies the Reflection Color

Each has advantages and disadvantages, but the one we suggest here is the last one. The reason for choosing this method is that it works well with interpolation.

  1. Create a map for the brush streaks. The possible ways to do this include painting a map in a paint program, or using a Noise map that has been stretched heavily in one direction. The map should vary between middle-gray and white.
  2. Apply this map to the Reflection Color in a scale suitable for the brushing.
  3. Set Diffuse Color to white (or the color of the metal) but set Diffuse Level to 0.0 (or a small value).
  4. Make sure Metal Material is on.
  5. Set Reflection Glossiness to 0.75.
  6. Set Anisotropy to 0.1 or a similar value. Use Anisotropy Rotation to align the highlight properly with the map. If necessary use Anisotropy Channel to base it on the same texture space as the map.

Brushed metal

mental ray Arch & Design Overview

Written September 7th, 2010
Categories: Articles, Rendering / Compositing, Textures / Materials
1 Comment »

This is a duplicate of the Arch & Design Overview document by Autodesk and not written by Mr. Bluesummers.

This topic serves as an introduction to the Arch & Design material for mental ray.

A range of material effects available with the Arch & Design material.

What Is the Arch & Design Material?

The mental ray Arch & Design material is a monolithic material shader designed to support most materials used in architectural and product-design renderings. It supports most hard-surface materials such as metal, wood and glass. It is especially tuned for fast glossy reflections and refractions (replacing the DGS material) and high-quality glass (replacing the dielectric material).

The major features are:

  • Easy to use, yet flexible – controls are arranged logically in a most-used-first fashion.
  • Templates - allow fast access to settings combinations for common materials.
  • Physically accurate – the material is energy conserving, making it impossible to create shaders that break the laws of physics.
  • Glossy performance – advanced performance boosts including interpolation, emulated glossiness, and importance sampling.
  • Tweakable BRDF (bidirectional reflectance distribution function) – the user can define how reflectivity depends on angle.
  • Transparency – “Solid” or “thin” materials: transparent objects such as glass can be treated as either solid (refracting, built out of multiple faces) or thin (nonrefracting, can use single faces).
  • Round corners – simulate fillets to allow sharp edges to still catch the light in a realistic fashion.
  • Indirect Illumination control – set the final gather accuracy or indirect illumination level on a per-material basis.
  • Oren-Nayar diffuse – allows “powdery” surfaces such as clay.
  • Built-in Ambient Occlusion – for contact shadows and enhancing small details.
  • All-in-one shader – photon and shadow shader built in.
  • Waxed floors, frosted glass and brushed metals – all fast and easy to set up.

Physics and the Display

The Arch & Design material attempts to be physically accurate, hence its output has a high dynamic range. How visually pleasing the material looks depends on how colors inside the renderer are mapped to colors displayed on the screen.

When rendering with the Arch & Design material it is highly recommended that you operate through a tone mapper/exposure control such as the mr Photographic Exposure Control in conjunction with gamma correction, or at the very least use gamma correction.

A Note on Gamma

Describing all the details of gamma correction is beyond the scope of this topic; this is just a brief overview.

The color space of a normal, off-the-shelf computer screen is not linear. The color with RGB value 200 200 200 is not twice as bright as a color with RGB value 100 100 100, as one might expect.

This is not a bug because, due to the fact that our eyes see light in a nonlinear way, the former color is actually perceived to be about twice as bright as the latter. This makes the color space of a normal computer screen roughly perceptually uniform. This is a good thing, and is actually the main reason 24-bit color (with only 8 bits or 256 discrete levels for each of the red, green and blue components) looks as good as it does to our eyes.

The problem is that physically correct computer graphics operates in a true linear color space where a value represents actual light energy. If one simply maps the range of colors output to the renderer naively to the 0–255 range of each RGB color component it is incorrect.

The solution is to introduce a mapping of some sort. One of these methods is called gamma correction.

Most computer screens have a gamma of about 2.2 (known as the sRGB color space), but 3ds Max defaults to a gamma of 1.8, which makes everything look too dark (especially midtones), and light does not “add up” correctly.

Using a gamma of 2.2 is the theoretically correct value, making the physically linear light inside the renderer appear in a correct linear manner on screen.

However, because the response of photographic film isn’t linear either, users find that this theoretically correct value looks too bright and washed out. A common compromise is to render to the default gamma of 1.8, making things look more photographic; that is, as if the image had been shot on photographic film and then developed. However, when exporting and importing images (for example, as texture maps) with external image-editing programs, for best results set all gamma values on Preferences > Gamma and LUT Preferences to 2.2.

Tone Mapping

Another method for mapping the physical energies inside the renderer to visually pleasing pixel values is known as tone mapping. You can accomplish this either by rendering to a floating-point file format and using external software, or with a plug-in that allows the renderer to do it on the fly. In 3ds Max such plug-ins are known as exposure controls and are accessed from the Environment dialog.

Use Final Gathering and Global Illumination

The Arch & Design material is designed to be used in a realistic lighting environment; one that incorporates full direct and indirect illumination.

mental ray provides two basic methods for generating indirect light: Final Gathering and Global Illumination. For best results, be sure to use at least one of these methods.

At the very least, enable Final Gathering, or use Final Gathering combined with Global Illumination (photons) for quality results. Performance tips for using Final Gather and Global Illumination can be found here.

If you use an environment for your reflections, make sure the same environment (or a blurred copy of it) is used to light the scene through Final Gathering. In 3ds Max this means you should include a Skylight in your scene set to Use Scene Environment, or use Daylight system with Skylight set to mr Sky.

Use Physically Correct Lights

Traditional computer-graphics light sources live in a cartoon universe where the intensity of the light doesn’t change with the distance. The real world doesn’t agree with that simplification. Light decays when leaving a light source due to the fact that light rays diverge from their source and the intensity of the light changes over distance. This decay of a point light source is 1/d2; in other words, light intensity is proportional to the inverse of the square of the distance to the source.

One of the reasons for this traditional oversimplification is the fact that in the early days of computer graphics, tone mapping was not used and problems of colors blowing out to white in the most undesirable ways was rampant. (Raw clipping in sRGB color space is displeasing to the eye, especially if one color channel clips earlier than the others. Tone mapping generally solves this by “soft clipping” in a more suitable color space than sRGB.)

However, as long as only Final Gathering (FG) is used as indirect illumination method, such traditional simplifications still work. Even light sources with no decay still create reasonable renderings. This is because FG is concerned only with the transport of light from one surface to the next, not with the transport of light from the light source to the surface.

It’s when working with Global Illumination (GI) (that is, with photons) the troubles arise.

When GI is enabled, light sources shoot photons. For the Arch & Design material (or any other mental ray material) to be able to work properly, it is imperative that the energy of these photons to match the direct light cast by that same light. And since photons model light in a physical manner, decay is built in.

Hence, when using GI:

Light sources must emit photons at the correct energy.
The direct light must decay in a physically correct way to match the decay of the photons.
Therefore it is important to make sure the light shader and the photon emission shader of the lights work well together.

In 3ds Max this is most easily solved by using the photometric lights. All of these lights are guaranteed to have their photon energy in sync with their direct light. It is built in and automatic and one does not need to worry about it.

Features

The Shading Model

From a usage perspective, the shading model consists of three components:

  • Diffuse - diffuse channel /including Oren Nayar “roughness”).
  • Reflections - glossy anisotropic reflections (and highlights).
  • Refraction - glossy anisotropic transparency (and translucency).

The Arch & Design material shading model

Direct and indirect light from the scene cause diffuse reflections as well as translucency effects. Direct light sources also create specular highlights.

Ray tracing is used to create reflective and refractive effects, and advanced importance-driven multi-sampling is used to create glossy reflections and refraction.

The rendering speed of the glossy reflections/refraction can further be enhanced by interpolation as well as “emulated” reflections with the help of Final Gathering.

Conservation of Energy

One of the most important features of the material is that it is automatically energy conserving. This means that it makes sure that diffuse + reflection + refraction <= 1. In other words, no energy is magically created and the incoming light energy is properly distributed to the diffuse, reflection and refraction components in a way that maintains the first law of thermodynamics.

In practice, this means, for example, that when adding reflectivity, the energy must be taken from somewhere, and hence the diffuse level and the transparency will be automatically reduced accordingly. Similarly, adding transparency happens at the cost of the diffuse level.

The rules are as follows:

  • Transparency takes energy from diffuse; that is, at 100% transparency, there is no diffuse at all.
  • Reflectivity takes energy from both diffuse and transparency; that is, at 100% reflectivity there is neither diffuse nor transparency.
  • Translucency is a type of transparency, and the Translucency Weight parameter defines the percentage of transparency vs. translucency.

From left to right: Reflectivity=0.0, 0.4, 0.8, and 1.0

From left to right: Transparency=0.0, 0.4, 0.8, and 1.0

Conservation of energy also means that the level of highlights is linked to the glossiness of a surface. A high Reflection Glossiness value causes a narrow, intense highlight, while a lower value causes a wider, less intense highlight. This is because the energy is now spread out and dissipated over a larger area.

BRDF: How Reflectivity Depends on Angle

In the real world, the reflectivity of a surface is often view-angle dependent. A fancy term for this is bidirectional reflectance distribution function (BRDF); that is, a way to define how much a material reflects when seen from various angles.

The reflectivity of the wood floor depends on the view angle.

Many materials exhibit this behavior. The most obvious examples are glass, water, and other dielectric materials with Fresnel effects (where the angular dependency is guided strictly by the index of refraction), but other layered materials such as lacquered wood and plastic display similar characteristics.

The Arch & Design material allows this effect to be defined by the index of refraction, and also allows an explicit setting for the two reflectivity values for:

  • 0 degree faces (surfaces directly facing the camera)
  • 90 degree faces (surfaces 90 degrees to the camera)

Reflectivity Features

The final surface reflectivity is in reality caused by the sum of three components:

  • The diffuse effect
  • The actual reflections
  • Specular highlights that simulate the reflection of light sources

Diffuse, reflections, and highlights

In the real world, highlights are just glossy reflections of the light sources. In computer graphics it’s more efficient to treat these separately. However, to maintain physical accuracy the material automatically keeps highlight intensity, glossiness, anisotropy, etc. in sync with the intensity, glossiness and anisotropy of reflections. Thus, there are no separate controls for these as both are driven by the reflectivity settings.

Transparency Features

The material supports full glossy anisotropic transparency and includes a translucent component, described in detail here.

Translucency

Solid versus Thin-Walled

The transparency/translucency property can treat objects as either solid or thin-walled.

If all objects were treated as solids at all times, every window pane in an architectural model would have to be modeled as two faces: an entry surface that refracts the light slightly in one direction, and immediately following it an exit surface, where light is refracted back into the original direction.

Not only does this entail additional modeling work, it is a waste of rendering power to simulate refraction that has very little net effect on the image. Hence the material allows modeling the entire window pane as a single flat plane, foregoing any actual refraction of light.

Solid vs. thin-walled transparency and translucency

In the preceding illustration the helicopter canopy, the window pane, the translucent curtain, and the right-hand sphere all use thin-walled transparency or translucency, whereas the glass goblet, the plastic horse, and the left-hand sphere all use solid transparency or translucency.

Cutout Opacity

Beyond the “physical” transparency, which models an actual property of the material, the material provides a completely separate, non-physical “cutout opacity” channel to allow “billboard” objects such as trees, or to cut out objects such as a chainlink fence with an opacity mask.

Special Effects

Built-in Ambient Occlusion

Ambient Occlusion (AO) is a method spearheaded by the film industry for emulating the look of true global illumination by using shaders that calculate the extent to which an area is occluded, or prevented from receiving incoming light.

Used alone, an AO shader, such as the separate mental ray Ambient/Reflective Occlusion shader, creates a grayscale output that is dark in areas light cannot reach and bright in areas where it can:

The following image illustrates the main results of AO: dark crevices and areas where light is blocked by other surfaces, and bright areas that are exposed to the environment.

An example of AO applied to a scene

One important aspect of AO is that the user can how far it looks for occluding geometry.

AO looked up within a shorter radius

Using a radius creates a localized AO effect: Only surfaces within the given radius are considered as occluders. This also speeds up rendering. The practical result is that the AO provides nice “contact shadow” effects and makes small crevices visible.

The Arch & Design material gives you two ways to utilize its built-in AO:

  • Traditional AO for adding an omnipresent ambient light that is then attenuated by the AO to create details.
  • Use AO for detail enhancement together with existing indirect lighting methods such as Final Gathering or photons.

The latter method is especially interesting when using a highly smoothed indirect illumination solution, such as a high photon radius or an extremely low final gather density, which could otherwise lose small details. By applying the AO with short rays these details can be brought back.

Round Corners

Computer-generated imagery tends to look unrealistic, partly because edges of objects are geometrically sharp, whereas most edges in the real world are slightly rounded, chamfered, worn, or filleted in some manner. This rounded edge tends to “catch the light” and create highlights that make edges more visually appealing.

The Arch & Design material can create the illusion of rounded edges at render time. This feature is intended primarily to speed up modeling, so that you need not explicitly fillet or chamfer edges of objects such as a tabletop.

Left: No round corners; Right: Round corners

The function is not a displacement; it is merely a shading effect, like bump mapping, and is best suited for straight edges and simple geometry, not advanced, highly curved geometry.

Performance Features

Finally, the Arch & Design material contains a large set of built-in functions for optimal performance, including but not limited to:

  • Advanced importance sampling with ray rejection thresholds
  • Adaptive glossy sample count
  • Interpolated glossy reflection/refraction with detail enhancements
  • Ultra-fast emulated glossy reflections (Highlights+FG Only mode)
  • The option to ignore internal reflections for glass objects
  • The choice between traditional transparent shadows, suitable for objects such as a window pane, and refractive caustics, suitable for solid glass objects, on a per-material basis.

Parti Volume Shader

Written March 25th, 2010
Categories: Materials / Shaders, Rendering / Compositing, Videos
3 comments

I bet you wern’t expecting this on a Thursday. This Monday Movie fills in the gap that came up when I was really sick that one weekend and couldn’t make a Monday Movie. In this video, we’ll look at how you can use the Parti Volume shader in mental ray to quickly create mist or volumetric lighting effects. It’s surprisingly easy to use once you know what spinners to mess with- but be careful! It can cause high render times!

VRay Displacement

Written March 25th, 2010
Categories: Materials / Shaders, Videos
9 comments

Hey everyone!

This week’s Monday Movie is on VRay displacement and map-based materials. I’ll be talking about how to set up these materials, as well as how to keep them from taking up too much time during rendering.

Later this week I’ll be releasing another Monday Movie for you viewers that are hoping for me to get back to some heavy mental ray concepts. Also, I’m still working on the site redesign. I expect to have it released sometime in April. Some of the expected changes include:

  • Transcriptions and auto-translation for every Monday Movie,
  • Better, more robust tagging and categories,
  • Page-specific formats,
  • 720p HD video footage,
  • and more!

I’ll keep you posted as it happens!

Submerge (lume) Shader

Written January 5th, 2010
Categories: Effects, Materials / Shaders, Videos
4 comments

Hey everyone,

This week I’ll be showing you how to use the submerge (lume) shader in 3dsMax and mental ray. It’s an easy way to make your scenes look like their underwater while harnessing the power of caustics and global illumination. Try these techniques in conjunction with the waterbox we made last week for a really great one-two punch!

Also, you may have noticed that I included a transcript of last week’s video.  I’m going to try adding that in to the mix for the next few weeks to see if people find that useful.  Remember that you can always pass this page through Google Translate to get the transcription in your desired language!

(Re)Making a Waterbox

Written December 28th, 2009
Categories: Effects, Modeling, Rendering / Compositing, Videos
5 comments

Hey everyone!

I’m on vacation right now, but I’ve queued up this Monday Movie so that you can start your new year right!  This week I’m showing you how to create a water box in 3dsMax using the mental ray renderer.  For those of you who don’t know it, a water box is a great way to practice your rendering technique and for learning how the different settings work in mental ray.

mental ray Matte/Shadow

Written December 15th, 2009
Categories: Materials / Shaders, Videos
3 comments

Hey everyone,

Sorry for the delay.  This week’s video tutorial is part 2 from last week where we talked about the matte/shadow material type in the scanline renderer.  This week, we’re looking at how you can use matte/shadow materials in the mental ray renderer and we’ll use a quick-and-dirty camera matching technique along with it.

Scanline Matte/Shadow

Written December 7th, 2009
Categories: Materials / Shaders, Videos
1 Comment »

Hey everyone,

I know I’ve already covered this a little bit in a previous video tutorial, but I wanted to give it a little more air time for comprehensive coverage.  This week I’m showing you how to use the Matte/Shadow material in the scanline renderer for product shots.  We’ll be keeping things simple, and I’ll show you a trick for getting sweet semi-transparent reflections.

Vue 6 Infinite Panoramic Rendering

Written November 10th, 2009
Categories: Import / Export, Rendering / Compositing, Videos
No Comments »

Hey Everyone,

In this Monday Movie we’ll be looking at how you can render panoramic HDR images in e-on software’s Vue 6 Infinite.  It’s a great program for rendering natural landscapes and skies.  A fantastic addition to any pipeline (though if you’re really crazy you can get their Ozone plugin for 3dsMax).  Next week we’ll look at how to bring these 360-degree images back into 3dsMax for use as backgrounds and illumination maps.

Panoramic Rendering and HDRI (Part 1)

Written November 3rd, 2009
Categories: Import / Export, Rendering / Compositing, Videos
5 comments

Hey everyone,

In this block of 3 video tutorials, we’ll be looking at how to render and use panoramic, 360-degree images in 3d Studio Max.  This week is part 1 where I cover how to render these “fish eye lens” images and save them out as high dynamic range images (HDR or HDRI).  It’s pretty easy to do in mental ray- just apply the “Wrap Around (lume)” lens shader, and you’re done!

In part 2 we’ll cover how to render great backgrounds with e-on software’s vue.  Finally, in part 3, I’ll show you how to bring those big renders back into 3dsMax and use them as image-based lighting.

High Resolution Renders

Written October 26th, 2009
Categories: Rendering / Compositing, Videos
4 comments

I’m back! Back with more delectable Monday Movies for you.

This week’s video tutorial is about how you can render very large images in 3dsMax. I mean really dang huge! Large renders in 3dsMax can bring just about any machine to it’s knees. I’ll show you how to split your render into pieces so that you can render them separately and then re-combine the images outside of 3dsMax using Photoshop or Gimp. The key is using the Blowup Region tool in the Viewport Configuration.

Enjoy!

Pre-Rendering

Written September 10th, 2009
Categories: Materials / Shaders, UVWs / Texturing, Videos
No Comments »

Hey all!

There are no excuses for this exceptionally tardy post. I fixed my computer problem back on Monday (turns out I’ve got two bad sticks of RAM). Then I contracted a nasty virus the same day, so I’ve had two delirious days where I could’ve posted the video. I’ll try to make it up to you on the next one. I’m thinking of a double feature on uploading to YouTube since I’ve been getting a lot of questions about that over the last few months. Think that might be useful? Let me know in the comments!

This last week is a good one! We’re looking at an old school technique where you can render an object in 3dsMax, extract the diffuse map and alpha map, and then re-use them as elements in another render. It seems rather simple, but it’s actually a very powerful 3d technique! We Bryce 3d users used to use it back in the old days to pack detail into a scene that our computers might not otherwise be able to handle. Alpha mapped plane objects should be part of any modeler’s pipeline- especially you low-poly junkies out there!

Sub-Surface Scattering Physical Material

Written July 5th, 2009
Categories: Effects, Materials / Shaders, Videos
11 comments

Hey everyone!

This week, we’re going to be looking at how what we learned last week applies to the Sub-Surface Scattering (SSS) Physical Material in 3dsMax and mental ray.  They’re very similar, but the physical material gives you a little more control over the final outcome.  Since this is both a shader and a material type, what you learn here is applicable across many applications!

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