Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
deftypes [2019/03/12 14:33] – created admindeftypes [2020/01/09 14:21] – [Notice] admin
Line 14: Line 14:
   -List::Meshes   -List::Meshes
   -TMeshDef   -TMeshDef
 +                        // a reference to the owner model
   -@Model::TModelDef   -@Model::TModelDef
   -/TMeshDef   -/TMeshDef
   -/List::Meshes   -/List::Meshes
 +
 +        // holds a list of TMaterialDef instances
 +        -List::Materials
 +  -TMaterialDef
 +                        // a reference to the owner model
 +  -@Model::TModelDef
 +
 +                        // holds a list of textures
 +  -List::Textures
 +  -TTextureDef
 +  -/TTextureDef
 +  -/List::Textures
 +
 +                        // holds a list of shader codes
 +  -List::Shaders
 +  -TShaderDef
 +  -/TShaderDef
 +  -/List::Shaders
 +
 +                        // holds a list of sub materials for layered material sources
 +  -List::Materials
 +  -TMaterialDef
 +                                 [...]
 +  -/TMaterialDef
 +  -/List::Materials
 +  -/TMaterialDef
 +        -/List::Materials
  
   // holds a list of THumanoidDef instances   // holds a list of THumanoidDef instances
   -List::Humanoids   -List::Humanoids
   -THumanoidDef   -THumanoidDef
 +                        // a reference to the owner model
   -@Model::TModelDef   -@Model::TModelDef
   // holds a list of TControllerDef references   // holds a list of TControllerDef references
Line 43: Line 72:
   -List::Controllers   -List::Controllers
   -TControllerDef   -TControllerDef
 +                        // a reference to the mesh, the controller handles
   -@Mesh::TMeshDef   -@Mesh::TMeshDef
 +
   // is a sub component of TSkinDef   // is a sub component of TSkinDef
   -Skin::TSkinDef   -Skin::TSkinDef
   -TSkinDef   -TSkinDef
 +                                        // the owner controller of the skin definition
   -@Controller::TControllerDef   -@Controller::TControllerDef
  
Line 73: Line 105:
   -List::Animations   -List::Animations
   -TAnimationDef   -TAnimationDef
 +                        // reference to the owner model
   -@Model::TModelDef   -@Model::TModelDef
  
Line 99: Line 132:
 ===== G3D File Format ===== ===== G3D File Format =====
  
 +The Gorilla3D file format is a representation of the internal model structure defintion.
 +It allows different kinds of storage formats:
 +
 +^ Format  ^ Notes  ^
 +| BSON      | binary json format: https://en.wikipedia.org/wiki/BSON [wikipedia] |
 +| JSON       | default json format: https://en.wikipedia.org/wiki/JSON [wikipedia] |
 +
 +In addition to those formats we provide different storage options:
 +
 +^ Option ^ Notes ^
 +| None     | The save routine simply stores data plain as BSON or JSON |
 +| Zipped  | Store as zipped data stream. You can extend this option by the FastestCompression or MaxCompression option. If none of them is set, the exporter will use default compression. |
 +| Beautified | Compatible with JSON format. Defines data will be exported with linebreaks and indents or not. This option has no influence on bson format. |
 +| FastestCompression | If the Zipped-Option is set, this option will choose the fastest algorithm for packing the data stream. |
 +| MaxCompression | If the Zipped-Option is set, this option will chose the maximum compression algorithm for packing the data stream. |
 +
 +Depending on your model data you can configure those options to optimize filesize.
 +In most cases a zipped JSON format with MaxCompression provides the best results.
 +
 +<code>
 +G3D_TEST : TGorillaG3DOptions = [TGorillaG3DOption.Zipped, TGorillaG3DOption.MaxCompression];
 +</code>
 +
 +===== Notice =====
 +
 +Every G3D file starts with some header information, where is defined which format and options are used.
 +The header format is described below:
 +
 +<file pascal>
 +  TGorillaG3DFormat = (BSONFormat, JSONFormat);
 +  
 +  TGorillaG3DOption  = (
 +    None,
 +    Zipped,
 +    Beautified,
 +    FastestCompression,
 +    MaxCompression);
 +
 +  TGorillaG3DOptions = Set Of TGorillaG3DOption;
 +
 +  TGorillaG3DHeader = record
 +    /// DEFAULT-VALUE = "Gorilla3D "
 +    /// 10 characters identify the exporter tool
 +    Exporter : Array[0..9] of Byte;
 +    Version : Cardinal;
 +    /// Datetime when the file was generated. (8 byte float value)
 +    Timestamp : TDateTime;
 +    /// The data format the was stored (bson or json).
 +    Format  : TGorillaG3DFormat;
 +    /// enum with values above
 +    Options : TGorillaG3DOptions;
 +  end;
 +</file>
 +
 +Next step: [[transparency|Transparency]]