AR-media TUTORIALS IMPROVING REALISM AMBIENT OCCLUSION. (June, 2011)

Similar documents
Ambient Occlusion Pass

Introduction to Digital Modelling and Animation in Design week 4 Textures

Textures and UV Mapping in Blender

What is the Deal with Color?

Caustics - Mental Ray

AR-media TUTORIALS LINKED MARKERS. (November, 2011)

Chapter 4- Blender Render Engines

Visualization Insider A Little Background Information

AR-media TUTORIALS MULTIMEDIA VIDEO OBJECTS. (June, 2011)

How to correctly utilize a linear workflow in 3ds Max, Various Renderers and Various Compositing Applications

Texture Mapping. Images from 3D Creative Magazine

Submerge Camera Shader

Dissolving Models with Particle Flow and Animated Opacity Map

Interior space in daylight Elsevier Inc. All rights reserved.

There are many kinds of surface shaders, from those that affect basic surface color, to ones that apply bitmap textures and displacement.

AR-media TUTORIALS LAYERS MANAGEMENT. (November, 2011)

Method I. 3ds max to zbrush

AR-media TUTORIALS REAL-TIME SHADOWS. (November, 2011)

Rock Tutorial: Creating A Rock Like Seen In Gears Of War With A Focus On Normal

diffuse diffuse reflection refraction diffuse mapping diffuse reflection reflection filter mapping mapping reflection

Quick Start Tutorial

O Hailey: Chapter 3 Bonus Materials

How to Rescue a Deleted File Using the Free Undelete 360 Program

Materials in Kerkythea ~ a beginners guide

UV Mapping to avoid texture flaws and enable proper shading

Shadows in the graphics pipeline

Max scene used to generate the image from the second pdf in this tutorial.

Lighting Techniques 1

CREATING AND USING NORMAL MAPS - A Tutorial

AR-media Plugin v2.3. QUICK START GUIDE (September, 2013)

AV Using Autodesk 3ds Max Design, Autodesk Revit, and iray to Render Compelling Photographic Scenes

Low Poly Game Plants


03. 3ds Max Design & Mental Ray

Chapter 23- UV Texture Mapping

Tangents. In this tutorial we are going to take a look at how tangents can affect an animation.

Shadows. COMP 575/770 Spring 2013

UDK Basics Textures and Material Setup

Modeling Level Design

Advanced Distant Light for DAZ Studio

MAYA; AN INTRODUCTION TO MAYA; EndOfLine.info;

Hemlock Folly v2 Notes

Point based global illumination is now a standard tool for film quality renderers. Since it started out as a real time technique it is only natural

ValuePRO Tutorial Internet Explorer 8 Configuration

AR-media Plugin v2.3. for Nemetschek Scia Engineer. INSTALLATION & USER GUIDE (February, 2013)

ENGL 323: Writing for New Media Repurposing Content for the Web Part Two

: CASE STUDY: USING MAYA AND MENTAL RAY FOR PHOTOREALISTIC INTERIOR LIGHTING

Caustics - Mental Ray

Extrude. Taper. STEP 04: Ctrl +V _ select Copy from the clone window _ name the copy: Slabs Mesh _ click OK

RIS shading Series #2 Meet The Plugins

Guide Contents Introduction Useful Information Navigating the Scene Hotkeys Placing and Manipulating Objects The Builder Cube Builder Cube Edit

ZBrush To Softimage XSI 16-Bit Displacement Guide

Soft shadows. Steve Marschner Cornell University CS 569 Spring 2008, 21 February

V-RAY MATERIAL SETTINGS

THEA RENDER ADAPTIVE BSD ENGINE

Enabling immersive gaming experiences Intro to Ray Tracing

Customizing DAZ Studio

TUTORIAL 7: Global Illumination & Ambient Occlusion

Lesson 03: We will add water and will set the placing conditions for the material. WorldBuilder 3.5. for. About Digital Element Tutorials:

3D Space is one of the most rewarding areas

Mia Round Corners Node

Mastering Autodesk 3ds Max 2013

LEVEL 1 ANIMATION ACADEMY2010

Tutorial 15: Publish web scenes

3ds Max certification prep

Assignment 6: Ray Tracing

Making parchments and parchment scrolls

MODELING EYES ESTIMATED TIME REQUIRED

Advanced Maya Texturing and Lighting

SNOWFLAKES PHOTO BORDER - PHOTOSHOP CS6 / CC

