Thursday, 20 July 2017

3D MONEY – MILLION DOLLARS

This 3ds Max tutorial covers the modeling and texturing of one million dollars. We’re going to create pack of 3d money, make many clones of it, and create huge pile of money with the help of reactor. I am using 3ds Max 2010 but this should be doable with many older versions as well.

Step 1 Ten Thousand Dollar Label

Create a Box ( Create panel > Geometry > Standard Primitives > Box ) in the left viewport and apply ( Make a selection > Modify panel ) the following parameters to it:
  • Length: 7,9
  • Width: 31
  • Height: 15,3

Step 2 Modify the Box with Edit Poly

Add Edit Poly modifier to the box ( Make a selection > Modify panel > Modifier List > Object-Space Modifiers > Edit Poly ). Activate Polygon sub-object level and delete two polygons according to picture below.
Modeling with Edit Poly

Step 3 Geometry for the 3D Money Itself

Create a Box ( Create panel > Geometry > Standard Primitives > Box ) in the top viewport and apply ( Make a selection > Modify panel ) the following parameters :
  • Length: 30,8
  • Width: 73,44
  • Height: 7.7
  • Length Segs: 10
  • Width Segs: 24
  • Height Segs: 8
( We need lots of segments to the money object to be able to deform it later )

Step 4 Align the Money with the Label

Select the box you just created and use the Align tool ( Tools > Align > Align… ) to place the box into the center of the first box like in picture below. In the Align tool, just select all axis and click ok. The center of the selected object will be placed to the center of the target object.
Money geometry in 3d studio max

Step 5 Money Textures

Now the geometry of the 3d money pack is complete and we need some textures to the surface. We need front and back sides of a hundred dollar bill and some bump maps to the sides. Fortunately there are high resolution money textures available at Wikipedia.

Step 6 Create the Bump Map in Photoshop or Click Here to Download

To make believable render we also need a bump map to the sides of the money pack. Bump map for this purpose is really easy to create in Photoshop:
  1. Create a new image with 1×100 pixel dimensions.
  2. Apply Noise filter ( Filter > Noise > Add Noise… ):
    • Amount: 60%
    • Distribution: Uniform
    • Monochromatic: On
  3. Apply another Noise filter ( Filter > Noise > Add Noise… ):
    • Amount: 75%
    • Distribution: Uniform
    • Monochromatic: On
The bump map is ready. Save the file in png format.

Step 7 Label texture

The last texture we need is for the label surrounding the money pack. Just create something like this in Photoshop or just use my texture.
Label texture for $10,000 money pack

Step 8 Texturing the Money

Now we have all the textures we need. Open Material Editor ( Rendering > Material Editor… ) and create material for the money:
Money pack material in 3ds max
  1. Select the 3d money object and click ‘Assign the material to selection’
  2. Material Type: Multi/Sub-Object
  3. Click ‘Set Number’ and set the number of materials to 4
  4. Material 1
    • Diffuse Map: Bitmap: 100 dollar bill front texture here
  5. Material 2
    • Diffuse Map: Bitmap: 100 dollar bill back texture here
  6. Material 3
    • Bump Map: Bitmap: Bump texture here
  7. Material 4
    • Bump Map: Bitmap: Bump texture here
      • Coordinates > Angle > W: 180 ( the idea is to flip the bump map vertically so that it appears different in adjacent sides, makes sense in the next step when we apply material IDs )
Notice that we aren’t t using diffuse maps in the materials number 3 and 4. Therefore the color of these materials will be gray ( the default Diffuse color ). It’s just a pure coincidence that the default gray is close enough to what we need. In fact, changing the Diffuse color of these materials might produce a tad more realistic material.

Step 9 Apply Material IDs to the 3D Money Pack

Add Edit Poly modifier to the pack of money ( Modify panel > Modifier List > Object-Space Modifiers > Edit Poly ), activate Polygon sub-object level, and apply Material IDs according to picture below. ( material IDs of top and bottom polygons should be ok by default ).
Setting material IDs for polygons

Step 10 Activate Super Sampling and Render a Test Image

Change the background color to white ( Rendering > Environment > Common Parameters > Background > Color ) and render a test image. Pay special attention to the bump maps. They are not that pretty. A good rule of thumb is to activate SuperSampling whenever there are reflections or bump maps in use. SuperSampling is an antialiasing technique that enhances the rendering quality. So let’s turn it on:
  • Rendering > Render Setup… > Renderer > Global SuperSampling
    • Disable all Samplers: OFF
    • Enable Global SuperSampler: ON, Adaptive Halton
    • Quality: 1,0
Now render another test image to see how the bump map quality ( and rendering time ) increases.
$10,000 render

Step 11 Texture for the Money Label

Next we’ll create a material for the the label:
  1. Select the label object and assign material to it
  2. Click ‘Show map in viewport’
  3. 2-Sided: ON
  4. Diffuse Color: Bitmap: money label texture here
Material editor in 3ds max

Step 12 Adjusting UVW Mapping of the Label

Now we can see the label texture in the viewport but there are some problems. The text is squeezed and repeated on each side. Let’s fix those issues with the help of a UVW Map modifier.
  • Add UVW Map modifier ( Make a selection > Modify panel > Modifier List > Object-Space Modifiers > UVW Map )
    • Mapping: Cylindrical
    • Alignment: Fit
    • Activate Gizmo level in UVW Map modifier and rotate the gizmo 180 degrees
Rotating UVW mapping gizmo

Step 13 Render a Money Picture

It’s time to render another test image to make sure texturing is good.
money image

Step 14 Increase the Realism by Deformations

At the moment the geometry of money pack looks too perfect ( common problem of many 3d renders ). Let’s deform it a little to make it more believable. Select the 3d money and add Wave modifier to it ( Make a selection > Modify panel > Modifier List > Object-Space Modifiers > Wave ). Apply the following parameters to the Wave modifier:
  • Amplitude 1: 0,5
  • Amplitude 2: 0,5
  • Wave Length: 15,2
  • Activate Gizmo level in the Wave modifier. Rotate and move the gizmo to get the result in picture below.
Using wave modifier

Step 15 Deform the 3D Money Pack Even More

Let’s add yet another modifier to the 3d money pack. Add FFD 3x3x3 modifier to it ( Modify panel > Modifier List > Object-Space Modifiers > FFD 3x3x3 ). Activate the Control Points sub-object level in the FFD 3x3x3 modifier and move the control points in the front viewport according to the picture below.
Using FFD3x3x3 modifier
Render the image to see the result. The effect of FFD 3x3x3 modifier is subtle, but still important step of the process.
money picture

Step 16 Render Digital Money

Now the $10,000 money pack is complete. Let’s make a proper render:
  1. Create a big white Plane under the 3d money pack ( Create panel > Geometry > Standard Primitives > Plane )
  2. Create a Skylight ( Create panel > Lights > Standard > Skylight )
  3. Change the SkyColor to pure white ( Make a selection > Modify panel )
  4. Activate Light Tracer ( Menu > Rendering > Light Tracer… ) and apply the following settings:
Global illumination settings in 3d max
Render the money image and this is what you get:
money image

Step 17 Create Million Dollars

Now we have $10,000 and next we’re going to turn it into a million dollars.
  • Select the money object, add Edit Poly modifier to it, and use the ‘Attach’ function to attach the money object to the label object.
  • Make a 99 copies of the money pack. You can clone an object by moving it while pressing shift in keyboard.
  • Place the million dollars according to picture below. Avoid overlapping. Make sure to rotate half of the money about 180 degrees. We want to final money pile to be as random as possible.
  • Create RBCollection ( Create panel > Helpers > Reactor > RBCollection ) and add all the money packs and the plane object to it. ( This is just a helper object that tells which objects are included in physics simulation as rigid bodies. )
