Friday, 16 September 2011

Three-point Lighting in 3DS MAX

3-point lighting

Picture 1. 3-point lighting in 3D Studio MAX.

3D Studio MAX default lighting

Picture 2. Using the default lighting (as in the picture above) in 3DS MAX is not the best option.

09.08.2007 Category: 3D (Lighting)
Three-point lighting is a very common lighting technique used in cinematography and photography. Three-point lighting is a very flexible technique and it can be used to illuminate the subject in an attractive way. Three-point lighting consists of three separate lights which can be used to control the lighting, shading and shadows of the subject:

  • Key light
  • Fill light
  • Back light / Rim light

Key light is the main light source, it illuminates the subject the most and it defines the overall lighting design of the scene. Key light casts the strongest shadows to the subject.

Fill light is less bright than key light and is used to illuminate the parts of the subject that cannot be reached by key light. Fill light is also used to soften the shadows of key light and to decrease the contrast of the subject's surface.

Back light is used to illuminate the edge of the subject from behind in order to separate the subject from its background. Back light can be very bright. Even if it's bright is doesn't compete with key light because it highlights only the edges of the subject. Back light is also known as rim light because it gives the subject a rim of light.

The idea of three-point lighting works also in 3D graphics but the practice has some differences compared to real cinematography. In this tutorial I discuss the three-point lighting setup in 3D Studio MAX.

Picture 2 is rendered with 3D Studio MAX's default lighting. In other words, it has been rendered before any light has been created. The default lighting of 3DS MAX works well while modelling the subject but is not a good solution in the rendering of the final image. There are at least two apparent problems in picture 2. Firstly, there are no shadows. And secondly, as you can see the left side of the face is left in darkness and merges with the background. Let's illuminate the face with three-point lighting setup in 3DS MAX.

Key Light

Key light placement in 3D Studio MAX

Picture 3. In this case the key light is placed so that it shines from the front and above of the character. Key light is the main light source of the scene.

The effect of key light in 3DS MAX

Picture 4. The picture above is rendered with key light only.

Key light represents the main light source. In real life the main light source usually shines from above, so let's place the key light above the face.

Create a Target Directional light, place it according to picture 3 and give the following parameters to it:

  • General Parameters:
    Shadows: On
  • Intensity/Color/Attenuation:
    Multiplier: 0.8
  • Directional Parameters:
    Hotspot/Beam: 0,5
    Falloff/Field: 0,51
  • Shadow Map Params:
    Bias: 0.0
    Size: 2048
    Sample Range: 4.0

(The settings above are used with a real size person. If your model is of different size you must change Hotspot/Beam and Falloff/Field accordingly. With this setup the shadows are pretty sharp. Feel free to soften the shadows by increasing Sample Range.) Render a test image. The lighting should be similar to picture 4.

Fill Light

Fill light placement in 3D Studio MAX

Picture 5. Fill light is used to illuminate the part of the face that key light can't reach. The intensity of fill light is much less than the intensity of key light.

The effect of fill light in 3DS MAX

Picture 6. The picture above is rendered with fill light only.

Create an Omni light according to picture 5 and give the following parameters to it:

  • Intensity/Color/Attenuation:
    Multiplier: 0.25
  • Advanced Effects:
    Specular: Off