EchoSub v1.2 EchoStyle

03 RENDERING PART TWO

Clean & Speed Up Windows with AWO

As we said Procedural Textures are not images but textures that Blender creates automatically. They are good to use as a foundation to start with.

Shadow Casting in World Builder. A step to step tutorial on how to reach decent results on the creation of shadows

CS125 : Introduction to Computer Science. Lecture Notes #38 and #39 Quicksort. c 2005, 2003, 2002, 2000 Jason Zych

CleanMyPC User Guide

XP: Backup Your Important Files for Safety

Creative Efficiency Research: MODO 801 vs. Maya From CAD file to finished rendering: How MODO stacks up in a real-world workflow situation

STARTING COMPOSITING PROJECT

critical theory Computer Science

DAZ Page 1. DAZ3D to Unity (Objects and Clothing)

Appendix A Design. User-Friendly Web Pages

Texturing laying out Uv's part I - Levitateme

DIRECTV Message Board

3DS MAX to MARVELOUS DESIGNER WORKFLOW

Visual cues to 3D geometry. Light Reflection and Advanced Shading. Shading. Recognizing materials. size (perspective) occlusion shading

COS 116 The Computational Universe Laboratory 10: Computer Graphics

An Approach to Content Creation for Trainz

Property of: Entrada Interactive. PBR Workflow. Working within a PBR-based environment

Iray for Cinema 4D Release Version 2.0 New Features Improved MDL Material Browser Stacking of MDL Material Layers

Dominic Filion, Senior Engineer Blizzard Entertainment. Rob McNaughton, Lead Technical Artist Blizzard Entertainment

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

Autodesk Fusion 360: Render. Overview

Advanced Maya e Texturing. and Lighting. Second Edition WILEY PUBLISHING, INC.

Turn your movie file into the homework folder on the server called Lights, Camera, Action.

Rendering Engines - Specific tools may depend on "Rendering Engine"

Burning Laser. In this tutorial we are going to use particle flow to create a laser beam that shoots off sparks and leaves a burn mark on a surface!

7 Tables. Screen ruling

Enhancing Traditional Rasterization Graphics with Ray Tracing. March 2015

Transcription:

AR-media TUTORIALS IMPROVING REALISM AMBIENT OCCLUSION (June, 2011)

Copyright Copyright 2008/2011 Inglobe Technologies S.r.l. All rights reserved. No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language or computer language, in any form or by any means, electronic, mechanical, magnetic, optical, chemical, manual or otherwise, without the prior written permission of Inglobe Technologies S.r.l.

INTRODUCTION TUTORIAL - IMPROVING REALISM AMBIENT OCCLUSION This tutorial will show you how to get a nice Ambient Occlusion effect with the plugin, this will add a lot of realism to your Augmented Reality scenes. IMPORTANT: be sure to read the Improving Realism The Basics before diving in the following example, the guide contains important information that will teach you how to get the best from your tools and also how to avoid common problems that you may encounter. EXAMPLE: Ambient Occlusion In this example we ll show how to fake Ambient Occlusion effect using both the LightTracer and the mental ray engine. We ll use a model of the Aphrodite of Milos statue, usually statues and sculptures are very nice examples to show Ambient Occlusion for. The statue s material is a simple white color with a little reflection map applied to improve realism. Here s an image showing how the final result will look like NOTE: you can employ the same technique to fake lighting for more general purposes: as you ll realize throughout the tutorial, instead of just the Ambient Occlusion information your textures can store every kind of shadows as well. LightTracer Step 1: setting up the scene Load the model of the statue into 3dsMax (you can search for any statue model on the Internet)

Open the Material Editor and select an empty slot. Be sure that the type of the material is Standard, then in the Shader Basic Parameters rollout choose an almost white diffuse color (240, 255, 255) and a pure white specular color. Set the Specular Level to 50, Glossiness to 80 and Soften to 0.1. Scroll down to the Maps rollout and click the button near the Reflection slot to add a sky image: in the Material/Map Browser window select Bitmap and then be sure to choose Environ and Spherical Environment for the Mapping parameter); go back to the material s maps and set the Reflection s Amount value to 15, this will add a lite reflection effect. Try to render the scene now, you d get something like this

As you can see, since there are no lights in the scene, Max uses a default light that helps us to perceive the depth of the model, but we can improve visual appearance by means of Ambient Occlusion (AO from now on). Let s add AO to the scene. Step 2: adding Ambient Occlusion One simple way to add AO in our scene is provided by the LightTracer module that comes with 3ds Max. So, create a simple SkyLight light and place it anywhere around the statue

Now open the Rendering menu and click the Render Setup item, in the window that will open click the Advanced Lighting tab, in the Select Advanced Lighting rollout be sure to select Light Tracer and to check the Active checkbox. Finally set the Global Multiplier to 0.85 in the Parameters rollout as shown here

When you get comfortable with Light Tracer, you can try different settings to improve the overall quality of your renderings and also to improve quality of the textures you ll create by means of Render To Texture command. Try to render the scene again, you should get something like this

As you can see the image looks more natural and you can see the AO effect very clearly in the upper part of the vest, let s compare both images more closely Later on we will compare also how the two scenes looks when rendered by the plugin. Now let s go on by preparing the scene to be used with the plugin without losing the AO effect. Step 3: Render To Texture If we try to view the scene with the plugin we ll get a very poor result, like shown below

Actually, the AO effect is completely missing, the only shading information we can see is the one that the plugin will compute by means of a default light (much like the way 3ds Max behaves when no light is added to the scene). In order to get the desired effect we ll use the Render To Texture command to fake illumination, basically we ll bake only the LightingMap so we ll be able to keep each map independent and eventually we ll be able to modify it later. The procedure will follow the same steps described in detail in the Improving Realism The Basics tutorial. Click the Rendering menu and then the Render To Texture menu item. In the Output rollout select a path local to your project/scene (we suggest to create a directory called baked to distinguish original textures from those created by Render To Texture). Then scroll down to the Objects To Bake rollout and select the statue model in the viewport, it will be added to the list of objects to treat with the command. Leave every setting as is and scroll down to the Baked Material rollout, be sure that it looks like this Please note that these settings apply to any case where the original material is a Standard Material, if using other advanced materials (mental ray, V-Ray, ) then you should refer to the Improving Realism The Basics tutorial for details. Now go back to the Output rollout, click the Add button, in the window that will show up select the LightingMap element and click Add Elements. In this way we tell 3ds Max that we re interested in creating a texture that will store the lighting information of our object and hence also the AO effect. Going back to

the Render To Texture window, the Output rollout will be filled with some values related to the texture element we have just chosen as shown here As you can see, the element has been added to the Output table and also a default file name has been provided in the File Name and Type slot, but while you can leave the base name as is, it is strongly advisable to change the file type, so click the button on the right of the File Name and Type slot and select PNG (or JPG) in the window that will open. In order to proceed we need to choose how the texture element will be used, this is done via the Target Map Slot entry, this value will set the map channel that will be used for the newly created material, so let s click the dropdown list and select Self-Illumination (after all we re faking illumination in this example). As a last step let s choose an appropriate size for the texture that will be created, since the model is quite complex we can try with a size as big as 2048x2048, but in many cases you can really use smaller sizes and still get very good results. Now the rollout should look like this

Note that the target slot has been set and the desired size has been chosen. Just click Render at the bottom of the Render To Texture window and the process will start. Basically two steps will be performed: the UV flattening and the rendering of the texture; the first step can be quite long depending on the complexity of geometry while the second will depend on the rendering engine s setup. At the end of the process you ll be show the rendered texture

Apparently it may make no sense to humans, but it makes a lot of sense to real-time rendering engines. Just view the model with the plugin now

As you can see the result has improved a lot. Let s compare the plugin s output before and after the Render To Texture command Now let s take a little time to show what has happened to our model s materials. Open the Material Editor and use the eyedropper to get the statue s material from the scene: you ll notice that now the statue s material is a Shell material whose Original Material slot is occupied by the original statue s material and the Baked Material slot is occupied by the material that has been created by the Render To Texture command. Also note that the original material is still used when you do a render while the baked material is used both in your viewports and by the plugin (you should not change these settings otherwise you may make the Render To Texture useless from the plugin standpoint). The Shell Material Parameters rollout should look like this