Adding rigid bodies

Step 18 Make Time for Simulation

Go to Time Configuration and increase the animation length to 300.
Increasing animation length in 3d studio max

Step 19 Define Physical Properties

Next step is to define some physical properties for the 3d money objects and make the simulation.
  • Choose Havok 3 as reactor solver ( Utilities Panel > Reactor > About )
  • Set Col. Tolerance to 0,05. ( Utilities Panel > Reactor > Havok 3 World )
Reactor settings
In Properties section you can define physical properties of your objects. First you select object(s) and then you define the properties. It’s like the Modify panel.
  • Select the plane and turn Unyielding on (Utilities Panel > Reactor > Properties)
  • Select all the money packs and apply the following properties (Utilities Panel > Reactor > Properties)
Defining properties of rigid bodies

Step 20 Calculate the Simulation and Render Million Dollars

Save your scene. Change the end time of the simulation to 300 and click ‘Create Animation’ to calculate the simulation (Utilities Panel > Reactor > Preview & Animation)! After the calculation is done there are only two things left to do:
  • Choose the frame you want to render
  • There is most probably some overlapping between objects, so fix that by moving the objects.
  • Render the million dollars and your are done!
million dollars render
That’s it for today! Happy rendering!

Sunday, 16 July 2017

BOKEH EFFECT IN 3DS MAX

In this beginner’s tutorial we’re going to create a bokeh effect in 3ds Max. The term bokeh is familiar from photography. When depth of field is shallow, part of the photo is blurred. Bokeh refers to that blur or the quality of it. There are a few different methods of creating shallow depth of field in 3ds Max, but this time we concentrate on the ‘Depth of Field / Bokeh’ camera shader which is a new feature in 3ds Max 2011. The Bokeh shader gives us nice tools to control the quality and the look of the out of focus areas.

Step 1 Mental Ray Renderer

We’re going to render the bokeh effect with Mental Ray. By default 3ds Max uses the Scanline renderer so we have to change that. Change the renderer to Mental Ray ( Rendering > Render Setup… > Common tab > Assign Renderer > Production > mental ray Renderer ).

Step 2 The Background

We’re going to create a simple 3d scene and finally add the bokeh effect to it. If you are just interested about the bokeh effect itself, go ahead and skip to step 13.
We’re going to create a simple scene with some text in it but first we create a background. Create a Plane ( Create panel > Geometry > Standard Primitives > Plane ) in the front viewport . Modify the Plane ( Make a selection > Modify panel ) according to the following parameters:
  • Length: 200
  • Width: 300
  • length Segs: 1
  • Width Segs: 1
Plane object

Step 3 The Material for the Background Plane

Open Material Editor ( Press ‘m’ in keyboard ) and create the material for the plane:
  1. Click “Get Material” button and select ( doubleclick ) ‘Arch & Design (mi)’ from the list ( Materials > mental ray > Arch & Design ).
  2. Select the plane and assign the material to it.
  3. Color: dark gray ( RGB 0,16 0,16 0,16 ).
  4. Roughness: 0,2 ( smoothens the highlights )
  5. Reflectivity: 0 ( perfectly matte surface )
Matte material settings

Step 4 Text

Create a Text shape ( Create panel > Shapes > Splines > Text ) in the front viewport . Modify the text ( Make a selection > Modify panel ) according to the following parameters:
  • Interpolation
    • Steps: 14 ( the default value is probably enough is you do only a low resolution render )
  • Parameters
    • Font: Century Gothic
    • Alignment: Center
    • Size: 60
    • Text: bokeh effect
Feel free to select different font or write something different. I chose Century Gothic because those round shapes are good at catching highlights.
Text shape in 3ds Max

Step 5 3D Text

