Learn how to clean up a 3D model prior to bringing the data into Unity. SketchUp is used, but AutoCAD, 3ds Max, and Revit are also discussed.
- [Instructor] This is Frank Lloyd Wright's Fallingwater design, which has been called the best all-time work of American architecture by the American Institute of Architects. We'll be using this model as the basis of our Unity project, and reviewing it right now through SketchUp. But you could just as well use any 3D, CAD or BIM software to generate your model for use in Unity. Your software just has to have the ability to export in a format that Unity can import. We'll be using the FBX file format for this purpose.
You'll need SketchUp Pro to generate FBX files, but if you're using the free version of SketchUp, I will provide the FBX files necessary for this project. In this video, I'd like to talk you though the steps necessary in any software to prepare your assets for use in Unity. The first thing that you'll want to do is delete any unnecessary objects. These might include text, dimensions, 2D symbols, tiny fasteners or hidden objects, or objects that are in rooms that you will not go into in the visualization.
You might be able to get rid of furniture, appliances, equipment and so on in those rooms. Basically, you want to clean up the model as much as possible and minimize the amount of information that you're bringing into Unity. You'll also want to delete any data structures that are in the database that may not even be visible onscreen, so that you don't bring those into Unity, and you can do that in SketchUp by going to the model info window. Click statistics, and here you can see the face count.
This is actually very low, only 16,000 faces, and I've worked hard to clean up this model and to make it as efficient as possible. You'll want to go through similar steps in whatever program that you're using. Here we can purge unused, and I've already done that. This will remove any unused materials, components, groups, et cetera. In AutoCAD, this would be the purge command, for example. The next thing that we need to do is set the units to meters, because meters are Unity's unit. So, in SketchUp, that's done by changing the format to decimal, meters.
You don't need to also scale the model, like you would in AutoCAD, for example. The next thing we should do is give meaningful names to the objects that we will bring into Unity. In SketchUp, that's handled through the outliner. Here, I've given meaningful names to the components and groups in the model, at least on the top level. If you start to expand some of these hierarchies, you'll see that, in some cases, I haven't bothered naming everything, some things here just say group, which is the default name.
But I have gone to the trouble of naming some of these nodes, and that's done by selecting a particular node, right-clicking, and choosing rename. At least now, I can tell what I'll be working on when I bring these objects into Unity. The next step is to examine the surface normals, and in SketchUp, that's done through the style. Go to window, styles. Let's also open up entity info. In the Mac version of SketchUp, it's necessary to open up these separate windows, whereas in the PC version, you can simply expand these names in default tray and you'll see the same type of interface.
I'll edit models only style, and then click on the second button here to edit the face level. Then display the model in monochrome by clicking this button. This displays everything in either a white or blue by default, to indicate whether it's facing outward, the surface normal is white, or blue if it's reversed. So, in this model, I've left just a single surface that you need to correct. So click the object, and it's a group or component, double-click to open that.
Select the object again, and this is a nested group, and you can double click to open that. Click again and you'll see that now we have an individual face selected. Up here in entity info, you can see the problem. Every face has two different materials that can potentially be assigned, one on the front face and one on the back face. I'm going to drag this material onto the front face here and copy it there. And I will also right-click on this surface and choose reverse faces, so now it's oriented outward. Let's display the model with textures here by clicking this button, and you can see that the material is still there.
So that's the kind of procedure that you have to go through, generally, in SketchUp to correct surface normals. I'll click outside these bounding boxes to close them. Now, let's go ahead and save the mode. File, save as. I'll save it in the additional assets folder in Chapter 1 and call it Fallingwater2.
Instructor Scott Onstott starts with a SketchUp model that he cleans up and imports into Unity, where he creates the first-person and third-person characters and cameras needed to explore the model. Then he shows how to improve the building's appearance by sculpting and texturing the surrounding landscape, and populating it with trees, moving grass, and flowing water. Next, he demonstrates how to animate and script doors so they automatically open as the character approaches. Then real-time lighting is baked into textures for greater efficiency and an overview map is added to keep the player oriented within the overall floorplan. Finally, Scott tests and deploys the final interactive visualization for desktop and the web. No plugins are required to view the results! Follow along to build your own version of the project and strengthen your Unity skills.
- Importing a model
- Creating a first-person and third-person characters
- Scripting the walk
- Swapping characters
- Adjusting lighting
- Sculpting terrain
- Painting textures
- Refining materials
- Animating doors that open and close
- Configuring an overview map
- Baking lighting into textures
- Deploying the game to different platforms