Now just click the baked material slot and have a look at its parameters, they are exactly the same as the original material s but if you scroll down to the Maps rollout, you ll notice the newly created texture in the Self-Illumination slot (remember that we chose the Self-Illumination target slot for the LightingMap element). Also notice that the Reflection map is still there, eventually you can now change and modify each map as you wish, in particular you could open the baked texture image and modify it for example to remove noise, to soften shadows, to change resolution and so on. One last things worth noting is that the statue s model has been added an Automatic Flatten UVs modifier, you should not remove it from the stack otherwise the Render To Texture effect will appear weird. NOTE: you can see that we left the SkyLight in the scene, that s fine in our example where we have just one object with a self illumination map because of which the light source will be ignored, but in general you may need to hide the light you used to do Render To Texture (for example if you follow the first strategy, i.e. if you are baking the CompleteMap element to the Diffuse channel). mental ray Step 1: setting up the scene Now let s do the same we ve just done but this time we will use mental ray engine. Start with the statue model with the same material we used earlier (note that in this example we will employ mental ray only to compute the Ambient Occlusion map not to render advanced materials, we ll do it later). Assign the mental ray engine as the current renderer (by the way, if you did not reset 3ds Max, first of all you must open the Render Setup window from the Rendering menu and remove any lighting plugin in the Advanced Lighting tab). Click the Rendering menu and then the Environment item and in the background Color switch select a pure white. Be sure that your model has the same original material as set in previous example. Step 2: adding Ambient Occlusion (MR) The process to create an AO effect with mental ray is quite different from what we ve seen earlier. Even though you can follow the same idea discussed earlier by creating a proper lighting setup, mental ray provides a shader that computes the AO of an object without the need to create a light in the scene, so we ll now see how to add AO with this approach. Open the Material Editor and select an empty slot, choose the mental ray material by selecting mental ray in the Material/Map Browser window. In the Material Shaders rollout click the button near the Surface checkbox in the Basic Shaders section: in the Material/Map Browser select Ambient/Reflective Occlusion. The Ambient/Reflective Occlusion Parameters rollout will be displayed in the Material Editor (we ll not describe every parameter in detail here because this goes beyond the scope of this guide, we ll give you hints about how to set some of them in order to get acceptable results that probably can be improved a lot if you spend some time adjusting those parameters). The most important parameters to take care of are the Samples number (the higher the better quality), we chose 64 for our example, Spread and Max distance (for the meaning of these parameters refer to the mental ray guide), the actual values to be set for these parameters depend on the scene you are using, in our case we set 2.0 and 200.0 respectively. We won t apply this material to any object, but we ll tell 3ds Max to temporary override any material in the scene with this one only for the purpose of computing AO maps. So let s open the Render Setup window, go to the Processing tab and in the Material Override section check the Enable checkbox, then drag the mental ray material with the AO shader into the Material slot near the Enable checkbox. By doing so, you can avoid to assign the AO material to your objects, it will

be applied temporary to them if you start a rendering and also if you use the Render To Texture command. So if everything has been done correctly, just click the Render button to see a preview of the AO map. You should get something like this If your scene is too white, try to increase the Max distance value by 10 or more units and Spread by 1 unit, and so on until you get a nice effect. NOTE: remember to disable the Material Override setting once the process is completed, otherwise any subsequent rendering will use the AO shader and not the original materials you set. Step 3: Render To Texture Since we re using MentalRay to generate only the AO map (the base material still being a Standard Material), we can employ a different technique when doing Render To Texture: instead of creating a Shell Material and a copy of the original material we can: - Choose to store the AO map to disk - Manually assign the AO map to the Self-Illumination slot of our model s original material Of course, nothing prevents you to use the standard approach, but this is by far the quickest and simplest. In this example we ll also employ a different approach for UV flattening to show you that you can get better results if you do not rely on the automatic algorithm, for this reason let s add the Unwrap UVW modifier to the statue, in the modifier Parameters rollout set the Map Channel to 3 and the click the Edit button, the Edit UVWs window will open

As you can see, there is a lot of wasted space and it is almost impossible to understand the topology of our model 1 (this is what the automatic flattening Render To Texture would produce). So, select all the faces in the Edit UVWs window, click the Mapping menu and then the Normal Mapping item, you should get something like this 1 Actually if you try to go on with the Render To Texture command using this UVs layout (that is the same that is produced by the automatic algorithm), the final result will have artifacts, for this reason we are using the approach that is being described.

