Reader small image

You're reading from  Unity for Architectural Visualization

Product typeBook
Published inSep 2013
Reading LevelIntermediate
PublisherPackt
ISBN-139781783559060
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Stefan Boeykens
Stefan Boeykens
author image
Stefan Boeykens

Stefan Boeykens is a Belgian architect-engineer. Starting out as a professional architect in several offices, he returned to KU Leuven in 2000, at the Department of Architecture, for teaching and research, completing his PhD on Building Information Modelling in 2007. Stefan is an experienced researcher with a variety of IT skills. Aside from teaching BIM, he is mainly working as senior Innovation and BIM manager for the Belgian D-Studio, focusing on BIM middleware and consultancy. He is a frequent speaker at BIM-related events and is actively involved in BIM standardization groups, including CEN/TC 442 (Europe) and Belgian Technical Committees. He is father of three boys and enjoys musical composition, reading, cycling and life-long-learning.
Read more about Stefan Boeykens

Right arrow

Chapter 5. Models and Environment

Most architectural photographs include furniture and props, to present the design in its full glory. To have a similar effect in our real-time project, we load additional models and set them up as properly scaled prefabs, which can be re-used throughout the project. We can place our project in a convincing environment, including terrain and sky.

After we have literally filled the scene with a large amount of objects, it is important to look at approaches to reduce the burden on the system.

This is again a chapter that is more reading and less doing. After all, optimizing performance is usually done by being clever and planning things properly.

In this chapter, we'll cover:

  • Loading a model from the 3D Warehouse

  • Setting up a basic landscape

  • Creating a custom Skybox

  • Working with large models

Loading 3D Warehouse models


To increase the impact of an interactive environment, it should contain sufficient detail. Furniture, accessories, plants, cars, and people can enliven the project. Rather than filling the model with every possible object, place some key items on visible locations around the scene. There are several online repositories of models, animations, and textures. The Unity Asset Store is an obvious entry, but do not underestimate the vast amount of online content that is freely available in Trimble 3D Warehouse. However, as the terms of service (ToS) are not fully clear for usage in commercial projects, you might want to rely on other sources or create your own models. You can either download models directly into Unity using the COLLADA format or prepare them first in other software. It is advised to start from the SketchUp model and at least clean up the normals (front/back faces), as explained in Chapter 1, An Integrated Unity Workflow, before exporting into Unity and...

Setting up a basic landscape


There are multiple approaches to add landscapes in an interactive scene:

  • Unity has a dedicated Terrain tool, which is easy to get started with. A terrain is a large subdivided plane, where vertices can be lifted in the Y-direction: a so-called height field. While it takes a lot of effort to fine-tune to perfection, it provides the following interesting features:

    • You can paint the height using brushes

    • You can also paint the materials using texture maps

    • You can add accessories, such as trees, bushes, and grass, which can move, as if the wind was blowing them

  • When you already have a grey-scale height-image for your terrain, maybe made in Photoshop or containing real-world geography data, you can import this as a raw image. Refer to the documentation on: http://docs.unity3d.com/Documentation/Components/terrain-Height.html.

  • If you created the terrain already inside your 3D environment, it can be loaded as a Mesh, just like any other imported Mesh. However, a regular mesh...

Creating a custom Skybox


When you want to include a credible environment, you can use the Skybox tool. This looks like a large cube, with seamless texture maps of skies placed on the inner side. By setting it around the scene, it follows camera movements and appears as if the whole sky surrounds your scene. There is a default package included with Unity that you can use (Assets | Import Package | Skyboxes) that contains about nine examples. A Skybox can be activated in two places, as shown in the following screenshot. You can activate a default Skybox material in the render settings (Edit | Render Settings). You can also define a Skybox material for a particular camera, by adding the Skybox component to it (Component | Rendering | Skybox).

It is possible to create your own Skybox images in almost any rendering software. Define a camera and position it perfectly horizontal. Set its viewing angle at 90 degrees. Record a six frame animation, with the camera orientated to one of the six cardinal...

Optimizing scenes and models


While the performance of Unity running on current generation computers and handheld devices is still increasing, there are limitations to the amount of geometry you can place in an interactive scene. Especially trees, cars, curved models, and other objects with many polygons slow down Unity, sometimes dramatically. The following screenshot shows how to activate the Stats button on the Game view, which gives some insight in how much work Unity has to do.

We try to reach at least 30 frames per second (FPS) for smooth display. In practice, we hope to attain 60 or more and drop down to 30 as a worst-case scenario. However, don't be too fixated on this number, as it is not an exact prediction of how the application itself will run, for example, on a tablet or in the Web Player. The Unity Wiki provides a utility script for that purpose. For more information on FPS visit: http://wiki.unity3d.com/index.php?title=FramesPerSecond.

Luckily, Unity itself does some optimization...

Summary


While this chapter required more reading than doing, it contains several pointers to procedures to improve your project. We can load additional geometry, to enliven the scene. You can even add detailed terrains and trees and a nice sky image.

However, this all comes at a price; that is, performance may suffer. So the last few sections looked at several approaches to lower draw calls and increase the amount of frames we can display per second. It is also obvious that a pro-license simplifies many of these optimization techniques, but with some experience and a few helper scripts, there is a lot you can improve using the free version as well.

Get ready for our next chapter, on further improving the use of textures and shaders.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Unity for Architectural Visualization
Published in: Sep 2013Publisher: PacktISBN-13: 9781783559060
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $19.99/month. Cancel anytime

Author (1)

author image
Stefan Boeykens

Stefan Boeykens is a Belgian architect-engineer. Starting out as a professional architect in several offices, he returned to KU Leuven in 2000, at the Department of Architecture, for teaching and research, completing his PhD on Building Information Modelling in 2007. Stefan is an experienced researcher with a variety of IT skills. Aside from teaching BIM, he is mainly working as senior Innovation and BIM manager for the Belgian D-Studio, focusing on BIM middleware and consultancy. He is a frequent speaker at BIM-related events and is actively involved in BIM standardization groups, including CEN/TC 442 (Europe) and Belgian Technical Committees. He is father of three boys and enjoys musical composition, reading, cycling and life-long-learning.
Read more about Stefan Boeykens