by date
Art pipeline progress update
Art pipeline progress update
| Name: | Phil Carlisle | ![]() |
|---|---|---|
| Date Posted: | Jun 29, 2007 | |
| Rating: | Not Rated | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Phil Carlisle |
Blog post
What a strange week.
Anyway, yes, progress on the art pipeline I talked about in a previous blog entry.
So, the basic idea so far, is to load a bunch of data from whatever DCC (art) package you choose in a format of your own choosing (as long as its supported) and then plop it out into DTS in as easy a manner as possible (i.e. without any effort on your part).
So, you'll remember my diagram from the last post here
Anyway, if you look at the diagram, it has in the right hand side the "scenegraph". A scenegraph is basically a simple tree structure called a "Directed Acyclic Graph" (DAG for short). Basically almost every 3D application out there and for that part, almost all game engines (including torque sort-of) use a scene graph to store the world data that is used for rendering.
The power of a scenegraph comes into its own when you go through the render loop and are looking at the various transforms. Basically, the one-way heirarchy of a scenegraph maps brilliantly onto how the 3d hardware wants to see its information represented.
Or at least, thats the theory. In practice its not quite that clean cut, because there are plenty of other issues beyond the rendering that dont really work with a simple one-way graph. For instance when you have multiple dependancies on position data.
Anyhoo, getting back to the point of progress made.
So far this week, I've thrashed through about a dozen different scenegraph api's looking to see if any of them was simple and generic enough to use as a container for data thats read in from the various 3D model formats, ready to be massaged and fiddled with prior to export to dts/x format.
Unfortunately, I came to the conclusion that its easier and faster to just write my own little dumb-as-a-brick scenegraph API. Mainly because its only going to store information, not do anything tricky and partially because even the thought of the dependancies that most of these open source scenegraphs impose on you scares me.
So how does a scene graph work?
Well, the basic idea, is that you have a basic "node" class. This is the main method of structuring the data. The node is essentially an abstract base class (I decided not to make it pure because I might need to just throw a node into a graph for no particular reason later on). Each node has 1 parent and N child nodes (N being any number > 0).
So with that basic structure, we can build a graph. But before doing so, we need some more useful nodes!
The nodes implemented so far are:
MeshNode - holds basic vertex data (i.e. the vertices and indicies of a model).
UVSetNode - holds UV data for the same set of vertices
MaterialNode - holds basic surface information (material attributes and surface description)
TransformNode - holds a transform to apply to subsequent nodes
LODNode - basically a switch node, each LOD node will normally have N number of mesh nodes, at varying levels of detail
So the basic nodes and scenegraph structure is in place, with the appropriate "get/set" and accessor functions for adding/removing nodes in a scene in the right place etc.
So what next?
Well, the next step, is to write a recursive reader that takes the appropriate file format (in the first instance, it will be the FBX format) and constructs a "Scene" from the file. All this basically will do, is use the FBX SDK api to load its own internal scenegraph representation of the file (funnily enough, a lot of 3d apps store thier info in a scene-graph like format) and then simply recursively traverse the FBX scene throwing the appropriate data into my own scene-graph nodes.
Now, the more switched on of you will ask "why do you have your own scenegraph when FBX already has one?". Good question! Of course, the answer is to reduce the dependancy on a proprietary API and to allow us to handle ANY format of data. The internal scenegraph is much simpler than the FBX version because the FBX by its nature is intended for a far more complex set of requirements. Plus, we can more easily support other file formats if we can somehow manage to parse them into our own scenegraph, because once they are in that format, writing a scene->dts traversal will be soooo much simpler.
So, next week will mostly be loading and populating scene's from FBX files. Dumping out the various data to the console to make sure it makes sense. Maybe comparing that to some kind of FBX text output on test scenes. Perhaps (shock horror) writing some unit tests to make sure we can catch some of the more insane things that tend to go into data files and often catch the unwary app off guard (I'm sure somewhere there will be a file with a gazillion one polygon mesh's).
It may be that the unit tests will end up as an "ArtComplaint" tool, where you can ship this to your artists and have it whine and moan at them automatically for having rotten or poorly formatted art. Hell, I might even incorporate a text to speech engine just for giggles :)
Once the data is in the scenegraph. The next step is of course, to write it out to dts. Yay, so we will have a method of transforming mesh data into dts. Not exactly stellar progress, but its a stepping stone.
So no screenshots this week. But I promise to show you next week a screen dump of some text output telling you that the internal scenegraph is indeed populated with lovely vertex, material and uv data!!
PS: For the keen eyed amongst you, notice there is a UVSet node? Imagine having MULTIPLE UVSet's associated with a given mesh??? oh yes..
Anyway, yes, progress on the art pipeline I talked about in a previous blog entry.
So, the basic idea so far, is to load a bunch of data from whatever DCC (art) package you choose in a format of your own choosing (as long as its supported) and then plop it out into DTS in as easy a manner as possible (i.e. without any effort on your part).
So, you'll remember my diagram from the last post here
Anyway, if you look at the diagram, it has in the right hand side the "scenegraph". A scenegraph is basically a simple tree structure called a "Directed Acyclic Graph" (DAG for short). Basically almost every 3D application out there and for that part, almost all game engines (including torque sort-of) use a scene graph to store the world data that is used for rendering.
The power of a scenegraph comes into its own when you go through the render loop and are looking at the various transforms. Basically, the one-way heirarchy of a scenegraph maps brilliantly onto how the 3d hardware wants to see its information represented.
Or at least, thats the theory. In practice its not quite that clean cut, because there are plenty of other issues beyond the rendering that dont really work with a simple one-way graph. For instance when you have multiple dependancies on position data.
Anyhoo, getting back to the point of progress made.
So far this week, I've thrashed through about a dozen different scenegraph api's looking to see if any of them was simple and generic enough to use as a container for data thats read in from the various 3D model formats, ready to be massaged and fiddled with prior to export to dts/x format.
Unfortunately, I came to the conclusion that its easier and faster to just write my own little dumb-as-a-brick scenegraph API. Mainly because its only going to store information, not do anything tricky and partially because even the thought of the dependancies that most of these open source scenegraphs impose on you scares me.
So how does a scene graph work?
Well, the basic idea, is that you have a basic "node" class. This is the main method of structuring the data. The node is essentially an abstract base class (I decided not to make it pure because I might need to just throw a node into a graph for no particular reason later on). Each node has 1 parent and N child nodes (N being any number > 0).
So with that basic structure, we can build a graph. But before doing so, we need some more useful nodes!
The nodes implemented so far are:
MeshNode - holds basic vertex data (i.e. the vertices and indicies of a model).
UVSetNode - holds UV data for the same set of vertices
MaterialNode - holds basic surface information (material attributes and surface description)
TransformNode - holds a transform to apply to subsequent nodes
LODNode - basically a switch node, each LOD node will normally have N number of mesh nodes, at varying levels of detail
So the basic nodes and scenegraph structure is in place, with the appropriate "get/set" and accessor functions for adding/removing nodes in a scene in the right place etc.
So what next?
Well, the next step, is to write a recursive reader that takes the appropriate file format (in the first instance, it will be the FBX format) and constructs a "Scene" from the file. All this basically will do, is use the FBX SDK api to load its own internal scenegraph representation of the file (funnily enough, a lot of 3d apps store thier info in a scene-graph like format) and then simply recursively traverse the FBX scene throwing the appropriate data into my own scene-graph nodes.
Now, the more switched on of you will ask "why do you have your own scenegraph when FBX already has one?". Good question! Of course, the answer is to reduce the dependancy on a proprietary API and to allow us to handle ANY format of data. The internal scenegraph is much simpler than the FBX version because the FBX by its nature is intended for a far more complex set of requirements. Plus, we can more easily support other file formats if we can somehow manage to parse them into our own scenegraph, because once they are in that format, writing a scene->dts traversal will be soooo much simpler.
So, next week will mostly be loading and populating scene's from FBX files. Dumping out the various data to the console to make sure it makes sense. Maybe comparing that to some kind of FBX text output on test scenes. Perhaps (shock horror) writing some unit tests to make sure we can catch some of the more insane things that tend to go into data files and often catch the unwary app off guard (I'm sure somewhere there will be a file with a gazillion one polygon mesh's).
It may be that the unit tests will end up as an "ArtComplaint" tool, where you can ship this to your artists and have it whine and moan at them automatically for having rotten or poorly formatted art. Hell, I might even incorporate a text to speech engine just for giggles :)
Once the data is in the scenegraph. The next step is of course, to write it out to dts. Yay, so we will have a method of transforming mesh data into dts. Not exactly stellar progress, but its a stepping stone.
So no screenshots this week. But I promise to show you next week a screen dump of some text output telling you that the internal scenegraph is indeed populated with lovely vertex, material and uv data!!
PS: For the keen eyed amongst you, notice there is a UVSet node? Imagine having MULTIPLE UVSet's associated with a given mesh??? oh yes..
Recent Blog Posts
| List: | 09/18/08 - Tell me I'm not going crazy!! 12/05/07 - The importance of good tools for productivity 11/17/07 - Using the way back machine. 09/21/07 - Juggling cats. 09/04/07 - End of Summer. 08/27/07 - Come work with me!! 08/14/07 - The changing nature of entertainment 07/25/07 - Someone stole my notes!! |
|---|
Submit your own resources!| Mark Smithh (Jun 29, 2007 at 21:31 GMT) |
http://www.khronos.org/collada/
| Phil Carlisle (Jun 29, 2007 at 21:37 GMT) |
| Andrew Hull (Jun 30, 2007 at 01:11 GMT) |
P.S. I'm putting my vote in for the Blender format...
| Phil Carlisle (Jun 30, 2007 at 08:51 GMT) |
One thing I want though, is for us to have a format that supports Physique generated animations from max. I think that will be easier for artists. Not a big issue I know :)
| Tim Heldna (Jun 30, 2007 at 13:32 GMT) |
The support for Collada is pretty solid in Max and Maya (using the Feeling Software plugins) and now Truespace. XSI has a useless Collada exporter that barely works and they don't offer you an SDK so you have to manually parse outputted files to fix them (makes me mad). Milkshape and Blender both have Collada support (it's native in Milkshape) however at this stage they only handle static meshes.
| Magnus Blikstad (Jun 30, 2007 at 13:44 GMT) |
| Phil Carlisle (Jun 30, 2007 at 18:56 GMT) |
Tim: Interesting, well, we'll work with collada, so no doubt that will show as a possible route for you to use this.
| Dee (Jun 30, 2007 at 22:38 GMT) |
Might want to chat with the dev of the '3D Object Converter' tool.
Has support for pretty much every format I've ever come across.
As such, he has most of the details on parsing existing formats.
<URL>http://web.axelero.hu/karpo/</URL>
Might save you some time if can get info from him (if he's willing to share...)
For anyone else looking for a 3D converter, to help you get various items into the expected DTS convertor formats, until real pipline exists (till Phil's done)..check it out.
Edited on Jun 30, 2007 22:46 GMT
You must be a member and be logged in to either append comments or rate this resource.



Not Rated


