technical architecture.

Interactive Lab Demo

by on Feb.10, 2010, under Architecture, csharp, Interactive, Unity3D

Here is another Architectural interactive test project. This time, a laboratory setup, a tighter interior space, set up without any real lighting (1 direct light + ambient colors + Ambient Occlusion currently) created with the goal of customizing the unity asset pipeline to be a little more friendly for architectural work.

First, the Project, roughly 6mb, clicking on the screenshot will open the project in a new window. its another quickly evolving work in progress, Warning: No consideration has been taken currently for speed on older hardware, ~100fps on an 8800GT was the target.

Some findings and random ramblings on arch and interactive 3d:

  • unlike with general gaming, with architecture you are in most cases going to already have a model provided in some form or another. odds are, the model is going to be pretty horrific, as arch models tend to be built for the purpose of either:
    • A: Viz… the Viz model will require a lot of cleanup in terms of material work, and stripping down a lot of the high poly fluff required for rendering.
    • B: Design Development… the DD model is normally plagued more by bad modeling conventions, no naming, poor materials, materials not fully assigned, or mangled geometry due to being stretched and squished for days on end to keep up with a design.
  • you will probably still want to break up the file by some logical layer type system, by default this will land you with a unique material for each material of each fbx file
  • a small AssetPostProcessor script that works on the OnMaterialAssign function can make the process of sharing materials across multiple FBX files much easier to handle, with the added bonus of being able to easily progressively build up a library of reusable realtime materials
//file: MaterialsPostProcessor.cs
//goal: Share a library of materials across different assets based on the name of material supplied in the FBX file
// Dave Buchhofer - 02.10.2010
using UnityEngine;
using UnityEditor;
using System.Collections;
public class MaterialsPostProcessor : AssetPostprocessor
    Material OnAssignMaterialModel (Material material, Renderer renderer)
        //The path where you keep your "Standard" library of materials
        string StandardMatPath = "Assets/DMGStandardMaterials/" + + ".mat";
        //the path where you want to keep your "temp" materials, that weren't found above
        //So you have a logical place to look for materials that need editing and tweaking for realtime work.
        string TemporaryMatPath = "Assets/Mesh/Materials/" + + ".mat";
        //Check for it in the standard 
        if (AssetDatabase.LoadAssetAtPath(StandardMatPath, typeof(Material)))
            Debug.Log("FOUND: " + StandardMatPath);
            return (Material)AssetDatabase.LoadAssetAtPath(StandardMatPath, typeof(Material));
        //Else check to see if we've already built one in the temp path
        if (AssetDatabase.LoadAssetAtPath(TemporaryMatPath, typeof(Material)))
            Debug.Log("FOUND temp: " + TemporaryMatPath);
            return (Material)AssetDatabase.LoadAssetAtPath(TemporaryMatPath, typeof(Material));
        //Or create it?
        material.shader = Shader.Find("Diffuse");
        AssetDatabase.CreateAsset(material, TemporaryMatPath);
        Debug.Log("CREATED temp: " + TemporaryMatPath);
        return material;

also check out the previous arch experiment a few posts down: Basketball Arena

:, , ,

3 Comments for this entry

  • samBrown

    very nice work – looks fantastic. I’ve been toying around with unity for arch viz projects and it seems very promising…

    Very encouraged by your work and super-pumped to see anything Max based.

    rss’d your blog with the quickness, looking forward to diggin through it…

  • Francisco Hermida

    Hi Dave,

    Great article, thanks for share this code for unity.

    I think we are in the same path, when i was releasing my script HCG Asset Browser i remember that you had something similar made with python, and now that I’m learning about unity, i just found that you are working with it also, definitely i need keep a eye in your blog hehe.


  • Dave Buchhofer

    Francisco, thanks! yea it does seem like we tend to get similar obsessions workwise 😉

    I’ve been slack on the blog a bit lately, project work/kid has kept me from experimenting as much as i’d like!

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!