Written Tutorial

From Rhino to Unreal Engine

This is a rewritten tutorial of an original made almost 2 years ago (28th September, 2015), and I promised both a newly written and better illustrated version, but I newer got around to it until now. I apologize for that, but now it is here!

 

List of contents:

Introduction

When I was a kid I would often dream of making my own games with my own worlds, thoughts and possibilities, that would be for others to explore. Then I grew up and those dreams sort of faded in the background, and instead I started to pursue a career within architecture and technology. Then something marvelous happened in 2010 or 2011 (I don’t recall the exact year) when I stumbled upon Unity3D not long after its initial release for Windows (mind you, it was originally an OS X exclusive application), those childhood dreams came back to me, but this time with a promising sight of allowing the coupling of architecture and game development to be coupled together.

Exactly the possibility of allowing you to virtually exploring your sketches, drafts and models inside a real-time application is something that can give most architects a hard-on, as you can transform the environment that would only exist inside your head into something you can get as close to realizing before it’s built. Sure, you can always make a 1:100 scale of some white cardboard, but those neither gives you the human scale-feeling, nor the phenomenological experience of the colors from your materials on that scale. 3D Arch Viz have been around for almost a decade now, but often you find yourself rendering a VRay scene away for a static image that probably has light flaws, or texture issues that doesn’t show until 5 hours into the rendering. – That’s where real-time visualization through game engines is a game changer!

In this tutorial, I’m going to let you through the process of visualization your conceptual rhino model in Unreal Engine 4. You might have heard of it, but in case you haven’t; Unreal Engine 4 is the 4th iteration of one of the most commercially successful AAA game engines throughout gaming history, initially released in 1998 by Epic Games and has been used in critically acclaimed games such as Unreal Tournament, Deus Ex, Bioshock, Gears of War, Ghost Recon, Splinter Cell and many more.

What you will be creating a simple real-time walk-through in first-person mode. I’ll guide you through the process of settings up your model in Rhino and preparing it for export, importing it in Unreal Engine and preparing it there and exporting it as a standalone executable package that you can send to clients.
Preparation

Before you start you might want to know exactly what you can use it for, and what kind of quality you can achieve by real-time visualizations. Through advanced lighting techniques you can achieve photorealism to a degree that matches even that of high-quality Archviz sequence renderings, an example of such is Koola‘s (a french UE4 artist from southern France) archviz videos [Link], while the more customizable displays can include the real-time (game-mode) includes the following demo from UE4 Architecture [Link]

Preparation

I’ll make this short, here’s all the applications you’ll need – apart from Rhino3D (which I presume you already have, since you looked up this tutorial), all the applications are available free of charge:

·         McNeel Rhinoceros 3D (about €1000)

·         Unreal Engine 4 (Free)

In case you want to tag along with the same files, you can get the tutorial files here:

·         Tutorial Files (Freebies)

You don’t need much else to get started right away!
Setting up your model

Alright, so I’ve prepared a little example of bad architecture (roughed out in a few minutes), but every piece of architecture needs pretentious name, so what better than Casa dé Manure? – Anyway, it looks like this:

Nothing spectacular and it’s been kept relatively simple for the sake of not making the tutorial too long. The first step is that we are going to map out the different elements with materials, so we will be able to easily assign materials once we get it inside Unreal Engine.

So, how do we map out the elements with materials you might wonder? – First, you select and explode the elements, where you want the surfaces to have different materials, in my case I want to have the external wall separated, since I want the outer walls to have a different material than the inner walls:

Now, you can select the individual surfaces to assign custom materials to them, in my case I’ll start out by select all the outer surfaces and assign them a material (Properties -> Material -> Object). The way it works is that a material is created as soon as you change the name. After you assign your selection a name (In my case “Wall”), assign it a color as well, it can be any color as long as you can differentiate between the elements. – Oh, and you might want to set your view-mode to “Rendered” so the material colors are shown (Top bar -> View -> Rendered):

Continue doing this for all the elements you want to have the specific materials you have in mind, this includes elements such as roof, walls (inner and outer), floors, et cetera, et cetera:


Exporting from Rhino

Now, when you export your mode from Rhino to Unreal Engine, there’s a couple of things you need to remember. First of all, there’s the file format you need to export in, as it can’t just be any file format, basically you’ve two choices (at the time writing):

·         .FBX (Autodesk)

o   A file format being developed by Autodesk, one of the leading figures in the 3D industry, and the primary supported file format used by

·         .OBJ (Wavefront)

o   An older file format which is very commonly used

For our purpose we’ll be using the .OBJ format, as Rhino’s .FBX exporter seems to produce some errors concerning the materials (instead of getting just a single material of each type, we get a whole bunch of materials multiplied by the amount of surfaces). In any case, go right ahead and select export under the menu “File” menu, from there select the “.OBJ” format:

