Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Unity for Architectural Visualization

You're reading from  Unity for Architectural Visualization

Product type Book
Published in Sep 2013
Publisher Packt
ISBN-13 9781783559060
Pages 144 pages
Edition 1st Edition
Languages
Author (1):
Stefan Boeykens Stefan Boeykens
Profile icon Stefan Boeykens

Chapter 6. Shaders and Textures

When loading CAD or BIM models, geometry usually receives a basic color and in many cases a texture map. However, for convincing visual results, you need to fine tune the shaders and set up materials that are a bit more advanced. This includes applying different texture channels and using the shading power inside your graphics card (GPU).

In this chapter, we will cover:

  • Basic textured materials

  • Advanced textured materials

  • Procedural materials

  • Further material techniques

Adjusting basic textured materials


As we have already seen in the previous chapters, Unity adds materials for all applied textures and colors in imported models. However, as the materials defined in CAD or BIM exports tend to be fairly basic, Unity has little information to define a dull color and texture map, using the default diffuse shader.

Note

Every material in Unity is controlled by a "Shader". This is a series of instructions, written in an interpreted language that gets compiled into GPU instructions. Common shaders use textures, for example, color and/or bump mapping.

The first thing to do is to check the imported materials to ensure all textures are really defined and found. Ensure imported models have integrated UV coordinates to define how the texture is mapped onto the geometry. If you use different textures, you might need to adapt the scaling (tiling). Since materials are shared between objects, this affects all objects that reference the same material.

The Diffuse shader only...

Using advanced textured materials


While you can go pretty far using the Unity shading language, we will focus on the use of image-based texture maps mostly in architectural visualization. We illustrate this with textures from the Arroway website (http://www.arroway-textures.com/catalog), which are provided commercially in high resolution or can be freely downloaded in low resolution, under a Creative-Commons license (CC-BY, so attribution is required if you apply them in your projects).

  1. Go to the Arroway website and browse to a texture that you like. We opt for bricks 002, which gives a nice weathered brick pattern. You get a preview of how the texture looks when applied to an example.

  2. Note the hints that are provided here: real world size is 6m x 3.4m and the texture is seamless only in the horizontal direction, so you should not repeat it in the upper direction. Download the RAR archive and unpack it. It contains three files: bricks-002_b030.jpg is bump map, hinted at 30% intensity, bricks...

Using procedural materials


Although it is not currently common in CAD or BIM software, most DCC applications not only support colors and textures, but also procedural materials using some kind of shading language. Shading languages can be very extensive and support many other instructions. Current GPUs calculate advanced shaders in real time. The glass shader above is a basic example of a procedural shader.

Allegorithmic substances

As we don't expect our readers to simply start writing such shaders, and this book has no room to discuss them either, we suggest an alternative route and use a procedural shading system that is more directly accessible for end users.

Allegorithmic is a company that develops a procedural material system called "Substances". They have an authoring environment where you can create new materials and they even sell individual materials. Many 3D systems, including Unity, support substance shaders. In the Asset Store, check the 8 FREE Substances for Mobile package (https...

Learning further material techniques


While the majority of texture work was explained previously, there are some additional techniques that you can apply in your projects.

Adjusting texture mapping

When materials are defined, you set up characteristics that are often defined by textures (images). However, the material only defines the look and not how the actual textures are placed on the geometry. This is done at the modeling stage (for example, inside your 3D, CAD, or BIM software). The latest architectural authoring software provides textures as part of the material properties and allows you to define the real size of a texture map; for example, inside the ArchiCAD material editor, you can define the visual properties of a material, including setting the real world size of a texture as follows:

If you modify a material to contain another texture, be sure also to adapt the real world size of the texture map immediately, so that it will be positioned at the right scale.

When you export your...

Summary


We discussed mainly the use of textures to assign visual properties to materials. For architectural visualization, this is good to emulate bricks, concrete, metal, and wood. To display a convincing glass, we used a custom (copied) shader. And finally, we illustrated procedural textures.

The final chapter will go into scripting and we introduce a few reusable scripts that can be used to further tweak and control what we learned throughout the previous chapters.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Unity for Architectural Visualization
Published in: Sep 2013 Publisher: Packt ISBN-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.
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}