Document not found! Please try again

CREATING THE 3D IMMERSIVE ENVIRONMENT

5 downloads 6409 Views 4MB Size Report
Creating a 3D immersive environment - Revised Fall 2007. Jean-Marc ... This tutorial introduces you to Maya's 3D Paint Effects allowing you to paint in 3D.
Creating a 3D immersive environment - Revised Fall 2007 Jean-Marc Gauthier. Created with the help of Miro Kirov. The following tutorial will take you step by step through the creation of a natural environment in Maya. You will also setup a character inside the environment and to add interactivity in Virtools. This tutorial introduces you to Maya’s 3D Paint Effects allowing you to paint in 3D. A few strokes can paint trees, grass, flowers. The paint strokes from your brush are converted into 3D objects inside a 3D space. Maya’s ability to convert 3D Paint Effects to polygonal objects is helpful to create content for interactive environments. This tutorial requires Maya 5.0 and up. You can control the strokes’ shape, color, density, while painting on the horizontal grid plane of the perspective view or directly on other 3D objects. Let’s grab a brush and start to paint trees and grass in 3D, let’s create the ground for your forest. 3.1 - Creating the ground Open a new scene in Maya. Go to the top menu, select, “File” > “New Scene”. Select the “Modeling” module in the box located on the left of the “Status Line”. Create a polygonal plane for the floor of your scene. Go to, “Create” > “Polygon Primitives” > “Plane”

Create a polygonal plane for the floor of your scene.] 3.2- Painting the trees A library of Paint Effects can be found in the “Visor” module. To open the “Visor” window Go to the top menu, select “Window” > “General Editor” > ”Visor”. Multiple folders with preset brushes are available. You can select a variety of paint effects inspired by natural forms by clicking on the folder, named “trees”.

You can select a variety of paint effects inspired by natural forms by clicking on the folder, named “trees”.] To resize your brush, Go to the top menu and click on “Paint Effects” > “Template Brush Settings”. The “Paint Effects Brush Settings” dialog window opens. Select the “Brush Profile”. Set the “Global Scale” slider = 2.0. Go to the “Visor” dialog window. Select “trees”, on the left side of the “Visor” window, click on the icon of the mel file called “birchBlowingLight.mel. Go to the Workspace, click and drag the mouse pointer a short distance near the Origin center in the perspective window. Maya creates randomly generated lush trees with a realistic look. Render the scene in order to see the final result.

Maya creates randomly generated lush trees with a realistic look. Render the scene in order to see the final result.]

3.3 - Painting tubes and grass Let’s paint some tubes Go to the “Visor” dialog window. Select “Oils”, on the left side of the “Visor” window, click on the icon in order to choose the oil of your choice. Select the tube that you created in green, go to the Attribute Editor. Select the paint effect tab, fore example, oilTextGreen1, go to Tubes, check Tube, > Creation > Change the parameters in order to create a mutant tube of your choice, Growth, check branches, Twigs.... Go to Branches > Change the parameters in order to create a mutant tube. Repeat the same steps for twigs, Leaves, Flowers and Buds.

Let’s paint some 3D grass Go to the “Visor” dialog window. Select “grass”, on the left side of the “Visor” window, click on the icon in order to choose the grass of your choice. Important note: since you will convert the content from your 3D painting into polygonal meshes, you have keep an eye on the number of polygons. The density of the brush strokes needs to be kept low. Let’s control the creation of your vegetation by tweaking parameters inside the “Attribute Editor”.

To tweak parameters for your brush stroke in the “Attribute Editor”: Select the brush stroke and press the “Control + A” keys. In the “Attribute Editor”, check “Sample density” and “Tube Segments” which are the main parameters. Two or three types of trees are needed for your scene in Maya. Once you import the trees in Virtools, you will clone them in order to create a whole forest.

or three types of trees are needed for your scene in Maya. Once you import the trees in Virtools, you will clone them in order to create a whole forest.”

50.000 polygons is a limit for the total number of polygons created inside a scene. To view the polygonal count: Go to the top menu, select “Display” > “Head Up Display” > “Poly Count”. Check the number of “Faces” rendered in the scene. 3.4 – Conversion of 3D models to polygonal meshes Let’s convert the Paint Effects to 3D objects made of polygonal meshes. To convert the 3D Paint Effect to polygonal meshes: Select one of the strokes from the “Outliner” window or from the perspective view. Choose “Modify” > “Convert” > “Paint Effects To Polygons”. The output from the conversion is a high-resolution model with a high polygonal count.

conversion of the 3D Paint Effect to polygonal meshes.] 3.5 - Reducing the number of polygons Let’s reduce the Paint Effects model by trimming the 3D model. Select the tree by components > Faces. Press ”Delete”. For example, if you created two trees you can delete one of them once you converted both trees to polygons. Pleae note that if you plan on rotating a tree the pivot point needs to be aligned with the center of the tree trunk. Select the move tool, press insert, select the “Move” tool. move the pivot point. Press “Insert” again to reverse to the default “Move” handles Let’s see how Maya can help you to reduce the polygonal count. Select the “Modeling” module in the box located on the left of the “Status Line”. To reduce the number of polygons for a tree: Select on of them and choose “Polygons” > “Reduce”. Click on the box located on the right of the word in order to open the “Polygon reduce Options” dialog window. Enter the percentage of reduction. Go to “Preserve”, check the following parameters, keep “Mesh Borders”, “UV borders”, “Hard Edges”. Click “Reduce”.

Reduction of the number of polygons for a tree.] Keep reducing the poly count until your tree has less than 15.000 polygons. If you get a message saying “Cannot Reduce Polygonal Object with Nonmanifold Geometry”, go to the top menu, select “Polygons” > “Cleanup”. Click on the box located on the right of the word in order to open the “Polygon Cleanup Options” dialog window. Go to “Other”, check “Nonmanifold” geometry and “Normals and Geometry”. Press “Clean up” and repeat the reduction process. Please note that another way to lower the polygon count is to make quadrangular meshes. Maya creates triangular meshes by default. Please note that after conversion, tree trunk and tree foliage may two different objects. They may appear in Outliner under one group. Move tree trunk and tree foliage one by one outside of the group and delete the empty group. Make sure to setup tree foliage as a child of tree trunk.

In Outliner, Move tree trunk and tree foliage one by one outside of the group and delete the empty group. Delete also stroke and curve.

Make sure to setup tree foliage as a child of tree trunk. 3.6 - Materials and textures Let’s open the “Hypershader” window in order to assign materials to your 3D models. To open the “Hypershader” Window, go to the top menu, select “Window” > “Rendering Editor” > “Hypershade”. Name the leaves material “LeavesSG”.

Name the trunk material “TrunkSG”. To select one material in the “Hypershader” window: Go to the main menu in “Hypershade” > select “Graph” > “Input And Output Connections”. You will see a network of connections that Maya generated after the converting the trees to polygons. You are looking for more information about textures, so double click on the texture icon and check the path of the texture that is used for the trees. The file is stored in “Program Files” > “Maya” > “brushes” > “trees” > “pine2LeafShader”. The texture used for the leaves is called sideleaf.iff , for the bark of the tree the texture is called wrapBark.iff.

Selecting one material in the “Hypershader” window.] Save your scene as “forest”. 3.7 - How to export the scene to Virtools Maya will export your polygonal mesh data plus the UV mapping information and shaders, generated during the conversion process. You need to export each element one by one as one tree or one object. To export the scene to Virtools: Select the object and go to “File” > “Export Selection”. Point your file browser in the desired location, for example, the data folder located in the Virtools database. Assign a unique name, choose a file type (.obj) and click export.

Exporting the scene to Virtools.] Lets export the elements of the scene to Virtools. Select one of the trees and go to “File” > “Export Selection”. In the exporting window. select “Virtools”. Check “Default File Extensions”. Under “Export Options”, select the following parameters: Uncheck character if a 3D object without animation Check character and check Enable animation if the 3D object has one or more animations.

Virtools export dialog window.] 3.8 - Setting up the scene in Virtools Open Virtools. The “3D Layout” window with a perspective view is on the left. The “Building Blocks” folders are on the right. The “Schematics” window is at the bottom. This window displays a network of connections between building blocks that is similar to the “Hypergraph” window in Maya.

The “Lever Manager” is similar to the “Outliner” window in Maya. You will create a “Data Resource” folder with subfolders in order to save your scene. To create a data resource folder: Go to Virtools top menu, select “Resources” > “Create New Data Resource”. Name the “Data Resource” folder and save it. Virtools create a file called Data_Ressource.rsc. The files exported from Maya or from other 3D software applications can be saved in the subfolders inside the “Data Resource” folder. For example a character will be saved in “Data Resource” folder > “Character”. A tree which is a 3D object will be saved in “Data Resource” folder > “3D Entity”.

Creating a data resource folder.] To access your assets saved in the data resource folder in Virtools: Go to the top menu, select “Resources” > Open Data Resource > select the Data_Resource.rsc file. Please note that you can also import in Virtools, one by one, all the files that you exported from Maya in .nmo file formats. To import .nmo files one by one: Go to the top menu, select “Resources” > “Import File”.

can also import in Virtools, one by one, all the files that you exported from Maya in .nmo file formats.]