Write whatever name you want for it, and press enter, at which point you’ll get another pop-up window that asks you which kind of settings you want for the format export. Here you’ll pay attention to three things, first thing is the way you’ll save the object, where you have to select Polygon Mesh (should be set to it by default). Second, you’ll want to export the Rhino object names as .OBJ Groups, as otherwise our model won’t have multiple material slots when we import it into Unreal Engine. Finally you’ll head down to the last section, where you’ll tick on that you want to export the texture coordinates, the vertex normals as well as the material definitions:

The last popup window involves the export detail settings – just before you selected the Polygon Mesh option, which basically converts your mathematically based rhino objects (NURBS/Splines) into vertex-based meshes that Unreal Engine works with. Since our building is mainly comprised of prismatic/square shapes, just set the slider all the way to the left. If your building had been made out of organic shapes (looking like the Guggenheim Museum or something like that, then you might consider adding more vertices to give more rounded details):


Setting up your unreal engine scene

Now, before you start importing your model, you need to set up your Unreal Engine scene for a first-person visualization (one that you can walk around). First off, start the Unreal Engine from the Epic Games Launcher and in the template menu, select a new project based on the blueprint first-person template – afterwards, make sure that you’ve the starter content turned on:

First thing we’ll do, is go ahead and delete all of your existing elements. Select every white box and label in the scene and delete it.

After that, we’ll do is go ahead and add a terrain that our house will rest on, mind you it’s not going to be a beautiful terrain, just a basic terrain with some grass. So, head right up to the terrain editor [Shift+3] and in the meantime also lead your content editor (the one usually at the bottom) into the folder “Materials” located in [Content => Starter Content]. Once there, find the material named ”M_Ground_Grass” and drop it into the terrain editors material slot, as seen here:

After that, set the section size to be 15×15 Quads, there’s no reason to make our terrain too big, when it’s only for a smaller demo. Finally, scroll all down to the panel until you see the “Create” button, and afterwards you’ll have a flat 15×15 terrain.

Afterwards, we will place some trees around the edge to give a more enclosed feeling to the scene, we are going to be planting some trees and bushes. Here we’ll be using the basic starter content bush in various sizes and use Unreal Engine’s foliage planter to accomplish this. Head over to the

After having the visuals of the background scene setup, we want to make sure the first-person controller is applicable as an interactive ArchViz walk-through. If you click Play now [Alt+P] you’ll notice that your controlling character (the player) will be carrying around a set of arms, and a scifi weapon – Not exactly something we’d want to show to clients – so the first thing we’ll do is to remove them, but the process is a bit complicated if you’re new to Unreal Engine and scripting/programming in general (don’t worry, we won’t be scripting in this tutorial).

Navigate to your “Blueprints” folder [Content => FirstPersonBP] and double click on the FirstPersonCharacter blueprint class which will open up the blueprint editor window. Head to the Event Graph is it isn’t already by default. You’ll see a couple of nodes and groups here, and you’ll have to delete the following groups marked below and move on to the “Construction Script”-tab:

In the next tab, you’ll want to delete everything except for the main construction script node as shown below:

Finally, move on to last tab, “Viewport”, where you select from Mesh2P down until the VR_Marker and press the delete button. You’ll now see the arms and the sci-fi weapon disappear from the viewport:

Finally, if you close the blueprint editor now, and go right ahead by clicking play (ALT+P) you’ll notice the arms are gone, but the red crosshair from the heads-up display (HUD) is still there, we’ll want to remove that one too.
With your content browser still being in the blueprints folder, double click on the blueprint class named “FirstPersonGameMode” and select the “HUD Class” drop-down to select “None”. Finally, press compile and save – you should now have removed all obtrusive elements from the screen:


Importing your rhino model

Now, the exciting part comes, you’ll finally see your model inside Rhino. In your Windows Explorer window drag and drop your .OBJ file directly into your content browser, upon which you’ll get an import dialog. The first thing you’ll want to do here is to set your uniform scale to 100, as the model otherwise will be way too tiny (scaling from what I presume is centimeters to meters), and click “Import All”, and drag & drop your model to Unreal Engine:

Alright, now time to get rid of those placeholder colors, from your content browser, navigate to the “Materials”-folder inside the StarterContent folder, here you’ll find the few materials that comes included in Unreal Engine’s starter package for the first-person template. The lovely thing about this process, is that it is straight forward: Pick whatever material you think will suit the specific color region, and drag & drop it on top:

Now, I’m aware that 9 out of 10 times of doing this step, you’ll have texture scaling issues – these CAN be solved, but it won’t be illustrated in this tutorial at this point (Maybe I’ll do a tutorial on this later). In either case, you will now have your Rhino model inside Unreal Engine. Before you’ll be able to walk-around inside it, you need to remove the auto-generated collision bounds. You do this by selecting the static mesh that you imported, upon which the mesh editor will open. All you simply need to do is to click the “Remove Collision” function located in the “Collision”-menu, and save:

