Showing posts with label assets pipeline. Show all posts
Showing posts with label assets pipeline. Show all posts

Thursday, January 7, 2010

Instant pipeline in action.

After setting up FBX exporting scripts for 3DSMAX and Maya, I've prototyped whole pipeline. How it looks like? You are double-clicking the MAX file in resources explorer and getting this:

 
After adding desired sub-meshes to list of exported we just pressing Export and viola - editor creates meta-file that contains user choices. Next time it has enough information to re-export without user interaction. This has few strong points comparing to classic exporting pipelines:
  • precise selection of list of needed meshes frees artists to use any helpers he needs. No more "clean version" files or "save selection" hell to keep exported assets clean from any helpers;
  • version control systems can contain original asset files for build machine to generate specialized asset formats for all platforms. No intermediate formats needed;
  • editor can detect that original asset file is changed (meta-file contains date and content CRCs) and automatically re-export and reload asset into engine;
  • new asset importing is very straightforward;
I've tried same principle on textures through NVidia Texture Tools. This allows artists to use original texture files in original scenes. Conversion as well is based on meta-files conception.


Few implementation details

For prototyping needs I've took the following steps:
  • created Max and Maya scripts that monitors some temporary folder for files with description of what scene should be exported;
  • when editor needs to export something, it starts Max or Maya in no-interface mode (like "-silent -mip -U MAXScript %s") and then places description files in temporary folder monitored by script;
  • script loads files one by one and exports them. When it finds special quit file it closes modeling package;
  • editor loads exported files and perform necessarily steps;
This works good for prototyping needs, but this way has few caveats. Editor needs to run modeling package each time it needs to export something. I've ended up with keeping it open with empty scene after first need. Also, loading big files can be time consuming and this will ruin instant feedback we want to achieve. So for production environment we should modify scheme a bit:
  • we need to create a small plugin for our favorite packages that will monitor for scene saving event and communicate to editor instance to decide if file should be exported as FBX;
  • plugin silently runs export routine (so no additional overhead of loading scene in another modeling package instance) and signals to editor;
  • editor loads exported file and perform necessarily steps;

Tuesday, December 29, 2009

Assets exporting.

Here we've discussed instant pipeline for our engine. To achieve this goal we need exporting tool compatible with our favorite modeling packages. Starting from ground up is not an option for us, as we want this part to be defined ASAP.

Some time ago I've used modified Microsoft's X File exporter for 3DSMAX and Maya. It can be extended if you need something specific, but it's not very practical when you want to get every bit of info about scene. Supporting it for different versions of modeling packages is another scary story. So I've dropped it.

After some research I've got two good candidates: COLLADA and FBX. And COLLADA seemed much more interesting option for me: open format, XML based, supported almost everywhere. One of our internal projects started COLLADA import/export pipeline implementation and I've watched closely on their progress. After few months of development I've got first impression from the team. It was a disaster. There was a lot of different implementations of COLLADA exporters, but none of them seemed working properly with all possible resources types we need for modern games development. Autodesk implementation didn't even were able to import scene it exported seconds ago. It was clear that you need to build custom solution and this is something we actually don't want to do.

So I've changed my mind and selected FBX for our task. And it worked like a charm.

To be continued.

Monday, December 28, 2009

Instant pipeline.

So, we are about creating brand new shiny engine. Where should we start? I've seen a lot of different opinions. Someone starts from renderer design, someone starts from basic things like math and core framework. If you will ask me, we should start from defining the pipeline. We should get clear view on how our assets will get into engine, how we will create our levels and how we will create platform specific builds from all this.

No magic here, this was solved zillion of times. But we will add one new thing to this equation: pipeline should be instant. No "Export" button in your favorite modeling package. Artist should get updated model in engine right after he pressed Ctrl-S and Alt-Tabbed into game editor. If he has dev console connected, model changes should instantly appear on console as well.