(The intensity of fill light is always much less than the intensity of key light. It's often a good idea to turn Specular off in fill light so that it affects the diffuse characteristic of the surface only.)

Picture 6 shows the face rendered with fill light only. You can try that by turning off the key light. It's often a good idea to test lights one at a time. When multiple lights are turned on it's not always easy to figure out how individual lights affect the illumination.

In real life fill lights are sometimes replaced by reflectors which reflect the light of key light. In 3D Studio MAX you can create the same effect by using a lighting technique called global illumination which creates indirect light by tracing light as it bounces from surfaces.

Back Light / Rim Light

Rim light placement in 3D Studio MAX

Picture 7. Back light is placed behind the character.

The effect of back light in 3DS MAX

Picture 8. The picture above is rendered with back light only. Back light is placed so that it illuminates only the edges of the subject.

Back light is needed when the contrast between the subject and the background is not enough. In real life the effect of back light is much stronger because of hair, clothes and other fuzzy surfaces. In 3D graphics surfaces are usually perfectly smooth and there are no little particles to pick up the light. Therefore, there is often a need to create several back lights in 3D graphics.

Create an Omni light according to picture 7 and give the following parameters to it:

  • Intensity/Color/Attenuation:
    Multiplier: 1.0
  • Advanced Effects:
    Specular: Off

(It's often a good idea to turn Specular off in back light so that it affects the diffuse characteristic of the surface only.)

Picture 8 shows the face rendered with back light only. Back light can be bright because it illuminates the edge of the subject only.

Three-point Lighting Rendering

Three-point lighting in 3DS MAX

Picture 9. The picture above is rendered with three-point lighting setup in 3D Studio MAX.

Picture 9 shows the final rendering with three-point lighting setup in 3D Studio MAX. Compare this picture to the picture rendered with the default lighting of 3DS MAX to understand the differences between them.


Clay Render Mental Ray (3DS MAX)

Clay render with Mental Ray in 3D MAX

Picture 1. Clay render with Mental Ray in 3DS MAX.

27.08.2007 Category: 3D (Rendering)
Incomplete models (wip) are often rendered with a clay render technique. Clay render means a rendering which looks like a picture of a clay model. In this tutorial I cover a clay render technique in 3D Studio MAX using Mental Ray renderer. If you are not familiar with the clay render concept I encourage you to first read about materials, background and lighting from my tutorial: Clay Render in 3DS MAX.

Mental Ray Final Gather

Mental Ray Final Gather with default settings

Picture 2. Enable Final Gather.

Clay render with default settings of Mental Ray's Final Gather

Picture 3. Clay render in 3D Studio MAX with default settings of Mental Ray's Final Gather.

With Mental Ray, clay render can be achieved simply by turning Final Gather on. Turn Final Gather on (picture2) and try to render your image. Picture 3 has been rendered by using the default settings of Final Gather. From picture 3 it's easy to notice a few things that could be improved. The edges of the model are jagged and shadows and shading look grainy in some places.

Sampling Quality

Mental Ray's Sampling settings

Picture 4. Edges can be made smoother by increasing Mental Ray's sampling quality.

The jagged edges can be fixed by increasing sampling quality of Mental Ray. Sampling is an antialiasing technique. Sampling settings of Mental Ray can be found from Renderer tab from Sampling Quality section. I am not going to go through the sampling settings or mathematics behind them but you can easily increase the sampling quality by increasing Minimum and Maximum values found in Samples per Pixel section. Try for example values 4 and 64 like in picture 4.

Final Gather Basic Parameters

Quality settings of Final Gather

Picture 5. Rendering quality can be increased by adjusting basic settings of Final Gather.

Clay render with high quality settings of Mental Ray

Picture 6. High quality rendering can be achieved by raising Mental Ray's quality settings.

Grainy shadows and shading can be fixed by adjusting Final Gather's basic parameters on Indirect Illumination tab. I am not going to go through the complicated mathematics behind the settings but simply put, you can increase the rendering quality by raising the following values:

  • Initial FG Point Density
  • Rays per FG Point
  • Interpolate Over Num. FG Points

Notice that raising these values affect considerably to the rendering speed. It's a good idea to experiment with different values to find satisfactory rendering quality. The realism of the rendering can be increased by adjusting the following values:

  • Diffuse Bounces
  • Weight

Diffuse Bounces means the bouncing of the light and Weight affects to the amount of light that is left after a bounce. Picture 6 has been rendered with the following Mental Ray settings:

  • Renderer > Samples per Pixel
    • Minimum: 4
    • Maximum: 64
  • Indirect Illumination > Basic
    • Initial FG Point Density: 40
    • Rays per FG Point: 250
    • Interpolate Over Num. FG Points: 27
    • Diffuse Bounces: 1
    • Weight: 0,4

Notice that when Initial FG Point Density is raised this high, the rendering might took a long time. Intel Core 2 Duo E4300 rendered picture 6 (400 x 300) in about three minutes.

Clay render in 3DS MAX

Clay render in 3D Studio MAX

Picture 1. Clay render with Light Tracer in 3D Studio MAX.

21.06.2007 Category: 3D (Rendering)
Unfinished models (wip) are often rendered with clay render technique. Clay render means a rendering which looks like a picture of a clay model. In this tutorial I cover easy clay rendering technique in 3DS MAX. This tutorial is designed for 3D Studio MAX 9. Some things might be little different in earlier versions.

1. Material of the 3D Model

Create a material for your 3D model. The standard material of 3D Studio MAX works well. Set the color of diffuse and ambient to very light gray (HSV 0,0,220). It's not wise to use pure white because then the model might merge with the white background. If you want you can also use some other color. One often sees for example little more yellowish clay renderings.

2. The Plane for the 3D Model

Create a plane object under the model. The plane object doesn't have to be very large. It's enough when it's big enough to cover the shadows cast by the model. If you want the plane to blend with the background use exactly the same color in the plane object and in the background, and use white light. However, if you use some color in the light, use that same color in the background and white color in the plane object so that it blends with the background. White is often used as a color of the plane object. The plane object will receive some soft shadows from the model and block the light coming from below.

3. Skylight

Create a Skylight. The position and orientation of the Skylight doesn't matter at all. In any case the Skylight illuminates evenly from all around. By default the Skylight has a light blue color which creates little cold feel into the rendering. You could change that to white or to light yellow if you want a warm feel into your rendering.

4. Light Tracer Settings

Light tracer settings for a clay render

Picture 2. Light Tracer settings. If there is graininess in the picture use larger Rays/Sample value. If there is noise in the image use larger Filter Size value.

Clay rendering of a dragon

Picture 3. Clay rendering in 3D Studio MAX.

Open the Light Tracer settings (Rendering > Advanced Lighting > Light Tracer...) and try to render the model. Lighting and material should look approximately like in the picture 3. There are many settings in the Light Tracer panel but in a simple clay rendering you probably need only two. If there is graininess in the picture use larger Rays/Sample value. If there is noise in the picture use larger Filter Size value. If you want to increase realism set Bounces to 2 and Object Mult: to 0,3. Bounces means the bouncing of the light and Object Mult: tells the intensity of the light after a bounce.

Wire and Isoline Clay Render in 3DS

Three different wire rendering methods in 3D MAX

Picture 1. Three wire clay render methods in 3DS MAX.

27.08.2007 Category: 3D (Rendering)
In 3D graphics the structure of the model often matters a lot. Well built model renders and animates nicely. When a clay render is created out of a 3D model, one often wants to show also the structure of the model. In this tutorial I cover clay rendering where also the structure (wire / edges) of the model is shown as addition to the surface.

Wire Clay Render in 3D Studio MAX

In 3D Studio MAX it's simple to see edges of the model in real time hardware shading but it's not that simple to make them visible in rendering. However, there are several ways to make edges of the model appear in the final rendering.

Face Map (Scanline and Mental Ray Renderers)

Enable Face Map and select Gradient Ramp as diffuse map

Picture 2. Turn Face Map on and select Gradient Ramp as diffuse map.

Settings of Gradient Ramp

Picture 3. Settings of Gradient Ramp.

Wire clay render with Mental Ray in 3DS MAX

Picture 4. Mental Ray rendering where Gradient Ramp works as Face map.

By using material's Face Map option texture can be mapped precisely inside of a polygon. The edges of the model can be made visible by using the following settings in the default material (pictures 2 and 3):

  • Face Map: Enable
  • Diffuse Map: Gradient Ramp
    • Blur: 0,01
    • Gradient Type: Box
    • Interpolation: Solid
    • By adjusting the place of the change in color you can control the thickness of the edges

If you are rendering with Scanline turn SuperSampling on and if you are rendering with Mental Ray increase sampling quality so that thin lines are rendered accurately enough. Picture 4 has been rendered by using the method described above. For some reason some of the edges seem to be thicker than others.

Composite Map (Mental Ray Only)

Standard material inside of Composite material

Picture 5. Select Standard material to Mat.1.

Wire material

Picture 6. Settings of wire material.

Wire clay render with Mental Raylla in 3D Studio MAX

Picture 7. Mental Ray rendering where wire material is in composite map.

Another method to make edges visible in rendered image is to use composite map:

  • Select your clay material in material editor.
  • Click on top of Standard and select Composite as material type according to picture 5. 3DS MAX asks whether you want to keep or discard the old material. Click OK so that your old material is saved as Base Material of the Composite material.
  • Click on the first material (Mat. 1) of Composite material and select the type of the material to be Standard and give it a name Wire (picture 5).
  • Enable Wire in the Wire material according to picture 6 and select suitable diffuse color for the material. When Wire is enabled the material is shown only in the edges of the model. If necessary you can change the thickness of the wire by adjusting the Size value in the material's Extended Parameters section (picture 6).

Picture 7 has been rendered by using the method described above. Wire-option makes all the lines to be equally thick. In other ways the result is very similar to the method with Gradient Ramp map.

The Problem with Face Map and Composite Map

The problem with the both methods may be that they make all the visible edges to appear in the rendering. Often the geometry of the model is very dense and edges are very close to each other. The net of edges might be too dense. You might be able to affect that. For example if you are using Meshsmooth modifier you can turn that off while rendering. Of course this makes the model rough and angular like the leg of the turtle in pictures 4 and 7.

Isoline Clay Render in 3DS MAX

Extraction of Isolines

Picture 8. Extract Isolines to separate object.

Enable the lines in renderer and thickness of the lines

Picture 9. Enable in renderer makes the lines to show up in rendering.

Isoline clay render with Mental Ray in 3D Studio MAX

Picture 10. Model and edges have been rendered with Mental Ray as separate objects.

If your model is so called Subdivision surface which is created by subdividing the surface to smaller polygons using Meshsmooth or Turbosmooth modifier you can use the following technique. When Meshsmooth modifier is added to your model the surface smoothens and is divided into smaller parts according to Iterations value. By default Isoline Display is turned on in Meshsmooth modifier which means that even if there are many new edges because of the modifier only the original edges are shown. That is how you see the model when you turn on Smooth + Highlights and Edged Faces in a view. In the following I cover the rendering of this kind of view. So we are going render a surface where only the edges according to Isoline Display setting are shown.

Extract Isolines as Edges

  • Add Edit Poly modifier into the modifier stack just below Meshsmooth modifier. (You don't have to do this if Meshsmooth modifier is already on top of Editable Poly or Edit Poly)
  • Select all edges in Edit Poly modifier.
  • Click on Meshsmooth modifier. Now Meshsmooth modifier is applied to all edges.
  • Add Edit Poly modifier on top of Meshsmooth modifier.
  • Activate edge sub-object mode and click settings button settings next to Create Shape button.
  • Select Linear as Shape Type and click OK (picture 8).

Now isolines are a separate shape object which can be rendered. Turn on Enable in renderer in the new shape object according to the picture 9. Thickness value can be used to control the thickness of the lines. Picture 10 has been rendered by using the method described above.

3D Tornado in 3DS MAX

27.01.2008 Category: 3D (Animation)
Tornado animation

Picture 1. Animated 3D tornado

In this tutorial I cover the creation of a simple tornado in 3D Studio MAX. The tornado is created by forcing particles to follow a path and adding motion blur to them. You need some experience with 3DS MAX to be able to follow this tutorial.

Helix Path

A Helix shape in 3DS MAX

Picture 2. The helix is the path that particles will follow.

First create a path for the particles to follow. Create a Helix Shape in the Top view (Create > Shapes > Helix). Use the following settings in the Helix:

  • Radius 1: 20
  • Radius 2: 5
  • Height: 300
  • Turns: 22

Rotate the Helix 180 degrees so that the first vertex of the helix is on top (picture 2).

Snow Particle System

Helix shape and Snow particle system in 3DS MAX

Picture 3. Create a Snow particle system.

Next you need some particles. Create a Snow particle system (Create > Particles > Snow) with the following settings (picture 3):

  • Particles: Render Count: 10000
  • Particles: Flake Size 8,0
  • Particles: Ticks
  • Render: Triangle
  • Timing: Start: 0
  • Timing: Life: 91
  • Emitter: Width: 40
  • Emitter: Length: 40

The speed of the particles won't have any effect in the final system and orientation of the Snow emitter has only a very little effect.

Path Follow Space Warp

Path Follow space warp

Picture 4. Create a Path Follow space warp and bind the Snow particle system to it.

A Path Follow space warp is used to force the particles to follow the path. Create a Path Follow space warp (Create > Space Warps > Forces > Path Follow) with the following settings:

  • Current Path: Object: Helix01
  • Motion Timing: Travel Time: 100
  • Motion Timing: Variation: 10
  • Motion Timing: Last Frame: 400
  • Particle Motion: Stream Swirl: 0,02
  • Particle Motion: Stream Swirl: Variation: 100
  • Particle Motion: Stream Swirl: Bidirectional

(The Particle Motion parameters add some chaos to the flow of the particles.)

Bind to space warp Bind the Snow particle system to the Path Follow space warp (picture 4).

Test the Animation

Particles following a path

Picture 5. Particles are following the path.

Test the animation. The particles should now roughly follow the helix shape (picture 5). It takes 100 frames (Travel time) for the particles to go through the path.

Wave modifier to the Tornado

Particle tornado in 3DS MAX

Picture 6. A wave modifier makes the tornado more alive.

At the moment the tornado is boring. Add a Wave modifier to the helix to make the tornado more interesting. Use the following settings in the Wave modifier (you probably have to also rotate the Gizmo of the Wave modifier 90 degrees):

  • Amplitude 1: 80
  • Amplitude 2: 80
  • Wave Length: 300
  • Phase: (Animate from 0 to 2 during 400 frames)

The tornado should now look like in picture 6. At the moment the tornado does wave motion only along one axis which means that it looks good only when looked at from certain angles. If you are going to render an animation I suggest you to animate two Wave modifiers with 90 degree separation to make the wave motion appear from any view angle.

Tornado Material

Material basic parameters

Picture 7. Basic parameters of the tornado material.

Gradient Ramp parameters

Picture 8. Gradient Ramp parameters.

Create a material for the tornado with the following settings:

Basic parameters (picture 7):

  • 2-Sided
  • Ambient & Diffuse: Light gray
  • Self-illumination: 50
  • Specular Level: 0
  • Glossiness: 0
  • Opacity: Gradient Ramp

Gradient Ramp Parameters (picture 8):

  • U Tiling: 2,0
  • V Tiling: 2,0
  • U Tile: Off
  • V Tile: Off
  • Gradient Type: Radial
  • Gradient color according to picture 8

Render an Test Image

Tornado rendering in 3DS MAX

Picture 9. First rendering of the tornado.

Render an image to test the material of the tornado. The rendered image should look like in picture 9. (For my rendering I added a plane object with Matte/Shadow material under the tornado and an Omni light with shadows on top of the tornado.) It doesn't look much of a tornado yet. Next you'll add motion blur to enhance the realism of the rendering.

Motion Blur to the Tornado

Tornado in 3D Studio MAX

Picture 10. The final rendering of the tornado in 3DS MAX.

Add motion blur to the tornado. Right click on the Snow Particle System and select Object Properties... from the pop-up menu. Enable Object Motion Blur.

Go to the render settings and Apply Object Motion Blur with the following settings:

  • Samples: 32
  • Duration: 8
  • Duration Subdivisions: 32

Render the tornado again. Now the rendering takes a few minutes longer because of the motion blur. The rendered image should look like in picture 10.

At the moment the tornado uses a Snow particle system. There are many other particle systems in 3DS MAX and you could also try this with any of them.


Getting started in max (tutorials)

...