If you click play at this point (ALT+P), you’ll be able to walk around in your building and see the materials on it. One thing you’ll notice though is that the light and shadows are very crude, which is because we haven’t baked any global illumination maps unto it (Lightmapping) yet.

In order to do this, we first want to set our lighting quality. Do this by clicking the drop down icon next to the button that says “Build”, find the “Lighting Quality” and select either Medium or High. Mind you, that the higher the lighting quality, the longer time it will take to bake the lightmap. After select it, click the “Build” button and wait a few minutes for the lighting to build. You’ll notice afterwards that the shadows and light seem to fit more realistically to the scene:

Often though, this leads to another problem which occurs when you take a closer look. You’ll notice the difference between light and dark is quite huge, and especially interior environments tends to become quite dark – luckily there’s a solution to that. What you want to change is the post-process settings, which can be done through the pre-existing “PostProcessVolume” object, select it and under details scroll down until you get to the “Post Process Volume” settings, here you’ll find a wide array of post-process effects that is built in the engine (which means you can also make your own, but I won’t get into that):

In our case, the ones you’ll want to take a closer look at is:

·         Auto Exposure (for eye adaption to the dark/light environments)

o   Documentation

·         Bloom (for reducing the overly bright glow from the outside)

o   Documentation

·         Ambient Occlusion (For proper edge shadows)

o   Documentation

·         Scene Color (For color fringing/chromatic aberration and vignette)

o   Documentation

·         White Balance

o   Documentation

I won’t go into much details about what these do, as they are described just excellent in the provided documentation links above from the official Unreal Engine website, but I will provide the settings I that I found working well for my scene:

If you click play now (ALT+P), you should be able to see your results – especially the automatic eye adaption should be noticeable when you move from outdoor to indoor environments:


Packaging your visualization

Right, you’ve made your interactive visualization, but you can’t really ask your clients to install several gigabytes of Unreal Engine just for the sake of having the trouble of starting it up, waiting and so on.

The solution to this is to package your content you simply click File -> Package Content -> Windows -> Windows (64-bit), if that happens to be the case, but as you can see, you can deploy to a wide range of platforms and devices, ranging from Linux to tablets and smartphones devices. After clicking you’ll be asked for a destination for the packaging. Proceed and the packaging will take a few minutes:

Now, if you’re currently sitting on a Windows machine (which you presumably are, since Rhino is still somewhat unusable on Mac at the time of writing), you might be wondering why you can’t deploy from Windows to Mac, and the reason is that deployment to Apple products generally requires Apple products in the first place. If your client only has a Mac without Bootcamp for Windows, you can try packaging your application as HTML5, which means your media will be compiled into something that can be played through a web browser (such as OSX’s Safari). From my experience, the only catch is the lack of performance (from my experience, but depends on your own setup).

Anyway, after spending a few minutes packaging your real-time demo, it should now be ready as an executable in the folder you designated, just double click on it and it should start. Please mind that there’s no HUD/menu options in your demo, so your only way of exiting your application by using [ALT+F4]. This isn’t a problem though, just keep it in mind:


Conclusion

Now as you can see, the process of transferring a model from Rhino to Unreal engine can be done in a few minutes, although naturally greater results are achieved with more time. Putting a few hours of work into it could in the future result you in one of those exceptionally beautiful real-time visualizations that you see on YouTube and that I linked to in the introduction. One thing you might have noticed is that in case you (like me) decided to have a very reflective floor surface, you’ll also notice that the reflections of the windows aren’t exactly beautiful, solutions to solving these could include adding more reflection capture actors (box or spheres), which you can read more about here: https://docs.unrealengine.com/latest/INT/Resources/Showcases/Reflections/

A few ideas for what could easily make the final package more immersive and tasty is perhaps add some subtle background music, or adding different environments such as cities, forests, desserts, or just simply changing the sky with different moody weather patterns, maybe even a snowy scene? – Only your imagination sets the limit.

For the next related tutorials, I’m considering writing about how to visualize data from Grasshopper inside Unreal Engine (such as shadows/daylighting conditions or real-time plan visualization techniques). Apart from that, I’m considering adding some energy related tutorial with Grasshopper packages for calculating natural ventilation. In any case, feel free to add your comment and please add your input if there’s anything you’d like to know more about related to this or future tutorials, I’d be happy to help.
References and links

Unreal Engine Blog: https://www.unrealengine.com/blog

Koola’s UE4 YouTube channel: https://www.youtube.com/user/koooolalala

Information about the .FBX format: http://www.autodesk.com/products/fbx/overview

Information about the .OBJ format: http://www.fileformat.info/format/wavefrontobj/egff.htm

Unreal Engine 4 Documentation: https://docs.unrealengine.com
Tutorial Files

LINKS WILL BE PROVIDED SOON!

Rhino Files:

          Casa Dé Manure (Ready for export)

Unreal Engine Files:

          Finished packaged Application

Packaged Files (Final executable for Windows 64-bit):

          RhinoToUnrealEngine (Win64)

Video Tutorial

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *