Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 May 2008
Offline Last Active Private

#5118098 Model import adventures

Posted by on 19 December 2013 - 06:52 AM

I come across this beautiful chain, while trying to update SharpDX's code, for model animation, problem arose from inconsistency in model formats.


3D applications internal workings ->

->OpenCollada exporter implementation->

->Assimp library Collada loader/parser implementation->

->AssimpNET implementation->

->SharpDX toolkit model processor, that converts Assimp format to SharpDX specific binary->

->SharpDX code that reads that binary at runtime->

->The application that uses that and, for example, displays the model.


7 whole steps, where something can go wrong.


Its a nightmare, let me tell you. Now, imagine that model you are loading, does not display correctly, where the problem lies?


Is there a bug in 3D application and its not exporting something correctly?

Is there a bug in OpenCOLLADA implementation?

Is there a bug in Assimp?

Is there a bug in AssimpNET?

Is there a bug in SharpDX assimp to binary conversion?

Is there a bug in SharpDX binary to runtime conversion?

Is there a bug display/rendering code?


So then you find it.


Then you load different model, or the same model with different model format...aaand you got something displaying incorrectly and round you go. You see where I'm getting at.


So while I'm thinking that I started to wonder - is there any data formats/ techniques, where you can get something like what you would call "intermediate runtime data format"? Something like .NET's msil that can be used to compile for different processors, but describing some memory data structure for different languages instead of processors?


I would imagine it work something like code and similar to XML+XML scheme. I would have something like XML scheme, that describes the constraints, but also includes support for references and typed data structures, I would have a language specific runtime type/class code generator, that makes runtime code/class from scheme. Then, given *ANY* scheme, any file that is written alongside this whole thing, and a file, that is a running instance of that scheme, I would just need to do 2 steps, that would not change for ANY model (or anything, for that matter) format, written in this way.


1. Generate language specific object/parser/whatever from any given scheme. Input universal scheme file -> Output code file containing language specific implementation of that scheme.

2. Initialize that object in runtime in trivial manner such as loading it from disk using common Load method (interface) available in all schemes.


Is there something like that? Discuss.


EDIT: So I found this http://en.wikipedia.org/wiki/Protocol_Buffers, Google inc. beat me to it. Just have to dig in deeper and find out is it supporting all the necessities.