At this point the text is just a shape and can’t even be seen in renderings. Let’s turn it to a 3d surface. Add Bevel modifier to the text ( Make a selection > Modify panel > Modifier List > Object-Space Modifiers > Bevel ). Apply the following parameters ( Make a selection > Modify panel ) to the Bevel modifier:
  • Parameters
    • Surface
      • Curved Sides: YES
      • Segments: 10 ( 3 is probably enough if you do only a low resolution render )
      • Smooth Across Levels: YES
  • Bevel Values
    • Level 1
      • Height: 4
    • Level 2
      • Height: 1,1
      • Outline: -0,6
3d text

Step 6 Material for the Text

Open Material Editor ( Press ‘m’ in keyboard ) and create the material for the text:
  1. Click “Get Material” button and select ( doubleclick ) ‘Arch & Design (mi)’ from the list ( Materials > mental ray > Arch & Design ).
  2. Select the text and assign the material to it.
  3. Color: beige/brown ( RGB 0,734 0,655 0,5 ).
  4. Glossiness: 0,7
  5. Metal material: YES
Settings for a shiny arch & design material

Step 7 Prepare the Scene for Rendering

Let’s prepare the scene for rendering:
  • Place the text into the center of the plane like in picture below.
  • Create a Target camera ( Create panel > Cameras > Target ) in the top viewport.
  • Right-click on the Perspective view and press ‘c’ in the keyboard to change it to the Camera view.
Rendering text in 3ds Max

Step 8 First Test Render

Now is a good time to render the scene for the first time so hit render ( Main toolbar > Render Production ) and you should see something like the picture below.
default render of text
This is our first render so obviously there are some problems:
  • First of all the image is boring, there is nothing interesting
  • There are some rough edges because of low sampling values
Let’s adjust the sampling settings to get a more polished render. Go to the render setup and increase antialiasing quality by increasing Mental Ray’s sampling values ( Rendering > Render setup… > Renderer > Sampling Quality ):
  • Samples per pixel
    • Minimum: 4
    • Maximum: 64
  • Filter
    • Type: Mitchell ( For most scenes the Mitchell filter gives the best results. )
Now the aliasing issues are fixed and it’s time to illuminate the text. By the way, if rendering time is an issue you could use the default sampling values for now and use these high quality settings only in the final rendering.

Step 9 Illumination

Create Mental Ray area omni ( Create panel > Lights > Standard > mr Area Omni ) in the front viewport and apply the following parameters to it ( Make a selection > Modify panel ):
  • Intensity/Color/Attenuation
    • Multiplier: 1,5 ( the intensity of the light )
Place the omni light according to the picture below.
Mental Ray area omni placement
When you render the scene you should get something like the picture below. Move the light if necessary.
illuminated with one omni light
The illumination is improved but the text is too dark and therefore merges with the background. Let’s address these issues with soft shadows and glare. Modify the omni light ( Make a selection > Modify panel ) to get softer shadows:
  • Area Light Parameters
    • Radius: 10
Apply Glare Camera Shader ( Rendering > Render Setup > Renderer > Camera Effects > Camera Shaders > Output > Glare ) Just turn the output shader on, the glare shader should be selected by default. Open Material Editor ( Press ‘m’ in keyboard ) and drag and drop the Glare shader from Camera Shaders to an empty material slot in Material Editor ( make sure to select ‘instance’ when asked ). Make the following adjustments to the Glare shader:
  • Quality: 4
  • Spread: 6
Render the scene the see the effect of these changes. Now shadows are softer and the text is brighter and has a nice glow.
Effect of mr area omni and glare shader

Step 10 Creating Particles