3.9 - Loading textures from Maya in Virtools In the “Lever Manager”, go to “Globals” > “Materials”. Double click on the name of material. The “materials Setup” window shows materials from 3D objects of the scene. Although most of the time Virtools loads 3D models with their textures in place, some textures may not be displayed automatically which is the case with 3D objects created in Maya. The following steps will help you to correct this situation. To export textures from Maya to Virtools: Let’s export textures from Maya. Textures in .iff format need to be converted in j-peg format using the Maya FCheck converter. To convert a texture from Maya:

Open the FCheck application from your desktop. Go to the “Start Menu” > “Programs” > “AliasWavefront” > “Maya” > “Fcheck”. Go to the “Fcheck” menu, select “File” > ”Open Image”. Load the leaf and bark .iff files. Go to “File” > ”Save Image” as .jpg file formats. The texture files are saved in the “Data Resource” folder > “Textures” folder that you previously created. In Virtools, select the tab for the “Data Resource” folder located on the right of the “3D Layout” window. Select the “Textures” shelf, the names of the textures that you previously saved will appear in the column to the right. To load a texture in Virtools: Click on the name of a texture and drag over the “3D Layout” window or “Level Manager” window. The texture will automatically reside in the “Level Manager” window, under “Level” > ”Global” > “Textures” shelf. When you save your file, assets referenced inside the “Level Manager” window will be saved with your project regardless of the presence of the data resource folder.

If you don’t see the Resource folder located on the right of the “3D Layout” window in Virtools, you may need to load the Resource folder. Go to the top menu, select “Resources” > Open Data Resource > select the Data_Resource.rsc file.

To load a texture in Virtools.]

Sometimes, textures are missing on 3D objects viewed in the 3D Layout window. If the texture is missing from the “Level Manager” > “Textures”, you need to import the texture again. If the texture can be located in the “Level Manager” > “Textures”, you need to associate again the texture to the 3D model. To reassign a texture to 3D object in Virtools: Go to “3D Layout” window, right mouse click on various shades visible on the trees. In the drop down menu, select “Material Setup”. A “Material Setup” tab opens at the bottom of the “3D Layout” window. The material is located in the lower part of the screen. In the Material Setup window, replace “Custom” with “Opaque”. Select Face > “Double Sided” Go to “Texture”, select the appropriate texture for the material that you selected. You are looking at trees inside a Virtools scene with the same look and feel than the trees that you created in Maya.

Reassign a texture to 3D object in Virtools.] 3.10 - Creating a skybox Let’s create a skybox for your scene in Virtools. More in depth examples of skyboxes can be found in the chapter covering textures. To create a skybox: Go to the top menu, select “Resources” >”Open Data Resource”. Open the “VirtoolsResources” folder installed with the application which can be found on your hard drive at “Program Files” > “Virtools” > “Documentation” > “VirtoolsResources.rsc” Go to the right of the “3D Layout” window, a new tab called “VirtoolsResources” appears next to your existing “DataResource”. Check “VirtoolsResources” > “Textures” > “Sky Around” Subfolder, select the five textures in .tiff files format. Drag the textures over the “3D Layout” window or “Level Manager” window.

[Creating a skybox.] In the “Building Blocks” tab, select

“World Environment” folder > “Background” subfolder. Select the “Sky Around” Building Block and drag it over one of the cameras located in the “Level Manager” > “Cameras”. Please note that his building block can be connected to any 3D object in the world. In the “Sky Around” window select the corresponding textures: “sky_t” for the top, “sky_b” for the bottom, “sky_b” for the back, “sky_f” for the front, “sky_l” for the left side and “sky_r” fot the right side of your environment.

[Insert illustration NATURE17 with caption - Selecting textures for the “Sky Around” building block.] Run the program by clicking on the Play button located at the left corner of the Virtools window. Textures of the sky are projected around the scene. 3.11 - Using textures with alpha-channels You may notice that the textures for the leaves are unrealistic. A whole polygon is showing around the leaf texture. You can fix this problem in Virtools by adding an alpha channel to the texture. This channel will turn black areas of the texture into see-through transparencies. Using targa file format in Photoshop. You can add the alpha channel in Photoshop, open the leaf picture select the leaf, create a mask under Channels. Save as a targa file format. The targa file will include the picture and its alpha channel.

You can also use png file format in Photoshop: select the leaf, delete the outside of the leaf and composite the leaf over a transparent background. Save as png. The outside of the leaf will appear transparent in Virtools. To add an alpha-channel to your texture, go to the “Level Manager”, double click on the leaf texture. The leaf texture Tab will open under the “3D Layout” window. Select the following parameters: Check “Color Key Transparency” Use the color picker to select the black color inside the leaf texture. Check the transparencies in you scene.

Adding an alpha-channel to your texture helps to create leaves with seethrough transparencies.]

Suggest Documents