Showing posts with label Underwater Scene. Show all posts
Showing posts with label Underwater Scene. Show all posts

Wednesday, 12 July 2017

ABSTRACT BACKGROUND

In this tutorial we’re going to create an abstract background image in 3ds Max. It seems that bokeh backgrounds have been extremely popular during the last few years so we’re going to create one as well. There are many Photoshop tutorials available, but here I’m going to show you how to create bokeh background in 3ds Max. I think 3ds Max is perfect for creating abstract backgrounds because of it’s parametric nature. It’s really easy to change everything with parameters. I’m using 3ds Max 2011, but many older versions should work as well.

Step 1 Scanline Renderer

We’re going to render the bokeh effect with Scanline Renderer. If you are using mental ray renderer you have to change that ( Rendering > Render Setup… > Common tab > Assign Renderer > Production > Default Scanline Renderer ).

Step 2 Particle Cloud

Our abstract background will consist of two elements: particles and background. First, we’ll create the particles. I’m using Particle Cloud, but feel free to use Particle Flow if you want to. I think it’s just a little easier / faster to use Particle Cloud for our purpose here, because we don’t need any of those advanced features that Particle Flow has to offer. So let’s create a particle cloud in the front viewport ( Create panel > Geometry > Particle Systems > PCloud ). Select the particle cloud, go to the modify panel and apply the following settings:
  • Basic Parameters
    • Display Icon
      • Rad/len: 670
      • Width: 1200
      • Height: 900
    • Viewport Display
      • Mesh
  • Particle Generation
    • Particle Quantity
      • Use total: 500
    • Particle Timing ( We create all particles between frames -29 and 0 so that they are visible already at frame 0 )
      • Emit Start: -29
      • Emit Stop: 0
      • Display Until: 0
      • Life: 30
      • Variation: 0
    • Particle Size
      • Particle Size: 20
      • Variation: 100
      • Grow for: 0
      • Fade for: 0
    • Uniqueness
      • Seed: 704 ( Feel free to try different numbers here )
  • Particle Type
    • Standard Particles: Facing ( flat four sided polygons that will always face the camera )
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 a camera view. Position the camera target in to the middle of the particle cloud and the camera itself like in picture below.
Positioning the camera in 3ds Max 2011
Render your scene to make sure you get something like the picture below. I rendered with 700 x 438 px dimensions.
500 particles in the particle cloud

Step 3 The Particle Material

Next we’re going to create the material for the particles. This is the most complicated part of this tutorial, but don’t worry, nothing really hard here. Open Material Editor ( Press ‘m’ in keyboard ) and create the material for the particles:
  1. Select the Particle Cluod and assign the first standard material to it
  2. Face Map: YES ( map in material will be automatically applied to each face of the object )
  3. Diffuse: Light gray ( RGB 230, 230, 230) ( diffuse and ambient are locked by default so both will have this color )
  4. Opacity: 0
  5. Advanced Transparency: Type: Additive
Particle material's basic parameters
Apply an opacity map:
  1. Opacity Amount: 40 ( particle transparency )
  2. Opacity Map: Gradient Ramp ( Material/Map Browser > Maps > Standard > Gradient Ramp )
  3. Gradient Ramp Flags:Flag #1: Color: RGB 44, 44, 44 Position: 0Flag #2: Color: RGB 44, 44, 44 Position: 88Flag #3: Color: RGB 64, 64, 64 Position: 92
    Flag #4: Color: RGB 64, 64, 64 Position: 96
    Flag #5: Color: RGB 0, 0, 0 Position: 100
    Click on the color gradient to add a new flag. Right-click on a flag to modify or delete it. )
  4. Gradient Type: Radial
Gradient Ramp parameters
Let’s utilize Particle Age map to add some variation to the opacity of individual particles:
  1. In the Maps rollout, click on the ‘Gradient Ramp’ Map
  2. Click on the ‘Gradient Ramp’ again. ( Material/Map browser appears )
  3. Double-click on the ‘Particle Age’ map ( Maps > Standard > Particle Age )
  4. Select ‘Keep old map as sub-map?’ and click ‘OK’. ( Now we have Particle Age as opacity map and Gradient Ramp as a sub-map of Particle Age )
  5. Drag and drop the Gradient Ramp map from ‘Color #1 Map’ slot to ,Color #2 Map’ slot. Select ‘Copy’ when asked.
  6. Drag and drop the Gradient Ramp map from ‘Color #1 Map’ slot to ,Color #3 Map’ slot. Select ‘Copy’ when asked.
  7. Adjust the Gradient Ramp Flags in Color #2 slot:Flag #1: Color: RGB 66, 66, 66 Position: 0Flag #2: Color: RGB 66, 66, 66 Position: 88Flag #3: Color: RGB 96, 96, 96 Position: 92
    Flag #4: Color: RGB 96, 96, 96 Position: 96
    Flag #5: Color: RGB 0, 0, 0 Position: 100
    Click on the color gradient to add a new flag. Right-click on a flag to modify or delete it. )
  8. Adjust the Gradient Ramp Flags in Color #3 slot:Flag #1: Color: RGB 99, 99, 99 Position: 0Flag #2: Color: RGB 99, 99, 99 Position: 88Flag #3: Color: RGB 144, 144, 144 Position: 92
    Flag #4: Color: RGB 144, 144, 144 Position: 96
    Flag #5: Color: RGB 0, 0, 0 Position: 100
    Click on the color gradient to add a new flag. Right-click on a flag to modify or delete it. )
Particle Age parameters
Now infant particles are darker / more transparent than particles that have some age. The effect of the Particle age map is not drastic but in my opinion necessary to get some variation to the opacity and brightness of individual particles. Render your scene to make sure it looks similar to picture below.
Bokeh particles for abstract background
Our abstract bokeh background doesn’t look like much yet.

Step 4 Abstract Background Material

The next step is to create the environment (background) map for our image. Open Material Editor ( Press ‘m’ in keyboard ) and create the environment map:
  1. Select the second material slot
  2. Click on ‘Get Material’ button and select Composite map from the Map list ( Material/Map Browser > Maps > Standard > Composite ). Make sure you select Composite map and not Composite material!
  3. Click ‘Add a new layer’ to add a second layer to the composite map
  4. Add Gradient Ramp map to the first layer of the Composite Map:Coordinates rolloutEnviron: SelectedMapping: Screen
    Angle: W: 90
    Gradient Ramp Parameters rollout
    Flag #1 Color: RGB 139, 84, 5 Position: 0
    Flag #2 Color: RGB 255, 229, 192 Position: 100
  5. Add Noise map to the second layer of the Composite Map:Noise Parameters rollout Noise Type: FractalLevels: 10
    Size: 20
    Color #1: RGB 100, 100, 100
    Color #2: RGB 255, 255, 255
  6. In the Composite Map, change the blending mode of the ‘Layer 2’ to ‘Color Burn’
Parameters for the environment map
Let’s apply the map to the environment:
  1. Open environment settings ( Rendering > Environment… )
  2. Drag and drop the environment map from the material editor slot to the Environment Map slot. Select ‘Instance’ when asked and click ‘OK’.
Render your scene to see how your abstract background looks.
Rendered abstract bokeh background
As you see the environment background brings a lot of life and color to the image. Feel free to change the color in the background map.

Step 5 Depth of Field

As a last thing, we’re going to make the image more interesting by adding real depth of field effect to it. Select the camera and go to the Modify Panel to apply the depth of field effect:
  • Parameters rollout
    • Multi-Pass Effect
      • Enable: YES ( Make sure ‘Depth of Field’ is selected in the drop down list )
  • Depth of Field Parameters
    • Focal Depth
      • Use Target Distance: YES ( particles near the camera target will appear sharp )
    • Sampling
      • Display Passes: YES
      • Use Original Location: YES
      • Total Passes: 100 ( try lower values if it takes a long time to render )
      • Sample Radius: 30
      • Sample Bias: 0,5
Render your image to see the difference.
Bokeh background with shallow depth of field
Finally, do some color correction in Photoshop if you like:
  • Brightness: 40
Abstract bokeh background

Thursday, 6 July 2017

3D UnderWater Scene

In this tutorial we’re going to create an underwater scene in 3ds Max. We’re going to create a deep blue sea with light rays and bubbles. Creating convincing underwater scene is a challenging task and I’m not even trying to create a physically accurate simulation. Rather I’m using my artistic freedom to neglect some real world rules to get the look and feel I’m going for.

Step 1 Mental Ray Renderer

We’re going to render our 3d underwater scene with the 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 Basic Geometry for the 3D Water

Create a plane ( Create panel > Geometry > Standard Primitives > Plane ) in the top viewport . Modify the plane ( Make a selection > Modify panel ) according to the following parameters :
  • Length: 1000
  • Width: 500
  • Length Segs: 200
  • Width Segs: 200
Plane object in the top viewport
We need a dense (80k faces) mesh because we’re going to deform it with the displace modifier. )

Step 3 Water Surface with the Displace Modifier

Add Displace modifier to the plane ( Make a selection > Modify panel > Modifier List > Object-Space Modifiers > Displace ) and apply the following parameters:
  • Displacement
    • Strength: 17
  • Image
    • Map: Noise
Open Material Editor ( Rendering > Material Editor > Compact Material Editor ). Drag and drop the Noise map from the Displace modifier into a material slot in Material Editor and select ‘instance’ when asked. Apply the following parameters to the Noise map:
  • Noise Parameters
    • Noise Type: Turbulence
    • Levels: 10
    • Size: 300
Displacement map settings and effect on the plane

Step 4 Water Material

Now the water geometry is complete so let’s apply a material to it. Open Material Editor ( Press M in keyboard ), click on the second material slot, and create the material:
  1. Click “Get Material” button and select ( doubleclick ) ‘Arch & Design (mi)’ from the list.
  2. Select the water plane and assign the material to it.
  3. Select template from the drop-down list: Water, Reflective Surface
  4. Transparency: 1,0
Mental Ray water material
In the material settings, go to the ‘Advanced Rendering Options’ rollout and set the following parameter:
  • Advanced Trasparency Options
    • Glass / Translucency treat objects as…: Thin-walled (can use single faces)
Finally we’re going to change the bump map settings to get smaller and steeper waves. In material settings, go the ‘Special Purpose Maps’, click on the Ocean shader, and apply the following parameters:
  • Largest: 100
  • Smallest: 1
  • Quantity: 20
  • Steepness: 5
Parameters of the Ocean shader

Step 5 The Environment for Underwater Scene

Since we have highly reflective and refractive material we desperately need effective environment as well. Without environment, the rendered water surface would just appear black. Next we’re going to cheat in 3ds Max. We’re going to create a highly unrealistic environment. However, it just happens to produce the kind of reflections and refractions I’m going for. So let’s create the environment. Go to the environment settings ( Rendering > Environment… ) and apply the following parameters:
  • Background
    • Use Map: YES
    • Environment Map: Gradient Ramp
Open Material Editor ( press M in keyboard ). Drag and drop the Gradient Ramp map from the background settings into a material slot in Material Editor and select ‘instance’ when asked. Apply the following parameters to the Gradient Ramp map:
  • Coordinates rollout
    • Mapping: Spherical Environment
  • Gradient Ramp Parameters rollout
    • Flag #1: Color: RGB 0, 16, 67 Position: 0
    • Flag #2: Color: RGB 189, 225, 240 Position: 100
    • delete the middle Flag by right-clicking and selecting ‘delete’ from the menu )
    • Noise
      • Amount: 1
      • Type: Fractal
      • Size: 2
      • Levels: 10
  • Output rollout
    • Output Amount: 3
Environment map parameters

Step 8 Prepare the 3D Underwater Scene for Rendering

Let’s prepare our underwater scene for the first rendering. 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. Create ‘mr Area Spot’ ( Create panel > Lights > Standard > mr Area Spot ) in the front viewport. Move the camera and spotlight around to get something like the picture below.
Camera and spotlight placement
Apply the following parameters to the area spotlight ( Make a selection > Modify panel ):
  • General Parameters
    • Shadows: OFF
  • Intensity/Color/Attenuation
    • Multiplier: 2
Now it’s a good time to make a test render to see how the water looks like.
Water test render
Some kind of watery effect but it doesn’t look much like an underwater scene yet. Let’s add Fog to make all the difference.

Step 9 Underwater Fog

Go to the Atmosphere settings ( Rendering > Environment… > Atmosphere ) and add the Fog:
  1. Click ‘Add…’ button, select ‘Fog’ from the list and click ‘OK’.
  2. Use Map: YES
  3. Environment Color Map: Gradient Ramp
  4. Open Material Editor ( Press M in keyboard ). Drag and drop the Gradient Ramp map from the Fog settings into a material slot in the Material Editor and select ‘instance’ when asked.
  5. Mapping: Screen
  6. Angle W: 90
  7. Flag #1: Color: RGB 0, 11, 45 Position: 0
  8. Flag #2: Color: RGB 70, 144, 255 Position: 100( delete the middle Flag by right-clicking and selecting ‘delete’ from the menu )
  9. Output Amount: 1,5
Settings for underwater fog
Before we render, let’s adjust environment ranges. Select the camera, go to the modify panel, and apply the following settings:
  • Parameters
    • Environment Ranges
      • Show: YES
      • Near Range: 200
      • Far Range: 810
Now we see the environment range in the viewport. It’s the area between beige and brown line. The fog will appear between these lines. By default the density of the fog is 0% at near range and 100% at far range. Adjust the values or camera position if necessary.
Scene with environmental ranges
Render the scene and you should get something like the picture below. Fog works well in underwater scenes. This time it serves two purposes. It fades the water edge to the background and creates the nice blue gradient color.
You could also try different camera angles to get different kind of water surface.
Basic 3d underwater scene

Step 10 Underwater Light Rays

And of course we’re going to create some light rays to enhance the mood of our underwater scene. Go back to the Atmosphere settings ( Rendering > Environment… > Atmosphere ) and add Volume light effect:
  1. Click ‘Add…’ button, select ‘Volume Light’ from the list and click ‘OK’.
  2. Click ‘Pick Light’ and click on the area spot we created earlier
  3. Density: 7
default volume light settings
If you are not familiar with volume lights, I suggest you render now to see how the effect looks by default (so far we’ve just increased the density a little). The next step is going to have a dramatic effect to the volume light. We’re going to use projector map to block most of the light and to use attenuation to fade the light to the background. Select the area spot, go to the modify panel and apply the following parameters:
  • Intensity/Color/Attenuation
    • Color: RGB 32, 137, 255
    • Far Attenuation
      • Use: YES ( Now you can see the attenuation ranges appearing as lens-shaped sections of the cone )
      • Start: 430 ( Sets the distance at which the light begins to fade out. )
      • End: 650 ( Sets the distance at which the light has faded to zero. )
  • Advanced Effects
      • Projector Map
      • Map: Noise
Open Material Editor ( Press M in keyboard ), drag and drop the Noise map from the projector map slot into a material slot in the Material Editor, and select ‘instance’ when asked. Apply the following parameters to the Noise map:
  • Coordinates
    • Source: Explicit Map Channel
  • Noise Parameters
    • Noise Type: Turbulence
    • Levels: 10
    • Size: 0,05
    • Low: 0,35 ( Decrease this if you need more rays and increase this if you need less rays. )
Light rays with projector map
Render your underwater scene to see the light rays.
3d underwater

Step 11 Underwater Bubbles

Our unrealistic environment might not be perfect for underwater bubbles but let’s see how they look anyway. Create a particle cloud in the left viewport ( Create panel > Geometry > Particle Systems > PCloud ). Select the particle cloud, go to the modify panel and apply the following settings:
  • Basic Parameters
    • Display Icon
      • Rad/len: 230
      • Width: 700
      • Height: 480
  • Particle Generation
    • Particle Quantity
      • Use total: 1000
    • Particle Timing
      • Emit Start: -10
    • Particle Size
      • Particle Size: 1,5
      • Variation: 100
      • Grow for: 0
      • Fade for: 0
  • Particle Type
    • Standard Particles: Sphere
Place the particle cloud so that it fills the view underwater. ( You can also change the size of the emitter if necessary. )
As a final thing we’re going to use a glass material for the bubbles. Press M in keyboard to open the Material editor, select a material slot, and create the material:
  1. Click ‘Get Material’ button and select ( doubleclick ) ‘Arch & Design (mi)’ from the list.
  2. Select the particle cloud and assign the material to it.
  3. Select template from the drop-down list: Glass (Solid Geometry).
Arch & Design glass material
Render the scene to see the bubbles. Some bubbles look ok while some look too bright. Furthermore, these bubbles are perfect spheres so they are not really realistic as underwater bubbles, but at least they are fast and easy to create!
3d underwater scene

Step 12 The Final Render of the 3D Underwater Scene

If you look closely you’ll see some jagged edges in the bubbles. 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. )
Beware, rendering time might be an issue with all these effects and sampling settings (about 1½h with quad core 2,33GHz Q8200). Render your scene to see the final image. I did some adjusting in Photoshop as well:
  • Contrast: +80
  • I removed a few overly bright bubbles from the lower left corner
Underwater scene
That’s it. Happy rendering!