At the moment our scene is really flat so there is no point in adding a bokeh effect just yet. First we’ll create something that will be out of focus in the final rendering. Let’s add some sparkles to the scene. Create a super spray ( Create panel > Geometry > Particle Systems > Super Spray ) in the top viewport and apply ( Make a selection > Modify panel ) the following parameters to it:
  • Particle Generation
    • Particle Quantity
      • Use Total: 1000
    • Particle Motion
      • Speed: 4
    • Particle Timing:
      • Emit Start: -500
      • Emit Stop: 0
      • Life: 500
    • Particle Size
      • Size: 0,5
  • Particle Type
    • Standard Particles: Sphere

Step 11 Path for the Particles

Next we’re going to create a spline and force the particles to travel along it. Create the spline:
  • Activate the Line tool ( Create panel > Shapes > Splines > Line ) and create a line with 4 vertices in the top viewport. The first vertex should be farthest from the camera and the last vertex should be closest to the camera.
  • Select the spline, go to the modify panel, and set ‘Steps’ to 40 ( Interpolation > Steps ).
  • Activate Vertex sub-object level.
  • Select all four vertices, right click on them, and select ‘Bezier’ from the menu.
  • Move the vertices and adjust the bezier handles to create a spline like in the picture below.( For the sake of this tutorial it’s not required to create exactly the same kind of line. However, to be able see
    the effect of a bokeh shader, at least some part of the spline should be close to the camera.
     )
  • Place the super spray to the starting point of the line.
Spline in 3ds Max
Create a path follow object ( Create panel > Space Warps > Forces > Path Follow ), go to the modify panel, and apply the following parameters to it:
  • Current Path: Click ‘Pick Shape Object’ and select the spline we just created
  • Motion Timing
    • Start Frame: -500
    • Travel Time: 500
    • Variation: 20 ( Some variation to the travel time )
Bind the super spray to the path follow object:
  1. Activate ‘Bind to Space Warp’ ( Main toolbar > Bind to Space Warp )
  2. Click and hold on top of the super spray
  3. Release over path follow object
Particles should immediately follow the path like in the picture below.
Binding to space warp
Tip. If you’d like the particles to stray away from the spline, try increasing the particle speed in super spray and/or adjusting Particle Motion settings in the path follow object.

Step 12 Material for the Particles

Open Material Editor ( Press ‘m’ in keyboard ) and create the material for the sparkles:
  1. Click “Get Material” button and select ( doubleclick ) ‘Arch & Design (mi)’ from the list.
  2. Select the super spray and assign the material to it.
  3. Turn self illumination on
  4. Orange (RGB 0,996 0,737 0,459)
  5. Luminance: 2
Glowing material with Mental Ray
Render the scene the see the particles. The glow is really strong but wait till you see it with the Bokeh effect.
Glowing sparkles

Step 13 The Bokeh Effect

Apply ‘Depth of Field / Bokeh’ Camera Shader ( Rendering > Render Setup > Renderer > Camera Effects > Camera Shaders > Lens > Depth of Field / Bokeh ). Open Material Editor ( Press ‘m’ in keyboard ) and drag and drop the bokeh shader from Camera Shaders to an empty material slot in Material Editor ( make sure to select ‘instance’ when asked ). Make the following adjustments to the Bokeh shader:
  • Focus Plane: The distance from the camera to the text ( 301 in my case ). The easiest way to measure the distance is to align the camera target with the text and check the camera target distance from the camera parameters ( Select the camera > Modify panel > Parameters > Target Distance ). Focus plane is the area of the scene that’ll appear sharp in the rendering.
  • Radius of Confusion: 2 ( The amount of blurriness )
  • Samples: 32 ( The quality of the blur. ) This value has a dramatic effect to the rendering time. If the rendering takes too long, decrease this value. I rendered my image with 256 samples to get silky smooth noise free bokeh. The downside was the 7h rendering time with my quad core 2,33GHz Q8200.
Depth of Field / Bokeh settings
Now we’re ready to render the final image with the bokeh effect. I made some adjustments in Photoshop as well:
  • Brightness: +25
  • Contrast: +40
Bokeh effect in 3ds Max
Let’s continue in the discussion. Patience with the rendering!