The flattening looks much more natural now. With this new layout we can go back to the Render To Texture window, be sure that the whole statue is selected and scroll down to the Mapping Coordinates section in the Objects to Bake rollout. This time, since we have manually flattened UVs, we have to choose the Use Existing Channel option and set the Channel to 3. Go on as usual by clicking Add and select Ambient Occlusion (MR) as texture element as shown below Set a proper texture size, we chose 2048x2048 but a smaller size could be sufficient. Do not change the Selected Element Unique Settings. Scroll down to the Baked Objects rollout and check the Render to Files Only option: by doing so the AO map will be stored to disk and no new material will be created for our model (remember that we don t want to create a new material but we want to just create the AO map that will manually assign to our original material).

Click Render button in the Render To Texture window, we ll get an AO map like this IMPORTANT: remember that, as described in the Improving Realism The Basics tutorial, we have to face with an annoying issue when we use Render To Texture with mental ray, i.e. when storing textures created by the Render To Texture command and mental ray engine, 3ds Max writes them to disk in black & white (even though the preview will show you the correct grey-scale or color image); this means that if you do not manually save the baked textures they will be missing when you run the plugin and you may get totally black objects in the worst case. That said, in order to save the correct grey-scale generated AO map, click the little disk icon and then you can choose the same file name that 3ds Max used to store that map (it is safe to do so because if you try to open the image automatically stored at the end of the Render To Texture process you ll find out that it is just black & white, so it will be useless). Of course, we can also improve the quality of the AO map: for example, we could remove some artifacts by means of any image editing software or we could use a better flattening strategy for the Unwrap UVWs modifier (see below). Now we need to assign this map to the Self-Illumination slot of our model s material, so open the Material Editor and select the statue s material, scroll down to the Maps rollout and click the Self-Illumination slot, choose Bitmap from the Materials/Maps Browser and finally select the AO map created/saved earlier. In

the Material Editor be sure to select the proper Map Channel for this AO map, since we chose to apply the Unwarp UVWs modifier to channel 3, we must also use that channel for the AO map. You can view the model with the plugin now and you should get a nice lit model like this NOTE: as we told, instead of saving the resulting AO map to disk and then adding it manually to your model s material, you can follow the usual Render To Texture procedure even for this mental ray case, i.e. you can still use the Duplicate Source to Baked option because, in this example, the base material is a Standard Material like in the example we have shown; later on we ll show how to do Render To Texture with pure mental ray materials. Troubleshooting Avoiding visual artifacts: depending on the complexity of the model s geometry and the rendering engine you are using, you may get some visual artifacts like those shown here

This happens if you rely only on the automatic flattening of UVs instead of manually applying an Unwrap UVWs modifier as we did: the problem is that the automatic flattening of UV doesn t produce an acceptable result because, as you can see from the created texture below, there is a lot of wasted space in the rendered image and the actual used portions of the texture are too little and will create weird results on their borders To overcome this problem, we can help 3ds Max by adding an Unwrap UVW modifier to our model (note that if you ve already done Render To Texture you could need to remove what you ve done so far, so in the Render To Texture window, with the model selected, click the Clear Shell Materials button in the Baked Material rollout and then click the Clean Unwrappers button in the Mapping Coordinate section of the Objects to Bake rollout, this will reset your model to its original state). Improving the AO map: we can try to add more detail (and to remove some artifacts as well) to the AO map by using a more appropriate flattening strategy, for example you can go back to the Unwrap UVW modifier and click the + sign beside its name, select Face and scroll down until you can see the available mapping types, here you should try some of the available types and chose the one that gives you the best result, for

our statue model we chose the cylindrical type by clicking the Cylindrical button. The mapping gizmo will appear on the model, eventually move/scale it properly until you get a better coverage in the Edit UVWs window, here s what we ve got As you can see, there is even less wasted space in the generated texture than in our earlier approach, so given a specified size we have more detail if we employ the proper flattening strategy. The better flattening strategy depends on the actual geometry you must deal with, so you have to fine tune the UVs flattening if you want to get almost perfect (artifacts-free) maps, also take a little time to explore all the tools available in the Edit UVWs window instead of just relying solely on the mapping types available in the Unwrap UVs parameters. Suggestions When you deal with complex scenes, you may have some objects that actually occlude too much some other object, so that the latter s AO map may look too dark, in these cases you can either temporary hide the occluding objects (if this makes sense) and do the Render To Texture command or manually adjust the AO map image in an external editor until it looks as bright as you want. CONCLUSION This tutorial showed you how to use the Render To Texture technique to create Ambient Occlusion effects for your augmented reality scenes. Two techniques were employed: the first uses a SkyLight and the LigthTracer engine, the second leverage on the mental ray engine and shaders.