It’s not as hard as you think to create an interactive VR experience with your Vectorworks models in Unity. The only tricky part might be getting the materials to import correctly. Below I explore three big concerns to address when it comes to importing .fbx Vectorworks materials into Unity:
- Editable Materials – Are the materials importing correctly?
- Normals – Is the material rendering on the correct side of the mesh?
- Render Quality – How do you get the materials to look good?
Let’s take a look at several solutions to each of these important material considerations and even cover a simple introduction to Baked Lighting in Unity.
How to Import Materials
To apply materials, click on the 3d model object in the Project window. In the Inspector> Materials tab, change:
- Location to ‘Use External Materials (Legacy)’ & Click Apply.
If this Legacy method doesn’t do the trick, try the below combination instead, then retry the ‘Use External Materials (Legacy) step above:
- Location to ‘Use Embedded Materials’,
- Extract Textures> Make a Folder in Assets to Save Files to
- Extract Materials> Make a Folder in Assets to Save Files to. Click Apply.
Still having problems? It might be that your model is too complex to import as one combined .fbx file. Instead, try exporting it as several smaller separate .fbx files and use the process above to import materials.
So you’ve imported your model but some materials are totally invisible, or are only rendering from one side. You’ve got misaligned normals.
There are a few options for tackling this annoying normals issue when moving between Vectorworks and Unity. Below are a few solutions to consider against your existing workflow. For beginners, I suggest the first option: applying a free double-sided shader.
In the asset store, search and import the free Double Sider Shader asset. Select the object in your hierachy with the misaligned normals. In the inspector, find the material component and change the Shader dropdown to be Ciconia Studio/ CS_Standard/ Builtin/ Standard/ Opaque.
Lastly, be sure to change the Double-Sided setting to ‘On’. Repeat for materials on all objects with normals issues.
Tweak Normals Manually in Cinema 4D
Cinema 4D Lite is included free with Adobe After Effects. To launch a Cinema 4D project from within After Effects, go to File>New>Maxon Cinema 4D File. Choose a save location and Cinema 4D Lite will launch automatically. Import your .c4d exported Vectorworks model.
In Cinema 4d, add all objects as children to a parent null object. Put a Display tag (within Render Tags) on this parent object and enable the use of backface culling to reveal what the normals would look like in Unity.
Manually align or reverse normals for any problem objects by selecting the object then Mesh>Align and/or Reverse Normals.
Finally, choose ‘Save Project for Cineware’ and import into Unity with the free Cineware by Maxon plugin from the Asset store (no license required). See this separate post on Cineware to learn more about when to use it.
Recalculate Normals in Blender
Downloading a free installation of Blender is one path to fix normals in your exported .fbx Vectorworks model before importing into Unity.
Once in Blender, select all objects in the hierarchy. Use Modeling> Mesh> Normals> Recalculate Outside. Some items you may need to ‘Flip’ individually instead to get the desired result, which is why this is my least preferred normals fix. But it makes sense if your workflow already brings you into Blender.
When exporting out of blender as .fbx, make sure you have ‘Path Mode’ set to ‘Copy’ and select the box icon to the right (so it turns blue). If not, the textures wont work in Unity.
Export as .obj Instead of .fbx
Another option is to export from Vectorworks as a collection of .obj files instead of a single .fbx file. This method is more time consuming as it requires a few mesh modifications before exporting from Vectorworks. However, the overall model in Unity will be better optimized if you decide to put in the time.
Enable ‘Use Recommended MSAA Level’ on the OVR Manager (Script) component on the OVRCameraRig game object and adjust the Min & Max Render Scales as seen below:
In Project Settings> Quality edit the following:
- Pixel Light Count = 1
- Anisotropic Textures = Per Texture
- Anti-Aliasing = 4x
- Uncheck Soft Particles
Generate Baked lighting
Baked lighting will create more beautiful shadows and prevent flickering at edges. To begin, make all objects Static (assuming they don’t move in your scene) by selecting them in the hierarchy and checking the box for Static in the Inspector.
Set all light objects in your scene to Baked light mode. Leave a single realtime light to illuminate the non-static controller object models, set to not cast shadows.
Next, in the Inspector>Lighting Tab, uncheck ‘Autogenerate’ and create New Lighting Settings set to Mixed Lighting>Shadowmask. Realtime Lighting is unchecked. With your lone realtime light turned off temporarily, click to Generate Lighting.
If objects are causing a problem or are not being included in the lightmap at all, select the model(s) in Assets. In Inspector> Model Tab, check the box to Generate Lightmap UVs. Click Apply and re-bake.
Note: When re-baking, be sure to Clear Baked Data before generating new lightmaps (in the Generate Lighting dropdown).
Lastly, when are you happy with the lighting generated and are finished baking, remember to turn your realtime light object in your scene back on before building.